From patchwork Mon Jul 17 19:58:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: srinivas pandruvada X-Patchwork-Id: 9846023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C418B60212 for ; Mon, 17 Jul 2017 19:58:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6DCC26CFF for ; Mon, 17 Jul 2017 19:58:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB8622844E; Mon, 17 Jul 2017 19:58:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35C6326CFF for ; Mon, 17 Jul 2017 19:58:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751340AbdGQT60 (ORCPT ); Mon, 17 Jul 2017 15:58:26 -0400 Received: from mga01.intel.com ([192.55.52.88]:48355 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbdGQT6Z (ORCPT ); Mon, 17 Jul 2017 15:58:25 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2017 12:58:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,375,1496127600"; d="scan'208";a="1173608315" Received: from spandruv-mobl3.jf.intel.com ([10.254.39.219]) by fmsmga001.fm.intel.com with ESMTP; 17 Jul 2017 12:58:15 -0700 Message-ID: <1500321494.21514.29.camel@linux.intel.com> Subject: Re: [PATCH] HID: Add quirk for Lenovo Yoga 910 with ITE Chips From: Srinivas Pandruvada To: Patrick Pedersen , jikos@kernel.org Cc: benjamin.tissoires@redhat.com, jic23@kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Date: Mon, 17 Jul 2017 12:58:14 -0700 In-Reply-To: <20170715122721.6908-1-ctx.xda@gmail.com> References: <20170715122721.6908-1-ctx.xda@gmail.com> X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) Mime-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, 2017-07-15 at 14:27 +0200, Patrick Pedersen wrote: > As with previous generations of this device (see https://patchwork.ke > rnel.org/patch/7887361/), the ITE > HID Sensor Hub, responsible for the accelerometer and als sensor, > requires a quirk entry. I want to get rid of these quirks as this is now the defacto standard. Can you try with this change without any quirk.                         return 0; Thanks, Srinivas > > Without the entry, the Sensor Hub can't be accessed and the kernel > fails to report any movements. As a result > iio-sensor-proxy receives no new data. > > It shall additionally be noted that the i2c-hid 'sleep' bug (present > since kernel ver. 4.3) > still affects the driver. This means that the sensor hub will not > report any movement, until > the device is suspended and resumed. > > Signed-off-by: Patrick Pedersen > --- >  drivers/hid/hid-ids.h        | 1 + >  drivers/hid/hid-sensor-hub.c | 3 +++ >  2 files changed, 4 insertions(+) > > diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h > index 4f9a3938189a..b427a0bcfbe8 100644 > --- a/drivers/hid/hid-ids.h > +++ b/drivers/hid/hid-ids.h > @@ -565,6 +565,7 @@ >  #define USB_DEVICE_ID_ITE_LENOVO_YOGA   0x8386 >  #define USB_DEVICE_ID_ITE_LENOVO_YOGA2  0x8350 >  #define USB_DEVICE_ID_ITE_LENOVO_YOGA900 0x8396 > +#define USB_DEVICE_ID_ITE_LENOVO_YOGA910 0x8186 >   >  #define USB_VENDOR_ID_JABRA 0x0b0e >  #define USB_DEVICE_ID_JABRA_SPEAK_410 0x0412 > diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor- > hub.c > index 4ef73374a8f9..85b8425483bd 100644 > --- a/drivers/hid/hid-sensor-hub.c > +++ b/drivers/hid/hid-sensor-hub.c > @@ -820,6 +820,9 @@ static const struct hid_device_id > sensor_hub_devices[] = { >   { HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, > USB_VENDOR_ID_ITE, >   USB_DEVICE_ID_ITE_LENOVO_YOGA900), >   .driver_data = HID_SENSOR_HUB_ENUM_QUIRK}, > + { HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, > USB_VENDOR_ID_ITE, > + USB_DEVICE_ID_ITE_LENOVO_YOGA910), > + .driver_data = HID_SENSOR_HUB_ENUM_QUIRK}, >   { HID_DEVICE(HID_BUS_ANY, HID_GROUP_SENSOR_HUB, > USB_VENDOR_ID_INTEL_0, >   0x22D8), >   .driver_data = HID_SENSOR_HUB_ENUM_QUIRK}, --- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index 16ade0a..1fb407f 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c @@ -110,6 +110,9 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state)         int report_val;         s32 poll_value = 0;   +       st->power_state.logical_minimum = 1; +       st->report_state.logical_minimum = 1; +         if (state) {                 if (!atomic_read(&st->user_requested_state))