From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 B354D32A3FD for ; Wed, 11 Mar 2026 16:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773248048; cv=none; b=ux1JfWpZRPMPUbi217w94frEVItBP48LQIJSiEg6nn5NRE/WAEYLfeAG0sj6MCnj/KeVKFN1HGJJCAZ62CyLHJqgWT+egxRJYXRNjEzI7Fuysd9xcOZ2QnVW9h/YOJfQD4UjJcxt2r9YNAHLjfMb0ab6yzuHcVwvPiI5o4Yxqno= 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.44 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-f44.google.com with SMTP id 4fb4d7f45d1cf-662b933f8d1so4368620a12.2 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=Yigb6SaazaCqareIeSygQ7HdKu3tFmiAzT7PTGFXr80pKuBXO2BnHKN1YgeBqCHkD/ +5je3U/Msedowhp6aDdmL9koObzJ0m9zYvyIn0raf1VR8w/NYkHkOWpR5A+1r7H49oU3 dFYNSjjxP/KR6Glwj4DoCcFnxtccIYENaAugG2qFbt+Wsdytae7XHM3pgkbJI5RG4R7a wKbZ3KL+xT8/rUztN57+aORl2K80wOQn8ld9Hp/fGCOQCW5P2qncSU90DJrHeLBVNcL7 Tm9Xly8EXPKLO+XXD7GHvyTDNvnpKCvOKuhaUtN3GVfn4YGJFZHVAZviM871YqnVSsJ6 QAcw== X-Forwarded-Encrypted: i=1; AJvYcCUNBaeeRcEcuAm42ZEr7PZsC5In1LLA6SmKZ7o+CJ2sBxjrSes/BlcClHLcjLlYkv5eqy04uCjhrXDnBoQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw02lHijGI2NiWQ7MvGRStwmcyNwL6q5gMcSLUS7Z3INgxshtdA 75Ls+A6b3JrwdMQCzyL8XCjz/WD2k4UTFCk94IJGLyngq6fl5sUa0h4U X-Gm-Gg: ATEYQzxAs6rxM7OSIeihiEiQzeCjIJN8ijWCfNp9IyvoxCpzDSDT/9YcCB4i5akm4/G dXUTVJlHMJZaGR2CaThcFeFjExcn4Nhy+dkY5zM5iNFl9Pu/3hSapvttzKc6glmCXSe43q2tslc m1YHnJJrUKuGk0++7BVL9wUhFYpxqB676dtsnxAo1vQe0jl98cssZ2bgWzOOC90dZNThEQqmUnx Danlxo41Z/yZd9sipK/hRu4dzZWNMresIETu2YesEjsYTSTQ/lxeD+buLTPDlD6G8zV48duBq/r 06p7v9tJMrmFcLxM1MuzwQkwBzOBH1I3sfVWYMZX8WEQ7v2eGufOh3P4nMd+p+yzuNAMSMbavPD /qxtv/9c5kCA9Deq/voqJ2r3f9+hH+Bd85IB1DNT2y4a6zJVPOVDUyUTlgvP5XaixVHIUV89lqt 5FWIppZP0ojMGfc0C0B0N2Pg== 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: linux-kernel@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