And the subject should be also corrected with prefix starting with
"pinctrl: mediatek:", typo fixup, and having a better subject close to
the content.
On Thu, Dec 13, 2018 at 1:36 AM <[email protected]> wrote:
>
> From: Chuanjia Liu <[email protected]>
>
> This patch add gpio vritual number select,avoid virtual gpio set SMT.
>
> Signed-off-by: Chuanjia Liu <[email protected]>
> ---
> drivers/pinctrl/mediatek/mtk-eint.h | 1 +
> drivers/pinctrl/mediatek/pinctrl-mt8183.c | 1 +
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 9 ++++++---
> 3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/mediatek/mtk-eint.h b/drivers/pinctrl/mediatek/mtk-eint.h
> index 48468d0..c16beaf 100644
> --- a/drivers/pinctrl/mediatek/mtk-eint.h
> +++ b/drivers/pinctrl/mediatek/mtk-eint.h
> @@ -37,6 +37,7 @@ struct mtk_eint_hw {
> u8 ports;
> unsigned int ap_num;
> unsigned int db_cnt;
> + unsigned int vir_start;
> };
>
> struct mtk_eint;
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8183.c b/drivers/pinctrl/mediatek/pinctrl-mt8183.c
> index 6262fd3..bbeafd3 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mt8183.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mt8183.c
> @@ -497,6 +497,7 @@
> .ports = 6,
> .ap_num = 212,
> .db_cnt = 13,
> + .vir_start = 180,
> };
>
> static const struct mtk_pin_soc mt8183_data = {
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> index 4a9e0d4..ca3bae1 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> @@ -289,9 +289,12 @@ static int mtk_xt_set_gpio_as_eint(void *data, unsigned long eint_n)
> if (err)
> return err;
>
> - err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE);
> - if (err)
> - return err;
> + if (gpio_n < hw->eint->hw->vir_start) {
> + err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT,
> + MTK_ENABLE);
> + if (err)
> + return err;
> + }
>
> return 0;
> }
> --
> 1.7.9.5
On Fri, 2018-12-14 at 03:51 +0800, Sean Wang wrote:
> And the subject should be also corrected with prefix starting with
> "pinctrl: mediatek:", typo fixup, and having a better subject close to
> the content.
I will change it in next patch.
> On Thu, Dec 13, 2018 at 1:36 AM <[email protected]> wrote:
> >
> > From: Chuanjia Liu <[email protected]>
> >
> > This patch add gpio vritual number select,avoid virtual gpio set SMT.
> >
> > Signed-off-by: Chuanjia Liu <[email protected]>
> > ---
> > drivers/pinctrl/mediatek/mtk-eint.h | 1 +
> > drivers/pinctrl/mediatek/pinctrl-mt8183.c | 1 +
> > drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 9 ++++++---
> > 3 files changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/pinctrl/mediatek/mtk-eint.h b/drivers/pinctrl/mediatek/mtk-eint.h
> > index 48468d0..c16beaf 100644
> > --- a/drivers/pinctrl/mediatek/mtk-eint.h
> > +++ b/drivers/pinctrl/mediatek/mtk-eint.h
> > @@ -37,6 +37,7 @@ struct mtk_eint_hw {
> > u8 ports;
> > unsigned int ap_num;
> > unsigned int db_cnt;
> > + unsigned int vir_start;
> > };
> >
> > struct mtk_eint;
> > diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8183.c b/drivers/pinctrl/mediatek/pinctrl-mt8183.c
> > index 6262fd3..bbeafd3 100644
> > --- a/drivers/pinctrl/mediatek/pinctrl-mt8183.c
> > +++ b/drivers/pinctrl/mediatek/pinctrl-mt8183.c
> > @@ -497,6 +497,7 @@
> > .ports = 6,
> > .ap_num = 212,
> > .db_cnt = 13,
> > + .vir_start = 180,
> > };
> >
> > static const struct mtk_pin_soc mt8183_data = {
> > diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> > index 4a9e0d4..ca3bae1 100644
> > --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> > +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> > @@ -289,9 +289,12 @@ static int mtk_xt_set_gpio_as_eint(void *data, unsigned long eint_n)
> > if (err)
> > return err;
> >
> > - err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE);
> > - if (err)
> > - return err;
> > + if (gpio_n < hw->eint->hw->vir_start) {
> > + err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT,
> > + MTK_ENABLE);
> > + if (err)
> > + return err;
> > + }
> >
> > return 0;
> > }
> > --
> > 1.7.9.5