diff options
author | Barry Song <barry.song@analog.com> | 2009-07-17 03:04:55 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-09-16 21:31:51 -0400 |
commit | 427f277e5f472b6c1bc444ef5f7d30ebe280420e (patch) | |
tree | dde65f74bdb861e72919e6c86c65063cbb94da18 | |
parent | 407505dc01ac2b4f2944cd3c6a0c02473ffb869e (diff) |
Blackfin: bf537-stamp: update AD714x resources
Push the device table to the board resources as data interpretation can be
changed on a per-board basis.
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 133 |
1 files changed, 131 insertions, 2 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 72d11de30471..e5fffe7e84cd 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -540,6 +540,120 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = { | |||
540 | }; | 540 | }; |
541 | #endif | 541 | #endif |
542 | 542 | ||
543 | #if defined(CONFIG_INPUT_EVAL_AD7147EBZ) | ||
544 | #include <linux/input.h> | ||
545 | #include <linux/input/ad714x.h> | ||
546 | static struct bfin5xx_spi_chip ad7147_spi_chip_info = { | ||
547 | .enable_dma = 0, | ||
548 | .bits_per_word = 16, | ||
549 | }; | ||
550 | |||
551 | static struct ad714x_slider_plat slider_plat[] = { | ||
552 | { | ||
553 | .start_stage = 0, | ||
554 | .end_stage = 7, | ||
555 | .max_coord = 128, | ||
556 | }, | ||
557 | }; | ||
558 | |||
559 | static struct ad714x_button_plat button_plat[] = { | ||
560 | { | ||
561 | .keycode = BTN_FORWARD, | ||
562 | .l_mask = 0, | ||
563 | .h_mask = 0x600, | ||
564 | }, | ||
565 | { | ||
566 | .keycode = BTN_LEFT, | ||
567 | .l_mask = 0, | ||
568 | .h_mask = 0x500, | ||
569 | }, | ||
570 | { | ||
571 | .keycode = BTN_MIDDLE, | ||
572 | .l_mask = 0, | ||
573 | .h_mask = 0x800, | ||
574 | }, | ||
575 | { | ||
576 | .keycode = BTN_RIGHT, | ||
577 | .l_mask = 0x100, | ||
578 | .h_mask = 0x400, | ||
579 | }, | ||
580 | { | ||
581 | .keycode = BTN_BACK, | ||
582 | .l_mask = 0x200, | ||
583 | .h_mask = 0x400, | ||
584 | }, | ||
585 | }; | ||
586 | static struct ad714x_platform_data ad7147_platfrom_data = { | ||
587 | .slider_num = 1, | ||
588 | .button_num = 5, | ||
589 | .slider = slider_plat, | ||
590 | .button = button_plat, | ||
591 | .stage_cfg_reg = { | ||
592 | {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600}, | ||
593 | {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650}, | ||
594 | {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650}, | ||
595 | {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650}, | ||
596 | {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650}, | ||
597 | {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650}, | ||
598 | {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650}, | ||
599 | {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600}, | ||
600 | {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150}, | ||
601 | {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150}, | ||
602 | {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300}, | ||
603 | {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150}, | ||
604 | }, | ||
605 | .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0}, | ||
606 | }; | ||
607 | #endif | ||
608 | |||
609 | #if defined(CONFIG_INPUT_EVAL_AD7142EB) | ||
610 | #include <linux/input.h> | ||
611 | #include <linux/input/ad714x.h> | ||
612 | static struct ad714x_button_plat button_plat[] = { | ||
613 | { | ||
614 | .keycode = BTN_1, | ||
615 | .l_mask = 0, | ||
616 | .h_mask = 0x1, | ||
617 | }, | ||
618 | { | ||
619 | .keycode = BTN_2, | ||
620 | .l_mask = 0, | ||
621 | .h_mask = 0x2, | ||
622 | }, | ||
623 | { | ||
624 | .keycode = BTN_3, | ||
625 | .l_mask = 0, | ||
626 | .h_mask = 0x4, | ||
627 | }, | ||
628 | { | ||
629 | .keycode = BTN_4, | ||
630 | .l_mask = 0x0, | ||
631 | .h_mask = 0x8, | ||
632 | }, | ||
633 | }; | ||
634 | static struct ad714x_platform_data ad7142_platfrom_data = { | ||
635 | .button_num = 4, | ||
636 | .button = button_plat, | ||
637 | .stage_cfg_reg = { | ||
638 | /* fixme: figure out right setting for all comoponent according | ||
639 | * to hardware feature of EVAL-AD7142EB board */ | ||
640 | {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A}, | ||
641 | {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A}, | ||
642 | {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A}, | ||
643 | {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A}, | ||
644 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, | ||
645 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, | ||
646 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, | ||
647 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, | ||
648 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, | ||
649 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, | ||
650 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, | ||
651 | {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320}, | ||
652 | }, | ||
653 | .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0}, | ||
654 | }; | ||
655 | #endif | ||
656 | |||
543 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) | 657 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
544 | #define MMC_SPI_CARD_DETECT_INT IRQ_PF5 | 658 | #define MMC_SPI_CARD_DETECT_INT IRQ_PF5 |
545 | 659 | ||
@@ -784,6 +898,20 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
784 | .controller_data = &ad9960_spi_chip_info, | 898 | .controller_data = &ad9960_spi_chip_info, |
785 | }, | 899 | }, |
786 | #endif | 900 | #endif |
901 | |||
902 | #if defined(CONFIG_INPUT_EVAL_AD7147EBZ) | ||
903 | { | ||
904 | .modalias = "ad714x_captouch", | ||
905 | .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ | ||
906 | .irq = IRQ_PF4, | ||
907 | .bus_num = 0, | ||
908 | .chip_select = 5, | ||
909 | .mode = SPI_MODE_3, | ||
910 | .platform_data = &ad7147_platfrom_data, | ||
911 | .controller_data = &ad7147_spi_chip_info, | ||
912 | }, | ||
913 | #endif | ||
914 | |||
787 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) | 915 | #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) |
788 | { | 916 | { |
789 | .modalias = "mmc_spi", | 917 | .modalias = "mmc_spi", |
@@ -1337,10 +1465,11 @@ static struct adp5520_platform_data adp5520_pdev_data = { | |||
1337 | #endif | 1465 | #endif |
1338 | 1466 | ||
1339 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { | 1467 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { |
1340 | #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) | 1468 | #if defined(CONFIG_INPUT_EVAL_AD7142EB) |
1341 | { | 1469 | { |
1342 | I2C_BOARD_INFO("ad7142_joystick", 0x2C), | 1470 | I2C_BOARD_INFO("ad7142_captouch", 0x2C), |
1343 | .irq = IRQ_PG5, | 1471 | .irq = IRQ_PG5, |
1472 | .platform_data = (void *)&ad7142_platfrom_data, | ||
1344 | }, | 1473 | }, |
1345 | #endif | 1474 | #endif |
1346 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) | 1475 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |