From: Jonathan Cameron <jic23@kernel.org>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: light: add VEML6075 UVA and UVB light sensor driver
Date: Sun, 19 Nov 2023 14:25:47 +0000 [thread overview]
Message-ID: <20231119142547.6524160d@jic23-huawei> (raw)
In-Reply-To: <4dbcd233-cdd7-49ad-8db6-4bd3d706e82d@gmail.com>
On Sun, 19 Nov 2023 06:08:25 +0100
Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:
> On 19.11.23 05:58, Javier Carrasco wrote:
> > The Vishay VEMl6075 is a low power, 16-bit resolution UVA and UVB
> > light sensor with I2C interface and noise compensation (visible and
> > infrarred).
> >
> > Every UV channel generates an output measured in counts per integration
> > period. Available integration times are 50 ms, 100 ms, 200 ms, 400 ms
> > and 800 ms,
> >
> > This driver adds support for both UV channels and the ultraviolet
> > index (UVI) inferred from them according to the device application note
> > with open-air (no teflon) coefficients.
> >
> > Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Hi Javier,
One process note highlighted by this email.
Please crop to only relevant text when replying. Scrolling takes time!
+ makes it hard to be sure we didn't miss anything buried in hundreds
of lines of unnecessary context.
I'm jet lagged so may be more grumpy than average today :(
Thanks,
Jonathan
> > +static int veml6075_uva_comp(int raw_uva, int comp1, int comp2)
> > +{
> > + int comp1a_c, comp2a_c, uva_comp;
> > +
> > + comp1a_c = (comp1 * VEML6075_A_COEF) / 1000U;
> > + comp2a_c = (comp2 * VEML6075_B_COEF) / 1000U;
> > + uva_comp = raw_uva - comp1a_c - comp2a_c;
> > + pr_err("JCC: uva=%d, c1=%d, c2=%d, c1ca=%d, c2ca=%d, uvac=%d\n",
> > + raw_uva, comp1, comp2, comp1a_c, comp2a_c, uva_comp);
> Obviously this debug message should be gone and it will be removed for v2.
> > +
> > + return clamp_val(uva_comp, 0, U16_MAX);
> > +}
> > +
> > +static int veml6075_uvb_comp(int raw_uvb, int comp1, int comp2)
> > +{
> > + int comp1b_c, comp2b_c, uvb_comp;
> > +
> > + comp1b_c = (comp1 * VEML6075_C_COEF) / 1000U;
> > + comp2b_c = (comp2 * VEML6075_D_COEF) / 1000U;
> > + uvb_comp = raw_uvb - comp1b_c - comp2b_c;
> > + pr_err("JCC: uvb=%d, c1=%d, c2=%d, c1cb=%d, c2cb=%d, uvbc=%d\n",
> > + raw_uvb, comp1, comp2, comp1b_c, comp2b_c, uvb_comp);
> Same here.
> > +
> > + return clamp_val(uvb_comp, 0, U16_MAX);
> > +}
> > +
next prev parent reply other threads:[~2023-11-19 14:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-19 4:58 [PATCH 0/2] iio: light: add support for VEML6075 UVA and UVB light sensor Javier Carrasco
2023-11-19 4:58 ` [PATCH 1/2] iio: light: add VEML6075 UVA and UVB light sensor driver Javier Carrasco
2023-11-19 5:08 ` Javier Carrasco
2023-11-19 14:25 ` Jonathan Cameron [this message]
2023-11-19 15:02 ` Jonathan Cameron
2023-11-19 17:40 ` Javier Carrasco
2023-11-20 17:01 ` Jonathan Cameron
2023-11-19 22:21 ` kernel test robot
2023-11-19 4:58 ` [PATCH 2/2] dt-bindings: iio: light: add support for Vishay VEML6075 Javier Carrasco
2023-11-19 14:30 ` Jonathan Cameron
2023-11-20 10:24 ` Krzysztof Kozlowski
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=20231119142547.6524160d@jic23-huawei \
--to=jic23@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@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