Re: [PATCH v2 3/4] iio: adc: xilinx-xadc: Add I2C interface support
From: Andy Shevchenko
Date: Mon Mar 23 2026 - 07:48:02 EST
On Mon, Mar 23, 2026 at 1:32 PM Sai Krishna Potthuri
<sai.krishna.potthuri@xxxxxxx> wrote:
> > -----Original Message-----
> > From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> > Sent: Monday, March 23, 2026 4:22 PM
> > On Mon, Mar 23, 2026 at 01:15:04PM +0530, Sai Krishna Potthuri wrote:
...
> > > int xadc_write_samplerate(struct xadc *xadc, int val) {
> > > - unsigned long clk_rate = xadc_get_dclk_rate(xadc);
> > > + unsigned long clk_rate;
> > > unsigned int div;
> > >
> > > + if (!xadc->ops->get_dclk_rate)
> > > + return -EOPNOTSUPP;
> >
> > > + clk_rate = xadc_get_dclk_rate(xadc);
> > > +
> >
> > Unneeded blank line.
> >
> > Also, don't you asked for options?
> This callback is defined for all other platforms except I2C.
> Currently for I2c interface we are not supporting any configuration, it
> is used only to read the channels.
If the callback defined you should use its value and not hardcoded one, right?
> > > if (!clk_rate)
> > > return -EINVAL;
--
With Best Regards,
Andy Shevchenko