From patchwork Thu Jul 27 15:03:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Moysan X-Patchwork-Id: 707991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67940C001E0 for ; Thu, 27 Jul 2023 15:04:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 226F7846; Thu, 27 Jul 2023 17:04:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 226F7846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690470291; bh=sYAFTE79+RoX0LsvWor3HthbARpspjQmix6P+HTVRLs=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=XBXTVAF2FLMocsB0GFnZ9bHF5DGQYhv2m/9SDoFP2l990lthWGJKJQVgc9GUnZOtI YHh8GjSX8G355C43UpaW12KpA3whEhB19tDiLM0FhnoGQ0yTo6mzt5uP0jXBf6dLlS cic/0ARcNYebzpmqUxZ5DLhIl7S6O+U0kVkRFa+k= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D6FCF80310; Thu, 27 Jul 2023 17:04:00 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0668DF8019B; Thu, 27 Jul 2023 17:04:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7F668F8019B; Thu, 27 Jul 2023 17:03:56 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 599B4F80153 for ; Thu, 27 Jul 2023 17:03:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 599B4F80153 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector1 header.b=WKh8WR22 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36RBD8l4020221; Thu, 27 Jul 2023 17:03:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=doC1Pd1d3NibZb37WWHiE70DKjD6XTr1B8pDdUXXdeU=; b=WKh8WR22AxBJ/QxFWaS3op28d0rl7a8Nyuf6roe+2yyfevhAi98xg0CqHDltNkrDgyCQ cNGzI37Wav5oon8GfmjPvsK5pvTKyvP5Li5Saxd7N15R8t87i/2RCDrx3Yoqj/haszej HsgcbTr9VqAs50j6UB6X28DAq7G5/Mx6ah0v/eg4zZUVfyeLLhX2MHCmJgLSDWST6NIB r9bRDSvd10mF/j4yGAj88HdwyJ54sPzWV5wF+J/hMKLnx0od6XRv09VPyNNSDi8LKtla xQ6DWpi3LzqPNU++36daT5H/8/mF2t15BFr7jtJWvhBOotJ202ikt8n3HS0WS3xpGXy4 8w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3s3qgy97v8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jul 2023 17:03:35 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4313010002A; Thu, 27 Jul 2023 17:03:35 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3859B209BA1; Thu, 27 Jul 2023 17:03:35 +0200 (CEST) Received: from localhost (10.201.20.178) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 27 Jul 2023 17:03:34 +0200 From: Olivier Moysan To: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Olivier Moysan , Arnaud Pouliquen , Maxime Coquelin , Alexandre Torgue , Frank Rowand , Liam Girdwood , Mark Brown , Fabrice Gasnier CC: , , , , , Subject: [RFC v2 00/11] iio: add iio backend device type Date: Thu, 27 Jul 2023 17:03:11 +0200 Message-ID: <20230727150324.1157933-1-olivier.moysan@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.201.20.178] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-27_07,2023-07-26_01,2023-05-22_02 Message-ID-Hash: KUW22GVIPNANOBKDTQBGC43IVJDMZPVH X-Message-ID-Hash: KUW22GVIPNANOBKDTQBGC43IVJDMZPVH X-MailFrom: prvs=5572493f00=olivier.moysan@foss.st.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This v2 is an addon to initial RFC: https://lore.kernel.org/lkml/20230623140944.2613002-1-olivier.moysan@foss.st.com/ Despite the "IIO backend" naming has to be changed (as pointed out by Jonathan previously), it has been kept here, for time being. The appropriated naming still has to be discussed later on. In the previous RFC the "IIO backend" concept was proposed through a set of template APIs. This v2 implements a functionnal exemple based on STM32 DFSDM, to bring scaling support to this peripheral. Olivier Moysan (11): iio: introduce iio backend device of: property: add device link support for io-backends dt-bindings: iio: stm32-dfsdm-adc: add scaling support dt-bindings: iio: adc: add scaling support to sd modulator iio: adc: stm32-dfsdm: manage dfsdm as a channel provider iio: adc: stm32-dfsdm: adopt generic channel bindings iio: adc: stm32-dfsdm: add scaling support to dfsdm iio: adc: sd modulator: add scale and offset support ARM: dts: stm32: adopt new dfsdm bindings on stm32mp151 ARM: dts: stm32: add dfsdm pins muxing on stm32mp15 ARM: dts: stm32: add dfsdm iio support on stm32mp157c-ev .../iio/adc/sigma-delta-modulator.yaml | 9 +- .../bindings/iio/adc/st,stm32-dfsdm-adc.yaml | 189 ++++++------------ arch/arm/boot/dts/st/stm32mp15-pinctrl.dtsi | 39 ++++ arch/arm/boot/dts/st/stm32mp151.dtsi | 18 +- arch/arm/boot/dts/st/stm32mp157c-ev1.dts | 68 +++++++ drivers/iio/Makefile | 1 + drivers/iio/adc/sd_adc_modulator.c | 106 ++++++++-- drivers/iio/adc/stm32-dfsdm-adc.c | 187 +++++++++++------ drivers/iio/industrialio-backend.c | 107 ++++++++++ drivers/of/property.c | 2 + include/linux/iio/backend.h | 56 ++++++ 11 files changed, 561 insertions(+), 221 deletions(-) create mode 100644 drivers/iio/industrialio-backend.c create mode 100644 include/linux/iio/backend.h