Commit 64874508 authored by Joey Gouly's avatar Joey Gouly
Browse files

HACK: add dt node for keyboard



Fix two issues in spi-apple.c
Signed-off-by: Joey Gouly's avatarJoey Gouly <joey.gouly@arm.com>
parent 50d215f5
......@@ -103,6 +103,13 @@ clk24: clock-24m {
clock-output-names = "clk24";
};
clk120: clock-120m {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <120000000>;
clock-output-names = "clk120";
};
soc {
compatible = "simple-bus";
#address-cells = <2>;
......@@ -143,6 +150,7 @@ pinctrl_ap: pinctrl@23c100000 {
apple,npins = <212>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 190 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 191 IRQ_TYPE_LEVEL_HIGH>,
......@@ -157,6 +165,13 @@ pcie_pins: pcie-pins {
<APPLE_PINMUX(151, 1)>,
<APPLE_PINMUX(32, 1)>;
};
spi3_pins: spi3-pins {
pinmux = <APPLE_PINMUX(46, 1)>,
<APPLE_PINMUX(47, 1)>,
<APPLE_PINMUX(48, 1)>,
<APPLE_PINMUX(49, 1)>;
};
};
pinctrl_aop: pinctrl@24a820000 {
......@@ -169,6 +184,7 @@ pinctrl_aop: pinctrl@24a820000 {
apple,npins = <42>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 268 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 269 IRQ_TYPE_LEVEL_HIGH>,
......@@ -189,6 +205,7 @@ pinctrl_nub: pinctrl@23d1f0000 {
apple,npins = <23>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 330 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 331 IRQ_TYPE_LEVEL_HIGH>,
......@@ -209,6 +226,7 @@ pinctrl_smc: pinctrl@23e820000 {
apple,npins = <16>;
interrupt-controller;
#interrupt-cells = <2>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 391 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 392 IRQ_TYPE_LEVEL_HIGH>,
......@@ -233,6 +251,7 @@ pcie0_dart_1: dart@682008000 {
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 699 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
pcie0_dart_2: dart@683008000 {
......@@ -241,6 +260,7 @@ pcie0_dart_2: dart@683008000 {
#iommu-cells = <1>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 702 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
pcie0: pcie@690000000 {
......@@ -338,5 +358,29 @@ port02: pci@2,0 {
<0 0 0 4 &port02 0 0 0 3>;
};
};
spi3: spi@23510c000 {
compatible = "apple,t6000-spi", "apple,spi";
reg = <0x2 0x3510c000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 617 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk120>;
//cs-gpios = <&pinctrl_ap 49 0>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&spi3_pins>;
pinctrl-names = "default";
status = "okay";
keyboard@0 {
compatible = "input,applespi-kbd-v1";
reg = <0>;
spi-max-frequency = <2000000>;
spien-gpios = <&pinctrl_ap 195 0>;
interrupts-extended = <&pinctrl_nub 13 IRQ_TYPE_LEVEL_LOW>;
status = "okay";
};
};
};
};
......@@ -248,7 +248,7 @@ static void apple_spi_tx(struct apple_spi *spi, const void **tx_ptr, u32 *left,
return;
inuse = FIELD_GET(APPLE_SPI_FIFOSTAT_LEVEL_TX, reg_read(spi, APPLE_SPI_FIFOSTAT));
words = wrote = min_t(u32, *left, APPLE_SPI_FIFOSTAT_LEVEL_TX - inuse);
words = wrote = min_t(u32, *left, APPLE_SPI_FIFO_DEPTH - inuse);
if (!words)
return;
......@@ -394,7 +394,7 @@ apple_spi_transfer_one(struct spi_controller *ctlr, struct spi_device *device,
*/
while (remaining_rx && retries--) {
apple_spi_rx(spi, &rx_ptr, &remaining_rx, bpw);
retries++;
// retries++;
}
if (remaining_tx)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment