[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74CDBE0F657A3D45AFBB94109FB122FF176B446FFA@HQMAIL01.nvidia.com>
Date: Wed, 14 Dec 2011 07:44:26 -0800
From: Stephen Warren <swarren@...dia.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Chanho Park <chanho61.park@...sung.com>
CC: Linus Walleij <linus.walleij@...ricsson.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Grant Likely <grant.likely@...retlab.ca>,
Barry Song <21cnbao@...il.com>,
Shawn Guo <shawn.guo@...escale.com>,
Thomas Abraham <thomas.abraham@...aro.org>,
Dong Aisheng <dong.aisheng@...aro.org>,
Rajendra Nayak <rajendra.nayak@...aro.org>,
Haojian Zhuang <haojian.zhuang@...vell.com>
Subject: RE: [PATCH v6] pinctrl: add a pin config interface
Linus Walleij wrote at Wednesday, December 14, 2011 2:06 AM:
> On Wed, Dec 14, 2011 at 8:04 AM, Chanho Park <chanho61.park@...sung.com> wrote:
>
> >> ChangeLog v5->v6:
> >> - Change to using a pin name as parameter for the
> >> [get|set]_config() functions, as suggested by Stephen Warren.
> >> This is more natural as names will be what a developer has
> >> access to in written documentation etc.
> >
> > I don't agree with it.
> > Someone doesn't like to assign a pin name individually because a
> > pin number is sufficient to represent each pin.
...
> What turned me around to see things Stephen's way was the fact
> that if someone reads this code and finds:
>
> pin_config_set(dev, 42, MY_FUNNY_PULLUP_MACRO);
>
> It is harder to understand than:
>
> pin_config_set(dev, "I2C0 SCL", MY_FUNNY_PULLUP_MACRO);
You could mitigate the opaqueness of the numbers by having the pinctrl
driver export a header of #defines for the pin numbers, so this could be:
pin_config_set(dev, FOO_PMX_PIN_I2C0_SCL, MY_FUNNY_PULLUP_MACRO);
Still, using strings avoids the need to do this.
Equally, I don't see the disadvantage of using strings here. In earlier
discussions, I thought we already discussed making pin names mandatory,
which seems to avoid most of Chanho's objections?
--
nvpublic
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists