[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b834bc83-e3fa-511b-7c29-bd3a9af01d5b@gmail.com>
Date: Fri, 31 Aug 2018 14:01:08 +0200
From: Philipp Rossak <embed3d@...il.com>
To: Maxime Ripard <maxime.ripard@...tlin.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,
eugen.hristev@...rochip.com, rdunlap@...radead.org,
vilhelm.gray@...il.com, clabbe.montjoie@...il.com,
quentin.schulz@...tlin.com, geert+renesas@...der.be,
lukas@...ner.de, icenowy@...c.io, arnd@...db.de,
broonie@...nel.org, arnaud.pouliquen@...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 v3 21/30] iio: adc: sun4i-gpadc-iio: add support for H3
thermal sensor
On 31.08.2018 11:11, Maxime Ripard wrote:
>> + regmap_write(info->regmap, SUN8I_H3_THS_CTRL0,
>> + SUN4I_GPADC_CTRL0_T_ACQ(0xff));
>> +
>> + regmap_write(info->regmap, SUN8I_H3_THS_CTRL2,
>> + SUN8I_H3_THS_ACQ1(0x3f));
>> +
>> + regmap_write(info->regmap, SUN8I_H3_THS_STAT,
>> + SUN8I_H3_THS_INTS_TDATA_IRQ_0);
>> +
>> + regmap_write(info->regmap, SUN8I_H3_THS_FILTER,
>> + SUN4I_GPADC_CTRL3_FILTER_EN |
>> + SUN4I_GPADC_CTRL3_FILTER_TYPE(0x2));
>> +
>> + regmap_write(info->regmap, SUN8I_H3_THS_INTC,
>> + SUN8I_H3_THS_INTC_TDATA_IRQ_EN0 |
>> + SUN8I_H3_THS_TEMP_PERIOD(0x55));
>> +
>> + regmap_read(info->regmap, SUN8I_H3_THS_CTRL2, &value);
>> +
>> + regmap_write(info->regmap, SUN8I_H3_THS_CTRL2,
>> + SUN8I_H3_THS_TEMP_SENSE_EN0 | value);
> Ideally, all these values should have a comment explaining what they
> are.
>
> And we really start to have a lot of registers defines. We'd be better
> off using regmap_fields.
I will rework this in the next version.
Thanks,
Philipp
Powered by blists - more mailing lists