linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@nvidia.com>
To: Haojian Zhuang <haojian.zhuang@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	Barry Song <21cnbao@gmail.com>,
	Shawn Guo <shawn.guo@freescale.com>,
	Thomas Abraham <thomas.abraham@linaro.org>,
	Dong Aisheng <dong.aisheng@linaro.org>,
	Rajendra Nayak <rajendra.nayak@linaro.org>,
	Haojian Zhuang <haojian.zhuang@marvell.com>
Subject: RE: [PATCH v6] pinctrl: add a pin config interface
Date: Tue, 13 Dec 2011 13:49:15 -0800	[thread overview]
Message-ID: <74CDBE0F657A3D45AFBB94109FB122FF1751860BDA@HQMAIL01.nvidia.com> (raw)
In-Reply-To: <CAN1soZw=51caZjEoxBx8ch0KiE-kgHQFA1amRcTOyDDKe5Ymzw@mail.gmail.com>

Haojian Zhuang wrote at Tuesday, December 13, 2011 12:22 AM:
> On Tue, Dec 13, 2011 at 8:22 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> > On Mon, Dec 12, 2011 at 7:19 AM, Haojian Zhuang
> > <haojian.zhuang@gmail.com> wrote:
> >
> >> You mentioned that pin_config_set() is used in below.
> >> ret = pin_config_set(dev, "FOO_GPIO_PIN", PLATFORM_X_PULL_UP);
> >>
> >> struct pinctrl_dev is created while pinmux is registered. I think this
> >> structure is always internal structure. It can't be observed by
> >> platform driver or device driver.
> >
> > True. Was fixed today by a patch from Stephen Warren that
> > simply cuts out the middleman and use the original platform
> > device directly. Kudos to Stephen for fixing this!
> >
> > Linus Walleij
> 
> Excuse me that I didn't find that patch. Did you merge it into your
> git tree? The latest patch on pinconf.c is updating pdev->dev to
> &pdev->dev.

I just hit the same problem. This isn't what my patch addresses.

My patch prevents the pinctrl core from creating a struct device for the
pin controller, since it already has one.

The problem that Haojian mentions is regarding struct pinctrl_dev, not
plain device.

I'd suggest modifying all the pin_config_* APIs to take a device name
rather than a "struct pinctrl_dev *". I'll work on a patch to do this,
since I'm hitting the same problem.

An alternative may be to either:

* Add function pinctrl_get_dev_by_name(name)

Or:

* Use dev = bus_find_device_by_name(name) to get the plain device, and
add a pinctrl_find_dev_by_dev(dev).

Either of those sound more complex though, but I suppose do allow
direct operation if you somehow do already have the struct pinctrl_dev.

-- 
nvpublic


  parent reply	other threads:[~2011-12-13 21:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 11:57 [PATCH v6] pinctrl: add a pin config interface Linus Walleij
2011-12-12  6:19 ` Haojian Zhuang
2011-12-13  0:22   ` Linus Walleij
2011-12-13  7:21     ` Haojian Zhuang
2011-12-13 12:23       ` Linus Walleij
2011-12-13 21:49       ` Stephen Warren [this message]
2011-12-13 22:56         ` Linus Walleij
2011-12-12 10:56 ` Domenico Andreoli
2011-12-13 12:19   ` Linus Walleij
2011-12-14  7:04 ` Chanho Park
2011-12-14  9:05   ` Linus Walleij
2011-12-14 15:44     ` Stephen Warren
2011-12-14 19:37       ` Linus Walleij
2012-01-18  7:16 ` Thomas Abraham
2012-01-19 16:58   ` Linus Walleij
2012-01-19 18:14     ` Thomas Abraham
     [not found]     ` <CAJuYYwTP8a4KYDrJ2o9Wmt4jo_DvLviy75T90JnV7Hw10Y+ZXw@mail.gmail.com>
     [not found]       ` <CACRpkdYwx3O42aC8F+DMV1GL0ce62ZhChOQYdbd7-syunsgBOg@mail.gmail.com>
2012-01-20 15:59         ` Thomas Abraham

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=74CDBE0F657A3D45AFBB94109FB122FF1751860BDA@HQMAIL01.nvidia.com \
    --to=swarren@nvidia.com \
    --cc=21cnbao@gmail.com \
    --cc=dong.aisheng@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=haojian.zhuang@gmail.com \
    --cc=haojian.zhuang@marvell.com \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajendra.nayak@linaro.org \
    --cc=shawn.guo@freescale.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 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).