1 From 334eef94045c93957cad3477522086492dd19b06 Mon Sep 17 00:00:00 2001
2 From: Steve Sakoman <sakoman@gmail.com>
3 Date: Tue, 15 Dec 2009 15:34:29 -0800
4 Subject: [PATCH 05/16] ARM: OMAP: add support for TCT Zippy to Beagle board file
6 Signed-off-by: Steve Sakoman <sakoman@gmail.com>
8 arch/arm/mach-omap2/board-omap3beagle.c | 74 +++++++++++++++++++++++++++++-
9 1 files changed, 71 insertions(+), 3 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
12 index 41480bd..f3df638 100644
13 --- a/arch/arm/mach-omap2/board-omap3beagle.c
14 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
17 #include <linux/leds.h>
18 #include <linux/gpio.h>
19 +#include <linux/irq.h>
20 #include <linux/input.h>
21 #include <linux/gpio_keys.h>
25 #define NAND_BLOCK_SIZE SZ_128K
27 +#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
29 +#include <plat/mcspi.h>
30 +#include <linux/spi/spi.h>
32 +#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157
34 +static struct omap2_mcspi_device_config enc28j60_spi_chip_info = {
36 + .single_channel = 1, /* 0: slave, 1: master */
39 +static struct spi_board_info omap3beagle_spi_board_info[] __initdata = {
41 + .modalias = "enc28j60",
44 + .max_speed_hz = 20000000,
45 + .controller_data = &enc28j60_spi_chip_info,
49 +static void __init omap3beagle_enc28j60_init(void)
51 + if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) &&
52 + (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) {
53 + gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0);
54 + omap3beagle_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ);
55 + set_irq_type(omap3beagle_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
57 + printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n");
61 + spi_register_board_info(omap3beagle_spi_board_info,
62 + ARRAY_SIZE(omap3beagle_spi_board_info));
66 +static inline void __init omap3beagle_enc28j60_init(void) { return; }
70 static struct mtd_partition omap3beagle_nand_partitions[] = {
71 /* All the partition sizes are listed in terms of NAND block size */
73 @@ -114,6 +158,14 @@ static struct twl4030_hsmmc_info mmc[] = {
82 + .transceiver = true,
83 + .ocr_mask = 0x00100000, /* 3.3V */
88 @@ -277,7 +329,7 @@ static struct twl4030_platform_data beagle_twldata = {
89 .vpll2 = &beagle_vpll2,
92 -static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
93 +static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
95 I2C_BOARD_INFO("twl4030", 0x48),
96 .flags = I2C_CLIENT_WAKE,
97 @@ -286,10 +338,24 @@ static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
101 +#if defined(CONFIG_RTC_DRV_DS1307) || \
102 + defined(CONFIG_RTC_DRV_DS1307_MODULE)
104 +static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
106 + I2C_BOARD_INFO("ds1307", 0x68),
110 +static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
113 static int __init omap3_beagle_i2c_init(void)
115 - omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
116 - ARRAY_SIZE(beagle_i2c_boardinfo));
117 + omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
118 + ARRAY_SIZE(beagle_i2c1_boardinfo));
119 + omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
120 + ARRAY_SIZE(beagle_i2c2_boardinfo));
121 /* Bus 3 is attached to the DVI port where devices like the pico DLP
122 * projector don't work reliably with 400kHz */
123 omap_register_i2c_bus(3, 100, NULL, 0);
124 @@ -434,6 +500,8 @@ static void __init omap3_beagle_init(void)
125 /* REVISIT leave DVI powered down until it's needed ... */
126 gpio_direction_output(170, true);
128 + omap3beagle_enc28j60_init();
131 usb_ehci_init(&ehci_pdata);
132 omap3beagle_flash_init();