Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753107AbdIXWAh (ORCPT ); Sun, 24 Sep 2017 18:00:37 -0400 Received: from mail-out-1.itc.rwth-aachen.de ([134.130.5.46]:16434 "EHLO mail-out-1.itc.rwth-aachen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752939AbdIXWAf (ORCPT ); Sun, 24 Sep 2017 18:00:35 -0400 X-IronPort-AV: E=Sophos;i="5.42,433,1500933600"; d="scan'208";a="14865883" From: =?UTF-8?q?Stefan=20Br=C3=BCns?= To: CC: Rob Herring , Peter Meerwald-Stadler , =?UTF-8?q?Stefan=20Br=C3=BCns?= , , Manivannan Sadhasivam , Lars-Peter Clausen , "Jonathan Cameron" , Hartmut Knaack Subject: [PATCH v3 0/4] Currently, the vl6180 driver reports bogus in_illuminance_scale values Date: Sun, 24 Sep 2017 23:59:16 +0200 X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [77.182.212.37] X-ClientProxiedBy: rwthex-s3-b.rwth-ad.de (2002:8682:1aa1::8682:1aa1) To rwthex-w2-a.rwth-ad.de (2002:8682:1a9e::8682:1a9e) Message-ID: <4c228333-df88-4fd4-86f7-90a7668a3ac3@rwthex-w2-a.rwth-ad.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 924 Lines: 28 when the integration time or hardware gain are changed from its default value, i.e. it always reports a fixed value. To avoid readback of the register values in case integration time, gain or scale is queried, save the register values. Use the saved values to report the correct scale value. Changes in v3: - Drop whitespace change - Use IIO_VAL_FRACTIONAL for integration time return value Changes in v2: - Removed redundant parenthesis - Add missing spaces Stefan BrĂ¼ns (4): iio: light: vl6180: Move range check to integration time setter, cleanup iio: light: vl6180: Avoid readback of integration time register iio: light: vl6180: Cleanup als_gain lookup, avoid register readback iio: light: vl6180: Correct ALS scale for non-default gain/integration time drivers/iio/light/vl6180.c | 126 +++++++++++++++++++++++++-------------------- 1 file changed, 69 insertions(+), 57 deletions(-) -- 2.14.1