All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: "Denis Carikli" <denis@eukrea.com>,
	"Rob Herring" <rob.herring@calxeda.com>,
	"Shawn Guo" <shawn.guo@linaro.org>,
	"Eric Bénard" <eric@eukrea.com>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Grant Likely" <grant.likely@secretlab.ca>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Stephen Warren" <swarren@wwwdotorg.org>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Linux Input" <linux-input@vger.kernel.org>,
	"Lothar Waßmann" <LW@karo-electronics.de>
Subject: Re: [PATCHv7][ 1/4] Input: tsc2007: Add device tree support.
Date: Mon, 4 Nov 2013 13:01:59 +0100	[thread overview]
Message-ID: <CACRpkdbuB6g+Qo0FCXaueKpAvT6vUKuNmoceWCGfG0KLa8+3Aw@mail.gmail.com> (raw)
In-Reply-To: <20131024151736.GE9044@ulmo.nvidia.com>

On Thu, Oct 24, 2013 at 5:17 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Thu, Oct 24, 2013 at 02:42:13PM +0200, Denis Carikli wrote:

>> +Optional properties:
>> +- gpios: the interrupt gpio the chip is connected to (trough the penirq pin)
>> +  (see GPIO binding[2] for more details).
>> +- interrupt-parent: the phandle for the gpio controller
>> +  (see interrupt binding[1]).
>> +- interrupts: (gpio) interrupt to which the chip is connected
>> +  (see interrupt binding[1]).
>> +- pinctrl-0: Should specify pin control groups used for the gpio
>> +  (see pinctrl bindings[0]).
>> +- pinctrl-names: Should contain only one value - "default"
>> +  (see pinctrl bindings[0]).
>
> Also I haven't seen a response as to why this can't be handled by the
> GPIO driver. Adding Linus Walleij, perhaps he knows a more definitive
> answer.
>
> Linus, the issue here is that the pinctrl properties for this chip are
> supposed to pinmux the pendown GPIO for this chip. I was under the
> impression that this should be handled by the GPIO controller itself, so
> that when gpio_request() was called on a pin it would be the GPIO
> controller driver's responsibility to pinmux it appropriately.

If this is the only thing it does (just mux in the GPIO and not setting
any pulls or other pin config properties) then it can fall through from
the GPIO controller's request function to pinctrl_request_gpio()
and then pinctrl_free_gpio(), pinctrl_gpio_direction_input()
and pinctrl_gpio_direction_output() respectively so that pin control
provides a muxing back end to the GPIO driver.

Actually these functions are up to the driver to implement, but
the core will call ->gpio_request_enable() on the pinctrl driver,
and if all GPIOs are set up the same way (i.e. the same bits
are always poked into the hardware) then this can be done
in that routine.

If more fine-grained control is needed, this approach providing
a full pin control handle and state settings connected to the
struct device * can and should be used instead.

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv7][ 1/4] Input: tsc2007: Add device tree support.
Date: Mon, 4 Nov 2013 13:01:59 +0100	[thread overview]
Message-ID: <CACRpkdbuB6g+Qo0FCXaueKpAvT6vUKuNmoceWCGfG0KLa8+3Aw@mail.gmail.com> (raw)
In-Reply-To: <20131024151736.GE9044@ulmo.nvidia.com>

On Thu, Oct 24, 2013 at 5:17 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Thu, Oct 24, 2013 at 02:42:13PM +0200, Denis Carikli wrote:

>> +Optional properties:
>> +- gpios: the interrupt gpio the chip is connected to (trough the penirq pin)
>> +  (see GPIO binding[2] for more details).
>> +- interrupt-parent: the phandle for the gpio controller
>> +  (see interrupt binding[1]).
>> +- interrupts: (gpio) interrupt to which the chip is connected
>> +  (see interrupt binding[1]).
>> +- pinctrl-0: Should specify pin control groups used for the gpio
>> +  (see pinctrl bindings[0]).
>> +- pinctrl-names: Should contain only one value - "default"
>> +  (see pinctrl bindings[0]).
>
> Also I haven't seen a response as to why this can't be handled by the
> GPIO driver. Adding Linus Walleij, perhaps he knows a more definitive
> answer.
>
> Linus, the issue here is that the pinctrl properties for this chip are
> supposed to pinmux the pendown GPIO for this chip. I was under the
> impression that this should be handled by the GPIO controller itself, so
> that when gpio_request() was called on a pin it would be the GPIO
> controller driver's responsibility to pinmux it appropriately.

If this is the only thing it does (just mux in the GPIO and not setting
any pulls or other pin config properties) then it can fall through from
the GPIO controller's request function to pinctrl_request_gpio()
and then pinctrl_free_gpio(), pinctrl_gpio_direction_input()
and pinctrl_gpio_direction_output() respectively so that pin control
provides a muxing back end to the GPIO driver.

Actually these functions are up to the driver to implement, but
the core will call ->gpio_request_enable() on the pinctrl driver,
and if all GPIOs are set up the same way (i.e. the same bits
are always poked into the hardware) then this can be done
in that routine.

If more fine-grained control is needed, this approach providing
a full pin control handle and state settings connected to the
struct device * can and should be used instead.

Yours,
Linus Walleij

  parent reply	other threads:[~2013-11-04 12:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 12:42 [PATCHv7][ 1/4] Input: tsc2007: Add device tree support Denis Carikli
2013-10-24 12:42 ` Denis Carikli
2013-10-24 12:42 ` [PATCHv7][ 2/4] ARM: dts: cpuimx51 Add touchscreen support Denis Carikli
2013-10-24 12:42   ` Denis Carikli
2013-10-24 12:42 ` [PATCHv7][ 3/4] ARM: dts: cpuimx35 " Denis Carikli
2013-10-24 12:42   ` Denis Carikli
2013-10-24 12:42 ` [PATCHv7][ 4/4] ARM: imx_v6_v7_defconfig: Enable tsc2007 support Denis Carikli
2013-10-24 12:42   ` Denis Carikli
2013-10-24 15:17 ` [PATCHv7][ 1/4] Input: tsc2007: Add device tree support Thierry Reding
2013-10-24 15:17   ` Thierry Reding
2013-10-24 15:26   ` Eric Bénard
2013-10-24 15:26     ` Eric Bénard
2013-10-25  6:39   ` Lothar Waßmann
2013-10-25  6:39     ` Lothar Waßmann
2013-10-25  8:33     ` Thierry Reding
2013-10-25  8:33       ` Thierry Reding
2013-11-04 12:01   ` Linus Walleij [this message]
2013-11-04 12:01     ` Linus Walleij
2013-10-24 16:47 ` Grant Likely
2013-10-24 16:47   ` Grant Likely
2013-10-25  5:56   ` Lothar Waßmann
2013-10-25  5:56     ` Lothar Waßmann
2013-10-25 19:11     ` Grant Likely
2013-10-25 19:11       ` Grant Likely

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=CACRpkdbuB6g+Qo0FCXaueKpAvT6vUKuNmoceWCGfG0KLa8+3Aw@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=LW@karo-electronics.de \
    --cc=denis@eukrea.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eric@eukrea.com \
    --cc=grant.likely@secretlab.ca \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=shawn.guo@linaro.org \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.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.