-
Notifications
You must be signed in to change notification settings - Fork 915
Max22007 dev #3015
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
base: rpi-6.12.y
Are you sure you want to change the base?
Max22007 dev #3015
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| What: /sys/bus/iio/devices/iio:deviceX/out_voltageY_ldac_update | ||
| KernelVersion: 6.13 | ||
| Contact: linux-iio@vger.kernel.org | ||
| Description: | ||
| Trigger LDAC (Load DAC) update for the specified channel. Write 1 to update DAC outputs. | ||
|
|
||
| What: /sys/bus/iio/devices/iio:deviceX/out_currentY_ldac_update | ||
| KernelVersion: 6.13 | ||
| Contact: linux-iio@vger.kernel.org | ||
| Description: | ||
| Trigger LDAC (Load DAC) update for the specified channel. | ||
| Writing 1 will transfer the DAC register value to the actual | ||
| DAC output, effectively updating the analog output current. | ||
| Writing 0 has no effect. This is useful when using the | ||
| transparent latch mode is disabled, allowing manual control | ||
| over when DAC register changes take effect on the output. | ||
|
|
||
| What: /sys/bus/iio/devices/iio:deviceX/out_voltageY_powermode | ||
| What: /sys/bus/iio/devices/iio:deviceX/out_currentY_powermode | ||
| KernelVersion: 6.13 | ||
| Contact: linux-iio@vger.kernel.org | ||
| Description: | ||
| Control the power state of the specified channel. Write "on" to | ||
| enable the channel output, or "off" to disable it. Reading | ||
| returns the current power state. | ||
|
Comment on lines
+18
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't this be supported with
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. With the above, I guess we do not need any custom ABI |
||
|
|
||
| What: /sys/bus/iio/devices/iio:deviceX/out_voltageY_powermode_available | ||
| What: /sys/bus/iio/devices/iio:deviceX/out_currentY_powermode_available | ||
| KernelVersion: 6.13 | ||
| Contact: linux-iio@vger.kernel.org | ||
| Description: | ||
| Shows the available power modes for the channel. Always returns | ||
| "on off". | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // SPDX-License-Identifier: GPL-2.0 | ||
| /* | ||
| * Analog Devices MAX22007 | ||
| * | ||
| * hdl_project: <max22007_rpi> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need an hdl tag in here?! |
||
| * | ||
| * Copyright (C) 2025 Analog Devices Inc. | ||
| */ | ||
|
|
||
| /dts-v1/; | ||
| /plugin/; | ||
|
|
||
| #include <dt-bindings/gpio/gpio.h> | ||
|
|
||
| &spi0 { | ||
| status = "okay"; | ||
|
|
||
| max22007: max22007@0 { | ||
| compatible = "adi,max22007"; | ||
| reg = <0>; | ||
| spi-max-frequency = <500000>; | ||
| spi-cpha; | ||
| spi-cpol; | ||
| status = "okay"; | ||
| reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>; | ||
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
|
|
||
| channel@0 { | ||
| reg = <0>; | ||
| adi,dac-latch-mode = "ldac-control"; | ||
| adi,mode = "voltage"; | ||
| }; | ||
|
|
||
| channel@1 { | ||
| reg = <1>; | ||
| adi,dac-latch-mode = "ldac-control"; | ||
| adi,mode = "voltage"; | ||
| }; | ||
|
|
||
| channel@2 { | ||
| reg = <2>; | ||
| adi,dac-latch-mode = "ldac-control"; | ||
| adi,mode = "voltage"; | ||
| }; | ||
|
|
||
| channel@3 { | ||
| reg = <3>; | ||
| adi,dac-latch-mode = "ldac-control"; | ||
| adi,mode = "voltage"; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| &spidev0 { | ||
| status = "disabled"; | ||
| }; | ||
|
|
||
| &spidev1 { | ||
| status = "disabled"; | ||
| }; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The overlay is a different patch.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we keep it here until review and then move it later on? (please correct me if my understanding is wrong) |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -472,6 +472,19 @@ config MAX517 | |
| This driver can also be built as a module. If so, the module | ||
| will be called max517. | ||
|
|
||
| config MAX22007 | ||
| tristate "Analog Devices MAX22007 DAC Driver" | ||
| depends on SPI | ||
| select REGMAP | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be REGMAP_SPI |
||
| select CRC8 | ||
jansunil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| help | ||
| Say Y here if you want to build a driver for Analog Devices MAX22007. | ||
|
|
||
| MAX22007 is a single-channel, 16-bit, voltage-output digital to | ||
| analog converter (DAC) with SPI interface. | ||
|
|
||
| If compiled as a module, it will be called max22007. | ||
|
|
||
| config MAX5522 | ||
| tristate "Maxim MAX5522 DAC driver" | ||
| depends on SPI_MASTER | ||
|
|
||
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.
I'm not getting the use case for this DAC latch control feature. Why not always driving the device in 'transparent' mode? We already have
out_voltageY_rawfor each channel. Why make the user write toout_voltageY_rawand toout_currentY_ldac_updateto get the DAC output updated? I'd just always write the proper bits toLD_CTRLwhenever the user writes toout_voltageY_raw.With that, I think
adi,dac-latch-modewill no longer be needed.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.
Being it a per channel thing, I'm also not buying it (at least yet). AFAIR, typical case for this sort of thing is to for the latch mode to update all the channels at once which might be useful (in IIO) when buffering and update all channels at once. If we are only supporting raw writes I would (at least for now) just support transparent mode. Or do you have an actual request for this?