Hi,

I managed to get the SPI devices /dev/spidev0.0 and /dev/spidev0.1 to be 
visible using the mainline kernel 4.4.11 on my BananaPi R1 (Allwinner A20) 
with the attached patch to spidev.c and the dts. But the SPI device is not 
working. When I send some data for example with *echo "test" > 
/dev/spidev0.0 *I could see some activity on *both* chip select lines 
SPI_CS0 and SPI_CS1, but no reaction on SPI0_CLK. Is this a bug somewhere 
or is there additional tweaking in the dts required? 

A testprogramm driving a small display via SPI works fine with the old 
sunxi kernel.

Uli

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
index 67c8a76..1efa46e 100755
--- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
@@ -58,6 +58,9 @@
 		serial0 = &uart0;
 		serial1 = &uart3;
 		serial2 = &uart7;
+		spi0 = &spi0;
+		spi1 = &spi1;
+		spi2 = &spi2;
 	};
 
 	chosen {
@@ -252,6 +255,17 @@
 		    <&spi0_cs0_pins_a>,
 		    <&spi0_cs1_pins_a>;
 	status = "okay";
+	clock-frequency = <1000000>;
+	spidev@0x00 {
+		compatible = "allwinner,sun4i-a10-sp";
+		spi-max-frequency = <100000000>;
+		reg = <0>;
+	};
+	spidev@0x01 {
+		compatible = "allwinner,sun4i-a10-sp";
+		spi-max-frequency = <100000000>;
+		reg = <1>;
+	};
 };
 
 &uart0 {
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index d0e7dfc..80e21e0 100755
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -695,6 +695,7 @@ static struct class *spidev_class;
 static const struct of_device_id spidev_dt_ids[] = {
 	{ .compatible = "rohm,dh2228fv" },
 	{ .compatible = "lineartechnology,ltc2488" },
+	{ .compatible = "allwinner,sun4i-a10-sp" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, spidev_dt_ids);

Reply via email to