iio: dac: cio-dac: Migrate to the regmap API
Subsystems (2)
PATCH 1/1 iio: dac: cio-dac: Migrate to the regmap API
The regmap API supports IO port accessors so we can take advantage of regmap abstractions rather than handling access to the device registers directly in the driver.
--- drivers/iio/dac/Kconfig | 1 + drivers/iio/dac/cio-dac.c | 71 +++++++++++++++++++++++++++++---------- 2 files changed, 54 insertions(+), 18 deletions(-)
drivers/iio/dac/Kconfig +1 -0
@@ -277,6 +277,7 @@ config CIO_DAC tristate "Measurement Computing CIO-DAC IIO driver" depends on X86 && (ISA_BUS || PC104) select ISA_BUS_API + select REGMAP_MMIO help Say yes here to build support for the Measurement Computing CIO-DAC analog output device family (CIO-DAC16, CIO-DAC08, PC104-DAC06). The
drivers/iio/dac/cio-dac.c +53 -18
136 lines not on this page · raw message
base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
Signature · 1 line
2.39.2
Quoted 6 lines · William Breathitt Gray
The regmap API supports IO port accessors so we can take advantage of regmap abstractions rather than handling access to the device registers directly in the driver.
Suggested-by Andy Shevchenko <[email protected]>Signed-off-by William Breathitt Gray <[email protected]>
[...]
Quoted 5 lines
drivers/iio/dac/cio-dac.c +0
-1@@ -117,8 +148,12 @@ static int cio_dac_probe(struct device *dev, unsigned int id) indio_dev->name =dev_name (dev);/* initialize DAC outputs to 0V */ -for (i =0 ; i <CIO_DAC_NUM_CHAN ; i++)
drivers/iio/dac/cio-dac.c static int cio_dac_probe(struct device *dev, unsigned int id) · line 159
Quoted 10 lines
drivers/iio/dac/cio-dac.c +6
-1-iowrite16 (0 , priv->base + i); +for (i =0 ; i <CIO_DAC_NUM_CHAN ; i++) { + offset = i *CIO_DAC_CHANNEL_STRIDE ; + err =regmap_write (priv->map,CIO_DAC_BASE + offset,0 ); +if (err) +return err; + }return devm_iio_device_register (dev, indio_dev); }
As soon as I sent this I realized this last hunk is no longer necessary because the chan_out_states array is gone so we don't need to match its initialized state. I'll remove this block as superfluous and submit a v2 patch shortly.
William Breathitt Gray