From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 4B67E3FB7F6 for ; Mon, 11 May 2026 14:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778510822; cv=none; b=fszHcdgwsjz9eHmBQId6kbBACr8SwvOyxMkxER3uf+6QpZ8v7r8BeUOqp4YLac0fUx1dRX3Fym/o02sX4Pj6NUW/vh3yKPueouW5qna6RQDT2TWagEzLtJXmghaI2J8Oejp1rGS6gKhgWWbhWQ5mtV5ZJuhynxL0ZS81xSwGxo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778510822; c=relaxed/simple; bh=SICTXImZa4mMy4Kgs5BlhwJ8zVJUierNkIzSeoAS2I8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Dxo23DCkwxzHXPnwz5/bzYCrBGGzCY6fSH7G3sETvTluS/ihoQgzGEG4b+AHSdbJdfDDs7NIazfmsK7CJ+3wiFRnADDj1FZgMqd5r7ijHSnX5M1c0y3g1ePO+8JKtePjgxccUrpasovvwy8hhBv/WZKe3GogI2an5XI/vMoWIBo= 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.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b=pUfBrgRJ; arc=none smtp.client-ip=209.85.167.173 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.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b="pUfBrgRJ" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-479dd56d016so3106562b6e.3 for ; Mon, 11 May 2026 07:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1778510819; x=1779115619; 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=qEELPpISKPMY3OnOVJz/i6LMwFlmgDNP8fOvagl4Uf4=; b=pUfBrgRJ+2elUdz0lvJ9Tads7hP5t9qy/4AVVBeZ7Z0meOn48JThSLiseM0PsfCno6 fD2VQQNCHA9Bxp5gZyRFoiNDrhxvcVUVbNucl7SrI1CmJ1VSnH3R1jWneZlTEkiO/t+k KqijGSbF+EVBZEjQ+BURzFJnLfFBf8nseJ+pKVExSKeBxsPSElgt00AgzWnzgEigHrIA KLoroSfK5abQMAbOfiu9LaGbBXOjweFxmjYfXAk+SPNMLBAvcZJV5Ouu6zJCFIiQ/F6x QUfeBnb+qMh3T0UYCKL51QJFe2oJt8aebs8h/wZwJd2GF8zb/2gsjLJCqY6aD1rxW/6i G0Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778510819; x=1779115619; h=content-transfer-encoding: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; bh=qEELPpISKPMY3OnOVJz/i6LMwFlmgDNP8fOvagl4Uf4=; b=U4SMOeEv/hMrJ3+C2ebz8B6rJUMFDg1HNTDXzvesiNRNx5jZpiOhQjtf937Pt2TuN2 ZvdXx7OQPUILh2haFHllDx1IErIdn3W95+rvSMH7JKAquuDus1yFVkaxMgcTerciMgTP rqWhrGjW3v/ipRd0B+DQJJO3syZc3VDiwkSfmAJt9HLOUpaAh8ZoijK9NIEcnctvGpgk myMMhnDQUI5A10fhzAwhFClVo3oSCKGFRUUpqa97zSYdvg6bH7oJyLNkkRk7Me2deGCe BWgOvt4Ka5XJVKoYVXxnXpef18UtSqem9z5stW12Dwa/7y/z9rTla6e7NXq++MR/FXFh 4WMg== X-Forwarded-Encrypted: i=1; AFNElJ/swoQYG+4pFV1hvYEBXb94WfpDRb1t6fLosPfybnVWFkWzyKyVG4ISizZYVoLfoA91t4UBTIU/CK9H3Lo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4Sca4vvxwym2NylxDNRPQxleAc9fVi4mx21GDAGK0tIk93z4P qh0jkMCc/J8H4Ec8R3t9DpOf2E4tG0sI8sxupST8SypTOrNwXyNuzwqwZiltI9CcLmw= X-Gm-Gg: Acq92OF+rptW6xjBCOQ2+5vOKhY6S++JBLz1dQ33t4BU7neLXCLQQwHV9jfnOBrJQ4s Enmu5RI2RSMX/S7NBIyidnS7lLOfW6xuyBYmxsywg3UOOOkQvJKaZ9LnqoutxD15+vGSthOuaqK ZEgxk2Hpm73n5IWcXVNapqKjUu2hgNxJ8OyD7Y+oesaLupClpSsoEbgkyC7E3Qrd//GefLkk+P3 0W5lBmmhHKIGnETybve1AGLVM/7Fo3DrH0NU859yRm7wdvgaxJ8RbV8HEk0pdoHI364ZJPTilYl RHUZ44Sm+6KfGJtgcCfwAJSZMuvv5kcO6anB0N4pCE4ofhN5j2eEYldmb7PIJFeYNyabLbSrYBV lLOeooksIW2ZWefgGsbuoi2aFeE6Imzg6umuekjveJ34ER4A7MLJatU8SPpmU5RZjsaVtOGUwA8 H9BwBfH1X9/Gh1F8GxM0qX7QH3ts17IvoEEXacb42awPxZ6X756naYRwrHDT2HT8ZllondH9KkR O88btb9+w== X-Received: by 2002:a05:6808:e40a:b0:467:1212:46eb with SMTP id 5614622812f47-4804249c60dmr10483498b6e.35.1778510819130; Mon, 11 May 2026 07:46:59 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:591:4577:3439:3a1e? ([2600:8803:e7e4:500:591:4577:3439:3a1e]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e367be2238sm6968520a34.6.2026.05.11.07.46.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 07:46:58 -0700 (PDT) Message-ID: <18c2eab9-c0c7-4e93-b4e8-73b18531e784@baylibre.com> Date: Mon, 11 May 2026 09:46:57 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v4 10/10] docs: iio: add documentation for ad9910 driver To: Rodrigo Alencar <455.rodrigo.alencar@gmail.com>, rodrigo.alencar@analog.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-hardening@vger.kernel.org Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Jonathan Corbet , Shuah Khan , Kees Cook , "Gustavo A. R. Silva" References: <20260508-ad9910-iio-driver-v4-0-d26bfd20ee3d@analog.com> <20260508-ad9910-iio-driver-v4-10-d26bfd20ee3d@analog.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/10/26 4:30 AM, Rodrigo Alencar wrote: > On 26/05/09 06:42PM, David Lechner wrote: >> On 5/8/26 12:00 PM, Rodrigo Alencar via B4 Relay wrote: >>> From: Rodrigo Alencar >>> >>> Add documentation for the AD9910 DDS IIO driver, which describes channels, >>> DDS modes, attributes and ABI usage examples. > > ... > >>> + must be a power of 2. >>> + >>> + * - ``frequency_offset`` >>> + - Hz >>> + - Base FTW to which scaled parallel data is added. Range :math:`[0, f_{SYSCLK}/2)`. >>> + >>> + * - ``phase_offset`` >>> + - rad >>> + - Base phase for polar modulation. Lower 8 bits of POW register. >>> + Range :math:`[0, 2\pi/256)`. >>> + >>> + * - ``scale_offset`` >>> + - fractional >>> + - Base amplitude for polar modulation. Lower 6 bits of ASF register. >>> + Range :math:`[0, 1/256)`. >>> + >> >> I guess there was some discussion on these attributes. I see some of these in the >> ad9832 driver in staging, but I'm guessing they are new ABI. It isn't clear to >> me from the documentation here what they actually do though. I guess they are >> just basic transformations on the input signal? > > Not sure how the ABI is not clear: > > For a channel that allows amplitude control through buffers, this > represents the value for a base amplitude scale. The actual output > amplitude scale is a result with the sum of this value. > > So yes, it is a basic transformation. I didn't have time to read the ABI docs yet. For scale_offset though, how is that different from the existing offset attribute? > >> >> And a practical note, they should be "frequencyscale". I don't like that it is >> harder to read, but it is easier for a machine to parse. > > Parsers like the ones in libiio is not having problems with that. > >>> +Usage examples >>> +^^^^^^^^^^^^^^ >>> + >>> +Set parallel port frequency modulation with a scale of 16 and a 50 MHz >>> +offset: >>> + >>> +.. code-block:: bash >>> + >>> + echo 16 > /sys/bus/iio/devices/iio:device0/out_altvoltage113_frequency_scale >>> + echo 50000000 > /sys/bus/iio/devices/iio:device0/out_altvoltage113_frequency_offset >>> + >>> +Digital ramp generator (DRG) >>> +---------------------------- >>> + >>> +The DRG produces linear frequency, phase or amplitude sweeps using dedicated >>> +hardware. It is controlled through three channels: a parent control channel >>> +(``digital_ramp_generator``) and two child ramp channels >>> +(``digital_ramp_up``, ``digital_ramp_down``). DRG destination is set when >>> +ramp attributes are written, i.e. writing to ``frequency`` or ``frequency_roc`` >>> +sets the destination to frequency. >> >> Would it be better to say that the destination is set when the the >> value is non-zero? Otherwise, how would one change the destination >> once set? > > Destination is only one, so you just need to write phase or phase_roc, if you want > to target phase then. Does that not sound intuitive? I was thinking about if you needed to change the configuration. If you set it to phase, then want to change it to frequency, how could you do that if 0 is a valid value for phase? Also how could you know which is selected by reading back the values if 0 is a valid value? > > Zero is a valid value to be written. > >>