Hi Andy Shevchenko,
On 3/23/2026 5:16 PM, Andy Shevchenko wrote:
On Mon, Mar 23, 2026 at 1:32 PM Sai Krishna Potthuri
[off-list ref] wrote:
quoted
quoted
-----Original Message-----
From: Andy Shevchenko <redacted>
Sent: Monday, March 23, 2026 4:22 PM
On Mon, Mar 23, 2026 at 01:15:04PM +0530, Sai Krishna Potthuri wrote:
...
quoted
quoted
quoted
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;
quoted
+ 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?
Yes, that's the intention.
xadc_get_dclk_rate() - this is a wrapper function to call
xadc->ops->get_dclk_rate(). May be i will remove the wrapper function or
move the if (!xadc->ops->get_dclk_rate) check inside wrapper.
Regards
Sai Krishna
quoted
quoted
quoted
if (!clk_rate)
return -EINVAL;