Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Olof Johansson
On Wed, Aug 22, 2012 at 11:25 AM, Nicolas Pitre  wrote:
> On Wed, 22 Aug 2012, Olof Johansson wrote:
>
>> On Wed, Aug 22, 2012 at 9:00 AM, Philip Rakity  wrote:
>> >
>> > On Aug 22, 2012, at 8:44 AM, Doug Anderson  wrote:
>> >
>> >> Thanks for your feedback.  In this case I have a card that is an MMC
>> >> card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
>> >> mmc_attach_mmc() run it will actually find the MMC card.  However, on
>> >> this platform it is not valid to recognize MMC cards.
>> >>
>> >
>> >
>> > Understand.
>> >
>> > Can you explain why the change is needed.  Is it for technical
>> > reasons that MMC is not allowed -- if so then I do not understand how SD 
>> > can work
>> > and MMC cannot.
>> >
>> > If it is for marketing reasons -- then --- oh well .
>> >
>> >
>> > Could you add some additional comments to the commit message.
>> > I think it makes sense to handle all 3 cases
>> > a) SDIO not allowed
>> > b) SD not allowed
>> > c) MMC not allowed
>>
>> We are working with a system manufacturer who wishes to only support
>> SD cards in their product, and need to accommodate that. It made sense
>> for us to contribute this work upstream since others might want to do
>> the same in the future for some reason.
>>
>> Adding all three cases makes sense if others foresee a use case for it.
>
> Isn't this rather revolting?
>
> Personally I find such "feature" totally ridiculous. If said
> manufacturer doesn't want to support MMC cards, they just have to not
> advertise it, period.  Or if they really mean it, then they only have to
> state it explicitly in their user manual, and repeat it if ever problems
> are reported.
>
> Dumbing down kernel functionality to serve marketing purpose or
> technology lock-ins is utterly stupid.  Purposely restricting
> interoperability might even be ruled illegal in some jurisdictions.
>
> I therefore insist on providing a vehement NAK on such patches.

Ok, thanks. We'll keep carrying it locally instead then.


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Nicolas Pitre
On Wed, 22 Aug 2012, Olof Johansson wrote:

> On Wed, Aug 22, 2012 at 9:00 AM, Philip Rakity  wrote:
> >
> > On Aug 22, 2012, at 8:44 AM, Doug Anderson  wrote:
> >
> >> Thanks for your feedback.  In this case I have a card that is an MMC
> >> card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
> >> mmc_attach_mmc() run it will actually find the MMC card.  However, on
> >> this platform it is not valid to recognize MMC cards.
> >>
> >
> >
> > Understand.
> >
> > Can you explain why the change is needed.  Is it for technical
> > reasons that MMC is not allowed -- if so then I do not understand how SD 
> > can work
> > and MMC cannot.
> >
> > If it is for marketing reasons -- then --- oh well .
> >
> >
> > Could you add some additional comments to the commit message.
> > I think it makes sense to handle all 3 cases
> > a) SDIO not allowed
> > b) SD not allowed
> > c) MMC not allowed
> 
> We are working with a system manufacturer who wishes to only support
> SD cards in their product, and need to accommodate that. It made sense
> for us to contribute this work upstream since others might want to do
> the same in the future for some reason.
> 
> Adding all three cases makes sense if others foresee a use case for it.

Isn't this rather revolting?

Personally I find such "feature" totally ridiculous. If said
manufacturer doesn't want to support MMC cards, they just have to not
advertise it, period.  Or if they really mean it, then they only have to
state it explicitly in their user manual, and repeat it if ever problems
are reported.

Dumbing down kernel functionality to serve marketing purpose or
technology lock-ins is utterly stupid.  Purposely restricting
interoperability might even be ruled illegal in some jurisdictions.

I therefore insist on providing a vehement NAK on such patches.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Olof Johansson
Hi,

