Re: [PATCH v2] pinctrl: mediatek: check mtk_is_virt_gpio input parameter

2020-09-30 Thread Linus Walleij
On Thu, Aug 20, 2020 at 1:22 PM Hanks Chen  wrote:

> check mtk_is_virt_gpio input parameter,
> virtual gpio need to support eint mode.
>
> add error handler for the ko case
> to fix this boot fail:
> pc : mtk_is_virt_gpio+0x20/0x38 [pinctrl_mtk_common_v2]
> lr : mtk_gpio_get_direction+0x44/0xb0 [pinctrl_paris]
>
> Fixes: edd546465002 ("pinctrl: mediatek: avoid virtual gpio trying to set 
> reg")
> Singed-off-by: Jie Yang 
> Signed-off-by: Hanks Chen 
>
> ---
> Changes since v1:
> - update Singed-off-by
> - align with pinctrl/mediatek/pinctrl-mtk-mt*.h

Patch applied.

Yours,
Linus Walleij


Re: [PATCH v2] pinctrl: mediatek: check mtk_is_virt_gpio input parameter

2020-09-27 Thread Sean Wang
On Fri, Sep 25, 2020 at 5:51 AM Hanks Chen  wrote:
>
> Hi Sean & Linux & Matthias,
>
> Please kindly let me know your comments about this fixes patch.
> Thanks
>

Acked-by: Sean Wang 

> Regards,
> Hanks
>
>
> On Thu, 2020-08-20 at 19:22 +0800, Hanks Chen wrote:
> > check mtk_is_virt_gpio input parameter,
> > virtual gpio need to support eint mode.
> >
> > add error handler for the ko case
> > to fix this boot fail:
> > pc : mtk_is_virt_gpio+0x20/0x38 [pinctrl_mtk_common_v2]
> > lr : mtk_gpio_get_direction+0x44/0xb0 [pinctrl_paris]
> >
> > Fixes: edd546465002 ("pinctrl: mediatek: avoid virtual gpio trying to set 
> > reg")
> > Singed-off-by: Jie Yang 
> > Signed-off-by: Hanks Chen 
> >
> > ---
> > Changes since v1:
> > - update Singed-off-by
> > - align with pinctrl/mediatek/pinctrl-mtk-mt*.h
> >
> > ---
> >  drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 4 
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c 
> > b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> > index c53e2c391e32..a485d79f51a1 100644
> > --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> > +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> > @@ -259,6 +259,10 @@ bool mtk_is_virt_gpio(struct mtk_pinctrl *hw, unsigned 
> > int gpio_n)
> >
> >   desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n];
> >
> > + /* if the GPIO is not supported for eint mode */
> > + if (desc->eint.eint_m == NO_EINT_SUPPORT)
> > + return virt_gpio;
> > +
> >   if (desc->funcs && !desc->funcs[desc->eint.eint_m].name)
> >   virt_gpio = true;
> >
>


Re: [PATCH v2] pinctrl: mediatek: check mtk_is_virt_gpio input parameter

2020-09-25 Thread Hanks Chen
Hi Sean & Linux & Matthias,

Please kindly let me know your comments about this fixes patch.
Thanks

Regards,
Hanks


On Thu, 2020-08-20 at 19:22 +0800, Hanks Chen wrote:
> check mtk_is_virt_gpio input parameter,
> virtual gpio need to support eint mode.
> 
> add error handler for the ko case
> to fix this boot fail:
> pc : mtk_is_virt_gpio+0x20/0x38 [pinctrl_mtk_common_v2]
> lr : mtk_gpio_get_direction+0x44/0xb0 [pinctrl_paris]
> 
> Fixes: edd546465002 ("pinctrl: mediatek: avoid virtual gpio trying to set 
> reg")
> Singed-off-by: Jie Yang 
> Signed-off-by: Hanks Chen 
> 
> ---
> Changes since v1:
> - update Singed-off-by
> - align with pinctrl/mediatek/pinctrl-mtk-mt*.h 
> 
> ---
>  drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c 
> b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> index c53e2c391e32..a485d79f51a1 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> @@ -259,6 +259,10 @@ bool mtk_is_virt_gpio(struct mtk_pinctrl *hw, unsigned 
> int gpio_n)
>  
>   desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n];
>  
> + /* if the GPIO is not supported for eint mode */
> + if (desc->eint.eint_m == NO_EINT_SUPPORT)
> + return virt_gpio;
> +
>   if (desc->funcs && !desc->funcs[desc->eint.eint_m].name)
>   virt_gpio = true;
>  



[PATCH v2] pinctrl: mediatek: check mtk_is_virt_gpio input parameter

2020-08-20 Thread Hanks Chen
check mtk_is_virt_gpio input parameter,
virtual gpio need to support eint mode.

add error handler for the ko case
to fix this boot fail:
pc : mtk_is_virt_gpio+0x20/0x38 [pinctrl_mtk_common_v2]
lr : mtk_gpio_get_direction+0x44/0xb0 [pinctrl_paris]

Fixes: edd546465002 ("pinctrl: mediatek: avoid virtual gpio trying to set reg")
Singed-off-by: Jie Yang 
Signed-off-by: Hanks Chen 

---
Changes since v1:
- update Singed-off-by
- align with pinctrl/mediatek/pinctrl-mtk-mt*.h 

---
 drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c 
b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
index c53e2c391e32..a485d79f51a1 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
@@ -259,6 +259,10 @@ bool mtk_is_virt_gpio(struct mtk_pinctrl *hw, unsigned int 
gpio_n)
 
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n];
 
+   /* if the GPIO is not supported for eint mode */
+   if (desc->eint.eint_m == NO_EINT_SUPPORT)
+   return virt_gpio;
+
if (desc->funcs && !desc->funcs[desc->eint.eint_m].name)
virt_gpio = true;
 
-- 
2.18.0