aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-devkit8000.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-26 15:11:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-26 15:11:54 -0400
commit829ae2732998e628d762b97627e4e5cc6c1b5625 (patch)
tree7ffdfa365ab54df4fd1742673289621b3f5de2f5 /arch/arm/mach-omap2/board-devkit8000.c
parent6ddb4518c7af7b03fa322552d794f759cd5c26fa (diff)
parent9b28b11e2a648f07c8481b9666ccf1c088e1ab74 (diff)
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (33 commits) OMAP3: PM: Boot message is not an error, and not helpful, remove it OMAP3: cpuidle: change the power domains modes determination logic OMAP3: cpuidle: code rework for improved readability OMAP3: cpuidle: re-organize the C-states data OMAP3: clean-up mach specific cpuidle data structures OMAP3 cpuidle: remove useless SDP specific timings usb: otg: OMAP4430: Powerdown the internal PHY when USB is disabled usb: otg: OMAP4430: Fixing the omap4430_phy_init function usb: musb: am35x: fix compile error when building am35x usb: musb: OMAP4430: Power down the PHY during board init omap: drop board-igep0030.c omap: igep0020: add support for IGEP3 omap: igep0020: minor refactoring omap: igep0020: name refactoring for future merge with IGEP3 omap: Remove support for omap2evm arm: omap2plus: GPIO cleanup omap: musb: introduce default board config omap: move detection of NAND CS to common-board-devices omap: use common initialization for PMIC i2c bus omap: consolidate touch screen initialization among different boards ...
Diffstat (limited to 'arch/arm/mach-omap2/board-devkit8000.c')
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c131
1 files changed, 12 insertions, 119 deletions
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 1d1b56a29fb1..cf520d7dd614 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -51,7 +51,6 @@
51#include <plat/mcspi.h> 51#include <plat/mcspi.h>
52#include <linux/input/matrix_keypad.h> 52#include <linux/input/matrix_keypad.h>
53#include <linux/spi/spi.h> 53#include <linux/spi/spi.h>
54#include <linux/spi/ads7846.h>
55#include <linux/dm9000.h> 54#include <linux/dm9000.h>
56#include <linux/interrupt.h> 55#include <linux/interrupt.h>
57 56
@@ -60,6 +59,7 @@
60#include "mux.h" 59#include "mux.h"
61#include "hsmmc.h" 60#include "hsmmc.h"
62#include "timer-gp.h" 61#include "timer-gp.h"
62#include "common-board-devices.h"
63 63
64#define NAND_BLOCK_SIZE SZ_128K 64#define NAND_BLOCK_SIZE SZ_128K
65 65
@@ -97,13 +97,6 @@ static struct mtd_partition devkit8000_nand_partitions[] = {
97 }, 97 },
98}; 98};
99 99
100static struct omap_nand_platform_data devkit8000_nand_data = {
101 .options = NAND_BUSWIDTH_16,
102 .parts = devkit8000_nand_partitions,
103 .nr_parts = ARRAY_SIZE(devkit8000_nand_partitions),
104 .dma_channel = -1, /* disable DMA in OMAP NAND driver */
105};
106
107static struct omap2_hsmmc_info mmc[] = { 100static struct omap2_hsmmc_info mmc[] = {
108 { 101 {
109 .mmc = 1, 102 .mmc = 1,
@@ -249,7 +242,7 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
249 /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */ 242 /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
250 devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0; 243 devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
251 ret = gpio_request_one(devkit8000_lcd_device.reset_gpio, 244 ret = gpio_request_one(devkit8000_lcd_device.reset_gpio,
252 GPIOF_DIR_OUT | GPIOF_INIT_LOW, "LCD_PWREN"); 245 GPIOF_OUT_INIT_LOW, "LCD_PWREN");
253 if (ret < 0) { 246 if (ret < 0) {
254 devkit8000_lcd_device.reset_gpio = -EINVAL; 247 devkit8000_lcd_device.reset_gpio = -EINVAL;
255 printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n"); 248 printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
@@ -258,7 +251,7 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
258 /* gpio + 7 is "DVI_PD" (out, active low) */ 251 /* gpio + 7 is "DVI_PD" (out, active low) */
259 devkit8000_dvi_device.reset_gpio = gpio + 7; 252 devkit8000_dvi_device.reset_gpio = gpio + 7;
260 ret = gpio_request_one(devkit8000_dvi_device.reset_gpio, 253 ret = gpio_request_one(devkit8000_dvi_device.reset_gpio,
261 GPIOF_DIR_OUT | GPIOF_INIT_LOW, "DVI PowerDown"); 254 GPIOF_OUT_INIT_LOW, "DVI PowerDown");
262 if (ret < 0) { 255 if (ret < 0) {
263 devkit8000_dvi_device.reset_gpio = -EINVAL; 256 devkit8000_dvi_device.reset_gpio = -EINVAL;
264 printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n"); 257 printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
@@ -366,19 +359,9 @@ static struct twl4030_platform_data devkit8000_twldata = {
366 .keypad = &devkit8000_kp_data, 359 .keypad = &devkit8000_kp_data,
367}; 360};
368 361
369static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = {
370 {
371 I2C_BOARD_INFO("tps65930", 0x48),
372 .flags = I2C_CLIENT_WAKE,
373 .irq = INT_34XX_SYS_NIRQ,
374 .platform_data = &devkit8000_twldata,
375 },
376};
377
378static int __init devkit8000_i2c_init(void) 362static int __init devkit8000_i2c_init(void)
379{ 363{
380 omap_register_i2c_bus(1, 2600, devkit8000_i2c_boardinfo, 364 omap3_pmic_init("tps65930", &devkit8000_twldata);
381 ARRAY_SIZE(devkit8000_i2c_boardinfo));
382 /* Bus 3 is attached to the DVI port where devices like the pico DLP 365 /* Bus 3 is attached to the DVI port where devices like the pico DLP
383 * projector don't work reliably with 400kHz */ 366 * projector don't work reliably with 400kHz */
384 omap_register_i2c_bus(3, 400, NULL, 0); 367 omap_register_i2c_bus(3, 400, NULL, 0);
@@ -463,56 +446,6 @@ static void __init devkit8000_init_irq(void)
463#endif 446#endif
464} 447}
465 448
466static void __init devkit8000_ads7846_init(void)
467{
468 int gpio = OMAP3_DEVKIT_TS_GPIO;
469 int ret;
470
471 ret = gpio_request(gpio, "ads7846_pen_down");
472 if (ret < 0) {
473 printk(KERN_ERR "Failed to request GPIO %d for "
474 "ads7846 pen down IRQ\n", gpio);
475 return;
476 }
477
478 gpio_direction_input(gpio);
479}
480
481static int ads7846_get_pendown_state(void)
482{
483 return !gpio_get_value(OMAP3_DEVKIT_TS_GPIO);
484}
485
486static struct ads7846_platform_data ads7846_config = {
487 .x_max = 0x0fff,
488 .y_max = 0x0fff,
489 .x_plate_ohms = 180,
490 .pressure_max = 255,
491 .debounce_max = 10,
492 .debounce_tol = 5,
493 .debounce_rep = 1,
494 .get_pendown_state = ads7846_get_pendown_state,
495 .keep_vref_on = 1,
496 .settle_delay_usecs = 150,
497};
498
499static struct omap2_mcspi_device_config ads7846_mcspi_config = {
500 .turbo_mode = 0,
501 .single_channel = 1, /* 0: slave, 1: master */
502};
503
504static struct spi_board_info devkit8000_spi_board_info[] __initdata = {
505 {
506 .modalias = "ads7846",
507 .bus_num = 2,
508 .chip_select = 0,
509 .max_speed_hz = 1500000,
510 .controller_data = &ads7846_mcspi_config,
511 .irq = OMAP_GPIO_IRQ(OMAP3_DEVKIT_TS_GPIO),
512 .platform_data = &ads7846_config,
513 }
514};
515
516#define OMAP_DM9000_BASE 0x2c000000 449#define OMAP_DM9000_BASE 0x2c000000
517 450
518static struct resource omap_dm9000_resources[] = { 451static struct resource omap_dm9000_resources[] = {
@@ -550,14 +483,14 @@ static void __init omap_dm9000_init(void)
550{ 483{
551 unsigned char *eth_addr = omap_dm9000_platdata.dev_addr; 484 unsigned char *eth_addr = omap_dm9000_platdata.dev_addr;
552 struct omap_die_id odi; 485 struct omap_die_id odi;
486 int ret;
553 487
554 if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) { 488 ret = gpio_request_one(OMAP_DM9000_GPIO_IRQ, GPIOF_IN, "dm9000 irq");
489 if (ret < 0) {
555 printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n", 490 printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n",
556 OMAP_DM9000_GPIO_IRQ); 491 OMAP_DM9000_GPIO_IRQ);
557 return; 492 return;
558 } 493 }
559
560 gpio_direction_input(OMAP_DM9000_GPIO_IRQ);
561 494
562 /* init the mac address using DIE id */ 495 /* init the mac address using DIE id */
563 omap_get_die_id(&odi); 496 omap_get_die_id(&odi);
@@ -576,45 +509,6 @@ static struct platform_device *devkit8000_devices[] __initdata = {
576 &omap_dm9000_dev, 509 &omap_dm9000_dev,
577}; 510};
578 511
579static void __init devkit8000_flash_init(void)
580{
581 u8 cs = 0;
582 u8 nandcs = GPMC_CS_NUM + 1;
583
584 /* find out the chip-select on which NAND exists */
585 while (cs < GPMC_CS_NUM) {
586 u32 ret = 0;
587 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
588
589 if ((ret & 0xC00) == 0x800) {
590 printk(KERN_INFO "Found NAND on CS%d\n", cs);
591 if (nandcs > GPMC_CS_NUM)
592 nandcs = cs;
593 }
594 cs++;
595 }
596
597 if (nandcs > GPMC_CS_NUM) {
598 printk(KERN_INFO "NAND: Unable to find configuration "
599 "in GPMC\n ");
600 return;
601 }
602
603 if (nandcs < GPMC_CS_NUM) {
604 devkit8000_nand_data.cs = nandcs;
605
606 printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
607 if (gpmc_nand_init(&devkit8000_nand_data) < 0)
608 printk(KERN_ERR "Unable to register NAND device\n");
609 }
610}
611
612static struct omap_musb_board_data musb_board_data = {
613 .interface_type = MUSB_INTERFACE_ULPI,
614 .mode = MUSB_OTG,
615 .power = 100,
616};
617
618static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 512static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
619 513
620 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 514 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
@@ -795,14 +689,13 @@ static void __init devkit8000_init(void)
795 ARRAY_SIZE(devkit8000_devices)); 689 ARRAY_SIZE(devkit8000_devices));
796 690
797 omap_display_init(&devkit8000_dss_data); 691 omap_display_init(&devkit8000_dss_data);
798 spi_register_board_info(devkit8000_spi_board_info,
799 ARRAY_SIZE(devkit8000_spi_board_info));
800 692
801 devkit8000_ads7846_init(); 693 omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);
802 694
803 usb_musb_init(&musb_board_data); 695 usb_musb_init(NULL);
804 usbhs_init(&usbhs_bdata); 696 usbhs_init(&usbhs_bdata);
805 devkit8000_flash_init(); 697 omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
698 ARRAY_SIZE(devkit8000_nand_partitions));
806 699
807 /* Ensure SDRC pins are mux'd for self-refresh */ 700 /* Ensure SDRC pins are mux'd for self-refresh */
808 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 701 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);