All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]omap hsmmc: fix incorrect capability reporting
@ 2010-03-30 14:37 Venkatraman S
  2010-03-30 15:47 ` Madhusudhan
  0 siblings, 1 reply; 6+ messages in thread
From: Venkatraman S @ 2010-03-30 14:37 UTC (permalink / raw)
  To: linux-mmc, linux-omap, kishore.kadiyala; +Cc: Madhusudhan Chikkature

MMC slots that support 8 bit mode also support 4 bit mode.
The capability flag has to reflect this, otherwise SDHC cards operate
in 1 bit mode.

Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 83f0aff..dbf83a6 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2093,7 +2093,7 @@ static int __init omap_hsmmc_probe(struct
platform_device *pdev)

 	if (mmc_slot(host).wires >= 8)
 		mmc->caps |= MMC_CAP_8_BIT_DATA;
-	else if (mmc_slot(host).wires >= 4)
+	if (mmc_slot(host).wires >= 4)
 		mmc->caps |= MMC_CAP_4_BIT_DATA;

 	if (mmc_slot(host).nonremovable)
-- 
1.6.3.3

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

* RE: [PATCH]omap hsmmc: fix incorrect capability reporting
  2010-03-30 14:37 [PATCH]omap hsmmc: fix incorrect capability reporting Venkatraman S
@ 2010-03-30 15:47 ` Madhusudhan
  2010-03-30 18:11   ` Venkatraman S
  0 siblings, 1 reply; 6+ messages in thread
From: Madhusudhan @ 2010-03-30 15:47 UTC (permalink / raw)
  To: 'Venkatraman S', linux-mmc, linux-omap, kishore.kadiyala



> -----Original Message-----
> From: svenkatr@gmail.com [mailto:svenkatr@gmail.com] On Behalf Of
> Venkatraman S
> Sent: Tuesday, March 30, 2010 9:37 AM
> To: linux-mmc@vger.kernel.org; linux-omap@vger.kernel.org;
> kishore.kadiyala@ti.com
> Cc: Madhusudhan Chikkature
> Subject: [PATCH]omap hsmmc: fix incorrect capability reporting
> 
> MMC slots that support 8 bit mode also support 4 bit mode.
> The capability flag has to reflect this, otherwise SDHC cards operate
> in 1 bit mode.
> 
> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
> Signed-off-by: Venkatraman S <svenkatr@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 83f0aff..dbf83a6 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -2093,7 +2093,7 @@ static int __init omap_hsmmc_probe(struct
> platform_device *pdev)
> 
>  	if (mmc_slot(host).wires >= 8)
>  		mmc->caps |= MMC_CAP_8_BIT_DATA;
> -	else if (mmc_slot(host).wires >= 4)
> +	if (mmc_slot(host).wires >= 4)
>  		mmc->caps |= MMC_CAP_4_BIT_DATA;
> 

Since 8-bit is the max how about:

  	if (mmc_slot(host).wires == 8)
  		mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA;
	if (mmc_slot(host).wires == 4)
  		mmc->caps |= MMC_CAP_4_BIT_DATA;

This would be little easy to read the code.

Regards,
Madhu

>  	if (mmc_slot(host).nonremovable)
> --
> 1.6.3.3


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

* Re: [PATCH]omap hsmmc: fix incorrect capability reporting
  2010-03-30 15:47 ` Madhusudhan
@ 2010-03-30 18:11   ` Venkatraman S
  2010-03-30 18:29     ` Nishanth Menon
  0 siblings, 1 reply; 6+ messages in thread
From: Venkatraman S @ 2010-03-30 18:11 UTC (permalink / raw)
  To: Madhusudhan, linux-mmc, linux-omap, kishore.kadiyala

