linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP
@ 2013-05-08 21:45 Geert Uytterhoeven
  2013-05-09  3:25 ` Simon Glass
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2013-05-08 21:45 UTC (permalink / raw)
  To: Simon Glass, Dmitry Torokhov, Samuel Ortiz
  Cc: linux-input, linux-kernel, Geert Uytterhoeven

If CONFIG_PM_SLEEP is not set:

drivers/input/keyboard/cros_ec_keyb.c:211: warning: ‘cros_ec_keyb_clear_keyboard’ defined but not used

Move the definition of cros_ec_keyb_clear_keyboard() inside the section
protected by #ifdef CONFIG_PM_SLEEP to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/input/keyboard/cros_ec_keyb.c |   54 ++++++++++++++++----------------
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 49557f2..7e8b0a5 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -206,33 +206,6 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
 	return NOTIFY_DONE;
 }
 
-/* Clear any keys in the buffer */
-static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev)
-{
-	uint8_t old_state[ckdev->cols];
-	uint8_t new_state[ckdev->cols];
-	unsigned long duration;
-	int i, ret;
-
-	/*
-	 * Keep reading until we see that the scan state does not change.
-	 * That indicates that we are done.
-	 *
-	 * Assume that the EC keyscan buffer is at most 32 deep.
-	 */
-	duration = jiffies;
-	ret = cros_ec_keyb_get_state(ckdev, new_state);
-	for (i = 1; !ret && i < 32; i++) {
-		memcpy(old_state, new_state, sizeof(old_state));
-		ret = cros_ec_keyb_get_state(ckdev, new_state);
-		if (0 == memcmp(old_state, new_state, sizeof(old_state)))
-			break;
-	}
-	duration = jiffies - duration;
-	dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i,
-		jiffies_to_usecs(duration));
-}
-
 static int cros_ec_keyb_probe(struct platform_device *pdev)
 {
 	struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent);
@@ -299,6 +272,33 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM_SLEEP
+/* Clear any keys in the buffer */
+static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev)
+{
+	uint8_t old_state[ckdev->cols];
+	uint8_t new_state[ckdev->cols];
+	unsigned long duration;
+	int i, ret;
+
+	/*
+	 * Keep reading until we see that the scan state does not change.
+	 * That indicates that we are done.
+	 *
+	 * Assume that the EC keyscan buffer is at most 32 deep.
+	 */
+	duration = jiffies;
+	ret = cros_ec_keyb_get_state(ckdev, new_state);
+	for (i = 1; !ret && i < 32; i++) {
+		memcpy(old_state, new_state, sizeof(old_state));
+		ret = cros_ec_keyb_get_state(ckdev, new_state);
+		if (0 == memcmp(old_state, new_state, sizeof(old_state)))
+			break;
+	}
+	duration = jiffies - duration;
+	dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i,
+		jiffies_to_usecs(duration));
+}
+
 static int cros_ec_keyb_resume(struct device *dev)
 {
 	struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP
  2013-05-08 21:45 [PATCH] input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP Geert Uytterhoeven
@ 2013-05-09  3:25 ` Simon Glass
  2013-05-15  6:42   ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2013-05-09  3:25 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Dmitry Torokhov, Samuel Ortiz, linux-input@vger.kernel.org, lk

On Wed, May 8, 2013 at 3:45 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> If CONFIG_PM_SLEEP is not set:
>
> drivers/input/keyboard/cros_ec_keyb.c:211: warning: ‘cros_ec_keyb_clear_keyboard’ defined but not used
>
> Move the definition of cros_ec_keyb_clear_keyboard() inside the section
> protected by #ifdef CONFIG_PM_SLEEP to fix this.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Acked-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP
  2013-05-09  3:25 ` Simon Glass
@ 2013-05-15  6:42   ` Dmitry Torokhov
  2013-06-17 23:16     ` Samuel Ortiz
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2013-05-15  6:42 UTC (permalink / raw)
  To: Simon Glass
  Cc: Geert Uytterhoeven, Samuel Ortiz, linux-input@vger.kernel.org, lk

On Wed, May 08, 2013 at 09:25:56PM -0600, Simon Glass wrote:
> On Wed, May 8, 2013 at 3:45 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > If CONFIG_PM_SLEEP is not set:
> >
> > drivers/input/keyboard/cros_ec_keyb.c:211: warning: ‘cros_ec_keyb_clear_keyboard’ defined but not used
> >
> > Move the definition of cros_ec_keyb_clear_keyboard() inside the section
> > protected by #ifdef CONFIG_PM_SLEEP to fix this.
> >
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> 
> Acked-by: Simon Glass <sjg@chromium.org>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Could you please forward this to Linus as I do not have this driver in
my branch yet.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP
  2013-05-15  6:42   ` Dmitry Torokhov
@ 2013-06-17 23:16     ` Samuel Ortiz
  2013-06-18  8:39       ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Ortiz @ 2013-06-17 23:16 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Simon Glass, Geert Uytterhoeven, linux-input@vger.kernel.org, lk

Hi Dmitry,

On Tue, May 14, 2013 at 11:42:48PM -0700, Dmitry Torokhov wrote:
> On Wed, May 08, 2013 at 09:25:56PM -0600, Simon Glass wrote:
> > On Wed, May 8, 2013 at 3:45 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > If CONFIG_PM_SLEEP is not set:
> > >
> > > drivers/input/keyboard/cros_ec_keyb.c:211: warning: ‘cros_ec_keyb_clear_keyboard’ defined but not used
> > >
> > > Move the definition of cros_ec_keyb_clear_keyboard() inside the section
> > > protected by #ifdef CONFIG_PM_SLEEP to fix this.
> > >
> > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > 
> > Acked-by: Simon Glass <sjg@chromium.org>
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Could you please forward this to Linus as I do not have this driver in
> my branch yet.
I guess you took that one now ? Or are you expecting me to merge it ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP
  2013-06-17 23:16     ` Samuel Ortiz
@ 2013-06-18  8:39       ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2013-06-18  8:39 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Dmitry Torokhov, Simon Glass, linux-input@vger.kernel.org, lk

On Tue, Jun 18, 2013 at 1:16 AM, Samuel Ortiz <sameo@linux.intel.com> wrote:
> On Tue, May 14, 2013 at 11:42:48PM -0700, Dmitry Torokhov wrote:
>> On Wed, May 08, 2013 at 09:25:56PM -0600, Simon Glass wrote:
>> > On Wed, May 8, 2013 at 3:45 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> > > If CONFIG_PM_SLEEP is not set:
>> > >
>> > > drivers/input/keyboard/cros_ec_keyb.c:211: warning: ‘cros_ec_keyb_clear_keyboard’ defined but not used
>> > >
>> > > Move the definition of cros_ec_keyb_clear_keyboard() inside the section
>> > > protected by #ifdef CONFIG_PM_SLEEP to fix this.
>> > >
>> > > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> >
>> > Acked-by: Simon Glass <sjg@chromium.org>
>>
>> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>
>> Could you please forward this to Linus as I do not have this driver in
>> my branch yet.
> I guess you took that one now ? Or are you expecting me to merge it ?

FWIW, I also have it in my exotic-arch-fixes branch, now destined for 3.11.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-18  8:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08 21:45 [PATCH] input: cros_ec_keyb_clear_keyboard() depends on CONFIG_PM_SLEEP Geert Uytterhoeven
2013-05-09  3:25 ` Simon Glass
2013-05-15  6:42   ` Dmitry Torokhov
2013-06-17 23:16     ` Samuel Ortiz
2013-06-18  8:39       ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).