]>
Commit | Line | Data |
---|---|---|
d006af40 AF |
1 | From 45bed17e65e1a83f753896e250f3458654dcb229 Mon Sep 17 00:00:00 2001 |
2 | From: Robert Nelson <robertcnelson@gmail.com> | |
3 | Date: Tue, 11 Dec 2012 06:32:15 -0600 | |
4 | Subject: [PATCH 03/10] Beagle: expansion: add zippy2 | |
5 | ||
6 | Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | |
7 | --- | |
8 | arch/arm/mach-omap2/board-omap3beagle.c | 48 ++++++++++++++++++++++++++++++- | |
9 | 1 file changed, 47 insertions(+), 1 deletion(-) | |
10 | ||
11 | diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c | |
12 | index b3685ed..74da505 100644 | |
13 | --- a/arch/arm/mach-omap2/board-omap3beagle.c | |
14 | +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |
15 | @@ -276,6 +276,46 @@ static void __init omap3beagle_enc28j60_init(void) | |
16 | static inline void __init omap3beagle_enc28j60_init(void) { return; } | |
17 | #endif | |
18 | ||
19 | +#if IS_ENABLED(CONFIG_KS8851) | |
20 | +#include <linux/platform_data/spi-omap2-mcspi.h> | |
21 | +#include <linux/spi/spi.h> | |
22 | + | |
23 | +#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157 | |
24 | + | |
25 | +static struct omap2_mcspi_device_config ks8851_spi_chip_info = { | |
26 | + .turbo_mode = 0, | |
27 | +}; | |
28 | + | |
29 | +static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata = { | |
30 | + { | |
31 | + .modalias = "ks8851", | |
32 | + .bus_num = 4, | |
33 | + .chip_select = 0, | |
34 | + .max_speed_hz = 36000000, | |
35 | + .controller_data = &ks8851_spi_chip_info, | |
36 | + }, | |
37 | +}; | |
38 | + | |
39 | +static void __init omap3beagle_ks8851_init(void) | |
40 | +{ | |
41 | + if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) && | |
42 | + (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) { | |
43 | + gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0); | |
44 | + omap3beagle_zippy2_spi_board_info[0].irq = gpio_to_irq(OMAP3BEAGLE_GPIO_KS8851_IRQ); | |
45 | + irq_set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); | |
46 | + } else { | |
47 | + pr_err("Beagle expansionboard: could not obtain gpio for KS8851_IRQ\n"); | |
48 | + return; | |
49 | + } | |
50 | + | |
51 | + spi_register_board_info(omap3beagle_zippy2_spi_board_info, | |
52 | + ARRAY_SIZE(omap3beagle_zippy2_spi_board_info)); | |
53 | +} | |
54 | + | |
55 | +#else | |
56 | +static inline void __init omap3beagle_ks8851_init(void) { return; } | |
57 | +#endif | |
58 | + | |
59 | static struct mtd_partition omap3beagle_nand_partitions[] = { | |
60 | /* All the partition sizes are listed in terms of NAND block size */ | |
61 | { | |
62 | @@ -674,7 +714,7 @@ static void __init omap3_beagle_init(void) | |
63 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | |
64 | omap3_beagle_init_rev(); | |
65 | ||
66 | - if (!strcmp(expansionboard_name, "zippy")) | |
67 | + if ((!strcmp(expansionboard_name, "zippy")) || (!strcmp(expansionboard_name, "zippy2"))) | |
68 | { | |
69 | pr_info("Beagle expansionboard: initializing zippy mmc\n"); | |
70 | platform_device_register(&omap_zippy_device); | |
71 | @@ -718,6 +758,12 @@ static void __init omap3_beagle_init(void) | |
72 | omap3beagle_enc28j60_init(); | |
73 | } | |
74 | ||
75 | + if (!strcmp(expansionboard_name, "zippy2")) | |
76 | + { | |
77 | + pr_info("Beagle expansionboard: initializing ks_8851\n"); | |
78 | + omap3beagle_ks8851_init(); | |
79 | + } | |
80 | + | |
81 | usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); | |
82 | usb_musb_init(NULL); | |
83 | ||
84 | -- | |
85 | 1.7.10.4 | |
86 |