> Madhusudhan <madhu.cr@ti.com> wrote:
>
>
>> -----Original Message-----
>> From: Venkatraman S
>> Sent: Tuesday, March 30, 2010 9:37 AM
>> To: linux-mmc@vger.kernel.org; linux-omap@vger.kernel.org;
>> kishore.kadiyala@ti.com
>> Cc: Madhusudhan Chikkature
>> Subject: [PATCH]omap hsmmc: fix incorrect capability reporting
>>
>> MMC slots that support 8 bit mode also support 4 bit mode.
>> The capability flag has to reflect this, otherwise SDHC cards operate
>> in 1 bit mode.
>>
>> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
>> Signed-off-by: Venkatraman S <svenkatr@ti.com>
>> ---
>>  drivers/mmc/host/omap_hsmmc.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>> index 83f0aff..dbf83a6 100644
>> --- a/drivers/mmc/host/omap_hsmmc.c
>> +++ b/drivers/mmc/host/omap_hsmmc.c
>> @@ -2093,7 +2093,7 @@ static int __init omap_hsmmc_probe(struct
>> platform_device *pdev)
>>
>>       if (mmc_slot(host).wires >= 8)
>>               mmc->caps |= MMC_CAP_8_BIT_DATA;
>> -     else if (mmc_slot(host).wires >= 4)
>> +     if (mmc_slot(host).wires >= 4)
>>               mmc->caps |= MMC_CAP_4_BIT_DATA;
>>
>
> Since 8-bit is the max how about:
>
>        if (mmc_slot(host).wires == 8)
>                mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA;
>        if (mmc_slot(host).wires == 4)
>                mmc->caps |= MMC_CAP_4_BIT_DATA;
>
> This would be little easy to read the code.

Sure. Works for me.
--
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] 6+ messages in thread

* Re: [PATCH]omap hsmmc: fix incorrect capability reporting
  2010-03-30 18:11   ` Venkatraman S
@ 2010-03-30 18:29     ` Nishanth Menon
  2010-03-30 18:42       ` Venkatraman S
  0 siblings, 1 reply; 6+ messages in thread
From: Nishanth Menon @ 2010-03-30 18:29 UTC (permalink / raw)
  To: S, Venkatraman
  Cc: Chikkature Rajashekar, Madhusudhan, linux-mmc, linux-omap,
	Kadiyala, Kishore

S, Venkatraman had written, on 03/30/2010 01:11 PM, the following:
[..]
>>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>>> index 83f0aff..dbf83a6 100644
>>> --- a/drivers/mmc/host/omap_hsmmc.c
>>> +++ b/drivers/mmc/host/omap_hsmmc.c
>>> @@ -2093,7 +2093,7 @@ static int __init omap_hsmmc_probe(struct
>>> platform_device *pdev)
>>>
>>>       if (mmc_slot(host).wires >= 8)
>>>               mmc->caps |= MMC_CAP_8_BIT_DATA;
>>> -     else if (mmc_slot(host).wires >= 4)
>>> +     if (mmc_slot(host).wires >= 4)
>>>               mmc->caps |= MMC_CAP_4_BIT_DATA;
>>>
>> Since 8-bit is the max how about:
>>
>>        if (mmc_slot(host).wires == 8)
>>                mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA;
>>        if (mmc_slot(host).wires == 4)
>>                mmc->caps |= MMC_CAP_4_BIT_DATA;
>>
>> This would be little easy to read the code.
> 
> Sure. Works for me.
nitpicky comment: might be better off using a 
switch(mmc_slot(host).wires) statement instead of using == if that is 
the intention here..

-- 
Regards,
Nishanth Menon

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

* Re: [PATCH]omap hsmmc: fix incorrect capability reporting
  2010-03-30 18:29     ` Nishanth Menon
@ 2010-03-30 18:42       ` Venkatraman S
  2010-03-31  5:20         ` kishore kadiyala
  0 siblings, 1 reply; 6+ messages in thread
From: Venkatraman S @ 2010-03-30 18:42 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Chikkature Rajashekar, Madhusudhan, linux-mmc, linux-omap,
	Kadiyala, Kishore

