David Brownell <[email protected]> writes:
> From: David Brownell <[email protected]>
>
> Move DM355 MMC/SD pinmux to the device setup code; it shouldn't
> be coupled to clock activation. This is a small cleanup which
> doesn't yet support options like not muxing all MMCSD1 pins when
> they're not needed (e.g. hard-wired to an SDIO WLAN adapter).
>
> Signed-off-by: David Brownell <[email protected]>
Thanks, pushing today.
I agree that this needs to be decoupled.
Kevin
> ---
> arch/arm/mach-davinci/devices.c | 15 +++++++++++++++
> arch/arm/mach-davinci/psc.c | 12 ------------
> 2 files changed, 15 insertions(+), 12 deletions(-)
>
> --- a/arch/arm/mach-davinci/devices.c
> +++ b/arch/arm/mach-davinci/devices.c
> @@ -28,6 +28,7 @@
> #include <mach/emac.h>
> #include <mach/i2c.h>
> #include <mach/cpu.h>
> +#include <mach/mux.h>
>
> #include "clock.h"
>
> @@ -163,6 +164,17 @@ void __init davinci_setup_mmc(int module
> case 1:
> if (!cpu_is_davinci_dm355())
> break;
> +
> + /* REVISIT we may not need all these pins if e.g. this
> + * is a hard-wired SDIO device...
> + */
> + davinci_cfg_reg(DM355_SD1_CMD);
> + davinci_cfg_reg(DM355_SD1_CLK);
> + davinci_cfg_reg(DM355_SD1_DATA0);
> + davinci_cfg_reg(DM355_SD1_DATA1);
> + davinci_cfg_reg(DM355_SD1_DATA2);
> + davinci_cfg_reg(DM355_SD1_DATA3);
> +
> pdev = &davinci_mmcsd1_device;
> clockname = "MMCSDCLK1";
> break;
> @@ -171,6 +183,9 @@ void __init davinci_setup_mmc(int module
> mmcsd0_resources[0].start = DM355_MMCSD0_BASE;
> mmcsd0_resources[0].end = DM355_MMCSD0_BASE + SZ_4K - 1;
> mmcsd0_resources[2].start = IRQ_DM355_SDIOINT0;
> +
> + /* expose all 6 MMC0 signals: CLK, CMD, DATA[0..3] */
> + davinci_cfg_reg(DM355_MMCSD0);
> }
> pdev = &davinci_mmcsd0_device;
> clockname = cpu_is_davinci_dm355() ? "MMCSDCLK0" : "MMCSDCLK";
> --- a/arch/arm/mach-davinci/psc.c
> +++ b/arch/arm/mach-davinci/psc.c
> @@ -86,15 +86,6 @@ static void dm355_psc_mux(unsigned int i
> * while declaring what pins/irqs/edmas/... we care about.
> */
> switch (id) {
> - case DM355_LPSC_MMC_SD1: /* MMC1 */
> - /* expose DATA[0..3], CMD, CLK */
> - davinci_cfg_reg(DM355_SD1_CLK);
> - davinci_cfg_reg(DM355_SD1_CMD);
> - davinci_cfg_reg(DM355_SD1_DATA3);
> - davinci_cfg_reg(DM355_SD1_DATA2);
> - davinci_cfg_reg(DM355_SD1_DATA1);
> - davinci_cfg_reg(DM355_SD1_DATA0);
> - break;
> case DM355_LPSC_McBSP1: /* ASP1 */
> /* our ASoC code currently doesn't use these IRQs */
> #if 0
> @@ -110,9 +101,6 @@ static void dm355_psc_mux(unsigned int i
> davinci_writel(tmp, DM355_EDMA_EVTMUX);
> break;
> case DAVINCI_LPSC_MMC_SD: /* MMC0 */
> - /* expose all 6 MMC0 signals: CLK, CMD, DATA[0..3] */
> - davinci_cfg_reg(DM355_MMCSD0);
> -
> /* support EMDA for MMC0 RX */
> tmp = davinci_readl(DM355_EDMA_EVTMUX);
> tmp &= ~BIT(2);
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> [email protected]
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source