On Thu, 18 Jun 2026 14:27:25 +0100 Rodrigo Alencar via B4 Relay <[email protected]> wrote:
> From: Rodrigo Alencar <[email protected]> > > Add the core AD9910 DDS driver infrastructure with single tone mode > support. This includes SPI register access, profile management via GPIO > pins, PLL/DAC configuration from firmware properties, and single tone > frequency/phase/amplitude control through IIO attributes. > > Signed-off-by: Rodrigo Alencar <[email protected]> Hi Rodrigo, just a couple of things that are really really trivial. > diff --git a/drivers/iio/frequency/ad9910.c b/drivers/iio/frequency/ad9910.c > new file mode 100644 > index 000000000000..95b01295e4a0 > --- /dev/null > +++ b/drivers/iio/frequency/ad9910.c > +static int ad9910_parse_fw(struct ad9910_state *st) > +{ > + static const char * const refclk_out_drv0[] = { > + "disabled", "low", "medium", "high", > + }; > + struct device *dev = &st->spi->dev; > + const char *prop; > + u32 tmp; > + int ret; > + > + st->data.pll_enabled = device_property_read_bool(dev, "adi,pll-enable"); > + if (st->data.pll_enabled) { > + tmp = AD9910_ICP_MIN_uA; Perhaps move to an else rather than doing it as set then override? > + prop = "adi,charge-pump-current-microamp"; > + if (device_property_present(dev, prop)) { > + ret = device_property_read_u32(dev, prop, &tmp); > + if (ret) > + return dev_err_probe(dev, ret, "property read: > %s\n", prop); > + > + if (tmp < AD9910_ICP_MIN_uA || tmp > AD9910_ICP_MAX_uA) > + return dev_err_probe(dev, -ERANGE, > + "invalid charge pump > current %u\n", tmp); > + } > + st->data.pll_charge_pump_current = tmp; > + > + prop = "adi,refclk-out-drive-strength"; > + if (device_property_present(dev, prop)) { > + ret = device_property_match_property_string(dev, prop, > + > refclk_out_drv0, > + > ARRAY_SIZE(refclk_out_drv0)); > + if (ret < 0) > + return dev_err_probe(dev, ret, "property read: > %s\n", prop); > + > + st->data.refclk_out_drv = ret; > + } > + } > + > + return 0; > +}

