All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Stephen Warren <swarren@nvidia.com>,
	Linus Walleij <linus.walleij@stericsson.com>,
	Barry Song <21cnbao@gmail.com>,
	Haojian Zhuang <haojian.zhuang@marvell.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Thomas Abraham <thomas.abraham@linaro.org>,
	Rajendra Nayak <rajendra.nayak@linaro.org>,
	Dong Aisheng <dong.aisheng@linaro.org>,
	Shawn Guo <shawn.guo@freescale.com>,
	Dong Aisheng <dongas86@gmail.com>
Subject: Re: [PATCH 2/2] pinctrl: Add simple pinmux driver using device tree data
Date: Fri, 10 Feb 2012 12:12:34 -0800	[thread overview]
Message-ID: <20120210201234.GY1426@atomide.com> (raw)
In-Reply-To: <20120207014449.GA2424@r65073-Latitude-D630>

Hi Shawn,

Sorry for the delay, some of this we already talked this week
at the conference.

* Shawn Guo <shawn.guo@linaro.org> [120206 17:13]:
> On Fri, Feb 03, 2012 at 12:55:08PM -0800, Tony Lindgren wrote:
> > 
> It's so great to eventually see some codes after such an extensive
> discussion on the binding.  The code looks nice to me except a few
> trivial comments below.  The only thing I'm concerned is the register
> level implementation is not so generic to cover controllers like imx
> one, where pinmux and pinconf have separate registers.  If we can make
> that part as generic as pin table creating, function/pingroup/mapping
> generating, the patch will be good for imx to migrate to.

OK, maybe let's see how far we can get by adding other #pinmux-cells
values to parse in addition to 2. And map some registers using
compatible + .data entry related to it.
 
