From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (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 4B59A375ADD for ; Mon, 11 May 2026 14:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778510822; cv=none; b=CVP2UCdXhJQVjY9zpixUQouMXl+TWWk6IZE/zqcJ0QsidKf+1Wc6xf2X18RXDmdkT7wvVd+koiDqGIAEgfZg8G5I/abS8Jly1XJ4AvHvphhhrgDQcIYtzRhatyfeTMGShUJfJYoUJXwawui8laTV+RYPyhWsbvMCahny9coYowg= 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.172 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-f172.google.com with SMTP id 5614622812f47-479dc6d26e3so2511353b6e.0 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=XqKBjDxq0ref/iUo/Dxxd8/Dxvb8RJjycWheAbCTb/wfdyLbo7QzT+2SgcF9amwuKn Vl5HsIzk9Ja6efr87wsTxlxrdwRXgkecWHTUJEvSjlY3hbCSDhdyreGO07tVusm5ca+b LIXO0k+2UAd1oOhKAKdesn5DdUQ/H4T20tV00p/Y0HcawoUHGjRqVqoOLUAI22zH3d/5 40YNIwSGbL/w3IVnIZjS2USF/tcNyZJmfwGsyKj4p8xMzbH/rNQPtG1jYuH/5mLj4Mij 1Poxbj/ygDMoN2mdXvpLXkCO8nvXEiagpGNa6dnH2PPVLDsE14wvDzq0OZn4FGwY+coy 2jFg== X-Forwarded-Encrypted: i=1; AFNElJ/PV18n7i1KQKdXAD07aQtI6skfUv/2WLQjjqNYDxPeeQhXjIel79cMXg3uim3h9ottfS0S+NfECZJ3@vger.kernel.org X-Gm-Message-State: AOJu0YxgEz8nvkBRZCB9ma81ysLoBlGwLICo/R0g8QX4AGsqMlrgfsDH 1CdKYrNy6KVbxcd3z0ErBEvHDxZ5ScQDcjFehRClOEEiQs3v2Bjin8cH1hEres+3wZE= X-Gm-Gg: Acq92OGQhe5bqExmJasx1Ks4DwrFUw6FfK6Iy9V9X8dYmvtNXzlMtj89LPKLLhFETsA znvkPl3Z9i3QQbRhIR29xHYn2iX2BkD811Ecor81+b1b4TO4ZyqzawHNuWnvTftro21WyYL7qyt 1vmukkGSoCzF9CZvExCqzrzREqljxEFJRxiFZ4t/fnswVepymFvpxON5SwytJsHDRSxDyF5Gruh GkKUTMbdGB52pO4vdsT8H169iS2GKTGwDpy2vxHs1jdsI3e2lNZymCVLUY7Zo0QTOfWKnzCD/2e iFwGMH0nKCsyjv4MpkpBh/ET++/jBcmLIqOjqsh7JQ6ElS/ip+A7xGCO24Yd8K5shUnnj/iAMGI GkQbKnavEWigCUA8b7er7ngDYr0whhbCulZJEpaPS/s2xWyRHOvI/CTjUvreK+j6m8yzyf9EsWA 2/aGwL4JS9Nphdiw8AqxmOZFdYyU4PnXB2jMISTGh4Onz+daTDTQzlz1W47/YDowKYPIWvssAn5 k1v08Xvmg== 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: devicetree@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. > >>