Hi Alan,

Thanks for this.
We are already trying such a modification but not for "spidev" but for "cc120" 
that we are trying to connect to beaglebone, through "mac802154/iee802154" 
proto drivers.
Not yet successful but still working on. Will soon send our state on the 
mailing list.

We are a bit "new" to kernel and hardware/protocols drivers in Linux. Why the 
way is so tricky for us. Do you know a good "tutorial" showing global schemes 
of interfaces between Network stack / Protocols drivers / hardware drivers ?

Best regards

Pierre-emmanuel

-----Message d'origine-----
De : Alan Ott [mailto:a...@signal11.us] 
Envoyé : mercredi 23 mai 2012 20:18
À : Pierre-Emmanuel Goudet; linux-zigbee-devel@lists.sourceforge.net
Cc : Alan Ott
Objet : [PATCH] BeagleBone: Patch to register SPIDEV on one of the SPI ports.

---
 arch/arm/mach-omap2/board-am335xevm.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am335xevm.c 
b/arch/arm/mach-omap2/board-am335xevm.c
index 36efca1..84daf62 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -1836,6 +1836,20 @@ static void tt3201_init(int evm_id, int profile)
 
        am33xx_d_can_init(1);
 }
+
+static struct spi_board_info am335x_spidev1_info[] = {
+       {
+               .modalias      = "spidev",
+               .platform_data = NULL,
+               .irq           = 0,
+               .max_speed_hz  = 12000000,
+               .bus_num       = 2,
+               .mode          = SPI_MODE_1,
+               .chip_select   = 0,
+       },
+};
+
+
 static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void 
*context)  {
        capecount++;
@@ -2143,6 +2157,16 @@ static void spi1_init(int evm_id, int profile)
        return;
 }
 
+/* setup spidev */
+static void spi1_spidev_init(int evm_id, int profile) {
+       pr_info("Setting up spidev on bus 2\n");
+
+       setup_pin_mux(spi1_pin_mux);
+       spi_register_board_info(am335x_spidev1_info,
+                       ARRAY_SIZE(am335x_spidev1_info));
+}
+
 
 static int beaglebone_phy_fixup(struct phy_device *phydev)  { @@ -2311,6 
+2335,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
        {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
        {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
        {bonew1_gpio_init, DEV_ON_BASEBOARD, PROFILE_ALL},
+       {spi1_spidev_init, DEV_ON_BASEBOARD, PROFILE_ALL},
        {NULL, 0, 0},
 };
 
--
1.7.0.4




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to