Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1530784 > unrolled thread
| Started by | Antonio Borneo <borneo.antonio@gmail.com> |
|---|---|
| First post | 2016-11-26 23:00 +0100 |
| Last post | 2016-11-28 14:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH RFC] HID: cp2112: add IRQ chip handling Antonio Borneo <borneo.antonio@gmail.com> - 2016-11-26 23:00 +0100
Re: [PATCH RFC] HID: cp2112: add IRQ chip handling Jiri Kosina <jikos@kernel.org> - 2016-11-28 14:50 +0100
| From | Antonio Borneo <borneo.antonio@gmail.com> |
|---|---|
| Date | 2016-11-26 23:00 +0100 |
| Subject | Re: [PATCH RFC] HID: cp2112: add IRQ chip handling |
| Message-ID | <sHTaN-3Ec-5@gated-at.bofh.it> |
On Mon, Nov 21, 2016 at 12:07 PM, Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
> The GPIO part doesn't provide interrupts when GPIO are toggled.
> So use a polling mechanism if someone requests a GPIO as an IRQ.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
>
> I am currently running this patch in my local tree.
> It allows to attach a SMBus device completely on the CP2112, with a simple
> definition at the end of probe:
>
> {
> struct i2c_client *client;
> struct i2c_hid_platform_data pdata = {
> .hid_descriptor_address = 0x20,
> };
> struct i2c_board_info synaptics_info = {
> I2C_BOARD_INFO("hid", 0x2c),
> .platform_data = &pdata,
> };
> int irq = cp2112_allocate_irq(dev, 2);
>
> if (irq <= 0) {
> dev_err(dev->gc.parent, "Failed to translate GPIO to IRQ\n");
> goto err_sysfs_remove;
> }
>
> synaptics_info.irq = irq;
> irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW);
>
> hid_device_io_start(hdev);
>
> /* give time for the device to initialize */
> msleep(500);
>
> client = i2c_new_device(&dev->adap, &synaptics_info);
> if (!client)
> hid_err(hdev, "failed allocating Synaptics device\n");
>
> }
>
> I wonder if we want to consider this upstream, given that the driver is only
> used for development.
Ciao Benjamin,
for me it makes sense to push it upstream.
I also coded something similar 2+ years ago, but then my cp2112 got
broken before I could clean-up and submit the patches.
As far as I remember, Ellen was using cp2112 in a system in production.
For sure this driver is not widely used, but definitively it's not for
development use only.
Best Regards
Antonio
[toc] | [next] | [standalone]
| From | Jiri Kosina <jikos@kernel.org> |
|---|---|
| Date | 2016-11-28 14:50 +0100 |
| Message-ID | <sIutI-2IY-43@gated-at.bofh.it> |
| In reply to | #1530784 |
On Sat, 26 Nov 2016, Antonio Borneo wrote:
> > I am currently running this patch in my local tree.
> > It allows to attach a SMBus device completely on the CP2112, with a simple
> > definition at the end of probe:
> >
> > {
> > struct i2c_client *client;
> > struct i2c_hid_platform_data pdata = {
> > .hid_descriptor_address = 0x20,
> > };
> > struct i2c_board_info synaptics_info = {
> > I2C_BOARD_INFO("hid", 0x2c),
> > .platform_data = &pdata,
> > };
> > int irq = cp2112_allocate_irq(dev, 2);
> >
> > if (irq <= 0) {
> > dev_err(dev->gc.parent, "Failed to translate GPIO to IRQ\n");
> > goto err_sysfs_remove;
> > }
> >
> > synaptics_info.irq = irq;
> > irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW);
> >
> > hid_device_io_start(hdev);
> >
> > /* give time for the device to initialize */
> > msleep(500);
> >
> > client = i2c_new_device(&dev->adap, &synaptics_info);
> > if (!client)
> > hid_err(hdev, "failed allocating Synaptics device\n");
> >
> > }
> >
> > I wonder if we want to consider this upstream, given that the driver is only
> > used for development.
>
> Ciao Benjamin,
>
> for me it makes sense to push it upstream.
> I also coded something similar 2+ years ago, but then my cp2112 got
> broken before I could clean-up and submit the patches.
> As far as I remember, Ellen was using cp2112 in a system in production.
> For sure this driver is not widely used, but definitively it's not for
> development use only.
I've queued this in for-4.10/cp2112. Thanks,
--
Jiri Kosina
SUSE Labs
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web