lkml.org 
[lkml]   [2023]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] iio: dac: cio-dac: Migrate to the regmap API
On Sat, Mar 11, 2023 at 08:40:12AM -0500, William Breathitt Gray wrote:
> 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 <andriy.shevchenko@linux.intel.com>
> Signed-off-by: William Breathitt Gray <william.gray@linaro.org>

[...]

> @@ -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++)
> - 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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-03-27 00:54    [W:0.042 / U:2.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site