diff mbox

[6/6] pinctrl: mt8173: set GPIO16 to usb iddig mode

Message ID 1462868614-20602-7-git-send-email-chunfeng.yun@mediatek.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chunfeng Yun May 10, 2016, 8:23 a.m. UTC
the default mode of GPIO16 pin is gpio, when set EINT16 to
IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
fixed when set its default mode as usb iddig.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/pinctrl/mediatek/pinctrl-mtk-mt8173.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij May 11, 2016, 11:56 a.m. UTC | #1
On Tue, May 10, 2016 at 10:23 AM, Chunfeng Yun
<chunfeng.yun@mediatek.com> wrote:

> the default mode of GPIO16 pin is gpio, when set EINT16 to
> IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
> fixed when set its default mode as usb iddig.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

This looks like it can be merged orthogonally to all the
other patches, but I don't understand the patch or if it
is correct.

Hongzhou/Yingjoe, can either of you review this patch?

Yours,
Linus Walleij
Hongzhou Yang May 11, 2016, 6:32 p.m. UTC | #2
On Wed, 2016-05-11 at 13:56 +0200, Linus Walleij wrote:
> On Tue, May 10, 2016 at 10:23 AM, Chunfeng Yun
> <chunfeng.yun@mediatek.com> wrote:
> 
> > the default mode of GPIO16 pin is gpio, when set EINT16 to
> > IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
> > fixed when set its default mode as usb iddig.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> 

Chunfeng, GPIO16 can be used as EINT16 mode, but the pinmux should be 0.
If you want to set its default mode to iddig, you should set it in dts.

Yours,
Hongzhou
Chunfeng Yun May 12, 2016, 1:41 a.m. UTC | #3
Hi,

On Wed, 2016-05-11 at 11:32 -0700, Hongzhou Yang wrote:
> On Wed, 2016-05-11 at 13:56 +0200, Linus Walleij wrote:
> > On Tue, May 10, 2016 at 10:23 AM, Chunfeng Yun
> > <chunfeng.yun@mediatek.com> wrote:
> > 
> > > the default mode of GPIO16 pin is gpio, when set EINT16 to
> > > IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
> > > fixed when set its default mode as usb iddig.
> > >
> > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > 
> 
> Chunfeng, GPIO16 can be used as EINT16 mode, but the pinmux should be 0.
> If you want to set its default mode to iddig, you should set it in dts.
> 
I set it in DTS, but it didn't work, because when usb driver requested
IRQ, pinmux was switched back to default mode set by
MTK_EINT_FUNCTION().


> Yours,
> Hongzhou
>
Hongzhou Yang May 12, 2016, 2:09 a.m. UTC | #4
On Thu, 2016-05-12 at 09:41 +0800, chunfeng yun wrote:
> Hi,
> 
> On Wed, 2016-05-11 at 11:32 -0700, Hongzhou Yang wrote:
> > On Wed, 2016-05-11 at 13:56 +0200, Linus Walleij wrote:
> > > On Tue, May 10, 2016 at 10:23 AM, Chunfeng Yun
> > > <chunfeng.yun@mediatek.com> wrote:
> > > 
> > > > the default mode of GPIO16 pin is gpio, when set EINT16 to
> > > > IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
> > > > fixed when set its default mode as usb iddig.
> > > >
> > > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > > 
> > 
> > Chunfeng, GPIO16 can be used as EINT16 mode, but the pinmux should be 0.
> > If you want to set its default mode to iddig, you should set it in dts.
> > 
> I set it in DTS, but it didn't work, because when usb driver requested
> IRQ, pinmux was switched back to default mode set by
> MTK_EINT_FUNCTION().
> 

After confirmed, there are something wrong with data sheet and pinmux
table, and GPIO16 can only receive interrupt by mode 1. So

Acked-by: Hongzhou Yang <hongzhou.yang@mediatek.com>

Yours,
Hongzhou
Hongzhou Yang May 12, 2016, 2:55 a.m. UTC | #5
On Wed, 2016-05-11 at 19:09 -0700, Hongzhou Yang wrote:
> On Thu, 2016-05-12 at 09:41 +0800, chunfeng yun wrote:
> > Hi,
> > 
> > On Wed, 2016-05-11 at 11:32 -0700, Hongzhou Yang wrote:
> > > On Wed, 2016-05-11 at 13:56 +0200, Linus Walleij wrote:
> > > > On Tue, May 10, 2016 at 10:23 AM, Chunfeng Yun
> > > > <chunfeng.yun@mediatek.com> wrote:
> > > > 
> > > > > the default mode of GPIO16 pin is gpio, when set EINT16 to
> > > > > IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
> > > > > fixed when set its default mode as usb iddig.
> > > > >
> > > > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > > > 
> > > 
> > > Chunfeng, GPIO16 can be used as EINT16 mode, but the pinmux should be 0.
> > > If you want to set its default mode to iddig, you should set it in dts.
> > > 
> > I set it in DTS, but it didn't work, because when usb driver requested
> > IRQ, pinmux was switched back to default mode set by
> > MTK_EINT_FUNCTION().
> > 
> 
> After confirmed, there are something wrong with data sheet and pinmux
> table, and GPIO16 can only receive interrupt by mode 1. So
> 
> Acked-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
> 

Linus,

We find there are some other pins still have the same problem, so please
hold on it. Sorry for so much noise.

