All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	uclinux-dist-devel@blackfin.uclinux.org,
	Michael Hennerich <michael.hennerich@analog.com>,
	Bryan Wu <cooloney@kernel.org>
Subject: Re: [PATCH v2] input/keyboard: add ADP5588 QWERTY I2C Keyboard Input device driver
Date: Tue, 15 Sep 2009 22:02:36 -0700	[thread overview]
Message-ID: <20090916050236.GF2756@core.coreip.homeip.net> (raw)
In-Reply-To: <1253062178-18196-1-git-send-email-vapier@gentoo.org>

On Tue, Sep 15, 2009 at 08:49:38PM -0400, Mike Frysinger wrote:
> From: Michael Hennerich <michael.hennerich@analog.com>
> 
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> Signed-off-by: Bryan Wu <cooloney@kernel.org>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
> v2
> 	- merge my and Dmitry's clean up fixes
> 

Looks good, I'd also like to add this instead of recalcularing delay
every time:

diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index 892a532..d48c808 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -63,7 +63,7 @@ struct adp5588_kpad {
 	struct i2c_client *client;
 	struct input_dev *input;
 	struct delayed_work work;
-	unsigned revid;
+	unsigned long delay;
 	unsigned short keycode[ADP5588_KEYMAPSIZE];
 };
 
@@ -119,9 +119,7 @@ static irqreturn_t adp5588_irq(int irq, void *handle)
 	 * REVID < 4
 	 */
 
-	schedule_delayed_work(&kpad->work,
-			WA_DELAYED_READOUT_REVID(kpad->revid) ?
-			(unsigned long) msecs_to_jiffies(30) : 0);
+	schedule_delayed_work(&kpad->work, kpad->delay);
 
 	return IRQ_HANDLED;
 }
@@ -164,6 +162,7 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 	struct adp5588_kpad *kpad;
 	struct adp5588_kpad_platform_data *pdata = client->dev.platform_data;
 	struct input_dev *input;
+	unsigned int revid;
 	int ret, i;
 	int error;
 
@@ -210,7 +209,9 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 		goto err_free_mem;
 	}
 
-	kpad->revid = (u8) ret & ADP5588_DEVICE_ID_MASK;
+	revid = (u8) ret & ADP5588_DEVICE_ID_MASK;
+	if (WA_DELAYED_READOUT_REVID(revid))
+		kpad->delay = msecs_to_jiffies(30);
 
 	input->name = client->name;
 	input->phys = "adp5588-keys/input0";
@@ -221,7 +222,7 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 	input->id.bustype = BUS_I2C;
 	input->id.vendor = 0x0001;
 	input->id.product = 0x0001;
-	input->id.version = kpad->revid;
+	input->id.version = revid;
 
 	input->keycodesize = sizeof(kpad->keycode[0]);
 	input->keycodemax = pdata->keymapsize;
@@ -247,8 +248,8 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 	}
 
 	error = request_irq(client->irq, adp5588_irq,
-		IRQF_TRIGGER_FALLING | IRQF_DISABLED,
-		client->dev.driver->name, kpad);
+			    IRQF_TRIGGER_FALLING | IRQF_DISABLED,
+			    client->dev.driver->name, kpad);
 	if (error) {
 		dev_err(&client->dev, "irq %d busy?\n", client->irq);
 		goto err_unreg_dev;
@@ -261,9 +262,7 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 	device_init_wakeup(&client->dev, 1);
 	i2c_set_clientdata(client, kpad);
 
-	dev_info(&client->dev, "Rev.%d keypad, irq %d\n",
-		kpad->revid, client->irq);
-
+	dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq);
 	return 0;
 
  err_free_irq:

-- 
Dmitry

WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
Cc: uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Michael Hennerich
	<michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2] input/keyboard: add ADP5588 QWERTY I2C Keyboard	Input device driver
Date: Tue, 15 Sep 2009 22:02:36 -0700	[thread overview]
Message-ID: <20090916050236.GF2756@core.coreip.homeip.net> (raw)
In-Reply-To: <1253062178-18196-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>

On Tue, Sep 15, 2009 at 08:49:38PM -0400, Mike Frysinger wrote:
> From: Michael Hennerich <michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
> 
> Signed-off-by: Michael Hennerich <michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Bryan Wu <cooloney-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Dmitry Torokhov <dtor-JGs/UdohzUI@public.gmane.org>
> ---
> v2
> 	- merge my and Dmitry's clean up fixes
> 

Looks good, I'd also like to add this instead of recalcularing delay
every time:

diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index 892a532..d48c808 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -63,7 +63,7 @@ struct adp5588_kpad {
 	struct i2c_client *client;
 	struct input_dev *input;
 	struct delayed_work work;
-	unsigned revid;
+	unsigned long delay;
 	unsigned short keycode[ADP5588_KEYMAPSIZE];
 };
 