> > +	/* board specific .dts file, such as omap4-sdp.dts */
> > +	pinmux@4a100040 {
> > +		pmx_uart3: pinconfig-uart3 {
> > +			mux = <0x0104 0x100
> > +			       0x0106 0x0>;
> > +                        };
> 
> The line is some leftover which should be deleted?

Thanks that looks wrong..
 
> > +config PINCTRL_SIMPLE
> > +	tristate "Simple device tree based pinmux driver"
> > +	depends on OF
> > +	help
> > +	  This selects the device tree based generic pinmux driver.
> > +
> 
> We would call it pinctrl instead pinmux driver?

Thanks, fixing.
 
> > +	smux->desc->pins = smux->pins.pa;
> > +	smux->desc->npins = smux->pins.max--;
> > +
> Hmm, why do you have pins.max minus 1 here and most of the places where
> it gets used plus 1?  Keep it as it is and use pins.max - 1 in that
> only place I have seen?

Makes sense.

> > +static int __init smux_register(struct smux_device *smux)
> > +{
> > +	int ret;
> > +
> > +	if (!smux->dev->of_node)
> > +		return -ENODEV;
> > +
> > +	smux->pctlops = &smux_pinctrl_ops;
> > +	smux->pmxops = &smux_pinmux_ops;
> 
> I do not see where these two pointers inside smux be used anywhere.
> And also they can be got from smux below anyway.  So why bothering?

Yes those are already gone in the second version I posted.

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] pinctrl: Add simple pinmux driver using device tree data
Date: Fri, 10 Feb 2012 12:12:34 -0800	[thread overview]
Message-ID: <20120210201234.GY1426@atomide.com> (raw)
In-Reply-To: <20120207014449.GA2424@r65073-Latitude-D630>

Hi Shawn,

Sorry for the delay, some of this we already talked this week
at the conference.

* Shawn Guo <shawn.guo@linaro.org> [120206 17:13]:
> On Fri, Feb 03, 2012 at 12:55:08PM -0800, Tony Lindgren wrote:
> > 
> It's so great to eventually see some codes after such an extensive
> discussion on the binding.  The code looks nice to me except a few
> trivial comments below.  The only thing I'm concerned is the register
> level implementation is not so generic to cover controllers like imx
> one, where pinmux and pinconf have separate registers.  If we can make
> that part as generic as pin table creating, function/pingroup/mapping
> generating, the patch will be good for imx to migrate to.

OK, maybe let's see how far we can get by adding other #pinmux-cells
values to parse in addition to 2. And map some registers using
compatible + .data entry related to it.
 
> > +	/* board specific .dts file, such as omap4-sdp.dts */
> > +	pinmux at 4a100040 {
> > +		pmx_uart3: pinconfig-uart3 {
> > +			mux = <0x0104 0x100
> > +			       0x0106 0x0>;
> > +                        };
> 
> The line is some leftover which should be deleted?

Thanks that looks wrong..
 
> > +config PINCTRL_SIMPLE
> > +	tristate "Simple device tree based pinmux driver"
> > +	depends on OF
> > +	help
> > +	  This selects the device tree based generic pinmux driver.
> > +
> 
> We would call it pinctrl instead pinmux driver?

Thanks, fixing.
 
> > +	smux->desc->pins = smux->pins.pa;
> > +	smux->desc->npins = smux->pins.max--;
> > +
> Hmm, why do you have pins.max minus 1 here and most of the places where
> it gets used plus 1?  Keep it as it is and use pins.max - 1 in that
> only place I have seen?

Makes sense.

> > +static int __init smux_register(struct smux_device *smux)
> > +{
> > +	int ret;
> > +
> > +	if (!smux->dev->of_node)
> > +		return -ENODEV;
> > +
> > +	smux->pctlops = &smux_pinctrl_ops;
> > +	smux->pmxops = &smux_pinmux_ops;
> 
> I do not see where these two pointers inside smux be used anywhere.
> And also they can be got from smux below anyway.  So why bothering?

Yes those are already gone in the second version I posted.

Regards,

Tony

  reply	other threads:[~2012-02-10 20:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 20:54 [PATCH 0/2] Initial DT only generic pinctrl-simple driver Tony Lindgren
2012-02-03 20:54 ` Tony Lindgren
2012-02-03 20:55 ` [PATCH 1/2] pinmux: Export pinmux_register_mappings for pinmux modules Tony Lindgren
2012-02-03 20:55   ` Tony Lindgren
2012-02-03 20:55 ` [PATCH 2/2] pinctrl: Add simple pinmux driver using device tree data Tony Lindgren
2012-02-03 20:55   ` Tony Lindgren
2012-02-03 22:49   ` Linus Walleij
2012-02-03 22:49     ` Linus Walleij
2012-02-04  0:55     ` Tony Lindgren
2012-02-04  0:55       ` Tony Lindgren
2012-02-04  0:55       ` Tony Lindgren
2012-02-04 17:59   ` Tony Lindgren
2012-02-04 17:59     ` Tony Lindgren
2012-02-08  1:53     ` Dong Aisheng
2012-02-08  1:53       ` Dong Aisheng
2012-02-10 20:05       ` Tony Lindgren
2012-02-10 20:05         ` Tony Lindgren
2012-02-11  0:33         ` Dong Aisheng
2012-02-11  0:33           ` Dong Aisheng
2012-02-11  0:33           ` Dong Aisheng
2012-02-13 19:11           ` Tony Lindgren
2012-02-13 19:11             ` Tony Lindgren
2012-02-14  7:54             ` Dong Aisheng
2012-02-14  7:54               ` Dong Aisheng
2012-02-07  1:44   ` Shawn Guo
2012-02-07  1:44     ` Shawn Guo
2012-02-07  1:44     ` Shawn Guo
2012-02-10 20:12     ` Tony Lindgren [this message]
2012-02-10 20:12       ` Tony Lindgren

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=20120210201234.GY1426@atomide.com \
    --to=tony@atomide.com \
    --cc=21cnbao@gmail.com \
    --cc=dong.aisheng@linaro.org \
    --cc=dongas86@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=haojian.zhuang@marvell.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rajendra.nayak@linaro.org \
    --cc=shawn.guo@freescale.com \
    --cc=shawn.guo@linaro.org \
    --cc=swarren@nvidia.com \
    --cc=thomas.abraham@linaro.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 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.