From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 855EAC3F68F for ; Mon, 30 Dec 2019 17:18:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67B342077B for ; Mon, 30 Dec 2019 17:18:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727236AbfL3RSH (ORCPT ); Mon, 30 Dec 2019 12:18:07 -0500 Received: from mga05.intel.com ([192.55.52.43]:29340 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727207AbfL3RSH (ORCPT ); Mon, 30 Dec 2019 12:18:07 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Dec 2019 09:18:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,376,1571727600"; d="scan'208";a="393292748" Received: from spandruv-desk.jf.intel.com ([10.54.75.31]) by orsmga005.jf.intel.com with ESMTP; 30 Dec 2019 09:18:06 -0800 Message-ID: <7830ad25a5cb7640e1da55c4278ce73c1ff3e0ad.camel@linux.intel.com> Subject: Re: Display got wrong rotation after hid_sensor_accel_3d is loaded From: Srinivas Pandruvada To: AceLan Kao , Bastien Nocera Cc: Jiri Kosina , Jonathan Cameron , linux-input@vger.kernel.org, linux-iio@vger.kernel.org Date: Mon, 30 Dec 2019 09:18:06 -0800 In-Reply-To: References: <9baeb165eddb4872fb701ff81f11692b7e153bf6.camel@hadess.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-3.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Hi Kao, Is this device sold with Windows? Can you send full report descriptor (You can get from /sys/kernel/debug/hid)? Thanks, Srinivas On Fri, 2019-12-27 at 10:30 +0800, AceLan Kao wrote: > Hi Bastien, > > Thanks for your suggestion. > I just tried to add the following line into > /lib/udev/hwdb.d/60-sensor.hwdb and got the correct screen rotation. > But the cursor is still un-rotated, the cursor is drawn upside down, > and its coordinates are inverted. > > ######################################### > # STMicro > ######################################### > sensor:modalias:platform:platform:HID-SENSOR-200073 > ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, 1 > > It looks like we should introduce a quirk into hid_sensor_accel_3d > driver. > There are 3 different scale variables in hid_sensor_accel_3d, but I > don't see any of them would work the way I want. > Do you mean to introduce new scale variables? > > drivers/iio/accel/hid-sensor-accel-3d.c:34: int > scale_pre_decml; > drivers/iio/accel/hid-sensor-accel-3d.c:35: int > scale_post_decml; > drivers/iio/accel/hid-sensor-accel-3d.c:36: int > scale_precision; > > Bastien Nocera 於 2019年12月26日 週四 下午11:03寫道: > > > > On Thu, 2019-12-26 at 17:22 +0800, AceLan Kao wrote: > > > Hi all, > > > > > > I'm working on a new platform which comes with an accelerator > > > meter. > > > It's a STMicroelectronics LSM6DS3US accelerator meter, it doesn't > > > use > > > st_sensors driver, but hid_sensor_accel_3d. > > > After hid_sensor_accel_3d is loaded, the display becomes upside > > > down, > > > so I tried to add some code to make it become normal.(ACCEL_X > > > should > > > have the same modification) > > > > > > I don't know how to fix this in a correct way, please give me > > > some > > > hints. > > > > This needs to be done as a quirk, either by applying a quirk for > > the > > HID descriptors (which should have a definition of the scale, which > > would be negative for this device), or in user-space in systemd's > > hwdb > > database, which your user-space consumers need to take care of: > > https://github.com/systemd/systemd/blob/master/hwdb.d/60-sensor.hwdb > > > > Cheers > >