From patchwork Fri Mar 21 20:28:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 14026018 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 AAADE230BE9 for ; Fri, 21 Mar 2025 20:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742589009; cv=none; b=lsbGIuskZw64gZIlrmNZG5RgMyIxio/wN5ndCM2ZWP8lBL42FyFiJuniLBZmAoaHxpSPXmroXWtGH3eCsLTqRJgq68ktijpI99MVXcqguhyr0FJUHUIKEHQ4YeGheQ/yydQcE9EDZNdPSrU/kw0kGzAqyRaC/F9CGaiSt24Hi/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742589009; c=relaxed/simple; bh=YC4T+Fxmel7++n7zPsX37ONlH8IUA0Cd+K60/qZjzk0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QFEIsEitmpaglcGrmoHiXU10Q7enCxOa3N3VMga1g+jIc1KNe579Hb72eiHOHb9Az/4On+s4OOQp470d3gloOfcYjX1bX1CXFdCEiY5rIpnVG2piJRnox6u7X6H+3VQvw/l1gGeYNQ569+FN9E694RHQzbZPSBNZNBAWG0VelHg= 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=xT2SzOz3; arc=none smtp.client-ip=209.85.128.48 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="xT2SzOz3" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-43cfe63c592so23272035e9.2 for ; Fri, 21 Mar 2025 13:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1742589006; x=1743193806; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=BrUIumItvCNnNNN+MtX5Y60lKBBj+tPu5adwP5ucCjc=; b=xT2SzOz3ASgDiQxSQJyEkSvMwLMhEo8w2kkCGnuIGjIM953gzRPXzPj1WP+Vx5XVjR lVqWWS25WjYcLj/ZKIPmhylxuUR0hMYqWgVQz5c21CpwMFk3dtUn3rWfrvjem7ZjjjqF /7LQfKQdAmKYjEa/8Wzi7uw5UROip3TPoVA3YIZ2FDxl6cx0kzOOIXEpIe4h0rm/eA4B grquOP5ScFV8a+kE03m7RmGW6cAqjb8GiAPiJy7RTBIO2punm1f4mJ6O26z5GwuzQ1/h Oo0KbexlDegvMXNzkrl7tpmARCC/yrOOWF4zJlfpCievuSK0SM5oZvVZUhWxOUah0KLQ 7J2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742589006; x=1743193806; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BrUIumItvCNnNNN+MtX5Y60lKBBj+tPu5adwP5ucCjc=; b=AiI+ydTH/qlp0pf+xkhyWxHpTgElHjVfFgCtHG9hXmy0X5K8HNPZBGEtDryfc7usv7 95SeZbYYJEhN+LhfpJ/tJvfeE63Oys8Af1i5oIsqARJtUYf1oG2L4DISdtLJrFGZrD3H oTv9n65zq+Pu/eU90IZYQp0B6iGC0MTuACPLfoMD8s9HPaebLzSx3MIRnoil/knAwjt+ fp+AZwaYB83/owORcLIr9c/jkpJC6QLh82ZYmKVWnfo5xAt8kSWz2AYdcfCy2U6NZbhX O/iF3aVXkrT9i6jQ/Fi6akJb+YD0N8jRRazy96mR+hb5v/Yylfj+FRXWIbN4HNINdEY5 t5Ow== X-Gm-Message-State: AOJu0Ywwh/FV/6zzzyhSRT2xOTQt4suSM5z76ffCOtXmHld7XnpDfggS ShYvx/a8QUPDDeFgFpU80YeAfK3U3bjW7NJ7b2ErT+RGpBo+CpyTQDJ7FzDOkcY= X-Gm-Gg: ASbGncvZy3BUMmVMVTtiO2ZyKWsmK02IjQSVqsf1fIpOMB42OkS9AmpowN2yoljhVBd s6RzFOS2exbQb5fCDXNotAghCYkcqu7GVzfZzT0Aa7mOsc6W47EeBpaj0Q73mQBwZrTz5UaoTVU Ku3Gl5y7EUvoZ8uYqUrWYMaKFZwEFCF34GjIlG9wpeknebsOlPGP93hDXtkcL9kuHOplQd7w7H/ ZlmcRqLZ3g3bBLIrgn9ESemgI4XLfc6I+eWVUb3kWxuxQx70Y8QbXNwrEZtSUR1eJFbAd4ZGIeM f9R4Iah2HwDcVhh9AotqnebT3RzfD8psGRdoRrvE1zGvTf7ptw/lTdPYr8Km/57dHCRQj61ENoQ A9mb+lyEGHTouNQ== X-Google-Smtp-Source: AGHT+IF0enc0SoBKgZE9ptV5JlSLStbIP21CY/7llnPzyfEnIzCO5p0eB6iQvZVUBHy0w0u/ovLT0A== X-Received: by 2002:a05:600c:4e87:b0:43c:fe15:41c9 with SMTP id 5b1f17b1804b1-43d509ec508mr40324515e9.9.1742589005643; Fri, 21 Mar 2025 13:30:05 -0700 (PDT) Received: from [127.0.1.1] (host-87-8-62-49.retail.telecomitalia.it. [87.8.62.49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9955c0sm3258380f8f.3.2025.03.21.13.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 13:30:05 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Fri, 21 Mar 2025 21:28:48 +0100 Subject: [PATCH 1/4] docs: iio: add documentation for ad3552r driver Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250321-wip-bl-ad3552r-fixes-v1-1-3c1aa249d163@baylibre.com> References: <20250321-wip-bl-ad3552r-fixes-v1-0-3c1aa249d163@baylibre.com> In-Reply-To: <20250321-wip-bl-ad3552r-fixes-v1-0-3c1aa249d163@baylibre.com> To: =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Lars-Peter Clausen , Jonathan Corbet , Olivier Moysan , Michael Hennerich Cc: linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.2 From: Angelo Dureghello Add documentation for ad3552r driver, needed to describe the high-speed driver debugfs attributes and shows how the user may use them. Signed-off-by: Angelo Dureghello --- Documentation/iio/ad3552r.rst | 65 +++++++++++++++++++++++++++++++++++++++++++ Documentation/iio/index.rst | 1 + MAINTAINERS | 1 + 3 files changed, 67 insertions(+) diff --git a/Documentation/iio/ad3552r.rst b/Documentation/iio/ad3552r.rst new file mode 100644 index 0000000000000000000000000000000000000000..638a62c99fb876cca026a0b1df469c81ba39ff29 --- /dev/null +++ b/Documentation/iio/ad3552r.rst @@ -0,0 +1,65 @@ +.. SPDX-License-Identifier: GPL-2.0-only + +============== +AD3552R driver +============== + +Device driver for Analog Devices Inc. AD35XXR series of DACs. The module name +is ``ad3552r``. +With the same module name, two different driver variants are available, the +``generic spi`` variant, to be used with any classic SPI controllers, and the +``hs`` (high speed) variant, for an ADI ``axi-dac`` (IP core) based controller +that allows to reach the maximum sample rate supported from the DACs, using the +DMA transfer and all the SPI lines available (D/QDSPI).. +The high speed driver variant is intended to be used with the ``adi-axi-dac`` +backend support enabled, that is enabled by default when the driver is selected. + +Supported devices +================= + +* `AD3541R `_ +* `AD3542R `_ +* `AD3551R `_ +* `AD3552R `_ + +Wiring connections +------------------ + +:: + + .-----------------. .-------. + | |--- D/QSPI -----| | + | DAC IP CORE |--- SPI S_CLK --| DAC | + | |--- SPI CS -----| | + | |--- LDAC -------| | + | |--- RESET ------| | + |_________________| |_______| + + +High speed features +=================== + +Device attributes +----------------- + +The following table shows the ad35xxr related device debug files, found in the +specific device debug folder path ``/sys/kernel/debug/iio/iio:deviceX``. + ++----------------------+-------------------------------------------------------+ +| Debugfs device files | Description | ++----------------------+-------------------------------------------------------+ +| data_source | The used data source, | +| | as ``iio-buffer`` or ``backend-ramp-generator``. | ++----------------------+-------------------------------------------------------+ + +Usage examples +-------------- + +. code-block:: bash + root:/sys/bus/iio/devices/iio:device0# cat data_source + iio-buffer + root:/sys/bus/iio/devices/iio:device0# echo -n backend-ramp-generator > data_source + root:/sys/bus/iio/devices/iio:device0# cat data_sourceāŽ + backend-ramp-generator + + diff --git a/Documentation/iio/index.rst b/Documentation/iio/index.rst index bbb2edce8272e7483acca500d1a757bbcc11c1e0..2d6afc5a8ed54a90cd8d5723f0dc5212b8593d16 100644 --- a/Documentation/iio/index.rst +++ b/Documentation/iio/index.rst @@ -19,6 +19,7 @@ Industrial I/O Kernel Drivers .. toctree:: :maxdepth: 1 + ad3552r ad4000 ad4030 ad4695 diff --git a/MAINTAINERS b/MAINTAINERS index 57eaab00f6cb53df52a4799eb2c1afbbd1e77a1e..52bc56a9ee22c66b90555681c4757ea4399adae1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1295,6 +1295,7 @@ L: linux-iio@vger.kernel.org S: Supported W: https://ez.analog.com/linux-software-drivers F: Documentation/devicetree/bindings/iio/dac/adi,ad3552r.yaml +F: Documentation/iio/ad3552r.rst F: drivers/iio/dac/ad3552r.c ANALOG DEVICES INC AD4000 DRIVER From patchwork Fri Mar 21 20:28:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 14026019 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 0D44F230D08 for ; Fri, 21 Mar 2025 20:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742589011; cv=none; b=sdAxy5eCyOAYmktTIY44I3MMt9w0e3Y2PXNJqzFTo4mbGCL7Rz9XT6jflNFx4aThB3ojZEk0CSb2HAiLp1UJQS6q5JDawABPZcgWk1EYqTWlB3gBa3LT0LlNWovXTPhQB5AbEbRf8LC7oicuaryC553f9md60Cv8IKHDXZnxRIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742589011; c=relaxed/simple; bh=hWSr+N4q8jPBwyhE+M9punDDVddf1n2Qdd8iVHO9YtM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MSoFRV2OGP1XJvCCssVe+/PFFZrkxtarbnhlWgX+RC9ArWsuu3z7V6SWskhGH3LWLMENT86t+Kwxu5rLtKyjM1n1L7tLLXQI/pDZ8ukFelJvutgHe+xZRpQZpze2x4gGZGc1ZGUi5UGFO7cWQcYZHbMxCvyrqo4t3+fAzs/zVTA= 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=qxw+Q4b7; arc=none smtp.client-ip=209.85.221.47 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="qxw+Q4b7" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-399737f4fa4so1518228f8f.0 for ; Fri, 21 Mar 2025 13:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1742589007; x=1743193807; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Hl8ec5RDehNYBKLIScFWmbMlzzx1NzVQIVCz8eQlZvo=; b=qxw+Q4b7IJ7P8+PLD0Elrll/p4/sRkpufAO5EvF5cHRpsrkMcumqf8ykd+wZdVbSL2 +yXg5SyBkfZRrruYKZi1WY/JaUhAiVhunRr8ARDTzNPSG8JETEeUbgXyJh+rYUaVcPZP iPWjjiOi8OiWzTysG6G909G3d1i/SdSjbpjhhvGUqUGkbOlfWxwsTzSYUYWgQuIyunrq 5paWU3l/3QfD7jNljDn+GgDH8m3n6RGnKF1L5iBe1cIrnuk3+zQfQNxfhiP5u+to2lzX c0OtDMnMbZDhGG7MlvYqD3aWPuxkJmFkFJYjIwiB83Bj16DJ/8W8NN/wi66Vq/HzuKX6 HBrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742589007; x=1743193807; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hl8ec5RDehNYBKLIScFWmbMlzzx1NzVQIVCz8eQlZvo=; b=f4/Vrt3LJIaf+4D9o58+dQk//NmG/rLzgO205/QIrK2in+fSh//DOximv1ZzsfT+pp Xvs4+KYiAfqkBU6NmH07+ROE2ansjTMiRiVyNbeHH8heC6JOGKg0ZH+AY5+liJllSENg iHDJYIaDpKV6bbVutWZ7pzoqgqCa5wMjVWGm8cweLxI9IDdaCWNBtoHGNBAUAhffUYxK brOFBNI8ufYenLuAVtB3hxkxW5Zi/zJloWQ/vvzb57byOA+EAWQ94izqbTBaCHoHUYTb 1exWq13auzsyRF+gjAWVk2eV/bIk5piwFJoCF3VgFrhCLEOW8tJCxCGT8AvA3LMdZ7O4 yc3g== X-Gm-Message-State: AOJu0Yx0oaUP5EiRqkDjSCo90JCGtbH3R7awlhXbV7hL/sQY7m2xRL0F Tw31BwMFSQwpxU7wZZwbbFCs4Dw7lh4k4jlubLst/pVyFCVnn6IDqZNA1LIttG8= X-Gm-Gg: ASbGncvvZs5FcpJ7VgeYODEneiRseKWmEQMe3SPcrCfHeSkr262c7iLd3MZKbYWT2D7 YDyxOoPoa90GXuLpkS9T0f3VXh2cY4SmmEBqfeP8aXylVxIlDVn+l9yEiYJhshtLK+YWayJiRdE 6vEXLb9DXwKXJuwrjL0ic5V/WB+RprGtaWhu7uP0dZhOtnsXuJICqpVet/8L6FpIHAfK1bJnqlc bfMbaXmqvrRlP6go74GKhkVBjRhE6RxUpAhU7+BO5z/xgeuK7QcUNvAFtFTEhH34ICQMMd+64wg 0VV+WzmoPPcaUlXRRhmHLrnvaM1L7YcFYU7fcWpM380MQAWVAxWOHxR1955XC12sAmbh+VQo5FY hmzpTL8gmdrbgNA== X-Google-Smtp-Source: AGHT+IHCTLucmhuzq/4rYnKJArEU8s60wFNIODgk7NLbKNSu1KiGUCksZNi/AgFQk55m9xo5mz+pag== X-Received: by 2002:a05:6000:400e:b0:391:3f94:dc9e with SMTP id ffacd0b85a97d-3997f90394emr5540891f8f.16.1742589007075; Fri, 21 Mar 2025 13:30:07 -0700 (PDT) Received: from [127.0.1.1] (host-87-8-62-49.retail.telecomitalia.it. [87.8.62.49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9955c0sm3258380f8f.3.2025.03.21.13.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 13:30:06 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Fri, 21 Mar 2025 21:28:49 +0100 Subject: [PATCH 2/4] iio: backend: add support for data source get Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250321-wip-bl-ad3552r-fixes-v1-2-3c1aa249d163@baylibre.com> References: <20250321-wip-bl-ad3552r-fixes-v1-0-3c1aa249d163@baylibre.com> In-Reply-To: <20250321-wip-bl-ad3552r-fixes-v1-0-3c1aa249d163@baylibre.com> To: =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Lars-Peter Clausen , Jonathan Corbet , Olivier Moysan , Michael Hennerich Cc: linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.2 From: Angelo Dureghello Add backend support for getting the data source used. The ad3552r HDL implements an internal ramp generator, so adding the getter to allow data source get/set by debugfs. Signed-off-by: Angelo Dureghello --- drivers/iio/industrialio-backend.c | 28 ++++++++++++++++++++++++++++ include/linux/iio/backend.h | 5 +++++ 2 files changed, 33 insertions(+) diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c index a43c8d1bb3d0f4dda4277cac94b0ea9232c071e4..c1eb9ef9db08aec8437d0d00cf77914ad6611b72 100644 --- a/drivers/iio/industrialio-backend.c +++ b/drivers/iio/industrialio-backend.c @@ -380,6 +380,34 @@ int iio_backend_data_source_set(struct iio_backend *back, unsigned int chan, } EXPORT_SYMBOL_NS_GPL(iio_backend_data_source_set, "IIO_BACKEND"); +/** + * iio_backend_data_source_get - Get current data source + * @back: Backend device + * @chan: Channel number + * @data: Pointer to receive the current source value + * + * A given backend may have different sources to stream/sync data. This allows + * to know what source is in use. + * + * RETURNS: + * 0 on success, negative error number on failure. + */ +int iio_backend_data_source_get(struct iio_backend *back, unsigned int chan, + enum iio_backend_data_source *data) +{ + int ret; + + ret = iio_backend_op_call(back, data_source_get, chan, data); + if (ret) + return ret; + + if (*data >= IIO_BACKEND_DATA_SOURCE_MAX) + return -EINVAL; + + return 0; +} +EXPORT_SYMBOL_NS_GPL(iio_backend_data_source_get, "IIO_BACKEND"); + /** * iio_backend_set_sampling_freq - Set channel sampling rate * @back: Backend device diff --git a/include/linux/iio/backend.h b/include/linux/iio/backend.h index e45b7dfbec35c094942a3034fc6057a7960b9772..e59d909cb65924b4872cadd4b7e5e894c13c189f 100644 --- a/include/linux/iio/backend.h +++ b/include/linux/iio/backend.h @@ -84,6 +84,7 @@ enum iio_backend_interface_type { * @chan_disable: Disable one channel. * @data_format_set: Configure the data format for a specific channel. * @data_source_set: Configure the data source for a specific channel. + * @data_source_get: Data source getter for a specific channel. * @set_sample_rate: Configure the sampling rate for a specific channel. * @test_pattern_set: Configure a test pattern. * @chan_status: Get the channel status. @@ -115,6 +116,8 @@ struct iio_backend_ops { const struct iio_backend_data_fmt *data); int (*data_source_set)(struct iio_backend *back, unsigned int chan, enum iio_backend_data_source data); + int (*data_source_get)(struct iio_backend *back, unsigned int chan, + enum iio_backend_data_source *data); int (*set_sample_rate)(struct iio_backend *back, unsigned int chan, u64 sample_rate_hz); int (*test_pattern_set)(struct iio_backend *back, @@ -176,6 +179,8 @@ int iio_backend_data_format_set(struct iio_backend *back, unsigned int chan, const struct iio_backend_data_fmt *data); int iio_backend_data_source_set(struct iio_backend *back, unsigned int chan, enum iio_backend_data_source data); +int iio_backend_data_source_get(struct iio_backend *back, unsigned int chan, + enum iio_backend_data_source *data); int iio_backend_set_sampling_freq(struct iio_backend *back, unsigned int chan, u64 sample_rate_hz); int iio_backend_test_pattern_set(struct iio_backend *back, From patchwork Fri Mar 21 20:28:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 14026020 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 73AF3231C9F for ; Fri, 21 Mar 2025 20:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742589012; cv=none; b=mCNS0rJ2AN5hZndGHqt1pMzT6MU+nJD3Hh1Z8epA2O0NmtDjelNqsZWze55SjY7bI9n38Am2QsgeiAOJNii8WXTYVuoUuHRwpI9nfQ7gGct1I7QK5Q1xC+7+JbZrUS6mtd8VYurpQLk5u8hH0V9/nGkUQVCTwxOgdO9bbl80mWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742589012; c=relaxed/simple; bh=v4x4imsy5YbeHXwQ1xMUyqRuJG1xvnmjMKbMtujlpgM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e+m7mkSRKMwnUh1NyAiQwlYQ5qrxQlkIVzE7k7NTJxeL4rHNiC/mxOjb4DpQHkrzaHJk4y6DGOdwrBZNaFAB/P10b/pz625PfVMrgBQHDqCPH9fnZmxaKgd3S16g1PBn6I4TyDxDbaoAZW1tRJMK6pNDmkmGgbm0GsWrDVY66j0= 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=EmqRGcaN; arc=none smtp.client-ip=209.85.221.42 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="EmqRGcaN" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3913cf69784so1968718f8f.1 for ; Fri, 21 Mar 2025 13:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1742589009; x=1743193809; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6eD3Dwg/bosoHeBveeP0hmUHF2AuEcJYQ+8dX6IEYkU=; b=EmqRGcaN09z1fnbzxCHLqoEAFqstLrW4cMfGTBzpr25pRDZheRRB+HdkctrAID+Qnz iYnceBbqlfRpvdig78rOrF1TjRnji5C70c8UX8SsRmbTL/tjsl0C2Www30K2Mi6GQ5+U a8t5hHuKpcJo0Cty3PHnB5TkfLjX3fpie2wZZWlIs/TWQ5T4/BXCX3E0FvaVwmRpGURE D3YxQNCBHdoe6sqFrY4izU0ldj0j+vMf5StXabp4ir6ZBGQlNZTFjRhoHd5GTWVOcTSh 1pVu55yI5HAfQ01eR/5Ac/8eqjr5sDjCVruO1RLigFlgiFHdCKAVyI7Ilola/PjVM8sj VUdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742589009; x=1743193809; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6eD3Dwg/bosoHeBveeP0hmUHF2AuEcJYQ+8dX6IEYkU=; b=rA5Uuio/LuGxCLqM2ZdAQSwmLiMFOgCRxFq225MfxiubVyxZWPeaEQgUSxu7z7F0Je /W7bPbKhT0D0CYRXE9a20a3TkcCvRoG6wLrHi29wF0Biv0lO1tiMCiivJIjZYLbddyDe ZvJOKDpczlTLPreTC044Y5YGjSoqszf9ap8Lt51j4gafboyL7SyKG9+UQCv3U2HhJ/Xx aOvWq5IQcETlJv6TpBLE4rZXpiPHdwdSBl38Fpe41aBcgGgFz6sYSF7NWrqAKr3WIxEY lEaeWFcrs7OVlUvA2gnB32kf03op4Tea/yj6q0hMMTtDx9FNkpjcR4mEdaj8agdLWIiO 7kOQ== X-Gm-Message-State: AOJu0YyFFoJzGCJlId4EBVDRm473RFSXgSlwNEau5ODUUnhzpGN+n8Kk lJ5UinwyAsZC5iGSgEwvZ93OTA0swcAILdLHXBI33mP+M+QfmPDcNsAmGRaynnw= X-Gm-Gg: ASbGncu7l7NkxMkprtW1jCNKNVjteZFNpwRqek87+6yQ534UOYOqnoq5N6IINogSrzC oqEQCm1QA81VR7VoBxZ53YJSn/gQtfHnPP3kiQcd8qjayW/Suwhlr94L22sAzSqR0gxXoUc6LHT Rv7qgz1bRWFLUCNIfbyrp5MHw4635cHv9C4v/XpQj1jRCPV+8SNtrSgnfzMGwN1URkQ5pIRRGR3 oY2lYkYh4SIaIp+evhNwnaAT5ytXDcAvKzU569vv0upbFQa8mJvq1OMiP2oBi9uOiWLQMg4fk1r rvvU3254/5paE/tQKNZRzNReGplZ+P4Rv/bj4KV8OqG7gea9UM5bM9NPqxETAKNQETcBYt4LKW9 5cdc75nTqvUMCSA== X-Google-Smtp-Source: AGHT+IELd83dYCLpu4krqWNQj9A+sofZQSmerqTYYZH1bItX2o5eghXCKYp/HNm41o+hSItzK0uPeQ== X-Received: by 2002:a5d:5f92:0:b0:391:212:459a with SMTP id ffacd0b85a97d-3997f90ff74mr4849355f8f.22.1742589008556; Fri, 21 Mar 2025 13:30:08 -0700 (PDT) Received: from [127.0.1.1] (host-87-8-62-49.retail.telecomitalia.it. [87.8.62.49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9955c0sm3258380f8f.3.2025.03.21.13.30.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 13:30:07 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Fri, 21 Mar 2025 21:28:50 +0100 Subject: [PATCH 3/4] iio: dac: adi-axi-dac: add data source get Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250321-wip-bl-ad3552r-fixes-v1-3-3c1aa249d163@baylibre.com> References: <20250321-wip-bl-ad3552r-fixes-v1-0-3c1aa249d163@baylibre.com> In-Reply-To: <20250321-wip-bl-ad3552r-fixes-v1-0-3c1aa249d163@baylibre.com> To: =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Lars-Peter Clausen , Jonathan Corbet , Olivier Moysan , Michael Hennerich Cc: linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.2 From: Angelo Dureghello Add data source getter. Signed-off-by: Angelo Dureghello --- drivers/iio/dac/adi-axi-dac.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/iio/dac/adi-axi-dac.c b/drivers/iio/dac/adi-axi-dac.c index 892d770aec69c4259de777058801c9ab33c79923..a6abd828ebdb34800cc08a2151e52a9acda9eba1 100644 --- a/drivers/iio/dac/adi-axi-dac.c +++ b/drivers/iio/dac/adi-axi-dac.c @@ -514,6 +514,32 @@ static int axi_dac_data_source_set(struct iio_backend *back, unsigned int chan, } } +static int axi_dac_data_source_get(struct iio_backend *back, unsigned int chan, + enum iio_backend_data_source *data) +{ + struct axi_dac_state *st = iio_backend_get_priv(back); + int ret; + u32 val; + + ret = regmap_read(st->regmap, AXI_DAC_CHAN_CNTRL_7_REG(chan), &val); + if (ret) + return ret; + + switch (val) { + case AXI_DAC_DATA_INTERNAL_TONE: + *data = IIO_BACKEND_INTERNAL_CONTINUOUS_WAVE; + return 0; + case AXI_DAC_DATA_DMA: + *data = IIO_BACKEND_EXTERNAL; + return 0; + case AXI_DAC_DATA_INTERNAL_RAMP_16BIT: + *data = IIO_BACKEND_INTERNAL_RAMP_16BIT; + return 0; + default: + return -EINVAL; + } +} + static int axi_dac_set_sample_rate(struct iio_backend *back, unsigned int chan, u64 sample_rate) { @@ -794,6 +820,7 @@ static const struct iio_backend_ops axi_ad3552r_ops = { .request_buffer = axi_dac_request_buffer, .free_buffer = axi_dac_free_buffer, .data_source_set = axi_dac_data_source_set, + .data_source_get = axi_dac_data_source_get, .ddr_enable = axi_dac_ddr_enable, .ddr_disable = axi_dac_ddr_disable, .data_stream_enable = axi_dac_data_stream_enable, From patchwork Fri Mar 21 20:28:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 14026021 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 CB9232309AD for ; Fri, 21 Mar 2025 20:30:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742589015; cv=none; b=HQshiUQ8MqB7RBeTeuN2kkxQ+/sXaWE4oob5mTH5w4qtcuL9lb7c+QAj30JqUvC8D7L9UM39WRbfLuPItvSW+am1kiZRHGr9fVMNV30RAPTKSmkYZpYFegovXYUWjrc19tPxjjsB6P43mCtG67J3ToPf7HCUYK775H7EUDGs4Mc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742589015; c=relaxed/simple; bh=lzaSJ/be6is8Rty2tbrCLJKH6+jdZRvilPwu+v8J4Cs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VktI/ZclFs3G5hihmwQW8duvZEUXjG2PJzZ2diyD7T7cxdUDacBIMJcxIi1BzxAnr06kDV6/574vQQGb1P2OvnLsHmXgW44o6DS2cgPgdo/12WRqEzetrm4lsB9s74EizQISlihnbLAKAmgSGFgWcYc7pXZVkyf0C4tph5oMoz0= 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=LaHXZn6J; arc=none smtp.client-ip=209.85.128.41 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.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="LaHXZn6J" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-43cfba466b2so21867555e9.3 for ; Fri, 21 Mar 2025 13:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1742589010; x=1743193810; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IKB6yQ/p4p5H9UdGeKJqY+C71MSKxypTKujViSujDac=; b=LaHXZn6JNPGfznqTGqNxxz0/9SWD3RNBiXmugdQJKD4Jt7+TUb/E0jb0uyzm1qpL8u dR1utsSXX05dTQ8k23aws3sXkphrbwrbYZGI9CungIA3LyhHmyIffho5rhlDCmt/Xvpl jCnuhrQ24TOyW7KfoL8ee8jaYds0Lcjdx9wPj60TlzvzaSOWooxuog6wgScKZ9QIACHM I9ogDKrrOJqrdUJQYS6TknGKU2XTFKTw5dbHR4Pp+NEN0Akh4y2UukC/8l/JURVx+nJt mvUhbxvXWPM6fCFyX+CUtGbXPdi8QcsHIrNWWSr3ofTg8o/6FmQc/+AmLhpRzhYV/pRi Poyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742589010; x=1743193810; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IKB6yQ/p4p5H9UdGeKJqY+C71MSKxypTKujViSujDac=; b=PL7sbAIdog4JZpizBFkzxg0TGQqQLqtyLiF0PQ4MDQORu3dY/468TPSKfa2YITjDJM 44S9yWEAC0pIYpocVUhcNnYVGKWIY7dGQjxCfCmQp+2+GkuvqCfc1OuKbeKpYekG2SVK 9ePGjBlU4OETPQC2hgw1aqxyOGZTc+UzCHb8jOdIhXG2Ntt26Ck2dbnvnwiVwizEtBCO m0F46A9rJ4oLqk4FtDbI5HXcCUobDhfV3zCFJ+nwVSiCXz/OloHo7d0FhsH3JRGpDMqI m8F51XbilL5gjXyTgbdVsAJw9sFaVfpQfJmMEpdXaAXo3dGVfmYQn9RvMtxEGDPdgfw4 mVog== X-Gm-Message-State: AOJu0Ywr4CwcLiUOo/PXZw1PmRMh5idaWrGRpJ0NVvm0C9cwU1LIKuNl AL+v6QJEkkMMgdMvH15YJNfPVS/nGYpQuDdTbG3VmgJFl/dQESYcW+607UptQ+M= X-Gm-Gg: ASbGnctBYjpKvRRQQgO70IG1drfqgdJnvXo8X3xtVsq9Uc8TRF77fMk6uZROQwgn9GL 1uwj+G6n3hfooFJEQBCBbRcR3PIny4+1SNcLwB0k1Kd8Fwu0fkVK5ya0y/CxVTklSgHpJPBa4zA 6L6/9WeZagSDJBpv8jpoUmuu05wTB7xVXckGf+E+/hauXWbjRAD9vwVF0SAb5AFRf6isYdQEUvn 4iVTKtAcVYlT+yZ71v8xAzN6z81j6ZgXqzoyOoVteMCzZrZcn97IDn8YmN4Aq/h/MQX/+Qoa3Gl IubtDEr3LGhNfQgyIhcUT7pBLk6B+u3+bFaPeK1RUaeqnvyehDMMTg7pVAmU03079yjAcivTTM8 jAZUbMat9O/pZHg== X-Google-Smtp-Source: AGHT+IGW0KT9uYhjfvzDuW5HrybppxMZ12fXv96hH0ZZ7RsY03Ppzqsltv2FqtvQ54zHcEEm7eOWKg== X-Received: by 2002:a5d:588b:0:b0:399:737f:4de6 with SMTP id ffacd0b85a97d-3997f8f8c35mr4323719f8f.3.1742589009965; Fri, 21 Mar 2025 13:30:09 -0700 (PDT) Received: from [127.0.1.1] (host-87-8-62-49.retail.telecomitalia.it. [87.8.62.49]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9955c0sm3258380f8f.3.2025.03.21.13.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 13:30:09 -0700 (PDT) From: Angelo Dureghello X-Google-Original-From: Angelo Dureghello Date: Fri, 21 Mar 2025 21:28:51 +0100 Subject: [PATCH 4/4] iio: dac: ad3552r-hs: add support for internal ramp Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250321-wip-bl-ad3552r-fixes-v1-4-3c1aa249d163@baylibre.com> References: <20250321-wip-bl-ad3552r-fixes-v1-0-3c1aa249d163@baylibre.com> In-Reply-To: <20250321-wip-bl-ad3552r-fixes-v1-0-3c1aa249d163@baylibre.com> To: =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Lars-Peter Clausen , Jonathan Corbet , Olivier Moysan , Michael Hennerich Cc: linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Angelo Dureghello X-Mailer: b4 0.14.2 From: Angelo Dureghello The ad3552r can be feeded from the HDL controller by an internally generated 16bit ramp, useful for debug pourposes. Add debugfs a file to enable or disable it. Signed-off-by: Angelo Dureghello --- drivers/iio/dac/ad3552r-hs.c | 106 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 100 insertions(+), 6 deletions(-) diff --git a/drivers/iio/dac/ad3552r-hs.c b/drivers/iio/dac/ad3552r-hs.c index 37397e188f225a8099745ec03f7c604da76960b1..41fe78d982a68980db059b095fc27b37ea1a461b 100644 --- a/drivers/iio/dac/ad3552r-hs.c +++ b/drivers/iio/dac/ad3552r-hs.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -65,6 +66,18 @@ static int ad3552r_hs_reg_read(struct ad3552r_hs_state *st, u32 reg, u32 *val, return st->data->bus_reg_read(st->back, reg, val, xfer_size); } +static int ad3552r_hs_set_data_source(struct ad3552r_hs_state *st, + enum iio_backend_data_source type) +{ + int ret; + + ret = iio_backend_data_source_set(st->back, 0, type); + if (ret) + return ret; + + return iio_backend_data_source_set(st->back, 1, type); +} + static int ad3552r_hs_update_reg_bits(struct ad3552r_hs_state *st, u32 reg, u32 mask, u32 val, size_t xfer_size) { @@ -483,6 +496,66 @@ static int ad3552r_hs_reg_access(struct iio_dev *indio_dev, unsigned int reg, return st->data->bus_reg_write(st->back, reg, writeval, 1); } +static ssize_t ad3552r_hs_show_data_source(struct file *f, char __user *userbuf, + size_t count, loff_t *ppos) +{ + struct ad3552r_hs_state *st = file_inode(f)->i_private; + enum iio_backend_data_source type; + int ret; + + ret = iio_backend_data_source_get(st->back, 0, &type); + if (ret) + return ret; + + switch (type) { + case IIO_BACKEND_INTERNAL_RAMP_16BIT: + return simple_read_from_buffer(userbuf, count, ppos, + "backend-ramp-generator", 22); + case IIO_BACKEND_EXTERNAL: + return simple_read_from_buffer(userbuf, count, ppos, + "iio-buffer", 10); + default: + return -EINVAL; + } +} + +static ssize_t ad3552r_hs_write_data_source(struct file *f, + const char __user *userbuf, + size_t count, loff_t *ppos) +{ + struct ad3552r_hs_state *st = file_inode(f)->i_private; + char buf[64]; + int ret; + + ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, userbuf, + count); + if (ret < 0) + return ret; + + buf[count] = 0; + + if (count == 10 && !strncmp(buf, "iio-buffer", 10)) { + ret = ad3552r_hs_set_data_source(st, IIO_BACKEND_EXTERNAL); + if (ret) + return ret; + } else if (count == 22 && !strncmp(buf, "backend-ramp-generator", 22)) { + ret = ad3552r_hs_set_data_source(st, + IIO_BACKEND_INTERNAL_RAMP_16BIT); + if (ret) + return ret; + } else { + return -EINVAL; + } + + return count; +} + +static const struct file_operations ad3552r_hs_data_source_fops = { + .owner = THIS_MODULE, + .write = ad3552r_hs_write_data_source, + .read = ad3552r_hs_show_data_source, +}; + static int ad3552r_hs_setup(struct ad3552r_hs_state *st) { u16 id; @@ -550,11 +623,7 @@ static int ad3552r_hs_setup(struct ad3552r_hs_state *st) if (ret) return ret; - ret = iio_backend_data_source_set(st->back, 0, IIO_BACKEND_EXTERNAL); - if (ret) - return ret; - - ret = iio_backend_data_source_set(st->back, 1, IIO_BACKEND_EXTERNAL); + ret = ad3552r_hs_set_data_source(st, IIO_BACKEND_EXTERNAL); if (ret) return ret; @@ -661,6 +730,24 @@ static const struct iio_info ad3552r_hs_info = { .debugfs_reg_access = &ad3552r_hs_reg_access, }; +static void ad3552r_hs_debugfs_init(struct iio_dev *indio_dev) +{ + struct ad3552r_hs_state *st = iio_priv(indio_dev); + struct dentry *d = iio_get_debugfs_dentry(indio_dev); + + if (!IS_ENABLED(CONFIG_DEBUG_FS)) + return; + + d = iio_get_debugfs_dentry(indio_dev); + if (!d) { + dev_warn(st->dev, "can't set debugfs in driver dir\n"); + return; + } + + debugfs_create_file("data_source", 0600, d, st, + &ad3552r_hs_data_source_fops); +} + static int ad3552r_hs_probe(struct platform_device *pdev) { struct ad3552r_hs_state *st; @@ -705,7 +792,14 @@ static int ad3552r_hs_probe(struct platform_device *pdev) if (ret) return ret; - return devm_iio_device_register(&pdev->dev, indio_dev); + ret = devm_iio_device_register(&pdev->dev, indio_dev); + if (ret) + return ret; + + ad3552r_hs_debugfs_init(indio_dev); + + return ret; + } static const struct of_device_id ad3552r_hs_of_id[] = {