Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2545705rdh; Sun, 26 Nov 2023 10:02:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLGtMZbFdaIxLyAGQwir1fztvtuVrCedgG5AW2kPYX3yybkFWhlH1xZQigbmZ8JG2vj2u6 X-Received: by 2002:a17:903:11c8:b0:1cc:511d:eb43 with SMTP id q8-20020a17090311c800b001cc511deb43mr11947788plh.61.1701021775608; Sun, 26 Nov 2023 10:02:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701021775; cv=none; d=google.com; s=arc-20160816; b=Go07TDi8LsrfAJ+b4B7k0AuWeMVruocJN/uG7A0kp0dne9Hn11zgKdIWVbDAdrdbQl sD0f0oOzQ3R7MerMkJgnj54ITga0brTo+M0cvl/i+U6nrmiXDSbONGKVAmQOLOx7XO/g zBnpQzfONfBqQIoX+TpYg+UibqdPVzmObEQKtFvoBUDkt5foNEHRptlrh0XkAVG3NSZW SUEYRPIvp5e85VA3b543CdPUEi+XbrsbqfQKc3BzxzqnDTcokuufY2Azo1q+P21ZaTWD Llm0jRgboljzb8QEcEod5XdzXhtD3Dn5W3ZYa/ZJgDtX6NOvEYfRmwumZQFzIa+FhwWh HXrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=PbhJ98sNAHriOW35dnVZa+VMhWfxLTR/W9PYS++/LEk=; fh=Yh2HZ0ZAmdD965kUD+GPU8zRnPWQboZoD4Krie9mNbA=; b=OIk394pk36fELFgfYoAhink6Jvjc1ebBZ9C9OC2NckEAJ5tD/4uT+5UDR/TouTfowd Ka+yEhrXfF/oX8dhqhjEpuFFvQX/SuwdjvnceTEs8kjuNFHx9RyYZcrqnPylotY95myX 6ytNInQ+TtdQ7Kx2KWYsovad/eGbLjdsSVESjPqg0z+kvCxvI9EZ7Ec9RPWIAurN9UGi fFGxggzwdhOG02rGdebJZt0GM10f3oIxtAOd2Tm6GqJR6Xfxjq2XWNs3nk5TQudDPZ4s MjDpceyFv2Qtw95WCfpIlOA1oZO88RM3nayGhD7cjRVKm6gvktnzjPuE8gyGblbZHr+s /VVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a0hGpUYP; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id ba10-20020a170902720a00b001cfc42b3b65si1580399plb.422.2023.11.26.10.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 10:02:55 -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=@kernel.org header.s=k20201202 header.b=a0hGpUYP; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A648B8086509; Sun, 26 Nov 2023 10:02:52 -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 S230052AbjKZSCi (ORCPT + 99 others); Sun, 26 Nov 2023 13:02:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKZSCh (ORCPT ); Sun, 26 Nov 2023 13:02:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3FD9E6 for ; Sun, 26 Nov 2023 10:02:43 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84472C433C7; Sun, 26 Nov 2023 18:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701021763; bh=GrzOSbw6X34tTV7cToVm3nPcglrShd1HMJtSVI8K+7w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=a0hGpUYPpa3B4+9XVnw0i72bIpFlF7C52SHu7BHrG9CmZpv2FiAVWPfcfLbx+xcar Q+AMk3MrOE/HeOIWefDvukX5H7WW1EFHpGL8fk9Ejiw3WmhY6sGD4t5dNjj9qZ8JYk 8NsSOv/+TiN1lvxSxLAg9BBOrzOiMIa88Bo60yoKBtrl1uDtcu8SOx/B+pfIiX7hll VoXnk3Uyek/3Hm/g6jQaH2FD0WUzRalEsu7vS6NxTM5UUPaUr3OtzPKfKtvVEOmJ/C OIiTNB19VdOv7UPSsuEEEROi7tXct4y6FrrRmSTQrstaf0x7viZRBPMRGk2/83r/a8 wGIjrNB70/alA== Date: Sun, 26 Nov 2023 18:02:36 +0000 From: Jonathan Cameron To: Shreeya Patel Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, lars@metafoo.de Subject: Re: [PATCH] iio: light: ltrf216a: Return floating point values Message-ID: <20231126180236.4af26387@jic23-huawei> In-Reply-To: <06d3c2f7-50b4-b44d-fa75-8ca6a1a26d89@collabora.com> References: <20231107192005.285534-1-shreeya.patel@collabora.com> <06d3c2f7-50b4-b44d-fa75-8ca6a1a26d89@collabora.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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]); Sun, 26 Nov 2023 10:02:53 -0800 (PST) On Wed, 22 Nov 2023 01:05:41 +0530 Shreeya Patel wrote: > 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 :) Hi Shreeya, Getting there on catching up - for some reason this one didn't reach my inbox, but thankfully patchwork had it. Anyhow, applied to the togreg branch of iio.git and pushed out as testing for all the normal reasons. Thanks, Jonathan > > > 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); >