Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jg-open
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
linux-arm
jg-open
Commits
64874508
Commit
64874508
authored
3 years ago
by
Joey Gouly
Browse files
Options
Downloads
Patches
Plain Diff
HACK: add dt node for keyboard
Fix two issues in spi-apple.c Signed-off-by:
Joey Gouly
<
joey.gouly@arm.com
>
parent
50d215f5
Branches
keyboard-dev
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arch/arm64/boot/dts/apple/t8103.dtsi
+44
-0
44 additions, 0 deletions
arch/arm64/boot/dts/apple/t8103.dtsi
drivers/spi/spi-apple.c
+2
-2
2 additions, 2 deletions
drivers/spi/spi-apple.c
with
46 additions
and
2 deletions
arch/arm64/boot/dts/apple/t8103.dtsi
+
44
−
0
View file @
64874508
...
...
@@ -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";
};
};
};
};
This diff is collapsed.
Click to expand it.
drivers/spi/spi-apple.c
+
2
−
2
View file @
64874508
...
...
@@ -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_FIFO
STAT_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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment