From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 E32C45339D; Thu, 3 Apr 2025 05:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743657538; cv=none; b=DCocnTyO9JjU/I9I3bXRP5j6V0z2wlVCPSV5bhcNlAQbzOC100r93xkT2jgYx4l0p4FiARMShcyAjbmKNdspuKFX1w4Ern4bj2dq3z8tzw/d2nvDonAs2tLJ3ibpgsgag67YH0obAcGuSdwmsmlNwldvWMvgB7jqpbLsUkVIogM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743657538; c=relaxed/simple; bh=SbruppALhz0jiFblb2Kdub02TWtG8ZzvjkPIvhFGY1A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mzo9FO5DlKPCUs/ricjlN06k/Yi034E44FPSGY5pQof5j0C4QNVGzktmiUK0s1e5Dc8Njmu/Emq5X93SF7Eh2kt+Iem4YhYNwQrcVkI/AfjzHah3hMKXzvPsGnPo+nPc9dyhhG4HT1kHUy7VzWaP9YCnLdMNza8SjSKz1VbD/4g= 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=ck7jLQ9x; arc=none smtp.client-ip=209.85.167.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ck7jLQ9x" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-54af20849bbso577911e87.0; Wed, 02 Apr 2025 22:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743657535; x=1744262335; 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=d+vyPAE39gromhmoTHVrC91GtciRJneVkgJKPcyS5xU=; b=ck7jLQ9xDd7Sz7PO0loX2dnQYqkGsbxxqxSg5tb1zrlObzE8tVo59LDybxtUIJSHeN UKnVju4lSWIflD8iqDrdSM6fbPj4P5nAQSExA+eI5opmgfFGUdcyVoT+sLn4NwAG4ecT JHvMGWyit4JBMZulbkVCc7f7l/t3vIrHzzSS3y0zEKBuAjisUV3v4QDIGR0KjcNUmer0 JlyWj8Fb9dEyC0iwmI3LgYOqIqHGJ8mjk9QYBMV0kGRFEdG1OQWgVCI5//ctFVyW4ytU EBP3qHrTkJMgJVILRqi/G1zVNgqn38WQFMA/U3x9DtluVTcBKSoXz/PZgCJU9QS0Nd1F m1ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743657535; x=1744262335; 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=d+vyPAE39gromhmoTHVrC91GtciRJneVkgJKPcyS5xU=; b=UKs2kvqgGb0By3xmBM61c2PagWWGoW28KMDhfDZb7lXJMV9AguUsGuIxfY4Y4v8l/7 O8uVY8Yxoe2b1EC66KrvsmST4Daq6SWZesLNz9J5SFbcXj0KzmgTy2AkEmhdf3BN56za 18d3TQKaomRLgmxkLJ1WDLtg/UkC03L8+/q8M+nMRaEc85bp9dyzS/0h4gOue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6sdUsEAC3KwJA== X-Received: by 2002:a05:6512:693:b0:545:5a5:b69f with SMTP id 2adb3069b0e04-54c1d89952dmr347234e87.9.1743657534833; Wed, 02 Apr 2025 22:18:54 -0700 (PDT) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54c1e635b3fsm52203e87.149.2025.04.02.22.18.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Apr 2025 22:18:54 -0700 (PDT) Message-ID: <078ee3c4-bb55-479b-85ff-3cab5f9a9eff@gmail.com> Date: Thu, 3 Apr 2025 08:18:52 +0300 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 RFC v2 7/7] iio: ti-adc128s052: Drop variable vref To: David Lechner , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nuno Sa , Javier Carrasco , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 02/04/2025 23:49, David Lechner wrote: > On 4/2/25 1:10 AM, Matti Vaittinen wrote: >> According to Jonathan, variable reference voltages are very rare. It is >> unlikely it is needed, and supporting it makes the code a bit more >> complex. > > There is also around 60 other drivers where we could do something like this > in case anyone is bored. :-p > >> >> Simplify the driver and drop the variable vref support. >> >> Suggested-by: Jonathan Cameron >> Signed-off-by: Matti Vaittinen >> --- >> Revision History: >> v2: >> - New patch >> --- >> drivers/iio/adc/ti-adc128s052.c | 29 ++++++----------------------- >> 1 file changed, 6 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c >> index 0f93c6266527..0bfe4e558c69 100644 >> --- a/drivers/iio/adc/ti-adc128s052.c >> +++ b/drivers/iio/adc/ti-adc128s052.c >> @@ -29,13 +29,12 @@ struct adc128_configuration { >> struct adc128 { >> struct spi_device *spi; >> >> - struct regulator *reg; >> /* >> * Serialize the SPI 'write-channel + read data' accesses and protect >> * the shared buffer. >> */ >> struct mutex lock; >> - >> + int vref; > > Units in the name are helpful: vref_uv. > > Could also consider doing division in probe and storing vref_mv instead > since we never use the microvolts part. Ah, thanks for the suggestions. I agree with both. > >> union { >> __be16 rx_buffer; >> u8 tx_buffer[2]; > Yours, -- Matti