On Wed, Aug 22, 2012 at 9:00 AM, Philip Rakity  wrote:
>
> On Aug 22, 2012, at 8:44 AM, Doug Anderson  wrote:
>
>> Jaehoon,
>>
>> On Tue, Aug 21, 2012 at 9:35 PM, Jaehoon Chung  
>> wrote:
>>>
>>> Hi Doug,
>>>
>>> I didn't know what purpose is.
>>> Why need to add the MMC_CAP2_NO_MMC?
>>> If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
>>> Could you explain to me in more detail?
>>
>> Thanks for your feedback.  In this case I have a card that is an MMC
>> card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
>> mmc_attach_mmc() run it will actually find the MMC card.  However, on
>> this platform it is not valid to recognize MMC cards.
>>
>
>
> Understand.
>
> Can you explain why the change is needed.  Is it for technical
> reasons that MMC is not allowed -- if so then I do not understand how SD can 
> work
> and MMC cannot.
>
> If it is for marketing reasons -- then --- oh well .
>
>
> Could you add some additional comments to the commit message.
> I think it makes sense to handle all 3 cases
> a) SDIO not allowed
> b) SD not allowed
> c) MMC not allowed

We are working with a system manufacturer who wishes to only support
SD cards in their product, and need to accommodate that. It made sense
for us to contribute this work upstream since others might want to do
the same in the future for some reason.

Adding all three cases makes sense if others foresee a use case for it.


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Philip Rakity

On Aug 22, 2012, at 8:44 AM, Doug Anderson  wrote:

> Jaehoon,
> 
> On Tue, Aug 21, 2012 at 9:35 PM, Jaehoon Chung  wrote:
>> 
>> Hi Doug,
>> 
>> I didn't know what purpose is.
>> Why need to add the MMC_CAP2_NO_MMC?
>> If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
>> Could you explain to me in more detail?
> 
> Thanks for your feedback.  In this case I have a card that is an MMC
> card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
> mmc_attach_mmc() run it will actually find the MMC card.  However, on
> this platform it is not valid to recognize MMC cards.
> 


Understand.   

Can you explain why the change is needed.  Is it for technical 
reasons that MMC is not allowed -- if so then I do not understand how SD can 
work
and MMC cannot.

If it is for marketing reasons -- then --- oh well .


Could you add some additional comments to the commit message.
I think it makes sense to handle all 3 cases
a) SDIO not allowed
b) SD not allowed
c) MMC not allowed

> -Doug
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Doug Anderson
Jaehoon,

On Tue, Aug 21, 2012 at 9:35 PM, Jaehoon Chung  wrote:
>
> Hi Doug,
>
> I didn't know what purpose is.
> Why need to add the MMC_CAP2_NO_MMC?
> If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
> Could you explain to me in more detail?

Thanks for your feedback.  In this case I have a card that is an MMC
card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
mmc_attach_mmc() run it will actually find the MMC card.  However, on
this platform it is not valid to recognize MMC cards.

-Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Doug Anderson
Jaehoon,

On Tue, Aug 21, 2012 at 9:35 PM, Jaehoon Chung jh80.ch...@samsung.com wrote:

 Hi Doug,

 I didn't know what purpose is.
 Why need to add the MMC_CAP2_NO_MMC?
 If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
 Could you explain to me in more detail?

Thanks for your feedback.  In this case I have a card that is an MMC
card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
mmc_attach_mmc() run it will actually find the MMC card.  However, on
this platform it is not valid to recognize MMC cards.

-Doug
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Philip Rakity

On Aug 22, 2012, at 8:44 AM, Doug Anderson diand...@chromium.org wrote:

 Jaehoon,
 
 On Tue, Aug 21, 2012 at 9:35 PM, Jaehoon Chung jh80.ch...@samsung.com wrote:
 
 Hi Doug,
 
 I didn't know what purpose is.
 Why need to add the MMC_CAP2_NO_MMC?
 If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
 Could you explain to me in more detail?
 
 Thanks for your feedback.  In this case I have a card that is an MMC
 card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
 mmc_attach_mmc() run it will actually find the MMC card.  However, on
 this platform it is not valid to recognize MMC cards.
 


Understand.   

Can you explain why the change is needed.  Is it for technical 
reasons that MMC is not allowed -- if so then I do not understand how SD can 
work
and MMC cannot.

If it is for marketing reasons -- then --- oh well .


