Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp596370lqj; Sun, 2 Jun 2024 12:53:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWndQeoeI/9otf0iwEZzRFkqFhcOaYCF4q4HIi+ZngFgcJ36JNKLrXPelxQ2iRj2ktrrqznD324qigws9ohahbKpwF7aDmY3qXaGJV7wA== X-Google-Smtp-Source: AGHT+IGyOOG+fSIHiAdETUgue5FuV1dVYVppabeIupjToRAOZU801zOPL9DikPxoBQBXn7zJT/YZ X-Received: by 2002:a50:8d59:0:b0:57a:3357:596a with SMTP id 4fb4d7f45d1cf-57a36372780mr4446410a12.13.1717358011904; Sun, 02 Jun 2024 12:53:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717358011; cv=pass; d=google.com; s=arc-20160816; b=lD2Fx6qtCaTz2dEzatCchVXL+Ttbm/g8n5Q2GGPDVY5wstaj2ygcXWkPLrAKVUydPf L36BsUjWYCg/TF+bEpqoG0vnnN1YwirSHUE9HAcl+hVWO/xSqa6Qk2lQss29aKgJY059 WfntZC8pOEzWqlBY26nFd/HVFgSUk2z7izfO67HRT9ed4yyBTx1CAOu5ASbS+fbu631M yALboEpR0v2LLTgH8idKQ9Oif/z0H2+DcX8rZGCGXl6WqSpKzDMmcNmhpIeMqqDOyvFm Gl51sP7vXo4aq42O9zyOF+NTkWGehqnkRra6MUK/X1nyl8G6ale/n+SHCfbZDIo2A+oI up7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from:dkim-signature; bh=zywBRIwHMJzG8+KsIh69OEutro3/6BBZ2kza9TwS0IE=; fh=36XqGKfp9VQAIJXvbgS1LpHt0RXTOPHFfiaTaAhLSj8=; b=MsaWGbgHKUjIIXkdXkNeWxAwejL3K/uBsYZKbcjIoY/BFKpRvyHm0L+wbL5OgROJXO BiYSAylLYhPTomu0pUTVhyoeOEFO00zpX/agJXtD1SqnJtQ1nPhW2PeDqAqHjQ4zUG2i C75AVFnq6z+fJREI0P8YYjZTl3+n2gW5tm8bhJEaT6zpsThfuxIyOxmiCGt7dnhxPY2U BX7aVeMhkrgp03QNQu99dPqxw/MTDhNLtEjUNMQGO/AtfLSH2VLwdRvQCkq29crqO0Vd Z6EoOX8kOFOIWSSgdszgj3FNipPqXKX7+XPyzjuXIr0nAMVdfyWm5ptvOhLnLfDmALeJ 1GLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ACFuN8xF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-198398-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198398-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31b80d8bsi3403587a12.68.2024.06.02.12.53.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 12:53:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198398-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ACFuN8xF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-198398-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198398-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9E8641F2166D for ; Sun, 2 Jun 2024 19:53:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBDA8757E5; Sun, 2 Jun 2024 19:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ACFuN8xF" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6985B74418; Sun, 2 Jun 2024 19:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717358003; cv=none; b=iGfgY0EABkXbmUjG/6oB8LcDNL7MFNYIx2xRtTDo410kIO+2F310yC/351ctxcPdzRrIAdlpa7ZG8TURlcvBA9YQdsPyXAM7SbHnTybCwYCm5dY28oyiTY2uFQpK1SFBlAdPsmR5yQAOMNPq2f3Fek9MwK8JmMiVOiaNdHnXKqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717358003; c=relaxed/simple; bh=CYY5A6G/VL2aE4c33pLR5Q4/47P7mhJn6prtJvanTdQ=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k8vdg0BHXYE82vST+u2vMS5YbQHQoeqDLV/hgC2H7wgWm39UG8YKyJ8cpBOJw/IKinIFiECjM64PZ8r7lywFUw5RbLaEYOnBwc3jt86hx6iNBzZAbVCMH67/zizqgrDfV3c4uWkTSeDH/lXbzcVYw2cDB9bZNRCigMTJnDRfWnA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ACFuN8xF; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-57a4ea8058bso1176122a12.1; Sun, 02 Jun 2024 12:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717357999; x=1717962799; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=zywBRIwHMJzG8+KsIh69OEutro3/6BBZ2kza9TwS0IE=; b=ACFuN8xF0Lqo7bxqO13+qNUPvvTIMXRz2DuCyT9y7CHiDR9jIsmL4mNVpaWaj0fN6S O/parfTlPNxlZFSnWNBIgFk2mya6VesuxpxUeaosQ7U0vNDeHdXQi/aYoo5/aRAHupJl dkZSdMmArAuGZ/4UEYp3DsGZ76uQhZ7qd5DCsMHXzj7w8QCuvoRoE6x+a02cwmIBJGsW tQvfUu/caVkFPHDJAQOinkT3d23lM12VKDT2qFA21iYo525Nte3Ah6GmNDQ4e4mx5Tsn ZwDufO1TDnDxZQnC/q+ana8RsZvgwmTlk6isIBFdjivcRzcu7cFPP57nwkr20WLKrByg MvxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717357999; x=1717962799; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zywBRIwHMJzG8+KsIh69OEutro3/6BBZ2kza9TwS0IE=; b=mF5NUK214AxgPns9Dtci10pc2L5KabvK5C6J8IN8+oCOQt+ShpXUC1On5XK6caUofE p3hevnBvI7xFIj4Mdf3rWRIbbcqvRbMBGQ7uT0EJDh43BPQX+WLJrLF2nJ9Y7FlHVC6A rNQKtI/NHu7gb4rq28uCqX9XdTvLnJQC6bw0YHMGYM0yYnaMYU83IAC/mPpVpQi7QmAe CiWOcSRn+fuRXukMT/oF5Gz3hBuM1MjHFVNwM8eNwhK6NBfnaCS787iWrC4mUNfWpDmm uGMJnoEY1m0C0ZSMODlIpMEAke9nIv8q9v0UAyt+hrajgZXu6D1RiGW/tcJ8dAs2R1lz +bZQ== X-Forwarded-Encrypted: i=1; AJvYcCVDx3OMr+QXTnyx5lPv8Z812CzbTL3GSRp5i49Cei+du9VeX05EZ8kM2JPWBYPauz8GmNIgpNzwLV2hHrMGpnpYP6c0HQr3xEjVUkg5oCzhmIWRi+5YHSTM8wl1FdlkkbM6Dv23Oc3k X-Gm-Message-State: AOJu0YyL2MZkJSGeEDZgQnwaRybGDsh9Sp/hrqfk5nARXCPzw/lIrS6x u4DAjD2m0t+L2XPGRUa/TXAvMvmNN0C8CJ/v960zUvixma2FuR6u X-Received: by 2002:a50:ab03:0:b0:572:4702:2227 with SMTP id 4fb4d7f45d1cf-57a36450a5bmr4741579a12.35.1717357999483; Sun, 02 Jun 2024 12:53:19 -0700 (PDT) Received: from vamoiridPC ([2a04:ee41:82:7577:add1:b1ad:7182:3e90]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57a5ef86458sm922814a12.78.2024.06.02.12.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 12:53:19 -0700 (PDT) From: Vasileios Amoiridis X-Google-Original-From: Vasileios Amoiridis Date: Sun, 2 Jun 2024 21:53:17 +0200 To: Jonathan Cameron Cc: Vasileios Amoiridis , 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: <20240602195317.GG387181@vamoiridPC> References: <20240527183805.311501-1-vassilisamir@gmail.com> <20240527183805.311501-18-vassilisamir@gmail.com> <20240602140405.7d6a71d0@jic23-huawei> 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-Disposition: inline In-Reply-To: <20240602140405.7d6a71d0@jic23-huawei> On Sun, Jun 02, 2024 at 02:04:05PM +0100, Jonathan Cameron wrote: > 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 Hi Jonathan, Thank you very much for the quick and thorough review, it is always extremely helpful. I will check a bit more on the alignment thing internally in the I2C and SPI busses and I will wait for your answer as well. Cheers, Vasilis