aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-mackerel.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/board-mackerel.c')
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 5bcf5c1e1399..7b15d21f0f68 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -657,17 +657,14 @@ static struct platform_device fsi_ak4643_device = {
657 */ 657 */
658static int slot_cn7_get_cd(struct platform_device *pdev) 658static int slot_cn7_get_cd(struct platform_device *pdev)
659{ 659{
660 if (gpio_is_valid(GPIO_PORT41)) 660 return !gpio_get_value(GPIO_PORT41);
661 return !gpio_get_value(GPIO_PORT41);
662 else
663 return -ENXIO;
664} 661}
665 662
666/* SDHI0 */ 663/* SDHI0 */
667static struct sh_mobile_sdhi_info sdhi0_info = { 664static struct sh_mobile_sdhi_info sdhi0_info = {
668 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 665 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
669 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 666 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
670 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 667 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
671}; 668};
672 669
673static struct resource sdhi0_resources[] = { 670static struct resource sdhi0_resources[] = {
@@ -700,7 +697,7 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
700 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, 697 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
701 .tmio_ocr_mask = MMC_VDD_165_195, 698 .tmio_ocr_mask = MMC_VDD_165_195,
702 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, 699 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
703 .tmio_caps = MMC_CAP_SD_HIGHSPEED | 700 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
704 MMC_CAP_NEEDS_POLL, 701 MMC_CAP_NEEDS_POLL,
705 .get_cd = slot_cn7_get_cd, 702 .get_cd = slot_cn7_get_cd,
706}; 703};
@@ -729,13 +726,23 @@ static struct platform_device sdhi1_device = {
729}; 726};
730#endif 727#endif
731 728
729/*
730 * The card detect pin of the top SD/MMC slot (CN23) is active low and is
731 * connected to GPIO SCIFB_SCK of SH7372 (GPIO_PORT162).
732 */
733static int slot_cn23_get_cd(struct platform_device *pdev)
734{
735 return !gpio_get_value(GPIO_PORT162);
736}
737
732/* SDHI2 */ 738/* SDHI2 */
733static struct sh_mobile_sdhi_info sdhi2_info = { 739static struct sh_mobile_sdhi_info sdhi2_info = {
734 .dma_slave_tx = SHDMA_SLAVE_SDHI2_TX, 740 .dma_slave_tx = SHDMA_SLAVE_SDHI2_TX,
735 .dma_slave_rx = SHDMA_SLAVE_SDHI2_RX, 741 .dma_slave_rx = SHDMA_SLAVE_SDHI2_RX,
736 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, 742 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
737 .tmio_caps = MMC_CAP_SD_HIGHSPEED | 743 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
738 MMC_CAP_NEEDS_POLL, 744 MMC_CAP_NEEDS_POLL,
745 .get_cd = slot_cn23_get_cd,
739}; 746};
740 747
741static struct resource sdhi2_resources[] = { 748static struct resource sdhi2_resources[] = {
@@ -953,6 +960,7 @@ static struct tca6416_keys_platform_data mackerel_tca6416_keys_info = {
953}; 960};
954 961
955/* I2C */ 962/* I2C */
963#define IRQ7 evt2irq(0x02e0)
956#define IRQ9 evt2irq(0x0320) 964#define IRQ9 evt2irq(0x0320)
957 965
958static struct i2c_board_info i2c0_devices[] = { 966static struct i2c_board_info i2c0_devices[] = {
@@ -965,6 +973,11 @@ static struct i2c_board_info i2c0_devices[] = {
965 .platform_data = &mackerel_tca6416_keys_info, 973 .platform_data = &mackerel_tca6416_keys_info,
966 .irq = IRQ9, 974 .irq = IRQ9,
967 }, 975 },
976 /* Touchscreen */
977 {
978 I2C_BOARD_INFO("st1232-ts", 0x55),
979 .irq = IRQ7,
980 },
968}; 981};
969 982
970#define IRQ21 evt2irq(0x32a0) 983#define IRQ21 evt2irq(0x32a0)
@@ -1092,6 +1105,10 @@ static void __init mackerel_init(void)
1092 gpio_request(GPIO_FN_IRQ9_42, NULL); 1105 gpio_request(GPIO_FN_IRQ9_42, NULL);
1093 set_irq_type(IRQ9, IRQ_TYPE_LEVEL_HIGH); 1106 set_irq_type(IRQ9, IRQ_TYPE_LEVEL_HIGH);
1094 1107
1108 /* enable Touchscreen */
1109 gpio_request(GPIO_FN_IRQ7_40, NULL);
1110 set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);
1111
1095 /* enable Accelerometer */ 1112 /* enable Accelerometer */
1096 gpio_request(GPIO_FN_IRQ21, NULL); 1113 gpio_request(GPIO_FN_IRQ21, NULL);
1097 set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH); 1114 set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH);
@@ -1127,6 +1144,10 @@ static void __init mackerel_init(void)
1127 gpio_request(GPIO_FN_SDHID2_1, NULL); 1144 gpio_request(GPIO_FN_SDHID2_1, NULL);
1128 gpio_request(GPIO_FN_SDHID2_0, NULL); 1145 gpio_request(GPIO_FN_SDHID2_0, NULL);
1129 1146
1147 /* card detect pin for microSD slot (CN23) */
1148 gpio_request(GPIO_PORT162, NULL);
1149 gpio_direction_input(GPIO_PORT162);
1150
1130 /* MMCIF */ 1151 /* MMCIF */
1131 gpio_request(GPIO_FN_MMCD0_0, NULL); 1152 gpio_request(GPIO_FN_MMCD0_0, NULL);
1132 gpio_request(GPIO_FN_MMCD0_1, NULL); 1153 gpio_request(GPIO_FN_MMCD0_1, NULL);