[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180130083205.j4b2wua7knymkfn6@flea.lan>
Date: Tue, 30 Jan 2018 09:32:05 +0100
From: Maxime Ripard <maxime.ripard@...e-electrons.com>
To: Philipp Rossak <embed3d@...il.com>
Cc: lee.jones@...aro.org, robh+dt@...nel.org, mark.rutland@....com,
wens@...e.org, linux@...linux.org.uk, jic23@...nel.org,
knaack.h@....de, lars@...afoo.de, pmeerw@...erw.net,
davem@...emloft.net, hans.verkuil@...co.com, mchehab@...nel.org,
rask@...melder.dk, clabbe.montjoie@...il.com, sean@...s.org,
krzk@...nel.org, quentin.schulz@...e-electrons.com,
icenowy@...c.io, edu.molinas@...il.com, singhalsimran0@...il.com,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-sunxi@...glegroups.com
Subject: Re: [PATCH v2 10/16] iio: adc: sun4i-gpadc-iio: add support for A83T
thermal sensor
1;5002;0c
On Mon, Jan 29, 2018 at 12:53:48PM +0100, Philipp Rossak wrote:
>
>
> On 29.01.2018 10:48, Maxime Ripard wrote:
> > On Mon, Jan 29, 2018 at 12:29:13AM +0100, Philipp Rossak wrote:
> > > This patch adds support for the A83T ths sensor.
> > >
> > > The A83T supports interrupts. The interrupt is configured to update the
> > > the sensor values every second.
> > >
> > > Signed-off-by: Philipp Rossak <embed3d@...il.com>
> > > ---
> > > drivers/iio/adc/sun4i-gpadc-iio.c | 38 ++++++++++++++++++++++++++++++++++++++
> > > include/linux/mfd/sun4i-gpadc.h | 18 ++++++++++++++++++
> > > 2 files changed, 56 insertions(+)
> > >
> > > diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
> > > index 8196203d65fe..9f7895ba1966 100644
> > > --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> > > +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> > > @@ -170,6 +170,40 @@ static const struct gpadc_data sun8i_h3_ths_data = {
> > > SUN8I_H3_THS_TEMP_PERIOD(0x7),
> > > };
> > > +static const struct gpadc_data sun8i_a83t_ths_data = {
> > > + .temp_offset = -2724,
> > > + .temp_scale = -70,
> > > + .temp_data = {SUN8I_H3_THS_TDATA0,
> > > + SUN8I_A83T_THS_TDATA1,
> > > + SUN8I_A83T_THS_TDATA2,
> > > + 0},
> > > + .sample_start = sunxi_ths_sample_start,
> > > + .sample_end = sunxi_ths_sample_end,
> > > + .sensor_count = 3,
> > > + .supports_nvmem = false,
> > > + .support_irq = true,
> > > + .ctrl0_map = SUN4I_GPADC_CTRL0_T_ACQ(0x1f3),
> > > + .ctrl2_map = SUN8I_H3_THS_ACQ1(0x1f3),
> >
> > Where are these values coming from?
> >
>
> These values are calculated with the formulas from the datasheet and also
> tested on hardware. These settings seem ok.
You should at least put a comment explaining how you got to these values.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists