linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: daniel.leung@linux.intel.com
To: jkosina@suse.cz, srinivas.pandruvada@intel.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Daniel Leung <daniel.leung@linux.intel.com>
Subject: [PATCH] HID: hid-sensor-hub: do not process feature reports in raw_event
Date: Thu, 21 Mar 2013 10:22:26 -0700	[thread overview]
Message-ID: <1363886546-6517-1-git-send-email-daniel.leung@linux.intel.com> (raw)

From: Daniel Leung <daniel.leung@linux.intel.com>

In sensor_hub_raw_event(), HID feature reports are ignored but are
still marked as processed. This causes the in-kernel struct not to be
updated. Any non-updated fields in the feature reports are zero, and
they are being sent to the device. This causes confusion in the
sensor hub firmware, and some sensors are not powered up as a result.

This changes the raw_event rountine to only process input reports,
and let the hid core handle the incoming feature reports.

The issue has been observed on Acer Iconia W700.

Signed-off-by: Daniel Leung <daniel.leung@linux.intel.com>
---
 drivers/hid/hid-sensor-hub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index ca749810..3f7df68 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -413,7 +413,7 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
 			 report->id, size, report->type);
 	hid_dbg(hdev, "maxfield:%d\n", report->maxfield);
 	if (report->type != HID_INPUT_REPORT)
-		return 1;
+		return 0;
 
 	ptr = raw_data;
 	ptr++; /*Skip report id*/
-- 
1.8.1.5


             reply	other threads:[~2013-03-21 17:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 17:22 daniel.leung [this message]
2013-03-25 15:45 ` [PATCH] HID: hid-sensor-hub: do not process feature reports in raw_event Srinivas Pandruvada
2013-03-27 15:09   ` Jiri Kosina
2013-04-04  7:48     ` Jiri Kosina
2013-04-08 16:54     ` Daniel Leung
2013-04-09 23:55       ` Daniel Leung
2013-04-10 15:44         ` Srinivas Pandruvada
2013-05-29 14:19           ` 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=1363886546-6517-1-git-send-email-daniel.leung@linux.intel.com \
    --to=daniel.leung@linux.intel.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.pandruvada@intel.com \
    /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).