From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Huang Changming-R66093 <r66093@freescale.com>
Cc: Chris Ball <cjb@laptop.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
Xie Shaohui-B21989 <B21989@freescale.com>,
Girish K S <girish.shivananjappa@linaro.org>
Subject: Re: [PATCH v5] powerpc/esdhc: disable CMD23 for some Freescale SoCs
Date: Wed, 24 Oct 2012 01:39:24 -0700 [thread overview]
Message-ID: <20121024083924.GA4118@lizard> (raw)
In-Reply-To: <110EED8CC96DFC488B7E717A2027A27C1B3F5A@039-SN1MPN1-003.039d.mgd.msft.net>
Sorry for the late reply, Huang.
On Tue, Oct 09, 2012 at 06:24:13AM +0000, Huang Changming-R66093 wrote:
[...]
> > > +static void esdhc_of_detect_limitation(struct platform_device *pdev,
> > > + struct sdhci_pltfm_data *pdata) {
Wrong indentation. Should be one more tab, at least (or align to opening
brace).
> > > + void __iomem *ioaddr;
> > > + struct resource *iomem;
> > > + u32 vvn;
> > > +
> > > + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > > + if (!iomem) {
> > > + dev_warn(&pdev->dev, "failed to get resource\n");
> > > + goto end;
> > > + }
> > > + if (resource_size(iomem) < 0x100)
> > > + dev_warn(&pdev->dev, "Invalid iomem size!\n");
> > > +
> > > + ioaddr = ioremap(iomem->start, resource_size(iomem));
> > > + if (!ioaddr) {
> > > + dev_warn(&pdev->dev, "failed to remap registers\n");
> > > + goto end;
> > > + }
> > > +
> > > + /* P102x and P4080 has IP version VVN2.2, CMD23 is not
> > supported */
> > > + vvn = in_be32(ioaddr + SDHCI_SLOT_INT_STATUS);
> > > + vvn = (vvn & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
> > > + if (vvn == VENDOR_V_22)
> > > + pdata->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
> > > +
> > > + iounmap(ioaddr);
> > > +end:
> > > + return;
No need for the 'end' label.
> > > +}
> > > +
> > > static struct sdhci_ops sdhci_esdhc_ops = {
> > > .read_l = esdhc_readl,
> > > .read_w = esdhc_readw,
> > > @@ -199,6 +231,7 @@ static struct sdhci_pltfm_data sdhci_esdhc_pdata =
> > > {
> > >
> > > static int __devinit sdhci_esdhc_probe(struct platform_device *pdev)
> > > {
> > > + esdhc_of_detect_limitation(pdev, &sdhci_esdhc_pdata);
I would rather prefer it to be in sdhci_ops (i.e. introduce
sdhci_ops->platform_init), so that way you wouldn't need to ioremap()
stuff by yourself. And make drivers/mmc/host/sdhci-pltfm.c call
platform_init after ioremap().
Then your detect_limitation() function would only need to check revision
and set additional quirks.
Thanks,
Anton.
next prev parent reply other threads:[~2012-10-24 8:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-26 6:02 [PATCH v5] powerpc/esdhc: disable CMD23 for some Freescale SoCs r66093
2012-09-26 13:03 ` Girish K S
2012-10-09 6:24 ` Huang Changming-R66093
2012-10-15 3:07 ` Huang Changming-R66093
2012-10-23 8:41 ` Huang Changming-R66093
2012-10-24 8:39 ` Anton Vorontsov [this message]
2012-10-25 6:29 ` Huang Changming-R66093
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=20121024083924.GA4118@lizard \
--to=cbouatmailru@gmail.com \
--cc=B21989@freescale.com \
--cc=cjb@laptop.org \
--cc=girish.shivananjappa@linaro.org \
--cc=linux-mmc@vger.kernel.org \
--cc=r66093@freescale.com \
/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 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.