Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp628395rdf; Tue, 21 Nov 2023 11:36:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFv8fhmX4Ixkji1dV8+DztcX3MbgHWybBnKbpPeYTfObuFgo9RIbOJ5GxiSWKFa1uoKAcrY X-Received: by 2002:a05:6a20:1611:b0:18a:be:9c99 with SMTP id l17-20020a056a20161100b0018a00be9c99mr19087pzj.18.1700595405451; Tue, 21 Nov 2023 11:36:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700595405; cv=none; d=google.com; s=arc-20160816; b=o3pzmySxpn/6Cdeo16atmqKNBE3o4Xzom4/1KD3etja4EJKNitHkqcD14brbuyLqG2 L0PFvJYQHdxp2kvNVlVf2JDS6foPehJ074TVrFndj2Qjn+QWvFBtMnVFDVTx4oh+G3Le 2c2Kqo02qT+3QuXYs/B9sN05ihiOq3WxAMbYGNvl1BtYMZ3xegtva8P3xFl8iiYkIk8w iFfZqUlTZ5t8EAw0rAyH3lXvxAEp9sCrJfDeeszLuY5unSa3UANIVERAQGP1G1obxRin tsX5PjxAgkwEwTt79Zt9LohjOT5ZQCqmetUx8Pi3GaQ1EGdjhCfTJlzn1CnFEjs6/Tov I5zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=aawMG37Q4axd33VUaKMO++RGYNzZ2KNvegWDH2MQdnI=; fh=p1ZMTtsDsQiii+G9+zxIuuM0uDewcTNul8lR4mrbPsU=; b=ozU1J823PVpRjz+MfHUF1vmQ3usZoKu+Bx4tGGDAL1yoej1shTGRVNI+qf64GtjieX PNDuTFZIwuojzCYQyMLHCakWI6DgomYPuNaOUDfj2M+BEeXKAThAtum1bE3Q96sctDKz D7RqZ8285V+noJtiOGQzxwdBcB5HVtfMOO6Bre2WMHiXmJwDJE0GAbog/RiiOe2YmFjU GQfBawG0AU6WPZO5O9MeCUB/vOYa8gYY867NtUWLdRo0/ZYMQX+Ch7fI4ON6lJ5SN0OY 9KILn+cq9c2BorUMN7C7e4e1Ooe+UqsrltjpmI/cS78uC6OUIRS0N4YRE3xCmY2wRoBS Rkzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=FXyvXTAY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u24-20020a634718000000b005ac9ae1aaa6si11088018pga.334.2023.11.21.11.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 11:36:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=FXyvXTAY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0B96080C3A2D; Tue, 21 Nov 2023 11:36:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229514AbjKUTfx (ORCPT + 99 others); Tue, 21 Nov 2023 14:35:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjKUTfx (ORCPT ); Tue, 21 Nov 2023 14:35:53 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFFF6191; Tue, 21 Nov 2023 11:35:49 -0800 (PST) Received: from [100.117.177.39] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: shreeya) by madras.collabora.co.uk (Postfix) with ESMTPSA id 4B2AA6602F3D; Tue, 21 Nov 2023 19:35:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700595348; bh=/VVJWABCA7OL+A9POx+GinmD39+Xcj9nJKZjqipf/BM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FXyvXTAY5u5vyGIr9fOEpnrHF2cv5bq9yC3SaO0eKxQZosbVe5MW9BQ/mxuRsaBQj 9K/WM8nrvt9Z8lHOz+9JKYBtQVGjsA9ZTVLJD7a8a6vw+Jdohsp1BVtuZIJ4m1X3kH Qug3PUYCRChei4tWj8eW8otT5kwtNhHh9Q3X7qXXLYQoqIfof0Gy6FvKT8w8mKtDpd +Bd23TWMx7WrWnx5QHrddDoySQCRTMag753bpIVXYbx8/Q6n1RG95jviuPyFsRyokC upnWkL3JNdEHyUmP2xtgAvty5imYK7H52y82pLRaq8beacvoeVoY7LkP5IPSamKwq0 f86E78pJjLEUA== Message-ID: <06d3c2f7-50b4-b44d-fa75-8ca6a1a26d89@collabora.com> Date: Wed, 22 Nov 2023 01:05:41 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] iio: light: ltrf216a: Return floating point values To: jic23@kernel.org Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, lars@metafoo.de References: <20231107192005.285534-1-shreeya.patel@collabora.com> Content-Language: en-US From: Shreeya Patel In-Reply-To: <20231107192005.285534-1-shreeya.patel@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 11:36:34 -0800 (PST) On 08/11/23 00:50, Shreeya Patel wrote: > For better precision of input light intesity, return floating point > values through sysfs instead of an integer value Hi Jonathan, Gentle ping for this patch. I am not sure if you got time to look at the patches after LPC but just making sure it doesn't get lost between bunch of others :) Thanks, Shreeya Patel > > Signed-off-by: Shreeya Patel > --- > drivers/iio/light/ltrf216a.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/iio/light/ltrf216a.c b/drivers/iio/light/ltrf216a.c > index 8de4dd849936..68dc48420a88 100644 > --- a/drivers/iio/light/ltrf216a.c > +++ b/drivers/iio/light/ltrf216a.c > @@ -234,7 +234,7 @@ static int ltrf216a_read_data(struct ltrf216a_data *data, u8 addr) > static int ltrf216a_get_lux(struct ltrf216a_data *data) > { > int ret, greendata; > - u64 lux, div; > + u64 lux; > > ret = ltrf216a_set_power_state(data, true); > if (ret) > @@ -246,10 +246,9 @@ static int ltrf216a_get_lux(struct ltrf216a_data *data) > > ltrf216a_set_power_state(data, false); > > - lux = greendata * 45 * LTRF216A_WIN_FAC * 100; > - div = data->als_gain_fac * data->int_time_fac * 100; > + lux = greendata * 45 * LTRF216A_WIN_FAC; > > - return div_u64(lux, div); > + return lux; > } > > static int ltrf216a_read_raw(struct iio_dev *indio_dev, > @@ -279,7 +278,8 @@ static int ltrf216a_read_raw(struct iio_dev *indio_dev, > if (ret < 0) > return ret; > *val = ret; > - return IIO_VAL_INT; > + *val2 = data->als_gain_fac * data->int_time_fac; > + return IIO_VAL_FRACTIONAL; > case IIO_CHAN_INFO_INT_TIME: > mutex_lock(&data->lock); > ret = ltrf216a_get_int_time(data, val, val2);