From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mundt Date: Wed, 15 Dec 2010 06:02:26 +0000 Subject: Re: [PATCH] ARM: mach-shmobile: mackerel: Add mmcif support Message-Id: <20101215060226.GA20847@linux-sh.org> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-sh@vger.kernel.org On Wed, Dec 15, 2010 at 01:08:05PM +0900, Yusuke Goda wrote: > @@ -723,6 +770,7 @@ static void __init mackerel_init(void) > gpio_request(GPIO_FN_SDHID0_1, NULL); > gpio_request(GPIO_FN_SDHID0_0, NULL); > > +#if !defined(CONFIG_MMC_SH_MMCIF) > /* enable SDHI1 */ > gpio_request(GPIO_FN_SDHICMD1, NULL); > gpio_request(GPIO_FN_SDHICLK1, NULL); > @@ -730,6 +778,7 @@ static void __init mackerel_init(void) > gpio_request(GPIO_FN_SDHID1_2, NULL); > gpio_request(GPIO_FN_SDHID1_1, NULL); > gpio_request(GPIO_FN_SDHID1_0, NULL); > +#endif > /* card detect pin for MMC slot (CN7) */ > gpio_request(GPIO_PORT41, NULL); > gpio_direction_input(GPIO_PORT41); > @@ -742,6 +791,18 @@ static void __init mackerel_init(void) > gpio_request(GPIO_FN_SDHID2_1, NULL); > gpio_request(GPIO_FN_SDHID2_0, NULL); > > + /* MMCIF */ > + gpio_request(GPIO_FN_MMCD0_0, NULL); > + gpio_request(GPIO_FN_MMCD0_1, NULL); > + gpio_request(GPIO_FN_MMCD0_2, NULL); > + gpio_request(GPIO_FN_MMCD0_3, NULL); > + gpio_request(GPIO_FN_MMCD0_4, NULL); > + gpio_request(GPIO_FN_MMCD0_5, NULL); > + gpio_request(GPIO_FN_MMCD0_6, NULL); > + gpio_request(GPIO_FN_MMCD0_7, NULL); > + gpio_request(GPIO_FN_MMCCMD0, NULL); > + gpio_request(GPIO_FN_MMCCLK0, NULL); > + So we can infer that MMCIF and SDHI1 are muxed on the same pins and we need to select one or the other based on the configuration. Is there a way to figure out which mode we are in based off of the card detect pin? It would be nice to detect this at runtime instead of having to hardcode the configuration.