All of lore.kernel.org
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Query on pin multiplexing with device tree
Date: Thu, 25 Sep 2014 16:09:13 +0200	[thread overview]
Message-ID: <20140925140913.GM15315@lukather> (raw)
In-Reply-To: <5424133C.5090106@gmail.com>

Hi Victor,

On Thu, Sep 25, 2014 at 06:36:04PM +0530, Victor Ascroft wrote:
> Hello,
> 
> pinctrl_touchctrl_idle: touchctrl_idle {
>             fsl,pins = <
>                 MF610_PAD_PTA18__GPIO_8            0x0041
>                 MF610_PAD_PTA19__GPIO_9            0x0041
>                 >;
>         };
> 
>         pinctrl_touchctrl_read: touchctrl_read {
>             fsl,pins = <
>                 MF610_PAD_PTA18__ADC0_SE0        0x0041
>                 MF610_PAD_PTA19__ADC0_SE1        0x0041
>                 >;
> 
> If i have pin multiplexing in device tree as above, how can i select
> and change the pin multiplexing at run time?

This will have to be done by the "consumer" driver, which judging by
the node names here will be your touchscreen driver.

You will have to reference in pinctrl-names several different states,
instead of just "default" that is commonly used, and then, you can
modify the state to use using the pinctrl functions.

That would make something like this in your DT:
    touchscreen at deadbeef {
        pinctrl-names = "default", "idle";
	pinctrl-0 = <&pinctrl_touchctrl_read>;
	pinctrl-1 = <&pinctrl_touchctrl_idle>;
    };

The good thing about this is that the states default, idle and sleep
are already grabbed by the device model whenever your driver is
probed, and the only thing you have to do from your driver to switch
from one state to another is to call pinctrl_pm_select_default_state
or pinctrl_pm_select_idle_state.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140925/01050d62/attachment.bin 

  reply	other threads:[~2014-09-25 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.879.1411472167.2642.kernelnewbies@kernelnewbies.org>
2014-09-25 13:06 ` Query on pin multiplexing with device tree Victor Ascroft
2014-09-25 14:09   ` Maxime Ripard [this message]
2014-09-25 14:35     ` Victor Ascroft

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=20140925140913.GM15315@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=kernelnewbies@lists.kernelnewbies.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.