[1/2] input: keyboard: imx: no need to control interrupt status in event check
diff mbox series

Message ID 1553842562-8481-1-git-send-email-Anson.Huang@nxp.com
State New
Headers show
Series
  • [1/2] input: keyboard: imx: no need to control interrupt status in event check
Related show

Commit Message

Anson Huang March 29, 2019, 7 a.m. UTC
There is no need to enable release interrupt and disable depress
interrupt in event check, as a timer is setup for checking these
events rather than interrupts.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/input/keyboard/imx_keypad.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Dmitry Torokhov April 3, 2019, 9:48 p.m. UTC | #1
Hi Anson,

On Fri, Mar 29, 2019 at 07:00:43AM +0000, Anson Huang wrote:
> There is no need to enable release interrupt and disable depress
> interrupt in event check, as a timer is setup for checking these
> events rather than interrupts.

But won't using release interrupt allow signalling key release earlier?

> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  drivers/input/keyboard/imx_keypad.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
> index 539cb67..7e32c36 100644
> --- a/drivers/input/keyboard/imx_keypad.c
> +++ b/drivers/input/keyboard/imx_keypad.c
> @@ -276,11 +276,6 @@ static void imx_keypad_check_for_events(struct timer_list *t)
>  		reg_val = readw(keypad->mmio_base + KPSR);
>  		reg_val |= KBD_STAT_KPKR | KBD_STAT_KRSS;
>  		writew(reg_val, keypad->mmio_base + KPSR);
> -
> -		reg_val = readw(keypad->mmio_base + KPSR);
> -		reg_val |= KBD_STAT_KRIE;
> -		reg_val &= ~KBD_STAT_KDIE;
> -		writew(reg_val, keypad->mmio_base + KPSR);
>  	}
>  }
>  
> -- 
> 2.7.4
> 

Thanks.
Anson Huang April 4, 2019, 1:29 a.m. UTC | #2
Hi, Dmitry

Best Regards!
Anson Huang

> -----Original Message-----
> From: dmitry.torokhov@gmail.com [mailto:dmitry.torokhov@gmail.com]
> Sent: 2019年4月4日 5:49
> To: Anson Huang <anson.huang@nxp.com>
> Cc: shawnguo@kernel.org; s.hauer@pengutronix.de;
> kernel@pengutronix.de; festevam@gmail.com; linux-input@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; dl-linux-
> imx <linux-imx@nxp.com>
> Subject: Re: [PATCH 1/2] input: keyboard: imx: no need to control interrupt
> status in event check
> 
> Hi Anson,
> 
> On Fri, Mar 29, 2019 at 07:00:43AM +0000, Anson Huang wrote:
> > There is no need to enable release interrupt and disable depress
> > interrupt in event check, as a timer is setup for checking these
> > events rather than interrupts.
> 
> But won't using release interrupt allow signalling key release earlier?

It makes sense, patch #1 can be dropped, I will resend the patch #2 for review.

Thanks,
Anson.

> 
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> >  drivers/input/keyboard/imx_keypad.c | 5 -----
> >  1 file changed, 5 deletions(-)
> >
> > diff --git a/drivers/input/keyboard/imx_keypad.c
> > b/drivers/input/keyboard/imx_keypad.c
> > index 539cb67..7e32c36 100644
> > --- a/drivers/input/keyboard/imx_keypad.c
> > +++ b/drivers/input/keyboard/imx_keypad.c
> > @@ -276,11 +276,6 @@ static void imx_keypad_check_for_events(struct
> timer_list *t)
> >  		reg_val = readw(keypad->mmio_base + KPSR);
> >  		reg_val |= KBD_STAT_KPKR | KBD_STAT_KRSS;
> >  		writew(reg_val, keypad->mmio_base + KPSR);
> > -
> > -		reg_val = readw(keypad->mmio_base + KPSR);
> > -		reg_val |= KBD_STAT_KRIE;
> > -		reg_val &= ~KBD_STAT_KDIE;
> > -		writew(reg_val, keypad->mmio_base + KPSR);
> >  	}
> >  }
> >
> > --
> > 2.7.4
> >
> 
> Thanks.
> 
> --
> Dmitry

Patch
diff mbox series

diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 539cb67..7e32c36 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -276,11 +276,6 @@  static void imx_keypad_check_for_events(struct timer_list *t)
 		reg_val = readw(keypad->mmio_base + KPSR);
 		reg_val |= KBD_STAT_KPKR | KBD_STAT_KRSS;
 		writew(reg_val, keypad->mmio_base + KPSR);
-
-		reg_val = readw(keypad->mmio_base + KPSR);
-		reg_val |= KBD_STAT_KRIE;
-		reg_val &= ~KBD_STAT_KDIE;
-		writew(reg_val, keypad->mmio_base + KPSR);
 	}
 }