> cache workaround delay in probe rather than calc it in every IRQ

Well, do we know how this interacts with CPUfrequency?
 

________________________________________
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Wednesday, September 16, 2009 8:21 PM
To: [email protected]
Subject: [Linux-kernel-commits] [7363]
trunk/drivers/input/keyboard/adp5588-keys.c: adp5588: more feedback from
lkml ( cache workaround delay in probe rather than calc it in every IRQ)

Revision
7363
Author
vapier
Date
2009-09-16 14:21:22 -0400 (Wed, 16 Sep 2009)
Log Message
adp5588: more feedback from lkml (cache workaround delay in probe rather
than calc it in every IRQ)
Modified Paths
* trunk/drivers/input/keyboard/adp5588-keys.c
Diff
Modified: trunk/drivers/input/keyboard/adp5588-keys.c (7362 => 7363)

--- trunk/drivers/input/keyboard/adp5588-keys.c 2009-09-16 17:20:45 UTC
(rev 7362)
+++ trunk/drivers/input/keyboard/adp5588-keys.c 2009-09-16 18:21:22 UTC
(rev 7363)
@@ -63,7 +63,7 @@
        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 @@
         * 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 @@
        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 @@
                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 @@
        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 @@
        }
 
        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 @@
        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:
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to