Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7461813ybi; Thu, 1 Aug 2019 08:31:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXbADJZ3xGHx2Y5p+n3jZRMJMnK/VorYL2G0BJWf5jB7EFuWna4yWmHEJbDI0K1V+YJCOV X-Received: by 2002:a62:64d4:: with SMTP id y203mr53781385pfb.91.1564673506426; Thu, 01 Aug 2019 08:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564673506; cv=none; d=google.com; s=arc-20160816; b=YGkgaK+SIKKI+r7yXhP2S7jx4X6+HjKoMqWDN5GR9tMDoDGvYK693mMCwW+r9VSpvn 5ZbIZAgd8Bx50HIwg7s3tDAQcw5jF2ygIUef54m0jL555yO2SlGN785Q94PY5o3rO83o sHDe9bvX9tECcLPb58HBSWFjwE8sP8dRWJMiNIo2Azt4NFUkSDVW70LhzBIuVMQQNgi6 1szRW0VyH9YjQaoBmwyosEQhgzQf99CtsRwSi1l2tucz9A0wGc6vDafbpkWURmua9T7V gODpi91J7h7dRUZJMwdLMP5K/JdKNNC9YwsigalcJdR4QoHYc8VC7160AxMFZbOIhCPO QLXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id:date :subject:cc:to:from; bh=HnhFfMRMsJ/m3vbperlTZyxKmc+YiOBsE34+PiomgvA=; b=R3ykObjLiyoaWh+2lZhKuOVFgOYZLesjesCAmRQvbwm5mH8ZCTFwKjy6OrVDvtc9NF P544YMJLWhBwFJaW+DnqUBBR/4K3lwwcseDeKzBIPpNEKCFqeTz0ig92jhV1gNA5C+tC ZkIXYaUUT24wYV0HkXwdp0RbImak1y5GgKWu5fWOVfZ9n4B38Zf9qJX2AOlxkNzxIexn uKPDSbhduDlcAqccNg/Db5myqRf1za4/0GEG6AyqHSzar2VCOkmNmi4qm/lZUb3pLLsa UuGQYvVFzhcTzmyXnOK8UqdroSSPZJe//xQeYbe2li+My8KR0NtMZHvGOjcprT+M58bo 0qEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k193si33491788pge.330.2019.08.01.08.31.30; Thu, 01 Aug 2019 08:31:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731588AbfHAOja (ORCPT + 99 others); Thu, 1 Aug 2019 10:39:30 -0400 Received: from comms.puri.sm ([159.203.221.185]:54674 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbfHAOj3 (ORCPT ); Thu, 1 Aug 2019 10:39:29 -0400 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 29B3EE0F66; Thu, 1 Aug 2019 07:39:29 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FG_DbJrd2E_C; Thu, 1 Aug 2019 07:39:28 -0700 (PDT) From: Martin Kepplinger To: lorenzo.bianconi83@gmail.com, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kepplinger Subject: [PATCH] iio: imu: st_lsm6dsx: make IIO_CHAN_INFO_SCALE shared by type Date: Thu, 1 Aug 2019 16:39:08 +0200 Message-Id: <20190801143908.27608-1-martin.kepplinger@puri.sm> Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org in_accel_x_scale, in_accel_y_scale and in_accel_z_scale are always the same. The scale is still defined to be in "info_mask_separate". Userspace (iio-sensor-proxy and others) is not used to that and only looks for "in_accel_scale" for the scaling factor to apply. Change IIO_CHAN_INFO_SCALE from being separate in all channel to be shared by type. This removes in_accel_x_scale, in_accel_y_scale and in_accel_z_scale and makes available in_accel_scale. Signed-off-by: Martin Kepplinger --- AFAIK in all other drivers, IIO_CHAN_INFO_SCALE is "shared by type". Sure devices are different, but LSM6DSX devices still don't have different scales for x/y/z channels :) thanks, martin drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h index af379a5429ed..59c3ab7cbb6f 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h @@ -56,8 +56,8 @@ enum st_lsm6dsx_hw_id { .address = addr, \ .modified = 1, \ .channel2 = mod, \ - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ - BIT(IIO_CHAN_INFO_SCALE), \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_index = scan_idx, \ .scan_type = { \ -- 2.20.1