aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index f5d55efda386..46ca4d4abf91 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -238,6 +238,18 @@ static struct platform_device smc911x_device = {
238 }, 238 },
239}; 239};
240 240
241/*
242 * The card detect pin of the top SD/MMC slot (CN7) is active low and is
243 * connected to GPIO A22 of SH7372 (GPIO_PORT41).
244 */
245static int slot_cn7_get_cd(struct platform_device *pdev)
246{
247 if (gpio_is_valid(GPIO_PORT41))
248 return !gpio_get_value(GPIO_PORT41);
249 else
250 return -ENXIO;
251}
252
241/* SH_MMCIF */ 253/* SH_MMCIF */
242static struct resource sh_mmcif_resources[] = { 254static struct resource sh_mmcif_resources[] = {
243 [0] = { 255 [0] = {
@@ -264,6 +276,7 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
264 .caps = MMC_CAP_4_BIT_DATA | 276 .caps = MMC_CAP_4_BIT_DATA |
265 MMC_CAP_8_BIT_DATA | 277 MMC_CAP_8_BIT_DATA |
266 MMC_CAP_NEEDS_POLL, 278 MMC_CAP_NEEDS_POLL,
279 .get_cd = slot_cn7_get_cd,
267}; 280};
268 281
269static struct platform_device sh_mmcif_device = { 282static struct platform_device sh_mmcif_device = {
@@ -313,6 +326,8 @@ static struct sh_mobile_sdhi_info sdhi1_info = {
313 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, 326 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
314 .tmio_ocr_mask = MMC_VDD_165_195, 327 .tmio_ocr_mask = MMC_VDD_165_195,
315 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, 328 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
329 .tmio_caps = MMC_CAP_NEEDS_POLL,
330 .get_cd = slot_cn7_get_cd,
316}; 331};
317 332
318static struct resource sdhi1_resources[] = { 333static struct resource sdhi1_resources[] = {
@@ -1060,6 +1075,10 @@ static void __init ap4evb_init(void)
1060 gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */ 1075 gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */
1061 gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */ 1076 gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */
1062 1077
1078 /* card detect pin for MMC slot (CN7) */
1079 gpio_request(GPIO_PORT41, NULL);
1080 gpio_direction_input(GPIO_PORT41);
1081
1063 /* set SPU2 clock to 119.6 MHz */ 1082 /* set SPU2 clock to 119.6 MHz */
1064 clk = clk_get(NULL, "spu_clk"); 1083 clk = clk_get(NULL, "spu_clk");
1065 if (!IS_ERR(clk)) { 1084 if (!IS_ERR(clk)) {