~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/sh/boards/mach-ecovec24/setup.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include <linux/init.h>
12
12
#include <linux/device.h>
13
13
#include <linux/platform_device.h>
14
 
#include <linux/mfd/sh_mobile_sdhi.h>
15
14
#include <linux/mmc/host.h>
16
15
#include <linux/mmc/sh_mmcif.h>
 
16
#include <linux/mmc/sh_mobile_sdhi.h>
17
17
#include <linux/mtd/physmap.h>
18
18
#include <linux/gpio.h>
19
19
#include <linux/interrupt.h>
20
20
#include <linux/io.h>
21
21
#include <linux/delay.h>
22
22
#include <linux/usb/r8a66597.h>
 
23
#include <linux/usb/renesas_usbhs.h>
23
24
#include <linux/i2c.h>
24
25
#include <linux/i2c/tsc2007.h>
25
26
#include <linux/spi/spi.h>
142
143
static struct sh_eth_plat_data sh_eth_plat = {
143
144
        .phy = 0x1f, /* SMSC LAN8700 */
144
145
        .edmac_endian = EDMAC_LITTLE_ENDIAN,
 
146
        .register_type = SH_ETH_REG_FAST_SH4,
 
147
        .phy_interface = PHY_INTERFACE_MODE_MII,
145
148
        .ether_link_active_low = 1
146
149
};
147
150
 
230
233
        .resource       = usb1_common_resources,
231
234
};
232
235
 
 
236
/*
 
237
 * USBHS
 
238
 */
 
239
static int usbhs_get_id(struct platform_device *pdev)
 
240
{
 
241
        return gpio_get_value(GPIO_PTB3);
 
242
}
 
243
 
 
244
static struct renesas_usbhs_platform_info usbhs_info = {
 
245
        .platform_callback = {
 
246
                .get_id         = usbhs_get_id,
 
247
        },
 
248
        .driver_param = {
 
249
                .buswait_bwait          = 4,
 
250
                .detection_delay        = 5,
 
251
        },
 
252
};
 
253
 
 
254
static struct resource usbhs_resources[] = {
 
255
        [0] = {
 
256
                .start  = 0xa4d90000,
 
257
                .end    = 0xa4d90124 - 1,
 
258
                .flags  = IORESOURCE_MEM,
 
259
        },
 
260
        [1] = {
 
261
                .start  = 66,
 
262
                .end    = 66,
 
263
                .flags  = IORESOURCE_IRQ,
 
264
        },
 
265
};
 
266
 
 
267
static struct platform_device usbhs_device = {
 
268
        .name   = "renesas_usbhs",
 
269
        .id     = 1,
 
270
        .dev = {
 
271
                .dma_mask               = NULL,         /*  not use dma */
 
272
                .coherent_dma_mask      = 0xffffffff,
 
273
                .platform_data          = &usbhs_info,
 
274
        },
 
275
        .num_resources  = ARRAY_SIZE(usbhs_resources),
 
276
        .resource       = usbhs_resources,
 
277
        .archdata = {
 
278
                .hwblk_id = HWBLK_USB1,
 
279
        },
 
280
};
 
281
 
233
282
/* LCDC */
234
283
const static struct fb_videomode ecovec_lcd_modes[] = {
235
284
        {
261
310
        },
262
311
};
263
312
 
 
313
static int ecovec24_set_brightness(void *board_data, int brightness)
 
314
{
 
315
        gpio_set_value(GPIO_PTR1, brightness);
 
316
 
 
317
        return 0;
 
318
}
 
319
 
 
320
static int ecovec24_get_brightness(void *board_data)
 
321
{
 
322
        return gpio_get_value(GPIO_PTR1);
 
323
}
 
324
 
264
325
static struct sh_mobile_lcdc_info lcdc_info = {
265
326
        .ch[0] = {
266
327
                .interface_type = RGB18,
271
332
                        .height = 91,
272
333
                },
273
334
                .board_cfg = {
 
335
                        .set_brightness = ecovec24_set_brightness,
 
336
                        .get_brightness = ecovec24_get_brightness,
 
337
                },
 
338
                .bl_info = {
 
339
                        .name = "sh_mobile_lcdc_bl",
 
340
                        .max_brightness = 1,
274
341
                },
275
342
        }
276
343
};
462
529
        .irq            = IRQ0,
463
530
};
464
531
 
465
 
#ifdef CONFIG_MFD_SH_MOBILE_SDHI
 
532
#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
466
533
/* SDHI0 */
467
534
static void sdhi0_set_pwr(struct platform_device *pdev, int state)
468
535
{
480
547
        [0] = {
481
548
                .name   = "SDHI0",
482
549
                .start  = 0x04ce0000,
483
 
                .end    = 0x04ce01ff,
 
550
                .end    = 0x04ce00ff,
484
551
                .flags  = IORESOURCE_MEM,
485
552
        },
486
553
        [1] = {
502
569
        },
503
570
};
504
571
 