Could you add some additional comments to the commit message.
I think it makes sense to handle all 3 cases
a) SDIO not allowed
b) SD not allowed
c) MMC not allowed

 -Doug
 --
 To unsubscribe from this list: send the line unsubscribe linux-mmc in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Olof Johansson
Hi,

On Wed, Aug 22, 2012 at 9:00 AM, Philip Rakity prak...@marvell.com wrote:

 On Aug 22, 2012, at 8:44 AM, Doug Anderson diand...@chromium.org wrote:

 Jaehoon,

 On Tue, Aug 21, 2012 at 9:35 PM, Jaehoon Chung jh80.ch...@samsung.com 
 wrote:

 Hi Doug,

 I didn't know what purpose is.
 Why need to add the MMC_CAP2_NO_MMC?
 If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
 Could you explain to me in more detail?

 Thanks for your feedback.  In this case I have a card that is an MMC
 card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
 mmc_attach_mmc() run it will actually find the MMC card.  However, on
 this platform it is not valid to recognize MMC cards.



 Understand.

 Can you explain why the change is needed.  Is it for technical
 reasons that MMC is not allowed -- if so then I do not understand how SD can 
 work
 and MMC cannot.

 If it is for marketing reasons -- then --- oh well .


 Could you add some additional comments to the commit message.
 I think it makes sense to handle all 3 cases
 a) SDIO not allowed
 b) SD not allowed
 c) MMC not allowed

We are working with a system manufacturer who wishes to only support
SD cards in their product, and need to accommodate that. It made sense
for us to contribute this work upstream since others might want to do
the same in the future for some reason.

Adding all three cases makes sense if others foresee a use case for it.


-Olof
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Nicolas Pitre
On Wed, 22 Aug 2012, Olof Johansson wrote:

 On Wed, Aug 22, 2012 at 9:00 AM, Philip Rakity prak...@marvell.com wrote:
 
  On Aug 22, 2012, at 8:44 AM, Doug Anderson diand...@chromium.org wrote:
 
  Thanks for your feedback.  In this case I have a card that is an MMC
  card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
  mmc_attach_mmc() run it will actually find the MMC card.  However, on
  this platform it is not valid to recognize MMC cards.
 
 
 
  Understand.
 
  Can you explain why the change is needed.  Is it for technical
  reasons that MMC is not allowed -- if so then I do not understand how SD 
  can work
  and MMC cannot.
 
  If it is for marketing reasons -- then --- oh well .
 
 
  Could you add some additional comments to the commit message.
  I think it makes sense to handle all 3 cases
  a) SDIO not allowed
  b) SD not allowed
  c) MMC not allowed
 
 We are working with a system manufacturer who wishes to only support
 SD cards in their product, and need to accommodate that. It made sense
 for us to contribute this work upstream since others might want to do
 the same in the future for some reason.
 
 Adding all three cases makes sense if others foresee a use case for it.

Isn't this rather revolting?

Personally I find such feature totally ridiculous. If said
manufacturer doesn't want to support MMC cards, they just have to not
advertise it, period.  Or if they really mean it, then they only have to
state it explicitly in their user manual, and repeat it if ever problems
are reported.

Dumbing down kernel functionality to serve marketing purpose or
technology lock-ins is utterly stupid.  Purposely restricting
interoperability might even be ruled illegal in some jurisdictions.

I therefore insist on providing a vehement NAK on such patches.


