linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bibek Basu <bbasu@nvidia.com>
To: benjamin.tissoires@gmail.com
Cc: linux-tegra@vger.kernel.org, jkosina@suse.cz, kadduri@nvidia.com,
	linux-input@vger.kernel.org, Bibek Basu <bbasu@nvidia.com>
Subject: [PATCH] HID: i2c-hid: add platform data for quirks
Date: Thu, 3 Oct 2013 14:18:41 +0530	[thread overview]
Message-ID: <1380790121-1355-1-git-send-email-bbasu@nvidia.com> (raw)

Some HID device does not responds to INPUT/FEATURE
report query during initialization. As a result HID driver
throws error even when its not mandatory according to the
HID specification. Add platform data to provide
quirk information to the driver so that init query is not
done on such devices.

Signed-off-by: Bibek Basu <bbasu@nvidia.com>
---
 drivers/hid/i2c-hid/i2c-hid.c | 1 +
 include/linux/i2c/i2c-hid.h   | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index fd7ce37..a7aec2c 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -1017,6 +1017,7 @@ static int i2c_hid_probe(struct i2c_client *client,
 	hid->version = le16_to_cpu(ihid->hdesc.bcdVersion);
 	hid->vendor = le16_to_cpu(ihid->hdesc.wVendorID);
 	hid->product = le16_to_cpu(ihid->hdesc.wProductID);
+	hid->quirks = platform_data->quirks;
 
 	snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX",
 		 client->name, hid->vendor, hid->product);
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h
index 7aa901d..12e682d 100644
--- a/include/linux/i2c/i2c-hid.h
+++ b/include/linux/i2c/i2c-hid.h
@@ -17,7 +17,7 @@
 /**
  * struct i2chid_platform_data - used by hid over i2c implementation.
  * @hid_descriptor_address: i2c register where the HID descriptor is stored.
- *
+ * @quirks: quirks, if any for i2c-hid devices
  * Note that it is the responsibility of the platform driver (or the acpi 5.0
  * driver, or the flattened device tree) to setup the irq related to the gpio in
  * the struct i2c_board_info.
@@ -31,6 +31,7 @@
  */
 struct i2c_hid_platform_data {
 	u16 hid_descriptor_address;
+	u32 quirks;
 };
 
 #endif /* __LINUX_I2C_HID_H */
-- 
1.8.1.5


             reply	other threads:[~2013-10-03  8:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-03  8:48 Bibek Basu [this message]
2013-10-09 10:26 ` [PATCH] HID: i2c-hid: add platform data for quirks Jiri Kosina
     [not found]   ` <alpine.LNX.2.00.1310091225230.13289-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2013-10-09 10:59     ` Benjamin Tissoires
2013-10-15  5:21       ` Bibek Basu

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=1380790121-1355-1-git-send-email-bbasu@nvidia.com \
    --to=bbasu@nvidia.com \
    --cc=benjamin.tissoires@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=kadduri@nvidia.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-tegra@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).