@@ -119,9 +119,7 @@ static irqreturn_t adp5588_irq(int irq, void *handle)
 	 * REVID < 4
 	 */
 
-	schedule_delayed_work(&kpad->work,
-			WA_DELAYED_READOUT_REVID(kpad->revid) ?
-			(unsigned long) msecs_to_jiffies(30) : 0);
+	schedule_delayed_work(&kpad->work, kpad->delay);
 
 	return IRQ_HANDLED;
 }
@@ -164,6 +162,7 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 	struct adp5588_kpad *kpad;
 	struct adp5588_kpad_platform_data *pdata = client->dev.platform_data;
 	struct input_dev *input;
+	unsigned int revid;
 	int ret, i;
 	int error;
 
@@ -210,7 +209,9 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 		goto err_free_mem;
 	}
 
-	kpad->revid = (u8) ret & ADP5588_DEVICE_ID_MASK;
+	revid = (u8) ret & ADP5588_DEVICE_ID_MASK;
+	if (WA_DELAYED_READOUT_REVID(revid))
+		kpad->delay = msecs_to_jiffies(30);
 
 	input->name = client->name;
 	input->phys = "adp5588-keys/input0";
@@ -221,7 +222,7 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 	input->id.bustype = BUS_I2C;
 	input->id.vendor = 0x0001;
 	input->id.product = 0x0001;
-	input->id.version = kpad->revid;
+	input->id.version = revid;
 
 	input->keycodesize = sizeof(kpad->keycode[0]);
 	input->keycodemax = pdata->keymapsize;
@@ -247,8 +248,8 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 	}
 
 	error = request_irq(client->irq, adp5588_irq,
-		IRQF_TRIGGER_FALLING | IRQF_DISABLED,
-		client->dev.driver->name, kpad);
+			    IRQF_TRIGGER_FALLING | IRQF_DISABLED,
+			    client->dev.driver->name, kpad);
 	if (error) {
 		dev_err(&client->dev, "irq %d busy?\n", client->irq);
 		goto err_unreg_dev;
@@ -261,9 +262,7 @@ static int __devinit adp5588_probe(struct i2c_client *client,
 	device_init_wakeup(&client->dev, 1);
 	i2c_set_clientdata(client, kpad);
 
-	dev_info(&client->dev, "Rev.%d keypad, irq %d\n",
-		kpad->revid, client->irq);
-
+	dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq);
 	return 0;
 
  err_free_irq:

-- 
Dmitry

  reply	other threads:[~2009-09-16  5:08 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 22:18 [PATCH] input/keyboard: add ADP5588 QWERTY I2C Keyboard Input device driver Mike Frysinger
2009-09-15  6:20 ` Dmitry Torokhov
2009-09-15 11:19   ` Mike Frysinger
2009-09-15 11:19     ` Mike Frysinger
2009-09-15 16:26     ` Dmitry Torokhov
2009-09-15 16:26       ` Dmitry Torokhov
2009-09-15 16:46       ` Mike Frysinger
2009-09-15 16:46         ` Mike Frysinger
2009-09-15 17:17         ` Dmitry Torokhov
2009-09-15 17:17           ` Dmitry Torokhov
2009-09-16  3:49       ` Barry Song
2009-09-16  3:49         ` Barry Song
2009-09-16  4:03         ` Mike Frysinger
2009-09-16  4:03           ` Mike Frysinger
2009-09-16  4:18           ` [Uclinux-dist-devel] [PATCH] input/keyboard: add ADP5588 QWERTYI2C " Song, Barry
2009-09-16  4:18             ` Song, Barry
2009-09-16  4:25             ` Mike Frysinger
2009-09-16  4:25               ` Mike Frysinger
2009-09-16  4:49               ` Dmitry Torokhov
2009-09-16  4:49                 ` Dmitry Torokhov
2009-09-16 21:07     ` [PATCH] input/keyboard: add ADP5588 QWERTY I2C " Robin Getz
2009-09-16 21:07       ` Robin Getz
2009-09-16  0:49   ` [PATCH v2] " Mike Frysinger
2009-09-16  5:02     ` Dmitry Torokhov [this message]
2009-09-16  5:02       ` Dmitry Torokhov
2009-09-16 12:55       ` [Uclinux-dist-devel] " Mike Frysinger
2009-09-16 12:55         ` Mike Frysinger
2009-09-16 16:33         ` Dmitry Torokhov
2009-09-16 16:33           ` Dmitry Torokhov
2009-09-16 18:20       ` [PATCH v3] " Mike Frysinger
2009-09-18  5:42         ` Dmitry Torokhov
2009-09-21 16:45       ` [Uclinux-dist-devel] [PATCH v2] " Mike Frysinger
2009-09-21 16:45         ` Mike Frysinger
2009-09-21 16:55         ` Dmitry Torokhov
2009-09-21 16:55           ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090916050236.GF2756@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=cooloney@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.