All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Grinberg <grinberg@compulab.co.il>
To: Igor Grinberg <grinberg@compulab.co.il>
Cc: Tony Lindgren <tony@atomide.com>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: OMAP3: hsmmc: fix MMC 2 setup for AM35x
Date: Thu, 08 Dec 2011 21:25:20 +0200	[thread overview]
Message-ID: <4EE10F20.5080806@compulab.co.il> (raw)
In-Reply-To: <1322559468-5883-1-git-send-email-grinberg@compulab.co.il>

ping

Tony,
I'd like this to go into 3.3, can it?

On 11/29/11 11:37, Igor Grinberg wrote:
> AM35x MMC 2 controller has internal clock loopback setting which cannot
> be utilized without this patch and thus SDIO devices connected to this
> controller and depend on this setting will fail to initialize.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
>  arch/arm/mach-omap2/hsmmc.c |   42 ++++++++++++++++++++++++++++++------------
>  1 files changed, 30 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index ecde558..c80859e 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -171,6 +171,17 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
>  	}
>  }
>  
> +static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc)
> +{
> +	u32 reg;
> +
> +	if (mmc->slots[0].internal_clock) {
> +		reg = omap_ctrl_readl(control_devconf1_offset);
> +		reg |= OMAP2_MMCSDIO2ADPCLKISEL;
> +		omap_ctrl_writel(reg, control_devconf1_offset);
> +	}
> +}
> +
>  static void hsmmc23_before_set_reg(struct device *dev, int slot,
>  				   int power_on, int vdd)
>  {
> @@ -179,16 +190,19 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot,
>  	if (mmc->slots[0].remux)
>  		mmc->slots[0].remux(dev, slot, power_on);
>  
> -	if (power_on) {
> -		/* Only MMC2 supports a CLKIN */
> -		if (mmc->slots[0].internal_clock) {
> -			u32 reg;
> +	if (power_on)
> +		hsmmc2_select_input_clk_src(mmc);
> +}
>  
> -			reg = omap_ctrl_readl(control_devconf1_offset);
> -			reg |= OMAP2_MMCSDIO2ADPCLKISEL;
> -			omap_ctrl_writel(reg, control_devconf1_offset);
> -		}
> -	}
> +static int am35x_hsmmc2_set_power(struct device *dev, int slot,
> +				  int power_on, int vdd)
> +{
> +	struct omap_mmc_platform_data *mmc = dev->platform_data;
> +
> +	if (power_on)
> +		hsmmc2_select_input_clk_src(mmc);
> +
> +	return 0;
>  }
>  
>  static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
> @@ -346,9 +360,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>  	else
>  		mmc->slots[0].ocr_mask = c->ocr_mask;
>  
> -	if (cpu_is_omap3517() || cpu_is_omap3505())
> -		mmc->slots[0].set_power = nop_mmc_set_power;
> -	else
> +	if (!cpu_is_omap3517() && !cpu_is_omap3505())
>  		mmc->slots[0].features |= HSMMC_HAS_PBIAS;
>  
>  	if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0))
> @@ -371,6 +383,9 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>  			}
>  		}
>  
> +		if (cpu_is_omap3517() || cpu_is_omap3505())
> +			mmc->slots[0].set_power = nop_mmc_set_power;
> +
>  		/* OMAP3630 HSMMC1 supports only 4-bit */
>  		if (cpu_is_omap3630() &&
>  				(c->caps & MMC_CAP_8_BIT_DATA)) {
> @@ -380,6 +395,9 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>  		}
>  		break;
>  	case 2:
> +		if (cpu_is_omap3517() || cpu_is_omap3505())
> +			mmc->slots[0].set_power = am35x_hsmmc2_set_power;
> +
>  		if (c->ext_clock)
>  			c->transceiver = 1;
>  		if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) {

-- 
Regards,
Igor.

WARNING: multiple messages have this Message-ID (diff)
From: grinberg@compulab.co.il (Igor Grinberg)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP3: hsmmc: fix MMC 2 setup for AM35x
Date: Thu, 08 Dec 2011 21:25:20 +0200	[thread overview]
Message-ID: <4EE10F20.5080806@compulab.co.il> (raw)
In-Reply-To: <1322559468-5883-1-git-send-email-grinberg@compulab.co.il>

ping

Tony,
I'd like this to go into 3.3, can it?

On 11/29/11 11:37, Igor Grinberg wrote:
> AM35x MMC 2 controller has internal clock loopback setting which cannot
> be utilized without this patch and thus SDIO devices connected to this
> controller and depend on this setting will fail to initialize.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
>  arch/arm/mach-omap2/hsmmc.c |   42 ++++++++++++++++++++++++++++++------------
>  1 files changed, 30 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index ecde558..c80859e 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -171,6 +171,17 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
>  	}
>  }
>  
> +static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc)
> +{
> +	u32 reg;
> +
> +	if (mmc->slots[0].internal_clock) {
> +		reg = omap_ctrl_readl(control_devconf1_offset);
> +		reg |= OMAP2_MMCSDIO2ADPCLKISEL;
> +		omap_ctrl_writel(reg, control_devconf1_offset);
> +	}
> +}
> +
>  static void hsmmc23_before_set_reg(struct device *dev, int slot,
>  				   int power_on, int vdd)
>  {
> @@ -179,16 +190,19 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot,
>  	if (mmc->slots[0].remux)
>  		mmc->slots[0].remux(dev, slot, power_on);
>  
> -	if (power_on) {
> -		/* Only MMC2 supports a CLKIN */
> -		if (mmc->slots[0].internal_clock) {
> -			u32 reg;
> +	if (power_on)
> +		hsmmc2_select_input_clk_src(mmc);
> +}
>  
> -			reg = omap_ctrl_readl(control_devconf1_offset);
> -			reg |= OMAP2_MMCSDIO2ADPCLKISEL;
> -			omap_ctrl_writel(reg, control_devconf1_offset);
> -		}
> -	}
> +static int am35x_hsmmc2_set_power(struct device *dev, int slot,
> +				  int power_on, int vdd)
> +{
> +	struct omap_mmc_platform_data *mmc = dev->platform_data;
> +
> +	if (power_on)
> +		hsmmc2_select_input_clk_src(mmc);
> +
> +	return 0;
>  }
>  
>  static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
> @@ -346,9 +360,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>  	else
>  		mmc->slots[0].ocr_mask = c->ocr_mask;
>  
> -	if (cpu_is_omap3517() || cpu_is_omap3505())
> -		mmc->slots[0].set_power = nop_mmc_set_power;
> -	else
> +	if (!cpu_is_omap3517() && !cpu_is_omap3505())
>  		mmc->slots[0].features |= HSMMC_HAS_PBIAS;
>  
>  	if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0))
> @@ -371,6 +383,9 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>  			}
>  		}
>  
> +		if (cpu_is_omap3517() || cpu_is_omap3505())
> +			mmc->slots[0].set_power = nop_mmc_set_power;
> +
>  		/* OMAP3630 HSMMC1 supports only 4-bit */
>  		if (cpu_is_omap3630() &&
>  				(c->caps & MMC_CAP_8_BIT_DATA)) {
> @@ -380,6 +395,9 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
>  		}
>  		break;
>  	case 2:
> +		if (cpu_is_omap3517() || cpu_is_omap3505())
> +			mmc->slots[0].set_power = am35x_hsmmc2_set_power;
> +
>  		if (c->ext_clock)
>  			c->transceiver = 1;
>  		if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) {

-- 
Regards,
Igor.

  reply	other threads:[~2011-12-08 19:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29  9:37 [PATCH] ARM: OMAP3: hsmmc: fix MMC 2 setup for AM35x Igor Grinberg
2011-11-29  9:37 ` Igor Grinberg
2011-12-08 19:25 ` Igor Grinberg [this message]
2011-12-08 19:25   ` Igor Grinberg
2011-12-09  0:31   ` Tony Lindgren
2011-12-09  0:31     ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE10F20.5080806@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.