From: Timur Tabi <timur@codeaurora.org>
To: Linus Walleij <linus.walleij@linaro.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
"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: Tue, 14 Mar 2017 16:55:13 -0500 [thread overview]
Message-ID: <e209d18d-dc53-c0e9-448c-8a88264cac74@codeaurora.org> (raw)
In-Reply-To: <CACRpkdZFzYStyPfK1DwkZfvtd7wX9HtD1bnCy+i9h-7xowOz4g@mail.gmail.com>
On 03/14/2017 04:41 PM, Linus Walleij wrote:
> On Mon, Mar 6, 2017 at 10:52 PM, Timur Tabi <timur@codeaurora.org> wrote:
>
>> 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.
>
> I think it would be better if pin control and ACPI play along, and I bet that
> will happen in the future. This is I guess a question for ACPI standardization
> work.
Maybe. During the development of the ACPI standard, everyone made a big stink
about how muxing should be handled by the firmware and never touched by the OS.
It would be a significant reversal if they decide to add mux configuration to ACPI.
>> 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.
>
> Does that mean that pins with 0 are free to play around with?
Yes.
>> 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?
>
> I would ask the driver maintainer about his opinion, and also whoever
> is an authority on ACPI for the TLMM-chips, I am no expert
> in ACPI. Hell I'm not even good at device tree. Not to mention SFI.
> Oh well...
Well, I was hoping that Stephen would respond to this question. :-)
My point is, if the driver knows that the GPIO cannot be written to (because
it's muxed to something else), shouldn't the driver return with an error if the
caller attempts to write?
--
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.
WARNING: multiple messages have this Message-ID (diff)
From: timur@codeaurora.org (Timur Tabi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: qcom: add get_direction function
Date: Tue, 14 Mar 2017 16:55:13 -0500 [thread overview]
Message-ID: <e209d18d-dc53-c0e9-448c-8a88264cac74@codeaurora.org> (raw)
In-Reply-To: <CACRpkdZFzYStyPfK1DwkZfvtd7wX9HtD1bnCy+i9h-7xowOz4g@mail.gmail.com>
On 03/14/2017 04:41 PM, Linus Walleij wrote:
> On Mon, Mar 6, 2017 at 10:52 PM, Timur Tabi <timur@codeaurora.org> wrote:
>
>> 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.
>
> I think it would be better if pin control and ACPI play along, and I bet that
> will happen in the future. This is I guess a question for ACPI standardization
> work.
Maybe. During the development of the ACPI standard, everyone made a big stink
about how muxing should be handled by the firmware and never touched by the OS.
It would be a significant reversal if they decide to add mux configuration to ACPI.
>> 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.
>
> Does that mean that pins with 0 are free to play around with?
Yes.
>> 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?
>
> I would ask the driver maintainer about his opinion, and also whoever
> is an authority on ACPI for the TLMM-chips, I am no expert
> in ACPI. Hell I'm not even good at device tree. Not to mention SFI.
> Oh well...
Well, I was hoping that Stephen would respond to this question. :-)
My point is, if the driver knows that the GPIO cannot be written to (because
it's muxed to something else), shouldn't the driver return with an error if the
caller attempts to write?
--
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-14 21:55 UTC|newest]
Thread overview: 28+ 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:21 ` Timur Tabi
2017-02-10 23:25 ` Stephen Boyd
2017-02-10 23:25 ` Stephen Boyd
2017-02-11 21:32 ` Timur Tabi
2017-02-11 21:32 ` Timur Tabi
2017-02-22 15:51 ` Linus Walleij
2017-02-22 15:51 ` Linus Walleij
2017-02-22 15:49 ` Linus Walleij
2017-02-22 15:49 ` Linus Walleij
2017-03-06 21:52 ` Timur Tabi
2017-03-06 21:52 ` Timur Tabi
2017-03-14 21:41 ` Linus Walleij
2017-03-14 21:41 ` Linus Walleij
2017-03-14 21:55 ` Timur Tabi [this message]
2017-03-14 21:55 ` Timur Tabi
2017-03-14 23:30 ` Stephen Boyd
2017-03-14 23:30 ` Stephen Boyd
2017-03-14 23:34 ` Timur Tabi
2017-03-14 23:34 ` Timur Tabi
2017-03-14 23:41 ` Stephen Boyd
2017-03-14 23:41 ` Stephen Boyd
2017-03-15 0:12 ` Timur Tabi
2017-03-15 0:12 ` Timur Tabi
2017-03-15 5:08 ` Bjorn Andersson
2017-03-15 5:08 ` Bjorn Andersson
2017-03-15 13:08 ` Linus Walleij
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=e209d18d-dc53-c0e9-448c-8a88264cac74@codeaurora.org \
--to=timur@codeaurora.org \
--cc=bjorn.andersson@linaro.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 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.