From: Marcelo Schmitt <marcelo.schmitt@analog.com>
To: <linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: Ana-Maria Cusco <ana-maria.cusco@analog.com>, <jic23@kernel.org>,
<lars@metafoo.de>, <Michael.Hennerich@analog.com>,
<robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
<marcelo.schmitt1@gmail.com>
Subject: [RFC PATCH 1/4] include: dt-bindings: iio: adc: Add defines for AD4170
Date: Wed, 18 Dec 2024 11:37:26 -0300 [thread overview]
Message-ID: <973852b372f8ecf3a62dc7e5b26d75bfaab99a4d.1734530280.git.marcelo.schmitt@analog.com> (raw)
In-Reply-To: <cover.1734530280.git.marcelo.schmitt@analog.com>
From: Ana-Maria Cusco <ana-maria.cusco@analog.com>
Add defines to improve readability of AD4170 device tree nodes.
Signed-off-by: Ana-Maria Cusco <ana-maria.cusco@analog.com>
Co-developed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
---
include/dt-bindings/iio/adc/adi,ad4170.h | 96 ++++++++++++++++++++++++
1 file changed, 96 insertions(+)
create mode 100644 include/dt-bindings/iio/adc/adi,ad4170.h
diff --git a/include/dt-bindings/iio/adc/adi,ad4170.h b/include/dt-bindings/iio/adc/adi,ad4170.h
new file mode 100644
index 000000000000..a508b37e9a46
--- /dev/null
+++ b/include/dt-bindings/iio/adc/adi,ad4170.h
@@ -0,0 +1,96 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * AD4170 ADC
+ *
+ * Copyright 2024 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2.
+ */
+
+#ifndef _DT_BINDINGS_IIO_ADC_AD4170_H_
+#define _DT_BINDINGS_IIO_ADC_AD4170_H_
+
+/*
+ * Excitation Current Chopping Control.
+ * Use for adi,chop-iexc
+ */
+#define AD4170_MISC_CHOP_IEXC_OFF 0
+/* Chopping of Iout_A and Iout_B Excitation Currents. */
+#define AD4170_MISC_CHOP_IEXC_AB 1
+/* Chopping of Iout_C and Iout_D Excitation Currents. */
+#define AD4170_MISC_CHOP_IEXC_CD 2
+/* Chopping of Both Pairs of Excitation Currents. */
+#define AD4170_MISC_CHOP_IEXC_ABCD 3
+
+/*
+ * Chopping
+ * Use for adi,chop-adc
+ */
+/* No Chopping. */
+#define AD4170_MISC_CHOP_ADC_OFF 0
+/* Chops Internal Mux. */
+#define AD4170_MISC_CHOP_ADC_MUX 1
+/* Chops AC Excitation Using 4 GPIO Pins. */
+#define AD4170_MISC_CHOP_ADC_ACX_4PIN 2
+/* Chops AC Excitation Using 2 GPIO Pins. */
+#define AD4170_MISC_CHOP_ADC_ACX_2PIN 3
+
+/*
+ * Reference Selection Mode
+ * Use for adi,reference-select
+ */
+#define AD4170_AFE_REFIN_REFIN1 0
+#define AD4170_AFE_REFIN_REFIN2 1
+#define AD4170_AFE_REFIN_REFOUT 2
+#define AD4170_AFE_REFIN_AVDD 3
+
+/*
+ * Definitios for describing channel selections
+ * Use for adi,channel-map
+ */
+#define AD4170_MAP_AIN0 0
+#define AD4170_MAP_AIN1 1
+#define AD4170_MAP_AIN2 2
+#define AD4170_MAP_AIN3 3
+#define AD4170_MAP_AIN4 4
+#define AD4170_MAP_AIN5 5
+#define AD4170_MAP_AIN6 6
+#define AD4170_MAP_AIN7 7
+#define AD4170_MAP_AIN8 8
+#define AD4170_MAP_TEMP_SENSOR_P 17
+#define AD4170_MAP_TEMP_SENSOR_N 17
+#define AD4170_MAP_AVDD_AVSS_P 18
+#define AD4170_MAP_AVDD_AVSS_N 18
+#define AD4170_MAP_IOVDD_DGND_P 19
+#define AD4170_MAP_IOVDD_DGND_N 19
+#define AD4170_MAP_DAC_P 20
+#define AD4170_MAP_DAC_N 20
+#define AD4170_MAP_ALDO 21
+#define AD4170_MAP_DLDO 22
+#define AD4170_MAP_AVSS 23
+#define AD4170_MAP_DGND 24
+#define AD4170_MAP_REFIN1_P 25
+#define AD4170_MAP_REFIN1_N 26
+#define AD4170_MAP_REFIN2_P 27
+#define AD4170_MAP_REFIN2_N 28
+#define AD4170_MAP_REFOUT 29
+
+/*
+ * Definitios for describing excitation current output pin selections
+ * Use for adi,excitation-pin-0/1/2/3
+ */
+#define AD4170_CURRENT_IOUT_AIN0 0
+#define AD4170_CURRENT_IOUT_AIN1 1
+#define AD4170_CURRENT_IOUT_AIN2 2
+#define AD4170_CURRENT_IOUT_AIN3 3
+#define AD4170_CURRENT_IOUT_AIN4 4
+#define AD4170_CURRENT_IOUT_AIN5 5
+#define AD4170_CURRENT_IOUT_AIN6 6
+#define AD4170_CURRENT_IOUT_AIN7 7
+#define AD4170_CURRENT_IOUT_AIN8 8
+#define AD4170_CURRENT_IOUT_GPIO0 17
+#define AD4170_CURRENT_IOUT_GPIO1 18
+#define AD4170_CURRENT_IOUT_GPIO2 19
+#define AD4170_CURRENT_IOUT_GPIO3 20
+
+#endif /* _DT_BINDINGS_IIO_ADC_AD4170_H_ */
--
2.45.2
next prev parent reply other threads:[~2024-12-18 14:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 14:37 [RFC PATCH 0/4] Add support " Marcelo Schmitt
2024-12-18 14:37 ` Marcelo Schmitt [this message]
2024-12-19 9:22 ` [RFC PATCH 1/4] include: dt-bindings: iio: adc: Add defines " Krzysztof Kozlowski
2024-12-18 14:37 ` [RFC PATCH 2/4] dt-bindings: iio: adc: Add AD4170 Marcelo Schmitt
2024-12-18 15:25 ` Rob Herring (Arm)
2024-12-18 19:48 ` Rob Herring
2024-12-19 14:07 ` Jonathan Cameron
2024-12-19 14:03 ` Jonathan Cameron
2024-12-18 14:37 ` [RFC PATCH 3/4] iio: adc: Add support for AD4170 Marcelo Schmitt
2024-12-19 9:25 ` Krzysztof Kozlowski
2024-12-19 14:15 ` Jonathan Cameron
2024-12-19 15:04 ` Jonathan Cameron
2024-12-19 19:49 ` David Lechner
2024-12-18 14:38 ` [RFC PATCH 4/4] Documentation: iio: Add ADC documentation Marcelo Schmitt
2024-12-18 20:46 ` David Lechner
2024-12-19 12:55 ` Jonathan Cameron
2025-01-14 13:36 ` Marcelo Schmitt
2025-01-14 13:33 ` Marcelo Schmitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=973852b372f8ecf3a62dc7e5b26d75bfaab99a4d.1734530280.git.marcelo.schmitt@analog.com \
--to=marcelo.schmitt@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=ana-maria.cusco@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®