Nishanth Menon <nm@ti.com> wrote:
> S, Venkatraman had written, on 03/30/2010 01:11 PM, the following:
> [..]
>>>>
>>>> diff --git a/drivers/mmc/host/omap_hsmmc.c
>>>> b/drivers/mmc/host/omap_hsmmc.c
>>>> index 83f0aff..dbf83a6 100644
>>>> --- a/drivers/mmc/host/omap_hsmmc.c
>>>> +++ b/drivers/mmc/host/omap_hsmmc.c
>>>> @@ -2093,7 +2093,7 @@ static int __init omap_hsmmc_probe(struct
>>>> platform_device *pdev)
>>>>
>>>>      if (mmc_slot(host).wires >= 8)
>>>>              mmc->caps |= MMC_CAP_8_BIT_DATA;
>>>> -     else if (mmc_slot(host).wires >= 4)
>>>> +     if (mmc_slot(host).wires >= 4)
>>>>              mmc->caps |= MMC_CAP_4_BIT_DATA;
>>>>
>>> Since 8-bit is the max how about:
>>>
>>>       if (mmc_slot(host).wires == 8)
>>>               mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA;
>>>       if (mmc_slot(host).wires == 4)
>>>               mmc->caps |= MMC_CAP_4_BIT_DATA;
>>>
>>> This would be little easy to read the code.
>>
>> Sure. Works for me.
>
> nitpicky comment: might be better off using a switch(mmc_slot(host).wires)
> statement instead of using == if that is the intention here..

Too verbose for just 2 cases, with the 'case's and 'default's adding
nothing to readability. YMMV.

Thanks,
Venkat.
--
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] 6+ messages in thread

* Re: [PATCH]omap hsmmc: fix incorrect capability reporting
  2010-03-30 18:42       ` Venkatraman S
@ 2010-03-31  5:20         ` kishore kadiyala
  0 siblings, 0 replies; 6+ messages in thread
From: kishore kadiyala @ 2010-03-31  5:20 UTC (permalink / raw)
  To: Venkatraman S
  Cc: Nishanth Menon, Chikkature Rajashekar, Madhusudhan, linux-mmc,
	linux-omap, Kadiyala, Kishore

please drop this patch , as correct patch is available at
https://patchwork.kernel.org/patch/78713/

Regards,
Kishore

On Wed, Mar 31, 2010 at 12:12 AM, Venkatraman S <svenkatr@ti.com> wrote:
> Nishanth Menon <nm@ti.com> wrote:
>> S, Venkatraman had written, on 03/30/2010 01:11 PM, the following:
>> [..]
>>>>>
>>>>> diff --git a/drivers/mmc/host/omap_hsmmc.c
>>>>> b/drivers/mmc/host/omap_hsmmc.c
>>>>> index 83f0aff..dbf83a6 100644
>>>>> --- a/drivers/mmc/host/omap_hsmmc.c
>>>>> +++ b/drivers/mmc/host/omap_hsmmc.c
>>>>> @@ -2093,7 +2093,7 @@ static int __init omap_hsmmc_probe(struct
>>>>> platform_device *pdev)
>>>>>
>>>>>      if (mmc_slot(host).wires >= 8)
>>>>>              mmc->caps |= MMC_CAP_8_BIT_DATA;
>>>>> -     else if (mmc_slot(host).wires >= 4)
>>>>> +     if (mmc_slot(host).wires >= 4)
>>>>>              mmc->caps |= MMC_CAP_4_BIT_DATA;
>>>>>
>>>> Since 8-bit is the max how about:
>>>>
>>>>       if (mmc_slot(host).wires == 8)
>>>>               mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA;
>>>>       if (mmc_slot(host).wires == 4)
>>>>               mmc->caps |= MMC_CAP_4_BIT_DATA;
>>>>
>>>> This would be little easy to read the code.
>>>
>>> Sure. Works for me.
>>
>> nitpicky comment: might be better off using a switch(mmc_slot(host).wires)
>> statement instead of using == if that is the intention here..
>
> Too verbose for just 2 cases, with the 'case's and 'default's adding
> nothing to readability. YMMV.
>
> Thanks,
> Venkat.
> --
> 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
>
--
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] 6+ messages in thread

end of thread, other threads:[~2010-03-31  5:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-30 14:37 [PATCH]omap hsmmc: fix incorrect capability reporting Venkatraman S
2010-03-30 15:47 ` Madhusudhan
2010-03-30 18:11   ` Venkatraman S
2010-03-30 18:29     ` Nishanth Menon
2010-03-30 18:42       ` Venkatraman S
2010-03-31  5:20         ` kishore kadiyala

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.