From: Timur Tabi <timur@codeaurora.org>
To: Linus Walleij <linus.walleij@linaro.org>,
Stephen Boyd <sboyd@codeaurora.org>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] pinctrl: qcom: add get_direction function
Date: Mon, 6 Mar 2017 15:52:08 -0600 [thread overview]
Message-ID: <13b19c7f-9440-ab8e-8a2f-d1796a9b3dde@codeaurora.org> (raw)
In-Reply-To: <CACRpkdaoHTZa+XjEBAMtO2dS1jevi5h-QYe90SrZDuJghQSyYw@mail.gmail.com>
On 02/22/2017 09:49 AM, Linus Walleij wrote:
> Actually no. The GPIOF* #defines are for the consumer side of GPIO,
> not the driver side. We actually just use 0/1 in drivers.
>
> So I merged this v1 version.
Thanks.
So I have a follow-up question.
On ACPI platforms, the kernel has no control over the muxing (aka function)
of the various pins. Firmware configures the TLMM controller for all pins,
and configures them for whatever functions they're supposed to be.
You can see an example of this in pinctrl-qdf2xxx.c. As you can see, each
group consists of 1 pin, and there are 0 functions defined.
Function 0 is plain gpio I/O. The other functions (1-7, typically) are muxes
for various devices, like UART TX, etc.
Therefore, on ACPI, the driver should never change the function of any pin.
If it's set to something other than 0, then it should never touch that pin.
Don't write to it, don't change the direction, and definitely don't change
the function.
So would it be acceptable, for example, to change msm_gpio_set() such that if
the function of that pin is non-zero, just return an error?
After all, if pin #17 is set to UART and not GPIO, then there's no point in
setting that value to 1 or 0, because it's not muxed for GPIO and therefore,
that 1/0 is not actually going anywhere. It won't be written to the pin.
I hope I'm making sense.
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2017-03-06 21:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 23:21 [PATCH] pinctrl: qcom: add get_direction function Timur Tabi
2017-02-10 23:25 ` Stephen Boyd
2017-02-11 21:32 ` Timur Tabi
2017-02-22 15:51 ` Linus Walleij
2017-02-22 15:49 ` Linus Walleij
2017-03-06 21:52 ` Timur Tabi [this message]
2017-03-14 21:41 ` Linus Walleij
2017-03-14 21:55 ` Timur Tabi
2017-03-14 23:30 ` Stephen Boyd
2017-03-14 23:34 ` Timur Tabi
2017-03-14 23:41 ` Stephen Boyd
2017-03-15 0:12 ` Timur Tabi
2017-03-15 5:08 ` Bjorn Andersson
2017-03-15 13:08 ` Linus Walleij
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=13b19c7f-9440-ab8e-8a2f-d1796a9b3dde@codeaurora.org \
--to=timur@codeaurora.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=sboyd@codeaurora.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).