Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp446415lqj; Sun, 2 Jun 2024 06:04:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpN4i0MxaCILbSM7Z8jQhRw8sN9rIzqfShUKzINUiqqtFt19OaxNqAgSscq4uhinQ2fCO31+kzHhUKxffPgvfZGFiITdPyJjC2R8UuQQ== X-Google-Smtp-Source: AGHT+IFGTwj9Zs6EGfEL7ebQUqFFllHlr/D+E0XEnXv1LHx21jzyKEFIXLFjVnkEctBKrRlTcOK6 X-Received: by 2002:a05:6a20:9183:b0:1af:fb2c:fac9 with SMTP id adf61e73a8af0-1b26f121a91mr8907033637.20.1717333467050; Sun, 02 Jun 2024 06:04:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717333467; cv=pass; d=google.com; s=arc-20160816; b=fMPLvkVUcXkjca8zy/cL9RsTI7GKnLqBiNpLrHTn8gx3xzah8r4vuhB7+nil0I0W2y XHJjhHqX9TrpWMkV0VAIM1YpPde9TONZc0BvDYZe6ZF+7aMnZDZ9DQuvp6Hd4W50MmNr 9I7aY9EX8dHgTYYiNbihdfXUpqyTehgGnWuIwuL0Bp8y2vD8I2LmhVV/kjzrXOa6kK9G sE8l8UKSOWP4ji2aXO3EhbVSHLomCxTEiXY55hFacxxsKvyrwiqj+Fwc7hYUCu9Ff9iZ OmgNUMiPL0YzQWHfJG3W+H1OMGK25ExPeg2C/0qf7rgDbm6HQFqinXl0BO2dUgE8sAk/ w3Uw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=aYKjK43OzDBbUukGhWckTXeAegwIZ6dgFyoZJz85v0Q=; fh=xjsdCYuomEJyS1EkfNUc5fKtF34cXQ1mOBn36d3R9dU=; b=fReemsd5zXsgUA1WbV9wzGzBzCtD9erZzRjjrkY4jPb3oXKrbizf6MDYfxeYO4RpCE 1OsPpnHuYNtcD4Ci5C2tcB+RGfBEOgTDTX9teE1/1oFa/ZL2cEq0TCkoYP8RvhukKT+M zqDnm2JYqqTz0G4/Arjs93YnqmEC128dA91jL9bGvTsUUmFaYR1KLDX8ZWP6L8MwkkgU 7t7WE09YyLE6wDid6N3arVWEWCv0ptQ0HCrj1pWGbgztlEWjNMnjHA86AEO/knFY5RmH 2PaRVCrVGseycCckXSERcqlXrTOJ6amBThMrGEz5vtSwA6AFRz5oF8IMjV38wEFqge72 Oj9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DtbxBYMc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-198247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-70249f77be2si4405392b3a.121.2024.06.02.06.04.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 06:04:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DtbxBYMc; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-198247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E6264B20B64 for ; Sun, 2 Jun 2024 13:04:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9798E3BBC1; Sun, 2 Jun 2024 13:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DtbxBYMc" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC55538385; Sun, 2 Jun 2024 13:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717333455; cv=none; b=ENqRV8JLRGG6+pGBknonVu5zzW84P9LR6lITZk7Fy4orAgPkiwmVQ34T7ZLX/rWwa6rudnX5WIlXPj4wWdanwOSJhybFGu7QmMBXONtBkn4CT+4cSaWSNpmEfqbYc2umjRpaKXH4RiugL/6iYeIJucUeEdRnQ9mzZdx2mV7FWNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717333455; c=relaxed/simple; bh=6kOdU4pa/axOKVqqBYDd13ehS/HE8WpaiUQmEES9AUE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HI7Ixo2QUC0gfhflgNZzTQRrjmuUFyTOmhEBOj6GaaKJ9IiOB96dgijJOcE7plB4NHlhr4zWxPUKphJmUGDyZYZCZYcykZzlj+cMefuLrnur7yFuC8oOE8IsC04X6Sd+ZSDH32BMuPIi+Kn6f3o2diMNTrsyn0Xe9tHLM0XY+4M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DtbxBYMc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B77FBC2BBFC; Sun, 2 Jun 2024 13:04:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717333455; bh=6kOdU4pa/axOKVqqBYDd13ehS/HE8WpaiUQmEES9AUE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DtbxBYMcikdPVSqtbqX1q6AEk+wiUclkV4istu38JQpAgCJKp4CeKufWy7GDaRVjq 23NXCOMk2+UnIa+zL2xMdXAO4Dxlf7F7795kwZbS6Iw3g9kTVjf9TB6+TerFYEuCkl zKhWDJvi0p2kZBLV/IsB3ys0GiH4rtMafpj1BAdSsJoUV5lLvwej0FfBP0cffNdmFG EwM5MziTG6OKsM5KfJOxXa+VvrQQEYwfEdxTjsopEKlIH/3gu4u8dnCUK3BYzSCsdJ 85TAJ0n0JlU9ima2BTt/0ZRiE4+A6bhBCG5UeopZ2XaXSAhxD6gsNw0DE4BF58HEaq iDkV0Yx2v3jQA== Date: Sun, 2 Jun 2024 14:04:05 +0100 From: Jonathan Cameron To: Vasileios Amoiridis Cc: lars@metafoo.de, himanshujha199640@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 17/17] iio: chemical: bme680: Refactorize reading functions Message-ID: <20240602140405.7d6a71d0@jic23-huawei> In-Reply-To: <20240527183805.311501-18-vassilisamir@gmail.com> References: <20240527183805.311501-1-vassilisamir@gmail.com> <20240527183805.311501-18-vassilisamir@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 27 May 2024 20:38:05 +0200 Vasileios Amoiridis wrote: > The reading of the pressure and humidity value, requires an update > of the t_fine variable which happens by reading the temperature > value. > > So the bme680_read_{press/humid}() functions of the above sensors > are internally calling the equivalent bme680_read_temp() function > in order to update the t_fine value. By just looking at the code > this relation is a bit hidden and is not easy to understand why > those channels are not independent. > > This commit tries to clear these thing a bit by splitting the > bme680_{read/compensate}_{temp/press/humid}() to the following: > > i. bme680_read_{temp/press/humid}_adc(): read the raw value from > the sensor. > > ii. bme680_calc_t_fine(): calculate the t_fine variable. > > iii. bme680_get_t_fine(): get the t_fine variable. > > iv. bme680_compensate_{temp/press/humid}(): compensate the adc > values and return the calculated value. > > v. bme680_read_{temp/press/humid}(): combine calls of the > aforementioned functions to return the requested value. > > Signed-off-by: Vasileios Amoiridis This and patches I didn't comment on (1-3, 6-9, 12, 15-17) all look good to me. Thanks, Jonathan