From: phdm@macq.eu (Philippe De Muyter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] bus: imx-weim: support CS GPR configuration
Date: Mon, 17 Feb 2014 11:52:24 +0100 [thread overview]
Message-ID: <20140217105224.GA10559@frolo.macqel> (raw)
In-Reply-To: <20140217092243.GB10731@S2101-09.ap.freescale.net>
On Mon, Feb 17, 2014 at 05:22:47PM +0800, Shawn Guo wrote:
> On Mon, Feb 17, 2014 at 09:52:21AM +0100, Philippe De Muyter wrote:
> > On Sun, Feb 16, 2014 at 10:31:16PM +0800, Shawn Guo wrote:
> > > On Sun, Feb 16, 2014 at 06:22:44PM +0400, Alexander Shiyan wrote:
> > > > ???????????, 16 ??????? 2014, 22:03 +08:00 ?? Shawn Guo <shawn.guo@linaro.org>:
> > > > > For imx50-weim and imx6q-weim type of devices, there might a WEIM CS
> > > > > space configuration register in General Purpose Register controller,
> > > > > e.g. IOMUXC_GPR1 on i.MX6Q.
> > > > ...
> > > > > +static int __init imx_weim_gpr_setup(struct platform_device *pdev)
> > > > > +{
> > > > > + struct device_node *np = pdev->dev.of_node;
> > > > > + struct property *prop;
> > > > > + const __be32 *p;
> > > > > + struct regmap *gpr;
> > > > > + u32 gprvals[4] = {
> > > > > + 05, /* CS0(128M) CS1(0M) CS2(0M) CS3(0M) */
> > > > > + 033, /* CS0(64M) CS1(64M) CS2(0M) CS3(0M) */
> > > > > + 0113, /* CS0(64M) CS1(32M) CS2(32M) CS3(0M) */
> > > > > + 01111, /* CS0(64M) CS1(32M) CS2(32M) CS3(0M) */
> > > > > + };
> > > > > + u32 gprval = 0;
> > > > > + u32 val;
> > > > > + int cs = 0;
> > > > > + int i = 0;
> > > > > +
> > > > > + gpr = syscon_regmap_lookup_by_phandle(np, "fsl,weim-cs-gpr");
> > > > > + if (IS_ERR(gpr)) {
> > > > > + dev_dbg(&pdev->dev, "failed to find weim-cs-gpr\n");
> > > > > + return 0;
> > > >
> > > > Only one comment:
> > > > You do not use these error codes in the probe(),
> > > > so let's declare this function as void.
> > >
> > > Oh, yes. I should check return of imx_weim_gpr_setup() in probe().
> > > Will add in the next version.
> >
> > Well, as all the error cases are already covered by error messages, there is
> > no added value in testing that again in probe(). As Alexander wrote, you can
> > declare imx_weim_gpr_setup() as 'void'.
>
> Hmm, shouldn't we stop probing when running into the error of invalid
> ranges configuration?
I agree, we could do that :)
Philippe
--
Philippe De Muyter +32 2 6101532 Macq SA rue de l'Aeronef 2 B-1140 Bruxelles
next prev parent reply other threads:[~2014-02-17 10:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-16 14:03 [PATCH v4] bus: imx-weim: support CS GPR configuration Shawn Guo
2014-02-16 14:22 ` Alexander Shiyan
2014-02-16 14:31 ` Shawn Guo
2014-02-17 8:52 ` Philippe De Muyter
2014-02-17 9:22 ` Shawn Guo
2014-02-17 10:52 ` Philippe De Muyter [this message]
2014-02-17 8:48 ` Philippe De Muyter
2014-02-17 9:20 ` Shawn Guo
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=20140217105224.GA10559@frolo.macqel \
--to=phdm@macq.eu \
--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