From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 B1FBE27F19F for ; Wed, 11 Mar 2026 16:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773248048; cv=none; b=LGtyRmocgaSwtS5s4Oqw0P8Kt01NravqrIbqRa5yAiGskrW8g2tEWZDjVna8Dw8fjX6WbRWYZr+Fg/73etwsVgpDeb4PQMKZ9hQyaOzKDgg1v4r7rp3yAnXk+RKoeVSbfAUK8FrtSWWWNU6//nbXQlRem2luLenOBRJzn7o0jn4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773248048; c=relaxed/simple; bh=Z9OZZB3CYTeVUj4B/NjeZZJLS8yiWmY8Bzo9StWySzU=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=plRpB3dVp1p7toK77WfF07IzegtH3whTYxxFDn6rJn/Vp8x8pcwGGN5OM5FhGqxwuksPA8sD18/AbmKqeknIYNJ0XQJ3FNMAWD5hUge3va5Xo0uyF2acLIAJUbw5zlTqIZQh59LQlzo0Se6P0+0qxmJ5y2jAz2gnxdlwxOyEQyU= 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=Jz0hG8wV; arc=none smtp.client-ip=209.85.208.43 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="Jz0hG8wV" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-6631e0edcf1so7511a12.1 for ; Wed, 11 Mar 2026 09:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773248045; x=1773852845; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=4OLoZWNfLX2Hv2p8BwoMWD6UD6t/Qu6fX1zjeJKXrT8=; b=Jz0hG8wVy8JSzI9ok0Uo0uZpWOu0D5g3LFvwtTTAtR8zxuULBgdtxeABNvWd+36Qhf gkBCzhFErLvc2io+0ACD5llrWTPsebWUL/molKJo5ajtJhKaM54GtcKP3XRKVYuWG6DQ yh2qlLH1uV/Lu0g5XztWrkkBpPXENESTcixtWXizlXcz3WlJupsLOLk91GdRuY//dBOj HtcA7mDXD8CgJpGwx/IptaspMLkRGANInDgN9rWJM0aHr22Bcc7GumYKakOBmIiycXut KsY86RGPfVEl3NL14i+tV9JxIkjmVGrAa2czxS68w2xvxKsgbIauCJuR1dDkQpPMiZFK d2jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773248045; x=1773852845; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4OLoZWNfLX2Hv2p8BwoMWD6UD6t/Qu6fX1zjeJKXrT8=; b=hyjqFkPomYC8sud41K7BY0acQxKyaPtmZxD+TtEGl0kFKsmqfJF53cFO4yCwTpM5nM QLLFNHeuLK+E2fETkT6+s6zO6I+ClNoCjBh85zJcqAsq+DT3JQqM9b1F3QxhUg2vlyAL 0ouypHrONkxA8+btvTS+cAvSUbkCWyat1jnbngrSy82s9Q5m2VWalCGKw2keB6wrlmU6 VckxJEJkDG2fBt1nW5lIIs5+WvvMtD/9OUwfRi2KjmlFOs19mw2EmPEJrVzeYTzwktCh HjOtoXxk9KUcvIyCXlwinuRfzU8XeVeSHaepO5QaaP3NHnhKHv4rmnbtn6pxr/qGkGkI KJJQ== X-Forwarded-Encrypted: i=1; AJvYcCWgesrxpUdfX5i/TvqYtWf9k9g1ti92XBgjzk2MoHpI0krR5LkwV2qfy3olGucmkBHJhTSj2oZo9SCl@vger.kernel.org X-Gm-Message-State: AOJu0Yyo4z/8YlDAROUF3xT8oRk7AS4wrcFVR5U37J1DxCay121ysQtq aaDQGRf4WeNxuFpHhYwOpsuEs1d7wYz3d7ZlT+goM8rtmKHh706qVMDv X-Gm-Gg: ATEYQzzCTP4tAYTpkXYJ8Wsk0I2wIHzOpRhb18Joq650ELtq+J0xQg8AkcfEkOk7Dt3 RVyMPStltDM9Hwg/67QsWmL7RBOvn3MFWBs9a79Ufrw3/W6NnLPO9a3VJKwoONP94ZJucJ8QHRh TycTu7uEEVQAAGS3H3dUcS3UQk8cgY1FBQCU/zJqnLuNXB7e/ZBoSoxKDBQL2TWzLmtoX2lvtNW VrVQn9m+bdz61QCPtmT1qjXXPpBThcp7Wqm368zYcSLuAzKxatfGT74Efif0TEIpQC4G1qXppEY +P4BWmXxTnNO+FrW3B2cmCLkTG83SmThHfck3GKjkHoWoB10sVUQXA8ZlrSFRo/YLS2iuV++QR+ iW+fLiecj8gUzUchhiqVCyTjGQHeMPpQZE0jiX60lxJPSUIq3JZQ3GJOjQMtLAgjUv2GKA6G5gI 5/aWfCQ3jfBLw2Uj0W9LhSCQ== X-Received: by 2002:a17:907:f815:b0:b94:3836:1672 with SMTP id a640c23a62f3a-b972e2c23acmr195615166b.37.1773248044571; Wed, 11 Mar 2026 09:54:04 -0700 (PDT) Received: from [10.5.0.2] ([185.128.9.22]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-66350890006sm39973a12.20.2026.03.11.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 09:54:04 -0700 (PDT) Message-ID: <3a967f38a43933f12c98a9dfe4f1e85fa592b41b.camel@gmail.com> Subject: Re: [PATCH RFC 6/8] iio: frequency: ad9910: add RAM mode support From: Nuno =?ISO-8859-1?Q?S=E1?= To: Rodrigo Alencar <455.rodrigo.alencar@gmail.com>, David Lechner , Jonathan Cameron , Rodrigo Alencar via B4 Relay Cc: rodrigo.alencar@analog.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen , Michael Hennerich , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Date: Wed, 11 Mar 2026 16:54:48 +0000 In-Reply-To: References: <20260220-ad9910-iio-driver-v1-0-3b264aa48a10@analog.com> <20260220-ad9910-iio-driver-v1-6-3b264aa48a10@analog.com> <20260301133153.7f2f8501@jic23-huawei> <20260307140735.5ec2e608@jic23-huawei> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-03-11 at 13:11 +0000, Rodrigo Alencar wrote: > On 26/03/10 07:11PM, David Lechner wrote: > > On 3/10/26 12:40 PM, Rodrigo Alencar wrote: > > > On 26/03/07 02:07PM, Jonathan Cameron wrote: > > > > On Sun, 1 Mar 2026 13:31:53 +0000 > > > > Jonathan Cameron wrote: > > > >=20 > > > > > On Fri, 20 Feb 2026 16:46:10 +0000 > > > > > Rodrigo Alencar via B4 Relay wrote: > > > > >=20 > > > > > > From: Rodrigo Alencar > > > > > >=20 > > > > > > Add RAM channel with support for profile-based control. This in= cludes: > > > > > > - RAM data loading via binary sysfs attribute (ram_data);=C2=A0= =20 > > > > >=20 > > > > > I'm not sure that's a long term viable path.=C2=A0 We either need > > > > > to figure out how to do it as firmware file load, or via an outpu= t buffer. > > > > >=20 > > > > > Firmware load would probably be too static and I'm not sure quite > > > > > how we map these to IIO output buffers. > > > >=20 > > > > We would have to carry it for ever which is very much not ideal. > > > > The firmware approach has the same issue, but can be thought of > > > > as defaults at boot time forever.=C2=A0 If no defaults then we use = whatever > > > > we come up with as the long term solution. > > >=20 > > > I was thinking about the firmware approach: > > > - Normally a driver would request the firmware during probe and the > > > =C2=A0 filename would be pre-defined. > > > - Less statically, It could have an attribute that once written, it w= ould > > > =C2=A0 request the RAM contents (e.g. under /lib/firmware/ad9910_ram.= bin). > > > =C2=A0 It could be the enable attribute itself (but that would not be= effective > > > =C2=A0 when the binary would not change), or a separate one (e.g. des= tination), > > > =C2=A0 or a new one (e.g. load_en) > >=20 > > Have you looked at firmware_upload_register()? It looks like it provide= s > > something along these lines. >=20 > Thanks! this is in fact perfect! > It might be ugly, but for the sake of debugging I managed to get libiio t= o > interface with this by exposing it in the debugfs. >=20 > debugfs_create_symlink("ram_loading", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 iio_get_debugfs_dentry(indio_dev)= , > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "/sys/class/firmware/ad9910-ram/l= oading"); > debugfs_create_symlink("ram_data", > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 iio_get_debugfs_dentry(indio_dev)= , > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "/sys/class/firmware/ad9910-ram/d= ata"); Or for the sake of future proving, maybe let's make the sysfs a bit more ge= neric. At least the path, /sys/class/firmware/dev_name(iio_dev)/* I guess userspace tools could work with the above to match the fw blob with= the right device. Also, hardcoding the name as it seems you have done will be a problem if we have = multiple devices, no? Not sure about the above though :) - Nuno S=C3=A1