Re: [PATCH 2/3] iio: light: tcs3472: implement wait time and sampling frequency

Jonathan Cameron
2026-05-06T18:17:24Z

>
> > +static unsigned int tcs3472_cycle_time_us(struct tcs3472_data *data)
> > +{
> > + unsigned int atime_us = (256 - data->atime) * 2400;
> > + unsigned int init_us = 2400;
> > + unsigned int wtime_us;
> > +
> > + if (!(data->enable & TCS3472_ENABLE_WEN))
> > + wtime_us = 0;
> > + else if (data->wlong)
> > + wtime_us = (256 - data->wtime) * 28800;
> > + else
> > + wtime_us = (256 - data->wtime) * 2400;
>
> This is the same as atime_us.
Similar form but not the same unless data->wtime == data->atime
Probably not worth defining anything common for that.

>
> > + return wtime_us + init_us + atime_us;