The LTC6373 is a silicon, 3-bit Fully-Differential digital instrumentation
amplifier that supports the following programmable gains (Vout/Vin):
G = 0.25, 0.5, 1, 2, 4, 8, 16 + Shutdown.
The programmable interface consists of 3 digitally controled inputs.
V4->V5
Move converion logic:
- Modify to use callbacks
Use pointers in match table:
- Drop enum type from state
Driver:
- Use DIV_ROUND_CLOSEST for conversion
- Remove comma from ltc6373_ext_info[]
V3->V4
- Fix git commit message typo and remove newline between tags
V2->V3
- Use return instead of break in *_gain_dB_to_code()
- Add new line before return in *_code_to_gain_dB()
- Match parameter alignment for added _powerdown functions
- Add precursor patch for using pointers in the match table
- Add chip_info attributes: has_powerdown and powerdown_val
- Change probe logic to use has_powerdown for default powerdown state
- Added 'Fixes' tag to commit message of 'add conditional GPIO array...'
V1->V2
Driver:
- Fix chip info table indent
- Remove enable attribute
- Add ext_info powerdown attribute
- Enable by default powerdown attribute
- Set default gain after disabling powerdown to min value
Binding:
- Fix conditional checking of GPIO array size for LTC6373
- Add precursor commit for correctly checking gpio size depending upon compatible
Dumitru Ceclan (5):
dt-bindings: iio: hmc425a: add conditional GPIO array size constraints
dt-bindings: iio: hmc425a: add entry for LTC6373
iio: amplifiers: hmc425a: move conversion logic
iio: amplifiers: hmc425a: use pointers in match table
iio: amplifiers: hmc425a: add support for LTC6373 Instrumentation
Amplifier
.../bindings/iio/amplifiers/adi,hmc425a.yaml | 47 ++-
drivers/iio/amplifiers/hmc425a.c | 273 ++++++++++++++----
2 files changed, 259 insertions(+), 61 deletions(-)
--
2.42.0
ADRF5740 and HMC540S have a 4 bit parallel interface.
Update ctrl-gpios description and min/maxItems values depending on the
matched compatible to correctly reflect the hardware properties.
Fixes: 79f2ff6461e7 ("dt-bindings: iio: hmc425a: add entry for ADRF5740 Attenuator")
Fixes: 20f87a9a26be ("dt-bindings: iio: hmc425a: add entry for HMC540S")
Acked-by: Conor Dooley <[email protected]>
Signed-off-by: Dumitru Ceclan <[email protected]>
---
.../bindings/iio/amplifiers/adi,hmc425a.yaml | 33 +++++++++++++++++--
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml b/Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml
index 67de9d4e3a1d..a434cb8ddcc9 100644
--- a/Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml
+++ b/Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml
@@ -33,11 +33,38 @@ properties:
ctrl-gpios:
description:
- Must contain an array of 6 GPIO specifiers, referring to the GPIO pins
- connected to the control pins V1-V6.
- minItems: 6
+ Must contain an array of GPIO specifiers, referring to the GPIO pins
+ connected to the control pins.
+ ADRF5740 - 4 GPIO connected to D2-D5
+ HMC540S - 4 GPIO connected to V1-V4
+ HMC425A - 6 GPIO connected to V1-V6
+ minItems: 1
maxItems: 6
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: adi,hmc425a
+ then:
+ properties:
+ ctrl-gpios:
+ minItems: 6
+ maxItems: 6
+ - if:
+ properties:
+ compatible:
+ contains:
+ anyOf:
+ - const: adi,adrf5740
+ - const: adi,hmc540s
+ then:
+ properties:
+ ctrl-gpios:
+ minItems: 4
+ maxItems: 4
+
required:
- compatible
- ctrl-gpios
--
2.42.0
The LTC6373 is a silicon, 3-bit Fully-Differential digital instrumentation
amplifier that supports the following programmable gains (Vout/Vin):
G = 0.25, 0.5, 1, 2, 4, 8, 16 + Shutdown.
Acked-by: Conor Dooley <[email protected]>
Signed-off-by: Dumitru Ceclan <[email protected]>
---
.../bindings/iio/amplifiers/adi,hmc425a.yaml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml b/Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml
index a434cb8ddcc9..3a470459b965 100644
--- a/Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml
+++ b/Documentation/devicetree/bindings/iio/amplifiers/adi,hmc425a.yaml
@@ -21,6 +21,8 @@ description: |
HMC540S 1 dB LSB Silicon MMIC 4-Bit Digital Positive Control Attenuator, 0.1 - 8 GHz
https://www.analog.com/media/en/technical-documentation/data-sheets/hmc540s.pdf
+ LTC6373 is a 3-Bit precision instrumentation amplifier with fully differential outputs
+ https://www.analog.com/media/en/technical-documentation/data-sheets/ltc6373.pdf
properties:
compatible:
@@ -28,6 +30,7 @@ properties:
- adi,adrf5740
- adi,hmc425a
- adi,hmc540s
+ - adi,ltc6373
vcc-supply: true
@@ -38,6 +41,7 @@ properties:
ADRF5740 - 4 GPIO connected to D2-D5
HMC540S - 4 GPIO connected to V1-V4
HMC425A - 6 GPIO connected to V1-V6
+ LTC6373 - 3 GPIO connected to A0-A2
minItems: 1
maxItems: 6
@@ -64,6 +68,16 @@ allOf:
ctrl-gpios:
minItems: 4
maxItems: 4
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: adi,ltc6373
+ then:
+ properties:
+ ctrl-gpios:
+ minItems: 3
+ maxItems: 3
required:
- compatible
--
2.42.0