linux-omap-pm 2.6.29: update to latest git HEAD, sync patches and defconfig with...
[openembedded.git] / recipes / linux / linux-omap-pm-2.6.29 / beagleboard / tincantools-zippy.diff
1 --- /tmp/board-omap3beagle.c    2009-08-13 12:35:01.000000000 +0200
2 +++ git/arch/arm/mach-omap2/board-omap3beagle.c 2009-08-13 12:44:00.000000000 +0200
3 @@ -21,6 +21,7 @@
4  #include <linux/io.h>
5  #include <linux/leds.h>
6  #include <linux/gpio.h>
7 +#include <linux/irq.h>
8  #include <linux/input.h>
9  #include <linux/gpio_keys.h>
10  
11 @@ -54,6 +55,47 @@
12  #define GPMC_CS_SIZE   0x30
13  
14  #define NAND_BLOCK_SIZE                SZ_128K
15 +#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
16 +
17 +#include <mach/mcspi.h>
18 +#include <linux/spi/spi.h>
19 +
20 +#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157
21 +
22 +static struct omap2_mcspi_device_config enc28j60_spi_chip_info = {
23 +       .turbo_mode     = 0,
24 +       .single_channel = 1,    /* 0: slave, 1: master */
25 +};
26 +
27 +static struct spi_board_info omap3beagle_spi_board_info[] __initdata = {
28 +       {
29 +               .modalias               = "enc28j60",
30 +               .bus_num                = 4,
31 +               .chip_select            = 0,
32 +               .max_speed_hz           = 20000000,
33 +               .controller_data        = &enc28j60_spi_chip_info,
34 +       },
35 +};
36 +
37 +static void __init omap3beagle_enc28j60_init(void)
38 +{
39 +       if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) &&
40 +           (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) {
41 +               gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0);
42 +               omap3beagle_spi_board_info[0].irq       = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ);
43 +               set_irq_type(omap3beagle_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
44 +       } else {
45 +               printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n");
46 +               return;
47 +       }
48 +
49 +       spi_register_board_info(omap3beagle_spi_board_info,
50 +                       ARRAY_SIZE(omap3beagle_spi_board_info));
51 +}
52 +
53 +#else
54 +static inline void __init omap3beagle_enc28j60_init(void) { return; }
55 +#endif
56  
57  static struct mtd_partition omap3beagle_nand_partitions[] = {
58         /* All the partition sizes are listed in terms of NAND block size */
59 @@ -318,7 +360,7 @@
60         .vpll2          = &beagle_vpll2,
61  };
62  
63 -static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
64 +static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
65         {
66                 I2C_BOARD_INFO("twl4030", 0x48),
67                 .flags = I2C_CLIENT_WAKE,
68 @@ -327,10 +369,24 @@
69         },
70  };
71  
72 +#if defined(CONFIG_RTC_DRV_DS1307) || \
73 +       defined(CONFIG_RTC_DRV_DS1307_MODULE)
74 +
75 +static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
76 +       {
77 +               I2C_BOARD_INFO("ds1307", 0x68),
78 +       },
79 +};
80 +#else
81 +static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
82 +#endif
83 +
84  static int __init omap3_beagle_i2c_init(void)
85  {
86 -       omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
87 -                       ARRAY_SIZE(beagle_i2c_boardinfo));
88 +       omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
89 +                       ARRAY_SIZE(beagle_i2c1_boardinfo));
90 +       omap_register_i2c_bus(2, 400,  beagle_i2c2_boardinfo,
91 +                       ARRAY_SIZE(beagle_i2c2_boardinfo));
92         /* Bus 3 is attached to the DVI port where devices like the pico DLP
93          * projector don't work reliably with 400kHz */
94         omap_register_i2c_bus(3, 100, NULL, 0);
95 @@ -542,6 +598,8 @@
96  
97         omap_cfg_reg(J25_34XX_GPIO170);
98  
99 +       omap3beagle_enc28j60_init();
100 +
101         usb_musb_init();
102         usb_ehci_init();
103         omap3beagle_flash_init();