public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Aldo Conte <aldocontelk@gmail.com>,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	shuah@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH 2/3] iio: light: tcs3472: implement wait time and sampling frequency
Date: Wed, 6 May 2026 19:17:15 +0100	[thread overview]
Message-ID: <20260506191715.4a943d60@jic23-huawei> (raw)
In-Reply-To: <afsVzTytyLsNcAi0@ashevche-desk.local>

> 
> > +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;

  reply	other threads:[~2026-05-06 18:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06  9:43 [PATCH 0/3] iio: light: tcs3472: devm conversion, wait time, locking cleanup Aldo Conte
2026-05-06  9:43 ` [PATCH 1/3] iio: light: tcs3472: use devm for resource management Aldo Conte
2026-05-06 10:00   ` Andy Shevchenko
2026-05-06  9:43 ` [PATCH 2/3] iio: light: tcs3472: implement wait time and sampling frequency Aldo Conte
2026-05-06 10:19   ` Andy Shevchenko
2026-05-06 18:17     ` Jonathan Cameron [this message]
2026-05-06  9:43 ` [PATCH 3/3] iio: light: tcs3472: Use guard(mutex)() family over manual locking Aldo Conte
2026-05-06 10:04   ` Andy Shevchenko
2026-05-06 10:21 ` [PATCH 0/3] iio: light: tcs3472: devm conversion, wait time, locking cleanup Andy Shevchenko
2026-05-06 12:19   ` Aldo Conte
2026-05-06 15:35   ` Aldo Conte
2026-05-06 15:45     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260506191715.4a943d60@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=aldocontelk@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox