From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 CA2572D662D for ; Mon, 6 Oct 2025 15:48:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759765737; cv=none; b=uUXPbr5Ze2sb2jtmaXSL2dHKvci/n24sw0GtWIk7B63MsavVQHOzEjcglXg31fkWcDW40enKqn20XDBqxFN87xPKYQ81IF6qdgK8VDRgQ35dXVVgBA91Fz/eEl3HJM3OTJGyF2kl/HpRjI3sHI3TrOjeGom24z8ezXICbHm0VG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759765737; c=relaxed/simple; bh=7cCqsIleQbTCE8nJ/cqNLb6Xh7ymZFZDoUIkZvvwW5c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Im8/s4jXoXmZL9TiCg+h/Hag6tq2kl5e1hw225oy7xi/jVc1VPYpCmW6gwyRySnEhgy/bSYgJBoM2SPUpYPJhOuh+tfI7erBwvLx0b8jOuxW31TMrvu3DJlZJZWh2aVyueNlhxWClsr8R69pGviampQC74BXtSQwX9p1HlxCmy0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=2zo+Zien; arc=none smtp.client-ip=209.85.210.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="2zo+Zien" Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-7b6ac55cf86so3189285a34.1 for ; Mon, 06 Oct 2025 08:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1759765734; x=1760370534; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=T869gDVevA9LpG7p7hXPgb7SP5eHhcw4WWhaTQBkq5A=; b=2zo+ZienJvyGr8v4PFCMg777UXY9YbInkEZSYVHaJh1LkrIiNQ5HSe30lkob5edkt5 gcX38kXd54+hdz1yB+LZchELWJwKFEYW6WPTMhoDU2sZJV9RMloSAwWUqZ30V8Lnx+uc PY/8SPITCvzJqOCIRj+gVJDSKdycdYsh6BimWJeM4zC+xWQvYFDAWTaZ4m5iS/d0p01y hkgQo2wu9L+mIVevhyMuhUgNS2SGZslZyXHWJhw9wI/cOl8vTr+GfP/IIkvlCHeBX7wx uzYomOekrrB/vn4cgha4lqO2Iw/ryKlaHS7hjIrj06Wl2Zbe+nTh1//C9yR+dyrsEnkv XTGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759765734; x=1760370534; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T869gDVevA9LpG7p7hXPgb7SP5eHhcw4WWhaTQBkq5A=; b=DZwLSaRtICVS6LUsG/b7UPYoseiiJs0LCXLyIS5nllGIrLq3ThUr9d3AEzZsgd1atC /dTjJq72C0E1yCwX4+UzzQcuYlHzDPenE1CNZn9CEcDaJzWo4QUkCX6KuqpF3uvsn68L JmpAkSap1QYgzjnmzNTetiMOsUUJpLkyXo0zgJKt4jsjLDVvcu4X9/QtvZhfmjBvJGt6 oHO124Q3T3zQSukM9buQe4eZKdL9Qaq2thYORjvdDJCQTz+V5+quQL/aOgjSK9hfuUd5 y9dZXqnbeYPhcBhpaFSKaLY8fwz5xxOP1Fr9qC8ruyldpcwvYYLmOnFt4S8pzk90AZ2/ VFxw== X-Forwarded-Encrypted: i=1; AJvYcCXieDhQvKWj98F29FuYcatktvesBhm77tANmNz87F3ilXwQ0Olfjn5+28Z+mrWxdXplgxIaAANWqZAg@vger.kernel.org X-Gm-Message-State: AOJu0YwJBamaM4b5TJgtKKuTlkz5xAjjNFZkPxDSv2qAsi+L/SUb8XqZ 7F5lJ/Ev18lv3zwHSIpFLfdOAdNUd5o5b13j776yAuT/3bjpCO40bkPUxSCo4BLbWEc= X-Gm-Gg: ASbGncvRiNq/KrQtoMCVhxtAiE+VlWaoozsP35zJJaA4zKjNToNr++qB7xnqvONx9oO U2iV47ccXxoiQ+5r3UI5H958J0EoJbpZ0Y451kLaiAk1Pr8GBryGmxeob3zmiDiybS5yFkYhpQr UcyjEolos1IIFCS9KVxPn7HBOPp7S9DVGpZtugiqikbxKnsPFH9042zr0SSGLijj6JGNGKiMlDl Sbr1+353cldnD90xM7e//Ol6cHvV43ZiILT8AvI4gbcz06UBiL1AoOgCQ7xmhP0Jbf2RDkFF3nd ugLGJ4YLinozcMqj0EW3BYv/yWyGo5OCie6h0yARa5x5cNBvLSTMKOnPhOFMvETUaEfvaKvuuoO h85+UURUMFb+P6atHUN6zHZx4zlMHLB+sjc/wiBzvSCfIYdH9xXBfXvKbol3y567OD74q5S+CN5 5afqVkJoAnRYyhOoOP/YtXX/jQYDBIhvy4bg== X-Google-Smtp-Source: AGHT+IH6njM+4Hb3ORuQPgRlqgDWQXTIapYtLEi8wuRV94ziPpiWcaXvJxfwgPJWYXWshy0ytCVboA== X-Received: by 2002:a05:6830:374c:b0:7bb:79ad:6604 with SMTP id 46e09a7af769-7bf77538cccmr7827018a34.22.1759765733844; Mon, 06 Oct 2025 08:48:53 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:1d00:a1fd:4fbd:e7a6:9246? ([2600:8803:e7e4:1d00:a1fd:4fbd:e7a6:9246]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7bf3fdcfb69sm3892248a34.13.2025.10.06.08.48.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Oct 2025 08:48:53 -0700 (PDT) Message-ID: Date: Mon, 6 Oct 2025 10:48:51 -0500 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v12 2/3] iio: adc: max14001: New driver To: Marilene Andrade Garcia Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Kim Seer Paller , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marcelo Schmitt , Marcelo Schmitt , Ceclan Dumitru , Jonathan Santos , Dragos Bogdan References: <961e5351afa408e69541b60ec75852fbbd1ddd24.1759121938.git.marilene.agarcia@gmail.com> <476b75cff0c3e5ff23ba7c642924511f3ba09a3f.1759121938.git.marilene.agarcia@gmail.com> <9ee20209-efba-44b1-9902-5885bacfb290@gmail.com> Content-Language: en-US From: David Lechner In-Reply-To: <9ee20209-efba-44b1-9902-5885bacfb290@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 10/5/25 6:25 PM, Marilene Andrade Garcia wrote: > On 01/10/2025 11:03, David Lechner wrote: >> On Mon, Sep 29, 2025 at 7:59 AM Marilene Andrade Garcia >> wrote: >>> >> > ... >>> +static int max14001_read_raw(struct iio_dev *indio_dev, >>> +                            struct iio_chan_spec const *chan, >>> +                            int *val, int *val2, long mask) >>> +{ >>> +       struct max14001_state *st = iio_priv(indio_dev); >>> +       int ret; >>> + >>> +       switch (mask) { >>> +       case IIO_CHAN_INFO_RAW: >>> +               ret = regmap_read(st->regmap, MAX14001_REG_ADC, val); >>> +               if (ret) >>> +                       return ret; >>> + >>> +               return IIO_VAL_INT; >>> +       case IIO_CHAN_INFO_AVERAGE_RAW: >>> +               ret = regmap_read(st->regmap, MAX14001_REG_FADC, val); >> >> I don't remember... did you give a reason why this should not be a >> separate channel? Or just use REG_FADC as the raw value and forget >> about REG_ADC? In any case we would want another attribute to control >> the filter window size. > ... > > Hello David, > > Thank you for the review and suggestions. > Sorry for not adding any comments about that in v12. From what I understood from our previous conversation, for now the code could have one channel to keep things simple, since we’re not sure if anyone will actually need to read both the filtered and unfiltered data at the same time. > > I was thinking of sending a separate set of commits to address that after this one gets merged, as it will involve new code changes related to adding a function to configure how many ADC readings are included in the mean calculation, and adding a new attribute to sysfs. > > Since both IIO_CHAN_INFO_RAW and IIO_CHAN_INFO_AVERAGE_RAW are currently returning the same value, I could drop IIO_CHAN_INFO_AVERAGE_RAW in v13 and add it back in the next series of commits to implement the related feature. > > I would like to know your thoughts about it, because if you prefer, I could change my plans and implement it in v13. > > Best Regards, > Marilene > Since everything else looks good, I think Marcelo's suggestion to drop averaging from this series and add it in a later series is the best advice.