-
Notifications
You must be signed in to change notification settings - Fork 904
iio: adc: add max11410 adc driver #1810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
What: /sys/bus/iio/devices/iio:deviceX/in_voltage_filterY_notch_en | ||
Date: September 2022 | ||
KernelVersion: 6.0 | ||
Contact: linux-iio@vger.kernel.org | ||
Description: | ||
Enable or disable a notch filter. | ||
|
||
What: /sys/bus/iio/devices/iio:deviceX/in_voltage_filterY_notch_center | ||
Date: September 2022 | ||
KernelVersion: 6.0 | ||
Contact: linux-iio@vger.kernel.org | ||
Description: | ||
Center frequency of the notch filter in Hz. |
177 changes: 177 additions & 0 deletions
177
Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | ||
# Copyright 2022 Analog Devices Inc. | ||
%YAML 1.2 | ||
--- | ||
$id: http://devicetree.org/schemas/iio/adc/adi,max11410.yaml# | ||
$schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
||
title: Analog Devices MAX11410 ADC device driver | ||
|
||
maintainers: | ||
- Ibrahim Tilki <Ibrahim.Tilki@analog.com> | ||
|
||
description: | | ||
Bindings for the Analog Devices MAX11410 ADC device. Datasheet can be | ||
found here: | ||
https://datasheets.maximintegrated.com/en/ds/MAX11410.pdf | ||
|
||
properties: | ||
compatible: | ||
enum: | ||
- adi,max11410 | ||
|
||
reg: | ||
maxItems: 1 | ||
|
||
interrupts: | ||
minItems: 1 | ||
maxItems: 2 | ||
|
||
interrupt-names: | ||
description: Name of the gpio pin of max11410 used for IRQ | ||
minItems: 1 | ||
items: | ||
- enum: [gpio0, gpio1] | ||
- const: gpio1 | ||
|
||
'#address-cells': | ||
const: 1 | ||
|
||
'#size-cells': | ||
const: 0 | ||
|
||
avdd-supply: | ||
description: Optional avdd supply. Used as reference when no explicit reference \ | ||
upplied. + | ||
vref0p-supply: | ||
description: vref0p supply can be used as reference for conversion. | ||
|
||
vref1p-supply: | ||
description: vref1p supply can be used as reference for conversion. | ||
|
||
vref2p-supply: | ||
description: vref2p supply can be used as reference for conversion. | ||
|
||
vref0n-supply: | ||
description: vref0n supply can be used as reference for conversion. | ||
|
||
vref1n-supply: | ||
description: vref1n supply can be used as reference for conversion. | ||
|
||
vref2n-supply: | ||
description: vref2n supply can be used as reference for conversion. | ||
|
||
spi-max-frequency: | ||
maximum: 8000000 | ||
|
||
patternProperties: | ||
"^channel(@[0-9])?$": | ||
$ref: adc.yaml | ||
type: object | ||
description: Represents the external channels which are connected to the ADC. | ||
|
||
properties: | ||
reg: | ||
description: The channel number in single-ended mode. | ||
minimum: 0 | ||
maximum: 9 | ||
|
||
adi,reference: | ||
description: | | ||
Select the reference source to use when converting on | ||
the specific channel. Valid values are: | ||
0: VREF0P/VREF0N | ||
1: VREF1P/VREF1N | ||
2: VREF2P/VREF2N | ||
3: AVDD/AGND | ||
4: VREF0P/AGND | ||
5: VREF1P/AGND | ||
6: VREF2P/AGND | ||
If this field is left empty, AVDD/AGND is selected. | ||
$ref: /schemas/types.yaml#/definitions/uint32 | ||
enum: [0, 1, 2, 3, 4, 5, 6] | ||
default: 3 | ||
|
||
adi,input-mode: | ||
description: | | ||
Select signal path of input channels. Valid values are: | ||
0: Buffered, low-power, unity-gain path (default) | ||
1: Bypass path | ||
2: PGA path | ||
$ref: /schemas/types.yaml#/definitions/uint32 | ||
enum: [0, 1, 2] | ||
default: 0 | ||
|
||
diff-channels: true | ||
|
||
bipolar: true | ||
|
||
settling-time-us: true | ||
|
||
adi,buffered-vrefp: | ||
description: Enable buffered mode for positive reference. | ||
type: boolean | ||
|
||
adi,buffered-vrefn: | ||
description: Enable buffered mode for negative reference. | ||
type: boolean | ||
|
||
required: | ||
- reg | ||
|
||
additionalProperties: false | ||
|
||
required: | ||
- compatible | ||
- reg | ||
|
||
allOf: | ||
- $ref: /schemas/spi/spi-peripheral-props.yaml# | ||
|
||
unevaluatedProperties: false | ||
|
||
examples: | ||
- | | ||
#include <dt-bindings/interrupt-controller/irq.h> | ||
spi { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
adc@0 { | ||
reg = <0>; | ||
compatible = "adi,max11410"; | ||
spi-max-frequency = <8000000>; | ||
|
||
interrupt-parent = <&gpio>; | ||
interrupts = <25 IRQ_TYPE_EDGE_FALLING>; | ||
interrupt-names = "gpio1"; | ||
|
||
avdd-supply = <&adc_avdd>; | ||
|
||
vref1p-supply = <&adc_vref1p>; | ||
vref1n-supply = <&adc_vref1n>; | ||
|
||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
channel@0 { | ||
reg = <0>; | ||
}; | ||
|
||
channel@1 { | ||
reg = <1>; | ||
diff-channels = <2 3>; | ||
adi,reference = <1>; | ||
bipolar; | ||
settling-time-us = <100000>; | ||
}; | ||
|
||
channel@2 { | ||
reg = <2>; | ||
diff-channels = <7 9>; | ||
adi,reference = <5>; | ||
adi,input-mode = <2>; | ||
settling-time-us = <50000>; | ||
}; | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,3 +184,4 @@ config IIO_ALL_ADI_DRIVERS | |
imply AD74413R | ||
imply ADI_IIO_FAKEDEV | ||
imply LTC2688 | ||
imply MAX11410 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not convinced this should be here... but well, up to you 👍