diff for duplicates of <50226843.4080508@gmail.com> diff --git a/a/1.txt b/N1/1.txt index dab3d78..d683f06 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -21,7 +21,7 @@ Daniel > Signed-off-by: Arnd Bergmann <arnd@arndb.de> -> Cc: stable at vger.kernel.org (v3.2+) +> Cc: stable@vger.kernel.org (v3.2+) > Cc: Daniel Mack <zonque@gmail.com> > Cc: Haojian Zhuang <haojian.zhuang@gmail.com> > --- @@ -88,12 +88,4 @@ Daniel > }; > > #endif /* LINUX_INPUT_EETI_TS_H */ -> - --------------- next part -------------- -A non-text attachment was scrubbed... -Name: 0001-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch -Type: text/x-patch -Size: 3730 bytes -Desc: not available -URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120808/9725df93/attachment.bin> +> diff --git a/N1/2.hdr b/N1/2.hdr new file mode 100644 index 0000000..8363ebd --- /dev/null +++ b/N1/2.hdr @@ -0,0 +1,5 @@ +Content-Type: text/x-patch; + name="0001-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch" +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; + filename="0001-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch" diff --git a/N1/2.txt b/N1/2.txt new file mode 100644 index 0000000..efea313 --- /dev/null +++ b/N1/2.txt @@ -0,0 +1,115 @@ +>From bfb14c1a0417435ebcf5bdebbb94ae6812cb4aee Mon Sep 17 00:00:00 2001 +From: Daniel Mack <zonque@gmail.com> +Date: Tue, 7 Aug 2012 17:02:59 +0200 +Subject: [PATCH] Input: eeti_ts: pass gpio value instead of IRQ + +The EETI touchscreen asserts its IRQ line as soon as it has data in its +internal buffers. The line is automatically deasserted once all data has +been read via I2C. Hence, the driver has to monitor the GPIO line and +cannot simply rely on the interrupt handler reception. + +In the current implementation of the driver, irq_to_gpio() is used to +determine the GPIO number from the i2c_client's IRQ value. + +As irq_to_gpio() is not available on all platforms, this patch changes +this and makes the driver ignore the passed in IRQ. Instead, a GPIO is +added to the platform_data struct and gpio_to_irq is used to derive the +IRQ from that GPIO. If this fails, bail out. The driver is only able to +work in environments where the touchscreen GPIO can be mapped to an +IRQ. + +Signed-off-by: Daniel Mack <zonque@gmail.com> +--- + drivers/input/touchscreen/eeti_ts.c | 21 +++++++++++++-------- + include/linux/input/eeti_ts.h | 1 + + 2 files changed, 14 insertions(+), 8 deletions(-) + +diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c +index 503c709..908407e 100644 +--- a/drivers/input/touchscreen/eeti_ts.c ++++ b/drivers/input/touchscreen/eeti_ts.c +@@ -48,7 +48,7 @@ struct eeti_ts_priv { + struct input_dev *input; + struct work_struct work; + struct mutex mutex; +- int irq, irq_active_high; ++ int irq_gpio, irq, irq_active_high; + }; + + #define EETI_TS_BITDEPTH (11) +@@ -62,7 +62,7 @@ struct eeti_ts_priv { + + static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv) + { +- return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high; ++ return gpio_get_value(priv->irq_gpio) == priv->irq_active_high; + } + + static void eeti_ts_read(struct work_struct *work) +@@ -157,7 +157,7 @@ static void eeti_ts_close(struct input_dev *dev) + static int __devinit eeti_ts_probe(struct i2c_client *client, + const struct i2c_device_id *idp) + { +- struct eeti_ts_platform_data *pdata; ++ struct eeti_ts_platform_data *pdata = client->dev.platform_data; + struct eeti_ts_priv *priv; + struct input_dev *input; + unsigned int irq_flags; +@@ -199,9 +199,12 @@ static int __devinit eeti_ts_probe(struct i2c_client *client, + + priv->client = client; + priv->input = input; +- priv->irq = client->irq; ++ priv->irq_gpio = pdata->irq_gpio; ++ priv->irq = gpio_to_irq(pdata->irq_gpio); + +- pdata = client->dev.platform_data; ++ err = gpio_request_one(pdata->irq_gpio, GPIOF_IN, client->name); ++ if (err < 0) ++ goto err1; + + if (pdata) + priv->irq_active_high = pdata->irq_active_high; +@@ -215,13 +218,13 @@ static int __devinit eeti_ts_probe(struct i2c_client *client, + + err = input_register_device(input); + if (err) +- goto err1; ++ goto err2; + + err = request_irq(priv->irq, eeti_ts_isr, irq_flags, + client->name, priv); + if (err) { + dev_err(&client->dev, "Unable to request touchscreen IRQ.\n"); +- goto err2; ++ goto err3; + } + + /* +@@ -233,9 +236,11 @@ static int __devinit eeti_ts_probe(struct i2c_client *client, + device_init_wakeup(&client->dev, 0); + return 0; + +-err2: ++err3: + input_unregister_device(input); + input = NULL; /* so we dont try to free it below */ ++err2: ++ gpio_free(pdata->irq_gpio); + err1: + input_free_device(input); + kfree(priv); +diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h +index f875b31..16625d7 100644 +--- a/include/linux/input/eeti_ts.h ++++ b/include/linux/input/eeti_ts.h +@@ -2,6 +2,7 @@ + #define LINUX_INPUT_EETI_TS_H + + struct eeti_ts_platform_data { ++ int irq_gpio; + unsigned int irq_active_high; + }; + +-- +1.7.11.2 diff --git a/a/content_digest b/N1/content_digest index 3af62d2..35abfcf 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,10 +1,15 @@ "ref\01344430493-5304-1-git-send-email-arnd@arndb.de\0" "ref\01344430493-5304-3-git-send-email-arnd@arndb.de\0" - "From\0zonque@gmail.com (Daniel Mack)\0" - "Subject\0[PATCH 2/6] ARM: pxa remove irq_to_gpio from eeti_ts driver\0" + "From\0Daniel Mack <zonque@gmail.com>\0" + "Subject\0Re: [PATCH 2/6] ARM: pxa remove irq_to_gpio from eeti_ts driver\0" "Date\0Wed, 08 Aug 2012 15:23:15 +0200\0" - "To\0linux-arm-kernel@lists.infradead.org\0" - "\00:1\0" + "To\0Arnd Bergmann <arnd@arndb.de>\0" + "Cc\0linux-arm-kernel@lists.infradead.org" + arm@kernel.org + linux-kernel@vger.kernel.org + v3.2+ <stable@vger.kernel.org> + " Haojian Zhuang <haojian.zhuang@gmail.com>\0" + "\01:1\0" "b\0" "On 08.08.2012 14:54, Arnd Bergmann wrote:\n" "> The irq_to_gpio function was removed from the pxa platform\n" @@ -29,7 +34,7 @@ "\n" "\n" "> Signed-off-by: Arnd Bergmann <arnd@arndb.de>\n" - "> Cc: stable at vger.kernel.org (v3.2+)\n" + "> Cc: stable@vger.kernel.org (v3.2+)\n" "> Cc: Daniel Mack <zonque@gmail.com>\n" "> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>\n" "> ---\n" @@ -96,14 +101,124 @@ "> };\n" "> \n" "> #endif /* LINUX_INPUT_EETI_TS_H */\n" - "> \n" + > + "\01:2\0" + "fn\00001-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch\0" + "b\0" + ">From bfb14c1a0417435ebcf5bdebbb94ae6812cb4aee Mon Sep 17 00:00:00 2001\n" + "From: Daniel Mack <zonque@gmail.com>\n" + "Date: Tue, 7 Aug 2012 17:02:59 +0200\n" + "Subject: [PATCH] Input: eeti_ts: pass gpio value instead of IRQ\n" + "\n" + "The EETI touchscreen asserts its IRQ line as soon as it has data in its\n" + "internal buffers. The line is automatically deasserted once all data has\n" + "been read via I2C. Hence, the driver has to monitor the GPIO line and\n" + "cannot simply rely on the interrupt handler reception.\n" + "\n" + "In the current implementation of the driver, irq_to_gpio() is used to\n" + "determine the GPIO number from the i2c_client's IRQ value.\n" + "\n" + "As irq_to_gpio() is not available on all platforms, this patch changes\n" + "this and makes the driver ignore the passed in IRQ. Instead, a GPIO is\n" + "added to the platform_data struct and gpio_to_irq is used to derive the\n" + "IRQ from that GPIO. If this fails, bail out. The driver is only able to\n" + "work in environments where the touchscreen GPIO can be mapped to an\n" + "IRQ.\n" + "\n" + "Signed-off-by: Daniel Mack <zonque@gmail.com>\n" + "---\n" + " drivers/input/touchscreen/eeti_ts.c | 21 +++++++++++++--------\n" + " include/linux/input/eeti_ts.h | 1 +\n" + " 2 files changed, 14 insertions(+), 8 deletions(-)\n" "\n" - "-------------- next part --------------\n" - "A non-text attachment was scrubbed...\n" - "Name: 0001-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch\n" - "Type: text/x-patch\n" - "Size: 3730 bytes\n" - "Desc: not available\n" - URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120808/9725df93/attachment.bin> + "diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c\n" + "index 503c709..908407e 100644\n" + "--- a/drivers/input/touchscreen/eeti_ts.c\n" + "+++ b/drivers/input/touchscreen/eeti_ts.c\n" + "@@ -48,7 +48,7 @@ struct eeti_ts_priv {\n" + " \tstruct input_dev *input;\n" + " \tstruct work_struct work;\n" + " \tstruct mutex mutex;\n" + "-\tint irq, irq_active_high;\n" + "+\tint irq_gpio, irq, irq_active_high;\n" + " };\n" + " \n" + " #define EETI_TS_BITDEPTH\t(11)\n" + "@@ -62,7 +62,7 @@ struct eeti_ts_priv {\n" + " \n" + " static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv)\n" + " {\n" + "-\treturn gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high;\n" + "+\treturn gpio_get_value(priv->irq_gpio) == priv->irq_active_high;\n" + " }\n" + " \n" + " static void eeti_ts_read(struct work_struct *work)\n" + "@@ -157,7 +157,7 @@ static void eeti_ts_close(struct input_dev *dev)\n" + " static int __devinit eeti_ts_probe(struct i2c_client *client,\n" + " \t\t\t\t const struct i2c_device_id *idp)\n" + " {\n" + "-\tstruct eeti_ts_platform_data *pdata;\n" + "+\tstruct eeti_ts_platform_data *pdata = client->dev.platform_data;\n" + " \tstruct eeti_ts_priv *priv;\n" + " \tstruct input_dev *input;\n" + " \tunsigned int irq_flags;\n" + "@@ -199,9 +199,12 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,\n" + " \n" + " \tpriv->client = client;\n" + " \tpriv->input = input;\n" + "-\tpriv->irq = client->irq;\n" + "+\tpriv->irq_gpio = pdata->irq_gpio;\n" + "+\tpriv->irq = gpio_to_irq(pdata->irq_gpio);\n" + " \n" + "-\tpdata = client->dev.platform_data;\n" + "+\terr = gpio_request_one(pdata->irq_gpio, GPIOF_IN, client->name);\n" + "+\tif (err < 0)\n" + "+\t\tgoto err1;\n" + " \n" + " \tif (pdata)\n" + " \t\tpriv->irq_active_high = pdata->irq_active_high;\n" + "@@ -215,13 +218,13 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,\n" + " \n" + " \terr = input_register_device(input);\n" + " \tif (err)\n" + "-\t\tgoto err1;\n" + "+\t\tgoto err2;\n" + " \n" + " \terr = request_irq(priv->irq, eeti_ts_isr, irq_flags,\n" + " \t\t\t client->name, priv);\n" + " \tif (err) {\n" + " \t\tdev_err(&client->dev, \"Unable to request touchscreen IRQ.\\n\");\n" + "-\t\tgoto err2;\n" + "+\t\tgoto err3;\n" + " \t}\n" + " \n" + " \t/*\n" + "@@ -233,9 +236,11 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,\n" + " \tdevice_init_wakeup(&client->dev, 0);\n" + " \treturn 0;\n" + " \n" + "-err2:\n" + "+err3:\n" + " \tinput_unregister_device(input);\n" + " \tinput = NULL; /* so we dont try to free it below */\n" + "+err2:\n" + "+\tgpio_free(pdata->irq_gpio);\n" + " err1:\n" + " \tinput_free_device(input);\n" + " \tkfree(priv);\n" + "diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h\n" + "index f875b31..16625d7 100644\n" + "--- a/include/linux/input/eeti_ts.h\n" + "+++ b/include/linux/input/eeti_ts.h\n" + "@@ -2,6 +2,7 @@\n" + " #define LINUX_INPUT_EETI_TS_H\n" + " \n" + " struct eeti_ts_platform_data {\n" + "+\tint irq_gpio;\n" + " \tunsigned int irq_active_high;\n" + " };\n" + " \n" + "-- \n" + 1.7.11.2 -af879f812237dcf98fa4838d5e6d2f87b4b591110378399ad757434293308488 +b7f35b1e5eba2b9e85ac68fe2e473da13dda5056dabf8570fb56cfc4713d8c53
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.