Nicolas
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-22 Thread Olof Johansson
On Wed, Aug 22, 2012 at 11:25 AM, Nicolas Pitre n...@fluxnic.net wrote:
 On Wed, 22 Aug 2012, Olof Johansson wrote:

 On Wed, Aug 22, 2012 at 9:00 AM, Philip Rakity prak...@marvell.com wrote:
 
  On Aug 22, 2012, at 8:44 AM, Doug Anderson diand...@chromium.org wrote:
 
  Thanks for your feedback.  In this case I have a card that is an MMC
  card so mmc_attach_sdio() and mmc_attach_sd() will fail.  If I let
  mmc_attach_mmc() run it will actually find the MMC card.  However, on
  this platform it is not valid to recognize MMC cards.
 
 
 
  Understand.
 
  Can you explain why the change is needed.  Is it for technical
  reasons that MMC is not allowed -- if so then I do not understand how SD 
  can work
  and MMC cannot.
 
  If it is for marketing reasons -- then --- oh well .
 
 
  Could you add some additional comments to the commit message.
  I think it makes sense to handle all 3 cases
  a) SDIO not allowed
  b) SD not allowed
  c) MMC not allowed

 We are working with a system manufacturer who wishes to only support
 SD cards in their product, and need to accommodate that. It made sense
 for us to contribute this work upstream since others might want to do
 the same in the future for some reason.

 Adding all three cases makes sense if others foresee a use case for it.

 Isn't this rather revolting?

 Personally I find such feature totally ridiculous. If said
 manufacturer doesn't want to support MMC cards, they just have to not
 advertise it, period.  Or if they really mean it, then they only have to
 state it explicitly in their user manual, and repeat it if ever problems
 are reported.

 Dumbing down kernel functionality to serve marketing purpose or
 technology lock-ins is utterly stupid.  Purposely restricting
 interoperability might even be ruled illegal in some jurisdictions.

 I therefore insist on providing a vehement NAK on such patches.

Ok, thanks. We'll keep carrying it locally instead then.


-Olof
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-21 Thread Jaehoon Chung
Hi Doug,

I didn't know what purpose is.
Why need to add the MMC_CAP2_NO_MMC?
If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
Could you explain to me in more detail?

Best Regards,
Jaehoon Chung