Thanks,
Hongzhou
Linus Walleij May 24, 2016, 10:58 a.m. UTC | #6
On Thu, May 12, 2016 at 4:55 AM, Hongzhou Yang
<hongzhou.yang@mediatek.com> wrote:

> We find there are some other pins still have the same problem, so please
> hold on it. Sorry for so much noise.

It's OK. Get me a big patch fixing it all when you're combed through
things and we can apply it for fixes/stable.

Yours,
Linus Walleij
Matthias Brugger Nov. 23, 2016, 6:32 p.m. UTC | #7
Hi Hongzhou,

On 12/05/16 04:55, Hongzhou Yang wrote:
> On Wed, 2016-05-11 at 19:09 -0700, Hongzhou Yang wrote:
>> On Thu, 2016-05-12 at 09:41 +0800, chunfeng yun wrote:
>>> Hi,
>>>
>>> On Wed, 2016-05-11 at 11:32 -0700, Hongzhou Yang wrote:
>>>> On Wed, 2016-05-11 at 13:56 +0200, Linus Walleij wrote:
>>>>> On Tue, May 10, 2016 at 10:23 AM, Chunfeng Yun
>>>>> <chunfeng.yun@mediatek.com> wrote:
>>>>>
>>>>>> the default mode of GPIO16 pin is gpio, when set EINT16 to
>>>>>> IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
>>>>>> fixed when set its default mode as usb iddig.
>>>>>>
>>>>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
>>>>>
>>>>
>>>> Chunfeng, GPIO16 can be used as EINT16 mode, but the pinmux should be 0.
>>>> If you want to set its default mode to iddig, you should set it in dts.
>>>>
>>> I set it in DTS, but it didn't work, because when usb driver requested
>>> IRQ, pinmux was switched back to default mode set by
>>> MTK_EINT_FUNCTION().
>>>
>>
>> After confirmed, there are something wrong with data sheet and pinmux
>> table, and GPIO16 can only receive interrupt by mode 1. So
>>
>> Acked-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
>>
>
> Linus,
>
> We find there are some other pins still have the same problem, so please
> hold on it. Sorry for so much noise.
>

Did you made any progress on this? I didn't see any patch on the mailing 
list.

Regards,
Matthias
Hongzhou Yang Dec. 1, 2016, 12:43 a.m. UTC | #8
On Wed, 2016-11-23 at 19:32 +0100, Matthias Brugger wrote:
> Hi Hongzhou,
> 
> On 12/05/16 04:55, Hongzhou Yang wrote:
> > On Wed, 2016-05-11 at 19:09 -0700, Hongzhou Yang wrote:
> >> On Thu, 2016-05-12 at 09:41 +0800, chunfeng yun wrote:
> >>> Hi,
> >>>
> >>> On Wed, 2016-05-11 at 11:32 -0700, Hongzhou Yang wrote:
> >>>> On Wed, 2016-05-11 at 13:56 +0200, Linus Walleij wrote:
> >>>>> On Tue, May 10, 2016 at 10:23 AM, Chunfeng Yun
> >>>>> <chunfeng.yun@mediatek.com> wrote:
> >>>>>
> >>>>>> the default mode of GPIO16 pin is gpio, when set EINT16 to
> >>>>>> IRQ_TYPE_LEVEL_HIGH, no interrupt is triggered, it can be
> >>>>>> fixed when set its default mode as usb iddig.
> >>>>>>
> >>>>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> >>>>>
> >>>>
> >>>> Chunfeng, GPIO16 can be used as EINT16 mode, but the pinmux should be 0.
> >>>> If you want to set its default mode to iddig, you should set it in dts.
> >>>>
> >>> I set it in DTS, but it didn't work, because when usb driver requested
> >>> IRQ, pinmux was switched back to default mode set by
> >>> MTK_EINT_FUNCTION().
> >>>
> >>
> >> After confirmed, there are something wrong with data sheet and pinmux
> >> table, and GPIO16 can only receive interrupt by mode 1. So
> >>
> >> Acked-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
> >>
> >
> > Linus,
> >
> > We find there are some other pins still have the same problem, so please
> > hold on it. Sorry for so much noise.
> >
> 
> Did you made any progress on this? I didn't see any patch on the mailing 
> list.
> 
> Regards,
> Matthias

Hi Matthias,

Sorry for the late reply.

I have double confirmed with HW designer, other special EINTs are
built-in and they are using internal signal, they are not triggered 
by GPIO, only GPIO16 should set to mode 1.

And, Chunfeng already re-sent this patch.

Thank you very much.

Yours,
Hongzhou
diff mbox

Patch

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-mt8173.h b/drivers/pinctrl/mediatek/pinctrl-mtk-mt8173.h
index 13e5b68..9b018fd 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-mt8173.h
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-mt8173.h
@@ -201,7 +201,7 @@  static const struct mtk_desc_pin mtk_pins_mt8173[] = {
 	MTK_PIN(
 		PINCTRL_PIN(16, "IDDIG"),
 		NULL, "mt8173",
-		MTK_EINT_FUNCTION(0, 16),
+		MTK_EINT_FUNCTION(1, 16),
 		MTK_FUNCTION(0, "GPIO16"),
 		MTK_FUNCTION(1, "IDDIG"),
 		MTK_FUNCTION(2, "CMFLASH"),