mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@enac.fr>
To: Stephane Chatty <chatty@enac.fr>,
	Henrik Rydberg <rydberg@euromail.se>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Jiri Kosina <jkosina@suse.cz>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Subject: [RFC v2 01/10] hid: add feature_mapping callback
Date: Wed,  5 Jan 2011 18:27:39 +0100	[thread overview]
Message-ID: <1294248468-19979-2-git-send-email-benjamin.tissoires@enac.fr> (raw)
In-Reply-To: <1294248468-19979-1-git-send-email-benjamin.tissoires@enac.fr>

Currently hid doesn't export the features it knows to the specific modules.
Some information can be really important in such features: MosArt and
Cypress devices are by default not in a multitouch mode.
We have to send the value 2 on the right feature.

This patch exports to the module the features report so they can find the
right feature to set up the correct mode.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
---
 drivers/hid/hid-input.c |   10 +++++++++-
 include/linux/hid.h     |    4 ++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index bb0b365..07d8cb2 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -287,6 +287,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		goto ignore;
 	}
 
+	if (field->report_type == HID_FEATURE_REPORT) {
+		if (device->driver->feature_mapping) {
+			device->driver->feature_mapping(device, hidinput, field,
+                                usage);
+		}
+		goto ignore;
+	}
+
 	if (device->driver->input_mapping) {
 		int ret = device->driver->input_mapping(device, hidinput, field,
 				usage, &bit, &max);
@@ -836,7 +844,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
 	struct hid_input *hidinput = NULL;
 	struct input_dev *input_dev;
 	int i, j, k;
-	int max_report_type = HID_OUTPUT_REPORT;
+	int max_report_type = HID_FEATURE_REPORT;
 
 	INIT_LIST_HEAD(&hid->inputs);
 
diff --git a/include/linux/hid.h b/include/linux/hid.h
index bb0f56f..75303b0 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -593,6 +593,7 @@ struct hid_usage_id {
  * @report_fixup: called before report descriptor parsing (NULL means nop)
  * @input_mapping: invoked on input registering before mapping an usage
  * @input_mapped: invoked on input registering after mapping an usage
+ * @feature_mapping: invoked on feature registering
  * @suspend: invoked on suspend (NULL means nop)
  * @resume: invoked on resume if device was not reset (NULL means nop)
  * @reset_resume: invoked on resume if device was reset (NULL means nop)
@@ -636,6 +637,9 @@ struct hid_driver {
 	int (*input_mapped)(struct hid_device *hdev,
 			struct hid_input *hidinput, struct hid_field *field,
 			struct hid_usage *usage, unsigned long **bit, int *max);
+	void (*feature_mapping)(struct hid_device *hdev,
+ 			struct hid_input *hidinput, struct hid_field *field,
+ 			struct hid_usage *usage);
 #ifdef CONFIG_PM
 	int (*suspend)(struct hid_device *hdev, pm_message_t message);
 	int (*resume)(struct hid_device *hdev);
-- 
1.7.3.4


  reply	other threads:[~2011-01-05 17:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-05 17:27 [RFC v2 0/10] hid-multitouch: a first step towards multitouch unification Benjamin Tissoires
2011-01-05 17:27 ` Benjamin Tissoires [this message]
2011-01-06 16:22   ` [RFC v2 01/10] hid: add feature_mapping callback Henrik Rydberg
2011-01-07  9:44     ` Benjamin Tissoires
2011-01-07 10:18       ` Henrik Rydberg
2011-01-07 11:12         ` Benjamin Tissoires
2011-01-05 17:27 ` [RFC v2 02/10] hid: set HID_MAX_FIELD at 128 Benjamin Tissoires
2011-01-06 16:28   ` Henrik Rydberg
2011-01-05 17:27 ` [RFC v2 03/10] hid-multitouch: support for PixCir-based panels Benjamin Tissoires
2011-01-06 17:25   ` Henrik Rydberg
2011-01-07  9:38     ` Benjamin Tissoires
2011-01-07 12:23       ` Henrik Rydberg
2011-01-07 15:12         ` Benjamin Tissoires
2011-01-07 15:57           ` Henrik Rydberg
2011-01-07 17:07             ` Benjamin Tissoires
2011-01-07 17:27               ` Henrik Rydberg
2011-01-07 17:31                 ` Benjamin Tissoires
2011-01-05 17:27 ` [RFC v2 04/10] hid-multitouch: migrated support for Cando panels Benjamin Tissoires
2011-01-05 17:27 ` [RFC v2 05/10] hid-multitouch: Add support for Cando 10.1" panels Benjamin Tissoires
2011-01-05 17:27 ` [RFC v2 06/10] hid-multitouch: added support for Cypress TrueTouch panels Benjamin Tissoires
2011-01-05 17:27 ` [RFC v2 07/10] hid-multitouch: migrated support for MosArt panels Benjamin Tissoires
2011-01-05 17:27 ` [RFC v2 08/10] hid-multitouch: migrated support for Quanta dual-touch panels Benjamin Tissoires
2011-01-05 17:27 ` [RFC v2 09/10] hid-mulitouch: added support for the 'Sensing Win7-TwoFinger' Benjamin Tissoires
2011-01-05 17:27 ` [RFC v2 10/10] hid-multitouch: migrated support for Stantum panels Benjamin Tissoires
2011-01-05 17:49 ` [RFC v2 0/10] hid-multitouch: a first step towards multitouch unification Henrik Rydberg
2011-01-06 15:08   ` Benjamin Tissoires
2011-01-06 15:11     ` Jiri Kosina
2011-01-06 16:04       ` Henrik Rydberg
2011-01-06 16:08         ` Benjamin Tissoires
2011-01-06 17:28           ` Henrik Rydberg
2011-01-06 23:26           ` Jiri Kosina
2011-01-07  1:14       ` Dmitry Torokhov
2011-01-07  9:41         ` Jiri Kosina
2011-01-07  9:48           ` Benjamin Tissoires
2011-01-07 10:03             ` 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=1294248468-19979-2-git-send-email-benjamin.tissoires@enac.fr \
    --to=benjamin.tissoires@enac.fr \
    --cc=chatty@enac.fr \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rydberg@euromail.se \
    /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

all inboxes | Powered by JetHome®