linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Borneo <borneo.antonio@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Ellen Wang <ellen@cumulusnetworks.com>,
	David Barksdale <dbarksdale@uplogix.com>,
	Jiri Kosina <jikos@kernel.org>,
	linux-input <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC] HID: cp2112: add IRQ chip handling
Date: Sat, 26 Nov 2016 22:57:10 +0100	[thread overview]
Message-ID: <CAAj6DX28iTuSxs5igUXJc3SoXPmdPwpf_ZQ98vaqfpKSum6G0A@mail.gmail.com> (raw)
In-Reply-To: <1479726474-31532-1-git-send-email-benjamin.tissoires@redhat.com>

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

  reply	other threads:[~2016-11-26 21:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 11:07 [PATCH RFC] HID: cp2112: add IRQ chip handling Benjamin Tissoires
2016-11-26 21:57 ` Antonio Borneo [this message]
2016-11-28 13:45   ` Jiri Kosina

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=CAAj6DX28iTuSxs5igUXJc3SoXPmdPwpf_ZQ98vaqfpKSum6G0A@mail.gmail.com \
    --to=borneo.antonio@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dbarksdale@uplogix.com \
    --cc=ellen@cumulusnetworks.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 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).