From nobody Thu Nov 28 04:44:34 2024 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 8C4251AE00E for ; Fri, 4 Oct 2024 21:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728078533; cv=none; b=g/EXJclYonl2D+878gIJDrFBe7/h9nodXB8JO1yFyVatfS2R69oUf+KCSz/JC8aCQNrlR/+aZ2SqtxrYBwYjj0jEdsbd4TK/zRiBQSv8SHW+vLd6KX3SG3R2i+kJd+gTRpRgeJt/YQrJh41JnArP4HuBJRq7tvvfylcyhgo9MQc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728078533; c=relaxed/simple; bh=EZV8dwpNecrxaA4gPBjayOFyXxpIgNERPQfdwxT0f2w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=npyxYD3GP1Cse5RKWoE3uexmfPgZDHUDwLCXb+gHS85UE2v/KsTygdsQuXd3zWLHsO6HnEcQlfeCLGkLKWVuYfHhBAl9f/0v42G0a222EF1MF4w95p4DAXBiBaSpCOv5QE4xVPNB5HOMwcxq2DeGJ78t35bwjcynIj8CYkrGC7U= 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=kYOv5Fgc; arc=none smtp.client-ip=209.85.128.46 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="kYOv5Fgc" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42ca6ba750eso15985995e9.0 for ; Fri, 04 Oct 2024 14:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728078530; x=1728683330; 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=aqWeA0LEyP3743aCtTxENnEYgzsdT+gARkI29iFfPOM=; b=kYOv5Fgc5FhUoesPXstC1CzXi0At8wQ1Z7Pk3Gm1TxoWnMFIsprUlYKInvWImmaHef 9nBGV/B2YDeLyOUQ5V6+RVE1ASA2k6N8ERyLe9RaMC5T1cUK3xqtNMesmSVYKxAwSQjv 4AfH/dGXBNuXKKra8W5RH1foQSoQfBhZdfLXdk3Y3/m9ylIVTHdvXOSYXGupb00AWuir TJTsky+SejqX0N6bf8XZfrulxqbBGJRWCaU2QiTc5lR/PhniIZK9tD6GkPYNI5+3aQ33 aD3ua8sbeJp7yucti26Xe5rDjc1Z6dobe5pC+n3kuXF0vMEXpWPNZIPrFN510qPMcpeX H1/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728078530; x=1728683330; 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=aqWeA0LEyP3743aCtTxENnEYgzsdT+gARkI29iFfPOM=; b=hHaEYL7q9/BJ/lODMIRJyU+GAHVyXpfMxjsY7HnfbJ+OEsLj+SVSUONqXJJNna7A+9 3r4WWmWfjkG7rUtBoRBW+H8zCWZkkKvywiGGHPqhpNy+/B6IDVYBEzHpC2SknulWQ/PF 1rW6AoXbrQo77QQvAwqnGZhmbNkSrImSJaYn5C6MbAh5EpZ4Om+NW3wjME962lyAI6TB 0TCCfvFAmFVDSTwB/YqVtOdd4ZC16vuxYvDDFw+2eBA9B6FucNlmflMi/Z1C+96qPx/G 0DLv/n867bv6OJNz0ucZt+M+/aAo2ND3Zik1yJgY4iLP0Lt1UTfp32/KlpMvwokTJ+yn XO9g== X-Forwarded-Encrypted: i=1; AJvYcCXvag9SsA041g27jIFiYFH/9ZqV7f/sIsEzGQjBgIZdI/64Asdzexx5jCKQUsy2Kz0YY5FuxaykVkESVrk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8VI4ZKh97/bRayl50dAKSE1FfxU/hOgM9J9+GAxqiSzPBkOJy Z4zsO8k9ArG79A4n2Feqqxp6/G5IYSNP+OcFJ616lRRlz8Rii5UN4y7qKTT+P0k= X-Google-Smtp-Source: AGHT+IFOelcSDljYwTZ3b1CqqshjojVPvrSodxfuXipBb6+t8a3QnlRE/fgX9Pqas+cEy3gWoq5beQ== X-Received: by 2002:a05:600c:1d1c:b0:42c:b697:a62c with SMTP id 5b1f17b1804b1-42f7df1cffbmr56193625e9.5.1728078529506; Fri, 04 Oct 2024 14:48:49 -0700 (PDT) Received: from [127.0.1.1] (frhb82016ds.ikexpress.com. [185.246.87.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f86b4ab63sm24680375e9.40.2024.10.04.14.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 14:48:49 -0700 (PDT) From: Guillaume Stols Date: Fri, 04 Oct 2024 21:48:37 +0000 Subject: [PATCH v3 03/10] dt-bindings: iio: adc: ad7606: Add iio backend bindings Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241004-ad7606_add_iio_backend_support-v3-3-38757012ce82@baylibre.com> References: <20241004-ad7606_add_iio_backend_support-v3-0-38757012ce82@baylibre.com> In-Reply-To: <20241004-ad7606_add_iio_backend_support-v3-0-38757012ce82@baylibre.com> To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , Jonathan Corbet Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Hennerich , linux-fbdev@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, aardelean@baylibre.com, dlechner@baylibre.com, Jonathan Cameron , Guillaume Stols X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728078523; l=3674; i=gstols@baylibre.com; s=20240417; h=from:subject:message-id; bh=EZV8dwpNecrxaA4gPBjayOFyXxpIgNERPQfdwxT0f2w=; b=rhqaKH6XB4tMlodHXcvh1879XCExdjmm3WkwiHwl2vsDT6KX7CZ/tBLm0AlR5QtNKDbHzV2r5 +j3Czol72YWDFIaM1qiiATSytiRQL1Eu9i8+7JXC5T/EfXecO5OGu// X-Developer-Key: i=gstols@baylibre.com; a=ed25519; pk=XvMm5WHuV67sGYOJZqIYzXndbaJOlNd8Q6li6vnb4Cs= Add the required properties for iio-backend support, as well as an example and the conditions to mutually exclude interruption and conversion trigger with iio-backend. The iio-backend's function is to controls the communication, and thus the interruption pin won't be available anymore. As a consequence, the conversion pin must be controlled externally since we will miss information about when every single conversion cycle (i.e conversion + data transfer) ends, hence a PWM is introduced to trigger the conversions. Signed-off-by: Guillaume Stols Reviewed-by: Rob Herring (Arm) --- .../devicetree/bindings/iio/adc/adi,ad7606.yaml | 64 ++++++++++++++++++= +++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml b/Do= cumentation/devicetree/bindings/iio/adc/adi,ad7606.yaml index 47081c79a1cf..a389cfda824d 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml @@ -129,6 +129,29 @@ properties: assumed that the pins are hardwired to VDD. type: boolean =20 + pwms: + description: + In case the conversion is triggered by a PWM instead of a GPIO plugg= ed to + the CONVST pin, the PWM must be referenced. + The first is the PWM connected to CONVST or CONVST1 for the chips wi= th 2 + PWM connected to CONVST2 if CONVST2 is available and not shorted to + CONVST1. + minItems: 1 + maxItems: 2 + + pwm-names: + items: + - const: convst1 + - const: convst2 + + io-backends: + description: + A reference to the iio-backend, which is responsible handling the BU= SY + pin's falling edge and communication. + An example of backend can be found at + http://analogdevicesinc.github.io/hdl/library/axi_ad7606x/index.html + + patternProperties: "^channel@[1-8]$": type: object @@ -175,12 +198,22 @@ required: - reg - avcc-supply - vdrive-supply - - interrupts - - adi,conversion-start-gpios =20 allOf: - $ref: /schemas/spi/spi-peripheral-props.yaml# =20 + - oneOf: + - required: + - adi,conversion-start-gpios + - required: + - pwms + + - oneOf: + - required: + - interrupts + - required: + - io-backends + - if: properties: compatible: @@ -222,6 +255,10 @@ allOf: adi,sw-mode: false else: properties: + pwms: + maxItems: 1 + pwm-names: + maxItems: 1 adi,conversion-start-gpios: maxItems: 1 =20 @@ -247,6 +284,29 @@ allOf: unevaluatedProperties: false =20 examples: + - | + #include + iio-backend { + #address-cells =3D <1>; + #size-cells =3D <0>; + adi_adc@0 { + compatible =3D "adi,ad7606b"; + reg =3D <0>; + pwms =3D <&axi_pwm_gen 0 0>; + + avcc-supply =3D <&adc_vref>; + vdrive-supply =3D <&vdd_supply>; + + reset-gpios =3D <&gpio0 91 GPIO_ACTIVE_HIGH>; + standby-gpios =3D <&gpio0 90 GPIO_ACTIVE_LOW>; + adi,range-gpios =3D <&gpio0 89 GPIO_ACTIVE_HIGH>; + adi,oversampling-ratio-gpios =3D <&gpio0 88 GPIO_ACTIVE_HIGH + &gpio0 87 GPIO_ACTIVE_HIGH + &gpio0 86 GPIO_ACTIVE_HIGH>; + io-backends =3D <&iio_backend>; + }; + }; + - | #include #include --=20 2.34.1