505
 
#if !defined(CONFIG_MMC_SH_MMCIF)
 
572
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
506
573
/* SDHI1 */
507
574
static void sdhi1_set_pwr(struct platform_device *pdev, int state)
508
575
{
520
587
        [0] = {
521
588
                .name   = "SDHI1",
522
589
                .start  = 0x04cf0000,
523
 
                .end    = 0x04cf01ff,
 
590
                .end    = 0x04cf00ff,
524
591
                .flags  = IORESOURCE_MEM,
525
592
        },
526
593
        [1] = {
723
790
 
724
791
/* FSI */
725
792
static struct sh_fsi_platform_info fsi_info = {
726
 
        .portb_flags = SH_FSI_BRS_INV |
727
 
                       SH_FSI_OUT_SLAVE_MODE |
728
 
                       SH_FSI_IN_SLAVE_MODE |
729
 
                       SH_FSI_OFMT(I2S) |
730
 
                       SH_FSI_IFMT(I2S),
 
793
        .portb_flags = SH_FSI_BRS_INV,
731
794
};
732
795
 
733
796
static struct resource fsi_resources[] = {
820
883
        },
821
884
};
822
885
 
823
 
#if defined(CONFIG_MMC_SH_MMCIF)
 
886
#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
824
887
/* SH_MMCIF */
825
888
static void mmcif_set_pwr(struct platform_device *pdev, int state)
826
889
{
869
932
        },
870
933
        .num_resources  = ARRAY_SIZE(sh_mmcif_resources),
871
934
        .resource       = sh_mmcif_resources,
 
935
        .archdata = {
 
936
                .hwblk_id = HWBLK_MMC,
 
937
        },
872
938
};
873
939
#endif
874
940
 
878
944
        &sh_eth_device,
879
945
        &usb0_host_device,
880
946
        &usb1_common_device,
 
947
        &usbhs_device,
881
948
        &lcdc_device,
882
949
        &ceu0_device,
883
950
        &ceu1_device,
884
951
        &keysc_device,
885
 
#ifdef CONFIG_MFD_SH_MOBILE_SDHI
 
952
#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
886
953
        &sdhi0_device,
887
 
#if !defined(CONFIG_MMC_SH_MMCIF)
 
954
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
888
955
        &sdhi1_device,
889
956
#endif
890
957
#else
896
963
        &fsi_device,
897
964
        &irda_device,
898
965
        &vou_device,
899
 
#if defined(CONFIG_MMC_SH_MMCIF)
 
966
#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
900
967
        &sh_mmcif_device,
901
968
#endif
902
969
};
938
1005
                return;
939
1006
        }
940
1007
 
941
 
        /* read MAC address frome EEPROM */
 
1008
        /* read MAC address from EEPROM */
942
1009
        for (i = 0; i < sizeof(pd->mac_addr); i++) {
943
1010
                pd->mac_addr[i] = mac_read(a, 0x10 + i);
944
1011
                msleep(10);
1104
1171
 
1105
1172
                /* enable TouchScreen */
1106
1173
                i2c_register_board_info(0, &ts_i2c_clients, 1);
1107
 
                set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
 
1174
                irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
1108
1175
        }
1109
1176
 
1110
1177
        /* enable CEU0 */
1164
1231
        gpio_direction_input(GPIO_PTR5);
1165
1232
        gpio_direction_input(GPIO_PTR6);
1166
1233
 
1167
 
#ifdef CONFIG_MFD_SH_MOBILE_SDHI
 
1234
#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1168
1235
        /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
1169
1236
        gpio_request(GPIO_FN_SDHI0CD,  NULL);
1170
1237
        gpio_request(GPIO_FN_SDHI0WP,  NULL);
1177
1244
        gpio_request(GPIO_PTB6, NULL);
1178
1245
        gpio_direction_output(GPIO_PTB6, 0);
1179
1246
 
1180
 
#if !defined(CONFIG_MMC_SH_MMCIF)
 
1247
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1181
1248
        /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */
1182
1249
        gpio_request(GPIO_FN_SDHI1CD,  NULL);
1183
1250
        gpio_request(GPIO_FN_SDHI1WP,  NULL);
1268
1335
        gpio_request(GPIO_PTU5, NULL);
1269
1336
        gpio_direction_output(GPIO_PTU5, 0);
1270
1337
 
1271
 
#if defined(CONFIG_MMC_SH_MMCIF)
 
1338
#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1272
1339
        /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */
1273
1340
        gpio_request(GPIO_FN_MMC_D7, NULL);
1274
1341
        gpio_request(GPIO_FN_MMC_D6, NULL);