]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/kernel/omap/panda/0003-Panda-expansion-add-spidev.patch
snort: Update urls for rules download (2.9.7.0) in 'ids.cgi'
[ipfire-2.x.git] / src / patches / kernel / omap / panda / 0003-Panda-expansion-add-spidev.patch
CommitLineData
d006af40
AF
1From 3304f2feba4999fc1013911f0cf0d9acc33a0117 Mon Sep 17 00:00:00 2001
2From: Adrien Ferre <ferre.adrien@gmail.com>
3Date: Mon, 25 Mar 2013 12:00:38 -0500
4Subject: [PATCH 3/3] Panda: expansion: add spidev
5
6I've made a patch to enable spidev on pandaboards using buddy=spidev just like for beagle.
7
8https://github.com/RobertCNelson/stable-kernel/issues/22
9
10Signed-off-by: Adrien Ferre <ferre.adrien@gmail.com>
11Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
12---
13 arch/arm/mach-omap2/board-omap4panda.c | 43 ++++++++++++++++++++++++++++++++
14 1 file changed, 43 insertions(+)
15
16diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
17index 1e2c75e..3563f86 100644
18--- a/arch/arm/mach-omap2/board-omap4panda.c
19+++ b/arch/arm/mach-omap2/board-omap4panda.c
20@@ -22,6 +22,7 @@
21 #include <linux/clk.h>
22 #include <linux/io.h>
23 #include <linux/leds.h>
24+#include <linux/irq.h>
25 #include <linux/gpio.h>
26 #include <linux/usb/otg.h>
27 #include <linux/i2c/twl.h>
28@@ -35,6 +36,7 @@
29 #include <linux/wl12xx.h>
30 #include <linux/irqchip/arm-gic.h>
31 #include <linux/platform_data/omap-abe-twl6040.h>
32+#include <linux/spi/spi.h>
33
34 #include <asm/mach-types.h>
35 #include <asm/mach/arch.h>
36@@ -54,6 +56,8 @@
37 #define GPIO_WIFI_PMENA 43
38 #define GPIO_WIFI_IRQ 53
39
40+char expboard_name[16];
41+
42 /* wl127x BT, FM, GPS connectivity chip */
43 static struct ti_st_plat_data wilink_platform_data = {
44 .nshutdown_gpio = 46,
45@@ -99,6 +103,25 @@ static struct platform_device leds_gpio = {
46 },
47 };
48
49+static struct spi_board_info panda_mcspi_board_info[] = {
50+ /* spi 1.0 */
51+ {
52+ .modalias = "spidev",
53+ .max_speed_hz = 48000000, //48 Mbps
54+ .bus_num = 1,
55+ .chip_select = 0,
56+ .mode = SPI_MODE_1,
57+ },
58+ /* spi 1.1 */
59+ {
60+ .modalias = "spidev",
61+ .max_speed_hz = 48000000, //48 Mbps
62+ .bus_num = 1,
63+ .chip_select = 1,
64+ .mode = SPI_MODE_1,
65+ },
66+};
67+
68 static struct omap_abe_twl6040_data panda_abe_audio_data = {
69 /* Audio out */
70 .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
71@@ -161,6 +184,18 @@ static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
72 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
73 };
74
75+static int __init expansionboard_setup(char *str)
76+{
77+ if (!machine_is_omap4_panda())
78+ return 0;
79+
80+ if (!str)
81+ return -EINVAL;
82+ strncpy(expboard_name, str, 16);
83+ pr_info("Panda expansionboard: %s\n", expboard_name);
84+ return 0;
85+}
86+
87 static void __init omap4_ehci_init(void)
88 {
89 int ret;
90@@ -435,11 +470,19 @@ static void __init omap4_panda_init(void)
91 omap_sdrc_init(NULL, NULL);
92 omap4_twl6030_hsmmc_init(mmc);
93 omap4_ehci_init();
94+ if (!strcmp(expboard_name, "spidev")) {
95+ #if IS_ENABLED(CONFIG_SPI_SPIDEV)
96+ pr_info("Panda expansionboard: spidev: enabling spi3/spi4\n");
97+ spi_register_board_info(panda_mcspi_board_info, ARRAY_SIZE(panda_mcspi_board_info));
98+ #endif
99+ }
100 usb_bind_phy("musb-hdrc.2.auto", 0, "omap-usb2.3.auto");
101 usb_musb_init(&musb_board_data);
102 omap4_panda_display_init();
103 }
104
105+early_param("buddy", expansionboard_setup);
106+
107 MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
108 /* Maintainer: David Anders - Texas Instruments Inc */
109 .atag_offset = 0x100,
110--
1111.7.10.4
112