From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796027297; b=si1oIWwnnGhZ7gJflUDK8h/oazMIFIK01FBvVAq0ND6ijUP2pAC3HIOkIAUfpSN96AAZ 2Uq/mYA2h0W8CvD45Q7olthOOGbOypnLQat/pYC0RDOPjzty1Kd8tyCqlOZhR+/HuKSE0 v6NxunJrdTr9mfH8+zjzOPjKpY4LotXfX+vYUAOrrz3oNF2euxrWb5hgKe4QmamWo1UYR 9SW5tKJhfY37W20tCLWPJzCgd8apRQmiLpdAW24lwkI8FOgofnmzqsTAhPheioFXesVOB ckGzrcFSSM+4qcyrwmLcjUlcn3uuRkbxXc5lA49ZszO+Hg6nRAV2w4nUnotQilHL1QQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796027297; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=sONLrCgGOUOK/8A9sFWU4RozMOJKLMgfkNJR8DBt/q8=; b=35knrjXkBDIinJLNYGmGGuPumL7G6Ig+dXjB7gyA2jAL0lQarS7ISNCoRqmaV44leaKT txNPgiyysHx2KMC8ngcZMR4JCqyiMtPbPPOZaaaSeHMDIuJrgZxq8eBKYtx231sPfv42D wKd3+CruzKd68X4oGKSwcVAfbHZ/hrY1iFm/zI3PY6+ZxEyUToLmF2FyswYwOOx5TcMMb C28N08p4+cjuLV1COOiC7LqCyWodDmTXU6WvPs52knvaMZtGqDcwAPoaSx+Z2gJ762rUz M81yDHt1wlnntpyzGvNduOldze8PPlJin5u4xvax/PYavSna26qq/qVz4xJFn9/+b0w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=nUh0qFsY; arc=none smtp.remote-ip=209.85.208.181 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2332606A320 for ; Mon, 30 Nov 2026 08:28:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F2332606A320 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.a=rsa-sha256 header.s=20260707 header.b=nUh0qFsY Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-3ae85add4dcso68818191fa.1 for ; Mon, 30 Nov 2026 00:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796027295; x=1796632095; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=sONLrCgGOUOK/8A9sFWU4RozMOJKLMgfkNJR8DBt/q8=; b=nUh0qFsYQBoKwjtqOCh50Nv4tJuQwWNWRxNajTQjHuZpGL9qKngqPZqBDX8ubtG6OR CLS+2Ij8kMJrjHqS802dyffXrYG1+H/FDJAdSB14wIvYxmeFap369Hxv5kdcXcRhnUuP WEJmuTpCN8QYNHsgzGf13ltEdx/bND30yoVRjgIA6I0ca7tQBtrGawueTeBX3Dq3Hvxs njJsoy/HwgqGHfPnZyPpwktI1hfhZjga+lhrd/42DjDEThu403HzqJDvQiD6i6//3sH7 8UmGWuz38i2123zJCMX30iX2QlsXRj/TKkSWqcW1+xM5rq0IEcqA+7xv6p5naVIOsAnD CV+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796027295; x=1796632095; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=sONLrCgGOUOK/8A9sFWU4RozMOJKLMgfkNJR8DBt/q8=; b=Xj3ovLEYLkG8ugxaN9H8EpQNT0SpJMaTcgzQ5fTfUGbAX791RIoLSlfkeQIIFHozA8 uZk6icaHlJebkVqa1k4eI3TJQEINtnEbEfHdvQgZs+slpzMQgISAm6r+gD+Ijkj8Vo8R kL+Y146RdWHeO6pBYPRuyV2+UZ1AT0XNWnRQieLxCXYGj5Gx1LYNiEx6hcsimpgSVz5s UdR+3UBJO8TqoB6kYNAnDhuWPXRdLD4e+PMSAI8o3lEeIgk0QFxCFouDUJhLMlhxY40K WI4SxHyIjNbvce9gPHSpOdBhLUyHvBvBvBZSPgtC2iGWIH9ov/ms7qDbEj4dcNbJb9Ds ofEg== X-Forwarded-Encrypted: i=1; AL+hErHa7PmY3P323pQ2kJE5B/3yn+KhksSbA2xngrkuI4BParfrorJ6S1AyO844Tkz7bzkqXKsOCHC2Qj5jSvg=@vger.kernel.org X-Gm-Message-State: APuU4Z8I9Z27HUktvScTzQyJf+FoLYhxu5BpTA7nuyeyz8LMXC84/XNb z/1NBy/8HAgxB86LUGVJYXpvq4T+cTvuSGCCZK+16iuIe8VwleSt3M6F X-Gm-Gg: AZFdTZdWKaHO6675/Uu6TYYIxFgidM+IMcV0ApTi3QRlhNnY9k7kAsPSRZHVsKYd8jR 1MJmh19NRuW5YZ9WLuLLn5XvktO0l0htsmsnuc10uBesbD5LZFBzgnCNarXa9mlFUjUinSjHzDy JPNZ5aq/RWa4zPh1Pp9asm4YYW7z0IJWQbn8J1XjusdjYftZ3K28Kxej31wh2SLlK5e5mFcT6mz 01qGwRG16bvCV/zr5xXtLlYWQms8kS9fJSwJDzmP/QhXe+CNBuOqLZejwE8gRW/vbz05o+bn3Iy UlqNiQUqC3hFciEz9zK8M4e7UUkPVH3WePxo+aoNqyhqtZliVFyVxP26cn+3YTYQOYUJAoY+iGk 0ShIog/HhPVxfHjYIn/0in1UeiZgHItQKzyTp6IhPn1Kz2MzKi1WrM1wsAdxAOvqLGmmTApib4P wf3PmeJdH7QzB3I68CBJssGdmwOKUVSpCcMxOSQf+ckU99jz8RPOxlOxma+6R2aMAKnaIok/NsO V/xLWCOsLpNzQQWcpoSYpTwm11KUzkLhgrhnybLOQ7OuqMcOiu5lMmc2XszEQ8zXITn6QpLUjkM sJqAjNC0MvhskQZ3FYLnQqHipqLXCp0mKcdWEFEhKc8SKT9YqrmhJdakpGDOeTOeXQ2WjDBWRBT i0NNyhxyjpw== X-Received: by 2002:a05:6512:b96:b0:5c3:1984:3a33 with SMTP id 2adb3069b0e04-5c341a355d5mr2710899e87.12.1796027294769; Mon, 30 Nov 2026 00:28:14 -0800 (PST) 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 38308e7fff4ca-3ae804ee2b0sm82592541fa.11.2026.11.30.00.28.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 00:28:14 -0800 (PST) Message-ID: Date: Mon, 30 Nov 2026 10:28:13 +0200 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] iio: dac: rohm-bd79703: Fix full-scale voltages To: Jonathan Cameron , Matti Vaittinen Cc: David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <0723d51fa973f0204e1c436c08a784b7b1cca795.1795699121.git.mazziesaccount@gmail.com> <20261128035336.0ad3ba76@jic23-hlaptop> Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: <20261128035336.0ad3ba76@jic23-hlaptop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 28/11/2026 05:53, Jonathan Cameron wrote: > On Thu, 26 Nov 2026 15:23:10 +0200 > Matti Vaittinen wrote: > >> From: Matti Vaittinen >> >> The BD79702 and BD79703 have a VFS pin which can be used to supply a >> full-scale voltage to be output with maximum DAC word. The driver >> assumes this voltage is the full-scale voltage for all of the DAC >> channels. This, however, is not true. >> >> The VFS-pin voltage is only used for the first half of the channels. Eg. >> on BD79703, channels AO1 and AO2 use VFS, AO3 and, AO4 use the VCC. >> Similarly, the BD79703 channels AO1, AO2, and, AO3 use VFS, AO4, AO5, and >> AO6 use the VCC. >> >> Fix the driver to use correct full-scale voltages (VCC instead of VFS) on >> the last channels of the BD79702 and BD79703. The BD79700 and BD79701 >> logic should not be changed. >> >> NOTE: This change is visible to the user-space, it makes the scale a >> per-channel property so the sysFS file out_voltage_scale gets replaced >> by per-channel variants out_voltageN_scale >> >> Fixes: af6aca656a85 ("iio: dac: Support ROHM BD79703 DAC") >> Signed-off-by: Matti Vaittinen > Enjoy the side discussion. I'm going to take the expedient path and > just merge this. Applied to the fixes-togreg branch of iio.git. Thanks for applying the fix! > This wins one of those awards for generally odd things to build > in hardware. I kind of understand the idea of the HW design. It allows having two different scale outputs from single IC. For example, 0-3V and 0-5V, while having all the DAC steps available for both scales. There may be designs which benefit from this. But I agree it is odd, and it totally caught me off guard. I only noticed this when started adding support for the series of next generation DAC ICs, bd7971[0-3]. They have the same design. It does not really help that data-sheets do not explicitly say the VCC is used as a full-scale voltage for some of the outputs. I just happened to notice the VFS pin was actually said to be full-scale voltage for AO1, AO2 and AO3 on a device having 6 channels. The full-scale voltage for the rest of the outputs just weren't mentioned at all. Then, one of the block diagrams did have VCC written to a box for some AOs and VFS for others, but at least I missed this when I wrote drivers for BD7970x. Oh, and I used same voltage for VCC and VFS in my test setups :rolleyes: Well, I confirmed this from the HQ designers - hopefully the fix does not come too late to some of the users... This had a real chance of frying-up something :| Yours, -- Matti -- Matti Vaittinen Linux kernel developer at ROHM Semiconductor Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~