Re: [PATCH v10 4/7] i2c: davinci: calculate bus freq from Hz instead of kHz
From: Andy Shevchenko
Date: Wed Jul 08 2026 - 15:30:56 EST
On Wed, Jul 08, 2026 at 02:16:16PM +0200, Marcus Folkesson wrote:
> The bus frequency is unnecessarily converted between Hz and kHz in
> several places.
> This is probably an old legacy from the old times (pre-devicetrees)
> when the davinci_i2c_platform_data took the bus_freq in kHz.
>
> Stick to Hz.
...
> -#define DAVINCI_I2C_DEFAULT_BUS_FREQ 100000
> -
You need to rebase this on top of the i2c-next.
...
> + /* standard bus frequency */
> + unsigned int bus_freq_hz;
While at it, I would dare to suggest _Hz as we started doing in IIO (id est
we start following more closely the SI units in the suffixes of constant
definitions and variables to be case sensitive).
...
> r = device_property_read_u32(&pdev->dev, "clock-frequency", &prop);
> if (r)
> - prop = DAVINCI_I2C_DEFAULT_BUS_FREQ;
> + prop = I2C_MAX_STANDARD_MODE_FREQ;
>
See above about rebase.
--
With Best Regards,
Andy Shevchenko