Re: [PATCH 2/3] iio: light: tcs3472: implement wait time and sampling frequency
Jonathan Cameron <[email protected]>
| Newsgroups | dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260506191715.4a943d60@jic23-huawei> |
>
> > +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;