On 08/22/2012 01:05 PM, Doug Anderson wrote:
> On some systems we need a way to disable MMC card support in a MMC/SD
> card slot.  Add support in the core SD/MMC code to support this.
> 
> Signed-off-by: Doug Anderson 
> Signed-off-by: Alim Akhtar 
> ---
>  drivers/mmc/core/core.c  |2 +-
>  include/linux/mmc/host.h |1 +
>  2 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 8ac5246..3214972 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1981,7 +1981,7 @@ static int mmc_rescan_try_freq(struct mmc_host *host, 
> unsigned freq)
>   return 0;
>   if (!mmc_attach_sd(host))
>   return 0;
> - if (!mmc_attach_mmc(host))
> + if (!(host->caps2 & MMC_CAP2_NO_MMC) && !mmc_attach_mmc(host))
>   return 0;
>  
>   mmc_power_off(host);
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index f578a71..f36370e 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -257,6 +257,7 @@ struct mmc_host {
>  #define MMC_CAP2_HC_ERASE_SZ (1 << 9)/* High-capacity erase size */
>  #define MMC_CAP2_CD_ACTIVE_HIGH  (1 << 10)   /* Card-detect signal 
> active high */
>  #define MMC_CAP2_RO_ACTIVE_HIGH  (1 << 11)   /* Write-protect signal 
> active high */
> +#define MMC_CAP2_NO_MMC  (1 << 12)   /* Only SD supported, 
> not MMC */
>  
>   mmc_pm_flag_t   pm_caps;/* supported pm features */
>   unsigned intpower_notify_type;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-21 Thread Doug Anderson
On some systems we need a way to disable MMC card support in a MMC/SD
card slot.  Add support in the core SD/MMC code to support this.

Signed-off-by: Doug Anderson 
Signed-off-by: Alim Akhtar 
---
 drivers/mmc/core/core.c  |2 +-
 include/linux/mmc/host.h |1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 8ac5246..3214972 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1981,7 +1981,7 @@ static int mmc_rescan_try_freq(struct mmc_host *host, 
unsigned freq)
return 0;
if (!mmc_attach_sd(host))
return 0;
-   if (!mmc_attach_mmc(host))
+   if (!(host->caps2 & MMC_CAP2_NO_MMC) && !mmc_attach_mmc(host))
return 0;
 
mmc_power_off(host);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f578a71..f36370e 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -257,6 +257,7 @@ struct mmc_host {
 #define MMC_CAP2_HC_ERASE_SZ   (1 << 9)/* High-capacity erase size */
 #define MMC_CAP2_CD_ACTIVE_HIGH(1 << 10)   /* Card-detect signal 
active high */
 #define MMC_CAP2_RO_ACTIVE_HIGH(1 << 11)   /* Write-protect signal 
active high */
+#define MMC_CAP2_NO_MMC(1 << 12)   /* Only SD supported, 
not MMC */
 
mmc_pm_flag_t   pm_caps;/* supported pm features */
unsigned intpower_notify_type;
-- 
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-21 Thread Doug Anderson
On some systems we need a way to disable MMC card support in a MMC/SD
card slot.  Add support in the core SD/MMC code to support this.

Signed-off-by: Doug Anderson diand...@chromium.org
Signed-off-by: Alim Akhtar alim.akh...@samsung.com
---
 drivers/mmc/core/core.c  |2 +-
 include/linux/mmc/host.h |1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 8ac5246..3214972 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1981,7 +1981,7 @@ static int mmc_rescan_try_freq(struct mmc_host *host, 
unsigned freq)
return 0;
if (!mmc_attach_sd(host))
return 0;
-   if (!mmc_attach_mmc(host))
+   if (!(host-caps2  MMC_CAP2_NO_MMC)  !mmc_attach_mmc(host))
return 0;
 
mmc_power_off(host);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f578a71..f36370e 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -257,6 +257,7 @@ struct mmc_host {
 #define MMC_CAP2_HC_ERASE_SZ   (1  9)/* High-capacity erase size */
 #define MMC_CAP2_CD_ACTIVE_HIGH(1  10)   /* Card-detect signal 
active high */
 #define MMC_CAP2_RO_ACTIVE_HIGH(1  11)   /* Write-protect signal 
active high */
+#define MMC_CAP2_NO_MMC(1  12)   /* Only SD supported, 
not MMC */
 
mmc_pm_flag_t   pm_caps;/* supported pm features */
unsigned intpower_notify_type;
-- 
1.7.7.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] mmc: core: Add a capability for disabling mmc cards

2012-08-21 Thread Jaehoon Chung
Hi Doug,

I didn't know what purpose is.
Why need to add the MMC_CAP2_NO_MMC?
If card is SD or SDIO, mmc_attach_mmc(host) should not be entered.
Could you explain to me in more detail?

Best Regards,
Jaehoon Chung

On 08/22/2012 01:05 PM, Doug Anderson wrote:
 On some systems we need a way to disable MMC card support in a MMC/SD
 card slot.  Add support in the core SD/MMC code to support this.
 
 Signed-off-by: Doug Anderson diand...@chromium.org
 Signed-off-by: Alim Akhtar alim.akh...@samsung.com
 ---
  drivers/mmc/core/core.c  |2 +-
  include/linux/mmc/host.h |1 +
  2 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
 index 8ac5246..3214972 100644
 --- a/drivers/mmc/core/core.c
 +++ b/drivers/mmc/core/core.c
 @@ -1981,7 +1981,7 @@ static int mmc_rescan_try_freq(struct mmc_host *host, 
 unsigned freq)
   return 0;
   if (!mmc_attach_sd(host))
   return 0;
 - if (!mmc_attach_mmc(host))
 + if (!(host-caps2  MMC_CAP2_NO_MMC)  !mmc_attach_mmc(host))
   return 0;
  
   mmc_power_off(host);
 diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
 index f578a71..f36370e 100644
 --- a/include/linux/mmc/host.h
 +++ b/include/linux/mmc/host.h
 @@ -257,6 +257,7 @@ struct mmc_host {
  #define MMC_CAP2_HC_ERASE_SZ (1  9)/* High-capacity erase size */
  #define MMC_CAP2_CD_ACTIVE_HIGH  (1  10)   /* Card-detect signal 
 active high */
  #define MMC_CAP2_RO_ACTIVE_HIGH  (1  11)   /* Write-protect signal 
 active high */
 +#define MMC_CAP2_NO_MMC  (1  12)   /* Only SD supported, 
 not MMC */
  
   mmc_pm_flag_t   pm_caps;/* supported pm features */
   unsigned intpower_notify_type;
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/