From: zhangfei.gao@gmail.com (zhangfei gao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] mmc: support sdhci-mmp2
Date: Wed, 8 Jun 2011 10:56:17 +0800 [thread overview]
Message-ID: <BANLkTinTKV3DwVdi8p-BYCZ4ON_ce4T74g@mail.gmail.com> (raw)
In-Reply-To: <86F2B225-A55D-41D9-B805-41C639C1882C@marvell.com>
On Wed, Jun 8, 2011 at 7:51 AM, Philip Rakity <prakity@marvell.com> wrote:
>
> On May 29, 2011, at 10:42 PM, zhangfei gao wrote:
>
>>>
>>> There is a little room for simplification, I think:
>>>
>>>> +static unsigned int mmp2_get_ro(struct sdhci_host *host)
>>>> +{
>>>> + ? ? /* Micro SD does not support write-protect feature */
>>>> + ? ? return 0;
>>>> +}
>>>
>>> You shouldn't need to provide an empty get_ro function, the
>>> default is that there is no write-protect.
>>
>> Thanks Arnd for review.
>> The reason to put get_ro here is some board use micro sd, while some
>> board design is general sd card.
>> The micro sd do not use write-protect, while SDHCI_WRITE_PROTECT will
>> return 1 in our controller, so it shows read only.
>> So add one call back for the board with micro sd card via flag.
>
>
>
> The code sets get_ro is for all the controllers. ? Some board designs may connect the WP signal.
>
> The host->ops field should be filled in using information in the board
> file using a flag such as the example with ?PXA_FLAG_CARD_PERMANENT.
>
> eg
>
> ? ? ? ?if (pdata && pdata->flags & PXA_FLAG_NO_WP) {
> ? ? ? ? ? ? ? ?***** etc ****
> ? ? ? ?}
>
>
This method is used in v1,
The method makes sdhci_ops non-const and have to dynamically alloc
sdhci_ops, since host->ops is pointer.
Will keep use const sdhci_ops, recommended by Arnd.
>
>
>
next prev parent reply other threads:[~2011-06-08 2:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-25 9:22 [PATCH v2 1/3] mmc: support sdhci-mmp2 Zhangfei Gao
2011-05-27 15:46 ` Arnd Bergmann
2011-05-30 5:42 ` zhangfei gao
2011-05-30 6:10 ` Philip Rakity
2011-05-30 7:11 ` Arnd Bergmann
2011-05-30 7:42 ` zhangfei gao
2011-06-07 23:51 ` Philip Rakity
2011-06-08 2:56 ` zhangfei gao [this message]
2011-06-08 3:59 ` Philip Rakity
2011-06-08 6:08 ` zhangfei gao
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=BANLkTinTKV3DwVdi8p-BYCZ4ON_ce4T74g@mail.gmail.com \
--to=zhangfei.gao@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).