linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: eric.y.miao@gmail.com (Eric Miao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] ARM: mmp: add pxa910 mmc resource
Date: Fri, 29 Apr 2011 10:21:49 +0800	[thread overview]
Message-ID: <BANLkTinzr-ByRUy9YFpskPxA6VwMCieKLw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikePbf43ffyCdQzNM0kyTo6tYLDFg@mail.gmail.com>

On Fri, Apr 29, 2011 at 10:13 AM, Jun Nie <niej0001@gmail.com> wrote:
> 2011/4/28 Eric Miao <eric.y.miao@gmail.com>:
>> On Thu, Apr 28, 2011 at 5:11 PM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>>> On Thu, Apr 21, 2011 at 09:56:53AM +0800, Jun Nie wrote:
>>>> +static inline int pxa910_add_sdhost(int id, struct sdhci_pxa_platdata *data)
>>>> +{
>>>> + ? ? struct pxa_device_desc *d = NULL;
>>>> +
>>>> + ? ? switch (id) {
>>>> + ? ? case 0: d = &pxa910_device_sdh0; break;
>>>> + ? ? case 1: d = &pxa910_device_sdh1; break;
>>>> + ? ? case 2: d = &pxa910_device_sdh2; break;
>>>> + ? ? default:
>>>> + ? ? ? ? ? ? return -EINVAL;
>>>> + ? ? }
>>>> +
>>>> + ? ? return pxa_register_device(d, data, sizeof(*data));
>>>> +}
>>>
>>> How about:
>>>
>>> static inline int pxa910_add_sdhost(struct pxa_device_desc *dev,
>>> ? ? ? ?struct sdhci_pxa_platdata *data)
>>> {
>>> ? ? ? ?return pxa_register_device(dev, data, sizeof(*data));
>>> }
>>>
>>> #define pxa910_add_sdhost0(data) pxa910_add_sdhost(&pxa910_device_sdh0, data)
>>> #define pxa910_add_sdhost1(data) pxa910_add_sdhost(&pxa910_device_sdh1, data)
>>> #define pxa910_add_sdhost2(data) pxa910_add_sdhost(&pxa910_device_sdh2, data)
>>>
>>> instead - which seems more sane if you're going to call the function with
>>> constant ID values.
>>>
>>
>> Indeed. Better to revise the original code as well.
>>
>
> I am thinking to move QUIRKs into this function for it is SOC
> specific, not board specific. Another item I want to move is bus
> timing adjustment register setting API, which is for clock fine tune
> and have different address/detail definition for different PXAs.
> Zhangfei is preparing driver code for timing register setting.
> How do you think about below change?
>

Basically I'm good with the move. Yet we can still incorporate this change
into the function Russell suggested pxa910_add_sdh().

> @@ -110,6 +110,8 @@ static inline int pxa910_add_sdh(int id, struct
> sdhci_pxa_platdata *data)
> ? ? ? ? ? ? ? ?case 2: d = &pxa910_device_sdh2; break;
> ? ? ? ? ? ? ? ?default:
> ? ? ? ? ? ? ? ? ? ? ? ? ? return -EINVAL;
> ? ? ? ?}
>
> + ? ? ? data->quirks ? ?= SDHCI_QUIRK_BROKEN_ADMA,
> + ? ? ? data->soc_set_timing ? ? ? ? ? ?= pxa910_sdh_specific_ctrl,
> ? ? ? ?return pxa_register_device(d, data, sizeof(*data));
> ?}
>
> diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
> index d616d09..fdd3457 100644
> --- a/arch/arm/mach-mmp/ttc_dkb.c
> +++ b/arch/arm/mach-mmp/ttc_dkb.c
> @@ -1534,13 +1534,11 @@ static void mmc2_set_ops(struct sdhci_pxa *pxa)
>
> ?/* MMC0 controller for SD-MMC */
> ?static struct sdhci_pxa_platdata pxa910_sdh_platdata_mmc0 = {
> - ? ? ? .quirks ? ? ? ? ? ? ? ? = SDHCI_QUIRK_BROKEN_ADMA,
> ? ? ? ?.max_speed ? ? ? ? ? ? ?= 48000000,
> - ? ? ? .soc_set_timing ? ? ? ? = pxa910_sdh_specific_ctrl,
> ?};
>

      reply	other threads:[~2011-04-29  2:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21  1:56 [PATCH v2 1/3] ARM: mmp: add pxa910 mmc resource Jun Nie
2011-04-28  9:11 ` Russell King - ARM Linux
2011-04-28  9:15   ` Eric Miao
2011-04-29  2:13     ` Jun Nie
2011-04-29  2:21       ` Eric Miao [this message]

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=BANLkTinzr-ByRUy9YFpskPxA6VwMCieKLw@mail.gmail.com \
    --to=eric.y.miao@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).