public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] HSMMC: Make loopback clock configurable
@ 2008-11-13 21:40 Grazvydas Ignotas
  2008-11-13 21:40 ` [PATCH 2/2] HSMMC: Enable external input clock for 2430 SDP MMC1 Grazvydas Ignotas
  2008-11-13 23:06 ` [PATCH 1/2] HSMMC: Make loopback clock configurable Tony Lindgren
  0 siblings, 2 replies; 8+ messages in thread
From: Grazvydas Ignotas @ 2008-11-13 21:40 UTC (permalink / raw)
  To: linux-omap; +Cc: Grazvydas Ignotas

Some boards use input clock from external pin for MMC/SDIO
modules in OMAP chips. Make that option selectable instead of
forcing loop back clock on everyone.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
This patch applies on previous patch I sent:
"minor mmc-twl4030 cleanups"

 arch/arm/mach-omap2/mmc-twl4030.c |   14 ++++++++------
 arch/arm/mach-omap2/mmc-twl4030.h |    1 +
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index b1fe0f3..0ea6ba6 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -250,8 +250,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
 			omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
 		}
 
-		/* REVISIT: Loop back clock not needed for 2430? */
-		if (!cpu_is_omap2430()) {
+		if (c->mmc->slots[0].internal_clock) {
 			reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
 			reg |= OMAP2_MMCSDIO1ADPCLKISEL;
 			omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
@@ -298,11 +297,13 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
 	struct twl_mmc_controller *c = &hsmmc[1];
 
 	if (power_on) {
-		u32 reg;
+		if (c->mmc->slots[0].internal_clock) {
+			u32 reg;
 
-		reg = omap_ctrl_readl(control_devconf1_offset);
-		reg |= OMAP2_MMCSDIO2ADPCLKISEL;
-		omap_ctrl_writel(reg, control_devconf1_offset);
+			reg = omap_ctrl_readl(control_devconf1_offset);
+			reg |= OMAP2_MMCSDIO2ADPCLKISEL;
+			omap_ctrl_writel(reg, control_devconf1_offset);
+		}
 		ret = twl_mmc_set_voltage(c, vdd);
 	} else {
 		ret = twl_mmc_set_voltage(c, 0);
@@ -354,6 +355,7 @@ void __init hsmmc_init(struct twl4030_hsmmc_info *controllers)
 					MMC_VDD_29_30 |
 					MMC_VDD_30_31 | MMC_VDD_31_32;
 		mmc->slots[0].wires = c->wires;
+		mmc->slots[0].internal_clock = !c->ext_clock;
 		mmc->dma_mask = 0xffffffff;
 
 		/* note: twl4030 card detect GPIOs normally switch VMMCx ... */
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index a2e60fe..e2d58a2 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -11,6 +11,7 @@ struct twl4030_hsmmc_info {
 	u8	wires;		/* 1/4/8 wires */
 	int	gpio_cd;	/* or -EINVAL */
 	int	gpio_wp;	/* or -EINVAL */
+	int	ext_clock:1;	/* use external pin for input clock */
 };
 
 #if	defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] HSMMC: Enable external input clock for 2430 SDP MMC1
  2008-11-13 21:40 [PATCH 1/2] HSMMC: Make loopback clock configurable Grazvydas Ignotas
@ 2008-11-13 21:40 ` Grazvydas Ignotas
  2008-11-13 23:06 ` [PATCH 1/2] HSMMC: Make loopback clock configurable Tony Lindgren
  1 sibling, 0 replies; 8+ messages in thread
From: Grazvydas Ignotas @ 2008-11-13 21:40 UTC (permalink / raw)
  To: linux-omap; +Cc: Grazvydas Ignotas

Previous patch removed cpu_is_omap2430() check in mmc-twl4030.c,
so update twl4030_hsmmc_info to accommodate that.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
 arch/arm/mach-omap2/board-2430sdp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 6aa83ac..22df018 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -396,6 +396,7 @@ static struct twl4030_hsmmc_info mmc[] __initdata = {
 		.wires		= 4,
 		.gpio_cd	= -EINVAL,
 		.gpio_wp	= -EINVAL,
+		.ext_clock	= 1,
 	},
 	{}	/* Terminator */
 };
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] HSMMC: Make loopback clock configurable
  2008-11-13 21:40 [PATCH 1/2] HSMMC: Make loopback clock configurable Grazvydas Ignotas
  2008-11-13 21:40 ` [PATCH 2/2] HSMMC: Enable external input clock for 2430 SDP MMC1 Grazvydas Ignotas
@ 2008-11-13 23:06 ` Tony Lindgren
  2008-11-14  6:41   ` Steve Sakoman
  1 sibling, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2008-11-13 23:06 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap

* Grazvydas Ignotas <notasas@gmail.com> [081113 13:40]:
> Some boards use input clock from external pin for MMC/SDIO
> modules in OMAP chips. Make that option selectable instead of
> forcing loop back clock on everyone.

Thanks, pushing both today.

Tony

> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
> ---
> This patch applies on previous patch I sent:
> "minor mmc-twl4030 cleanups"
> 
>  arch/arm/mach-omap2/mmc-twl4030.c |   14 ++++++++------
>  arch/arm/mach-omap2/mmc-twl4030.h |    1 +
>  2 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> index b1fe0f3..0ea6ba6 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.c
> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> @@ -250,8 +250,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
>  			omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
>  		}
>  
> -		/* REVISIT: Loop back clock not needed for 2430? */
> -		if (!cpu_is_omap2430()) {
> +		if (c->mmc->slots[0].internal_clock) {
>  			reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
>  			reg |= OMAP2_MMCSDIO1ADPCLKISEL;
>  			omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
> @@ -298,11 +297,13 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
>  	struct twl_mmc_controller *c = &hsmmc[1];
>  
>  	if (power_on) {
> -		u32 reg;
> +		if (c->mmc->slots[0].internal_clock) {
> +			u32 reg;
>  
> -		reg = omap_ctrl_readl(control_devconf1_offset);
> -		reg |= OMAP2_MMCSDIO2ADPCLKISEL;
> -		omap_ctrl_writel(reg, control_devconf1_offset);
> +			reg = omap_ctrl_readl(control_devconf1_offset);
> +			reg |= OMAP2_MMCSDIO2ADPCLKISEL;
> +			omap_ctrl_writel(reg, control_devconf1_offset);
> +		}
>  		ret = twl_mmc_set_voltage(c, vdd);
>  	} else {
>  		ret = twl_mmc_set_voltage(c, 0);
> @@ -354,6 +355,7 @@ void __init hsmmc_init(struct twl4030_hsmmc_info *controllers)
>  					MMC_VDD_29_30 |
>  					MMC_VDD_30_31 | MMC_VDD_31_32;
>  		mmc->slots[0].wires = c->wires;
> +		mmc->slots[0].internal_clock = !c->ext_clock;
>  		mmc->dma_mask = 0xffffffff;
>  
>  		/* note: twl4030 card detect GPIOs normally switch VMMCx ... */
> diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
> index a2e60fe..e2d58a2 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.h
> +++ b/arch/arm/mach-omap2/mmc-twl4030.h
> @@ -11,6 +11,7 @@ struct twl4030_hsmmc_info {
>  	u8	wires;		/* 1/4/8 wires */
>  	int	gpio_cd;	/* or -EINVAL */
>  	int	gpio_wp;	/* or -EINVAL */
> +	int	ext_clock:1;	/* use external pin for input clock */
>  };
>  
>  #if	defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
> -- 
> 1.5.4.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] HSMMC: Make loopback clock configurable
  2008-11-13 23:06 ` [PATCH 1/2] HSMMC: Make loopback clock configurable Tony Lindgren
@ 2008-11-14  6:41   ` Steve Sakoman
  2008-11-14 10:49     ` Grazvydas Ignotas
  0 siblings, 1 reply; 8+ messages in thread
From: Steve Sakoman @ 2008-11-14  6:41 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap@vger.kernel.org

On Thu, Nov 13, 2008 at 3:06 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Grazvydas Ignotas <notasas@gmail.com> [081113 13:40]:
>> Some boards use input clock from external pin for MMC/SDIO
>> modules in OMAP chips. Make that option selectable instead of
>> forcing loop back clock on everyone.
>
> Thanks, pushing both today.

Hmm . . . not sure if it is related to this patch, but I now get an
oops on Overo.

Has anyone else seen this?

I'll do some debugging after I get some sleep.

Steve

Unable to handle kernel NULL pointer dereference at virtual address 00000029
pgd = c0004000
[00000029] *pgd=00000000
Internal error: Oops: 5 [#1]
Modules linked in:
CPU: 0    Not tainted  (2.6.28-rc4-omap1 #1)
PC is at twl_mmc2_set_power+0x20/0x68
LR is at omap_mmc_set_ios+0x78/0x25c
pc : [<c00fb62c>]    lr : [<c02ec7d0>]    psr: 20000013
sp : cf93bf10  ip : cf93bf30  fp : cf93bf2c
r10: 00000000  r9 : 00000000  r8 : 00000000
r7 : cfbb4968  r6 : 00000013  r5 : c04ea960  r4 : cfbb4800
r3 : 00000000  r2 : 00000001  r1 : 00000001  r0 : cf901008
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387f  Table: 80004018  DAC: 00000017
Process kmmcd (pid: 209, stack limit = 0xcf93a2e8)
Stack: (0xcf93bf10 to 0xcf93c000)
bf00:                                     cfbb4800 cfbb4800 cfbb4a00 cfbb4968
bf20: cf93bf4c cf93bf30 c02ec7d0 c00fb618 cfbb4968 cfbb4800 c02e21d0 cf831ea0
bf40: cf93bf64 cf93bf50 c02e1924 c02ec764 cfbb4800 60000013 cf93bf84 cf93bf68
bf60: c02e2270 c02e18c4 c03ecd08 c010a4f8 cf831ea0 cf93a000 cf93bfa4 cf93bf88
bf80: c011e098 c02e21dc cf93bfb8 cf8ec5a0 cf93a000 cf831ea0 cf93bfdc cf93bfa8
bfa0: c011ec34 c011e000 c01219a8 00000000 cf8ec5a0 c0121e90 cf93bfb8 cf93bfb8
bfc0: cf831ea0 c011eb44 00000000 00000000 cf93bff4 cf93bfe0 c01219c0 c011eb50
bfe0: 00000000 00000000 00000000 cf93bff8 c0111360 c0121978 948ee7d5 0e80e45a
Backtrace:
[<c00fb60c>] (twl_mmc2_set_power+0x0/0x68) from [<c02ec7d0>]
(omap_mmc_set_ios+0x78/0x25c)
 r7:cfbb4968 r6:cfbb4a00 r5:cfbb4800 r4:cfbb4800
[<c02ec758>] (omap_mmc_set_ios+0x0/0x25c) from [<c02e1924>]
(mmc_power_up+0x6c/0xb0)
 r7:cf831ea0 r6:c02e21d0 r5:cfbb4800 r4:cfbb4968
[<c02e18b8>] (mmc_power_up+0x0/0xb0) from [<c02e2270>] (mmc_rescan+0xa0/0x1c0)
 r5:60000013 r4:cfbb4800
[<c02e21d0>] (mmc_rescan+0x0/0x1c0) from [<c011e098>] (run_workqueue+0xa4/0x120)
 r5:cf93a000 r4:cf831ea0
[<c011dff4>] (run_workqueue+0x0/0x120) from [<c011ec34>]
(worker_thread+0xf0/0x104)
 r7:cf831ea0 r6:cf93a000 r5:cf8ec5a0 r4:cf93bfb8
[<c011eb44>] (worker_thread+0x0/0x104) from [<c01219c0>] (kthread+0x54/0x80)
 r7:00000000 r6:00000000 r5:c011eb44 r4:cf831ea0
[<c012196c>] (kthread+0x0/0x80) from [<c0111360>] (do_exit+0x0/0x6c8)
 r5:00000000 r4:00000000
Code: e1a06003 e59f5044 0a00000d e5953010 (e5d33029)
---[ end trace 62381099a6bde9b1 ]---

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] HSMMC: Make loopback clock configurable
  2008-11-14  6:41   ` Steve Sakoman
@ 2008-11-14 10:49     ` Grazvydas Ignotas
  2008-11-14 18:34       ` Steve Sakoman
  2008-11-14 18:54       ` Koen Kooi
  0 siblings, 2 replies; 8+ messages in thread
From: Grazvydas Ignotas @ 2008-11-14 10:49 UTC (permalink / raw)
  To: linux-omap; +Cc: sakoman, Grazvydas Ignotas

On Fri, Nov 14, 2008 at 8:41 AM, Steve Sakoman <sakoman@gmail.com> wrote:
> On Thu, Nov 13, 2008 at 3:06 PM, Tony Lindgren <tony@atomide.com> wrote:
>> * Grazvydas Ignotas <notasas@gmail.com> [081113 13:40]:
>>> Some boards use input clock from external pin for MMC/SDIO
>>> modules in OMAP chips. Make that option selectable instead of
>>> forcing loop back clock on everyone.
>>
>> Thanks, pushing both today.
>
> Hmm . . . not sure if it is related to this patch, but I now get an
> oops on Overo.

Oops.. Haven't thought to try it without gpio_cd set up, in which case c->mmc
is not set initialized.. Please try the following patch:


diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 0ea6ba6..626d668 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -239,6 +239,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
 	u32 reg;
 	int ret = 0;
 	struct twl_mmc_controller *c = &hsmmc[0];
+	struct omap_mmc_platform_data *mmc = dev->platform_data;
 
 	if (power_on) {
 		if (cpu_is_omap2430()) {
@@ -250,7 +251,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
 			omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
 		}
 
-		if (c->mmc->slots[0].internal_clock) {
+		if (mmc->slots[0].internal_clock) {
 			reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
 			reg |= OMAP2_MMCSDIO1ADPCLKISEL;
 			omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
@@ -293,11 +294,11 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
 static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vdd)
 {
 	int ret;
-
 	struct twl_mmc_controller *c = &hsmmc[1];
+	struct omap_mmc_platform_data *mmc = dev->platform_data;
 
 	if (power_on) {
-		if (c->mmc->slots[0].internal_clock) {
+		if (mmc->slots[0].internal_clock) {
 			u32 reg;
 
 			reg = omap_ctrl_readl(control_devconf1_offset);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] HSMMC: Make loopback clock configurable
  2008-11-14 10:49     ` Grazvydas Ignotas
@ 2008-11-14 18:34       ` Steve Sakoman
  2008-11-14 18:48         ` Tony Lindgren
  2008-11-14 18:54       ` Koen Kooi
  1 sibling, 1 reply; 8+ messages in thread
From: Steve Sakoman @ 2008-11-14 18:34 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: linux-omap, Tony Lindgren

On Fri, Nov 14, 2008 at 2:49 AM, Grazvydas Ignotas <notasas@gmail.com> wrote:
> On Fri, Nov 14, 2008 at 8:41 AM, Steve Sakoman <sakoman@gmail.com> wrote:
>> On Thu, Nov 13, 2008 at 3:06 PM, Tony Lindgren <tony@atomide.com> wrote:
>>> * Grazvydas Ignotas <notasas@gmail.com> [081113 13:40]:
>>>> Some boards use input clock from external pin for MMC/SDIO
>>>> modules in OMAP chips. Make that option selectable instead of
>>>> forcing loop back clock on everyone.
>>>
>>> Thanks, pushing both today.
>>
>> Hmm . . . not sure if it is related to this patch, but I now get an
>> oops on Overo.
>
> Oops.. Haven't thought to try it without gpio_cd set up, in which case c->mmc
> is not set initialized.. Please try the following patch:

I did, and I am happy to report that it fixed the oops on mmc2 and my
wi2wi driver is happily working again.

Thanks!

Steve

> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> index 0ea6ba6..626d668 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.c
> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> @@ -239,6 +239,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
>        u32 reg;
>        int ret = 0;
>        struct twl_mmc_controller *c = &hsmmc[0];
> +       struct omap_mmc_platform_data *mmc = dev->platform_data;
>
>        if (power_on) {
>                if (cpu_is_omap2430()) {
> @@ -250,7 +251,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
>                        omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
>                }
>
> -               if (c->mmc->slots[0].internal_clock) {
> +               if (mmc->slots[0].internal_clock) {
>                        reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
>                        reg |= OMAP2_MMCSDIO1ADPCLKISEL;
>                        omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
> @@ -293,11 +294,11 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
>  static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vdd)
>  {
>        int ret;
> -
>        struct twl_mmc_controller *c = &hsmmc[1];
> +       struct omap_mmc_platform_data *mmc = dev->platform_data;
>
>        if (power_on) {
> -               if (c->mmc->slots[0].internal_clock) {
> +               if (mmc->slots[0].internal_clock) {
>                        u32 reg;
>
>                        reg = omap_ctrl_readl(control_devconf1_offset);
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] HSMMC: Make loopback clock configurable
  2008-11-14 18:34       ` Steve Sakoman
@ 2008-11-14 18:48         ` Tony Lindgren
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2008-11-14 18:48 UTC (permalink / raw)
  To: Steve Sakoman; +Cc: Grazvydas Ignotas, linux-omap

* Steve Sakoman <sakoman@gmail.com> [081114 10:34]:
> On Fri, Nov 14, 2008 at 2:49 AM, Grazvydas Ignotas <notasas@gmail.com> wrote:
> > On Fri, Nov 14, 2008 at 8:41 AM, Steve Sakoman <sakoman@gmail.com> wrote:
> >> On Thu, Nov 13, 2008 at 3:06 PM, Tony Lindgren <tony@atomide.com> wrote:
> >>> * Grazvydas Ignotas <notasas@gmail.com> [081113 13:40]:
> >>>> Some boards use input clock from external pin for MMC/SDIO
> >>>> modules in OMAP chips. Make that option selectable instead of
> >>>> forcing loop back clock on everyone.
> >>>
> >>> Thanks, pushing both today.
> >>
> >> Hmm . . . not sure if it is related to this patch, but I now get an
> >> oops on Overo.
> >
> > Oops.. Haven't thought to try it without gpio_cd set up, in which case c->mmc
> > is not set initialized.. Please try the following patch:
> 
> I did, and I am happy to report that it fixed the oops on mmc2 and my
> wi2wi driver is happily working again.

Grazvydas, can you please reply with your S-O-B so I can push your fix?

Thanks,

Tony


> 
> Thanks!
> 
> Steve
> 
> > diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
> > index 0ea6ba6..626d668 100644
> > --- a/arch/arm/mach-omap2/mmc-twl4030.c
> > +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> > @@ -239,6 +239,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
> >        u32 reg;
> >        int ret = 0;
> >        struct twl_mmc_controller *c = &hsmmc[0];
> > +       struct omap_mmc_platform_data *mmc = dev->platform_data;
> >
> >        if (power_on) {
> >                if (cpu_is_omap2430()) {
> > @@ -250,7 +251,7 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
> >                        omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
> >                }
> >
> > -               if (c->mmc->slots[0].internal_clock) {
> > +               if (mmc->slots[0].internal_clock) {
> >                        reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
> >                        reg |= OMAP2_MMCSDIO1ADPCLKISEL;
> >                        omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
> > @@ -293,11 +294,11 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
> >  static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vdd)
> >  {
> >        int ret;
> > -
> >        struct twl_mmc_controller *c = &hsmmc[1];
> > +       struct omap_mmc_platform_data *mmc = dev->platform_data;
> >
> >        if (power_on) {
> > -               if (c->mmc->slots[0].internal_clock) {
> > +               if (mmc->slots[0].internal_clock) {
> >                        u32 reg;
> >
> >                        reg = omap_ctrl_readl(control_devconf1_offset);
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] HSMMC: Make loopback clock configurable
  2008-11-14 10:49     ` Grazvydas Ignotas
  2008-11-14 18:34       ` Steve Sakoman
@ 2008-11-14 18:54       ` Koen Kooi
  1 sibling, 0 replies; 8+ messages in thread
From: Koen Kooi @ 2008-11-14 18:54 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org List

[-- Attachment #1: Type: text/plain, Size: 2382 bytes --]


Op 14 nov 2008, om 11:49 heeft Grazvydas Ignotas het volgende  
geschreven:

> On Fri, Nov 14, 2008 at 8:41 AM, Steve Sakoman <sakoman@gmail.com>  
> wrote:
>> On Thu, Nov 13, 2008 at 3:06 PM, Tony Lindgren <tony@atomide.com>  
>> wrote:
>>> * Grazvydas Ignotas <notasas@gmail.com> [081113 13:40]:
>>>> Some boards use input clock from external pin for MMC/SDIO
>>>> modules in OMAP chips. Make that option selectable instead of
>>>> forcing loop back clock on everyone.
>>>
>>> Thanks, pushing both today.
>>
>> Hmm . . . not sure if it is related to this patch, but I now get an
>> oops on Overo.
>
> Oops.. Haven't thought to try it without gpio_cd set up, in which  
> case c->mmc
> is not set initialized.. Please try the following patch:

This also fixes mmc on omap3evm.

regards,

Koen

>
>
>
> diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/ 
> mmc-twl4030.c
> index 0ea6ba6..626d668 100644
> --- a/arch/arm/mach-omap2/mmc-twl4030.c
> +++ b/arch/arm/mach-omap2/mmc-twl4030.c
> @@ -239,6 +239,7 @@ static int twl_mmc1_set_power(struct device  
> *dev, int slot, int power_on,
> 	u32 reg;
> 	int ret = 0;
> 	struct twl_mmc_controller *c = &hsmmc[0];
> +	struct omap_mmc_platform_data *mmc = dev->platform_data;
>
> 	if (power_on) {
> 		if (cpu_is_omap2430()) {
> @@ -250,7 +251,7 @@ static int twl_mmc1_set_power(struct device  
> *dev, int slot, int power_on,
> 			omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
> 		}
>
> -		if (c->mmc->slots[0].internal_clock) {
> +		if (mmc->slots[0].internal_clock) {
> 			reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
> 			reg |= OMAP2_MMCSDIO1ADPCLKISEL;
> 			omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
> @@ -293,11 +294,11 @@ static int twl_mmc1_set_power(struct device  
> *dev, int slot, int power_on,
> static int twl_mmc2_set_power(struct device *dev, int slot, int  
> power_on, int vdd)
> {
> 	int ret;
> -
> 	struct twl_mmc_controller *c = &hsmmc[1];
> +	struct omap_mmc_platform_data *mmc = dev->platform_data;
>
> 	if (power_on) {
> -		if (c->mmc->slots[0].internal_clock) {
> +		if (mmc->slots[0].internal_clock) {
> 			u32 reg;
>
> 			reg = omap_ctrl_readl(control_devconf1_offset);
> --
> To unsubscribe from this list: send the line "unsubscribe linux- 
> omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-11-14 18:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-13 21:40 [PATCH 1/2] HSMMC: Make loopback clock configurable Grazvydas Ignotas
2008-11-13 21:40 ` [PATCH 2/2] HSMMC: Enable external input clock for 2430 SDP MMC1 Grazvydas Ignotas
2008-11-13 23:06 ` [PATCH 1/2] HSMMC: Make loopback clock configurable Tony Lindgren
2008-11-14  6:41   ` Steve Sakoman
2008-11-14 10:49     ` Grazvydas Ignotas
2008-11-14 18:34       ` Steve Sakoman
2008-11-14 18:48         ` Tony Lindgren
2008-11-14 18:54       ` Koen Kooi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox