Thread (37 messages) 37 messages, 8 authors, 2020-01-08

Re: [PATCH v2 05/11] pinctrl: mediatek: avoid virtual gpio trying to set reg

From: Hanks Chen <hidden>
Date: 2020-01-08 11:27:41
Also in: linux-clk, linux-mediatek, lkml

On Tue, 2020-01-07 at 11:20 +0100, Linus Walleij wrote:
On Mon, Dec 23, 2019 at 4:11 AM Hanks Chen [off-list ref] wrote:
quoted
On Fri, 2019-08-23 at 10:57 +0200, Linus Walleij wrote:
quoted
On Mon, Aug 19, 2019 at 11:22 AM Mars Cheng [off-list ref] wrote:
quoted
quoted
This does not explain what a "virtual GPIO" is in this
context, so please elaborate. What is this? Why does
it exist? What is it used for?

GPIO is "general purpose input/output" and it is a
pretty rubbery category already as it is, so we need
to define our terms pretty strictly.
Virtual GPIO only used inside SOC and not being exported to outside SOC
in MTK platform. Some modules use virtual GPIO as eint (e.g. pmic or
usb).
I would call that internal GPIOs, those are very real rails inside
the chip made with polysilicone so there is nothing "virtual"
about them. If the documentation for the chip calls them virtual
then explain in the driver that these are SoC-internal
lines so that everyone will get it.
Got it, I will add the info into the driver in v3 
Is the PMIC inside the SoC? I thought that was usually outside of it
in its own chip.

But I suppose there could be some interface to it in the SoC and
then that interface has this EINT?
That's right. I use incorrect word.
e.g. pmic interface inside the SOC (PMIF), not pmic...
quoted
In MTK platform, external interrupt (EINT) and GPIO is 1-1 mapping and
we can set GPIO as eint.
But some modules use specific eint which doesn't have real GPIO pin.
So we use virtual GPIO to map it.
OK I get it I think... just put these comments into the code as well
so we understand when reading the code what is going on.
Got it, will add the comments in v3. Thanks for reviewing.
quoted
quoted
quoted
+       if (mtk_is_virt_gpio(hw, gpio))
+               return 1;
Why are "virtual GPIOs" always inputs?
We set virtual GPIO as eint.
It mean virtual GPIO only used inside SOC and not being exported to
outside SOC.
Are you saying that:
- "Virtual" GPIOs are always and only used for interrupts
- Since they are only used for interrupts, they are always inputs

Then write that in a comment to the above change so we know
this context.
Yes, virtual GPIOs are always and only used for interrupts in mtk
platform. I'll add the comments in v3. Thanks for reviewing
Yours,
Linus Walleij

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help