[v4,08/16] thermal: sun8i: add TEMP_CALIB_MASK for calibration data in sun50i_h6_ths_calibrate
diff mbox series

Message ID b8761e036b25f20873534e5f8d10b37b5d2ce72c.1594708864.git.frank@allwinnertech.com
State New
Headers show
Series
  • Allwinner A100 Initial support
Related show

Commit Message

Frank Lee July 14, 2020, 7:13 a.m. UTC
From: Yangtao Li <frank@allwinnertech.com>

For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of
calculation. On the other hand, the newer SOC may store other data in
the space other than 12bit sensor data. Add mask operation to read data
to avoid conversion error.

Signed-off-by: Yangtao Li <frank@allwinnertech.com>
Reviewed-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/thermal/sun8i_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Lezcano July 17, 2020, 4:26 a.m. UTC | #1
On 14/07/2020 09:13, Frank Lee wrote:
> From: Yangtao Li <frank@allwinnertech.com>
> 
> For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of
> calculation. On the other hand, the newer SOC may store other data in
> the space other than 12bit sensor data. Add mask operation to read data
> to avoid conversion error.
> 
> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
> Reviewed-by: Yangtao Li <tiny.windzz@gmail.com>

Can you clarify these SoB ?

Frank Lee==Yangtao Li==frank@allwinnertech.com==tiny.windzz@gmail.com ?



> ---
>  drivers/thermal/sun8i_thermal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c
> index 74d73be16496..f423d44b9290 100644
> --- a/drivers/thermal/sun8i_thermal.c
> +++ b/drivers/thermal/sun8i_thermal.c
> @@ -244,7 +244,7 @@ static int sun50i_h6_ths_calibrate(struct ths_device *tmdev,
>  	ft_temp = (caldata[0] & FT_TEMP_MASK) * 100;
>  
>  	for (i = 0; i < tmdev->chip->sensor_num; i++) {
> -		int sensor_reg = caldata[i + 1];
> +		int sensor_reg = caldata[i + 1] & TEMP_CALIB_MASK;
>  		int cdata, offset;
>  		int sensor_temp = tmdev->chip->calc_temp(tmdev, i, sensor_reg);
>  
>
Frank Lee July 17, 2020, 7:35 a.m. UTC | #2
On Fri, Jul 17, 2020 at 12:26 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 14/07/2020 09:13, Frank Lee wrote:
> > From: Yangtao Li <frank@allwinnertech.com>
> >
> > For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of
> > calculation. On the other hand, the newer SOC may store other data in
> > the space other than 12bit sensor data. Add mask operation to read data
> > to avoid conversion error.
> >
> > Signed-off-by: Yangtao Li <frank@allwinnertech.com>
> > Reviewed-by: Yangtao Li <tiny.windzz@gmail.com>
>
> Can you clarify these SoB ?

Previously I used 'Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>',
maybe this should be removed directly?

>
> Frank Lee==Yangtao Li==frank@allwinnertech.com==tiny.windzz@gmail.com ?
>

Yeah.

Yangtao
Daniel Lezcano July 17, 2020, 7:56 a.m. UTC | #3
On 17/07/2020 09:35, Frank Lee wrote:
> On Fri, Jul 17, 2020 at 12:26 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> On 14/07/2020 09:13, Frank Lee wrote:
>>> From: Yangtao Li <frank@allwinnertech.com>
>>>
>>> For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of
>>> calculation. On the other hand, the newer SOC may store other data in
>>> the space other than 12bit sensor data. Add mask operation to read data
>>> to avoid conversion error.
>>>
>>> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
>>> Reviewed-by: Yangtao Li <tiny.windzz@gmail.com>
>>
>> Can you clarify these SoB ?
> 
> Previously I used 'Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>',
> maybe this should be removed directly?
> 
>>
>> Frank Lee==Yangtao Li==frank@allwinnertech.com==tiny.windzz@gmail.com ?
>>
> 
> Yeah.

You are not supposed to add reviewed-by yourself. Please remove it.
Frank Lee July 20, 2020, 9:27 a.m. UTC | #4
HI,
On Fri, Jul 17, 2020 at 3:56 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 17/07/2020 09:35, Frank Lee wrote:
> > On Fri, Jul 17, 2020 at 12:26 PM Daniel Lezcano
> > <daniel.lezcano@linaro.org> wrote:
> >>
> >> On 14/07/2020 09:13, Frank Lee wrote:
> >>> From: Yangtao Li <frank@allwinnertech.com>
> >>>
> >>> For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of
> >>> calculation. On the other hand, the newer SOC may store other data in
> >>> the space other than 12bit sensor data. Add mask operation to read data
> >>> to avoid conversion error.
> >>>
> >>> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
> >>> Reviewed-by: Yangtao Li <tiny.windzz@gmail.com>
> >>
> >> Can you clarify these SoB ?
> >
> > Previously I used 'Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>',
> > maybe this should be removed directly?
> >
> >>
> >> Frank Lee==Yangtao Li==frank@allwinnertech.com==tiny.windzz@gmail.com ?
> >>
> >
> > Yeah.
>
> You are not supposed to add reviewed-by yourself. Please remove it.

Should I resend the entire series or just the thermal patch?
What about those that have been applied.

Thx,
Yangtao
Daniel Lezcano July 20, 2020, 10:38 a.m. UTC | #5
On 20/07/2020 11:27, Frank Lee wrote:
> HI,
> On Fri, Jul 17, 2020 at 3:56 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>>
>> On 17/07/2020 09:35, Frank Lee wrote:
>>> On Fri, Jul 17, 2020 at 12:26 PM Daniel Lezcano
>>> <daniel.lezcano@linaro.org> wrote:
>>>>
>>>> On 14/07/2020 09:13, Frank Lee wrote:
>>>>> From: Yangtao Li <frank@allwinnertech.com>
>>>>>
>>>>> For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of
>>>>> calculation. On the other hand, the newer SOC may store other data in
>>>>> the space other than 12bit sensor data. Add mask operation to read data
>>>>> to avoid conversion error.
>>>>>
>>>>> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
>>>>> Reviewed-by: Yangtao Li <tiny.windzz@gmail.com>
>>>>
>>>> Can you clarify these SoB ?
>>>
>>> Previously I used 'Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>',
>>> maybe this should be removed directly?
>>>
>>>>
>>>> Frank Lee==Yangtao Li==frank@allwinnertech.com==tiny.windzz@gmail.com ?
>>>>
>>>
>>> Yeah.
>>
>> You are not supposed to add reviewed-by yourself. Please remove it.
> 
> Should I resend the entire series or just the thermal patch?
> What about those that have been applied.

I can not speak on behalf of other maintainers.

The simplest would be to ask them directly.

If you want to go forward with the thermal changes, you can send them
separately but Maxim's Ack will be needed anyway.
Maxime Ripard July 23, 2020, 4:56 p.m. UTC | #6
On Mon, Jul 20, 2020 at 12:38:10PM +0200, Daniel Lezcano wrote:
> On 20/07/2020 11:27, Frank Lee wrote:
> > HI,
> > On Fri, Jul 17, 2020 at 3:56 PM Daniel Lezcano
> > <daniel.lezcano@linaro.org> wrote:
> >>
> >> On 17/07/2020 09:35, Frank Lee wrote:
> >>> On Fri, Jul 17, 2020 at 12:26 PM Daniel Lezcano
> >>> <daniel.lezcano@linaro.org> wrote:
> >>>>
> >>>> On 14/07/2020 09:13, Frank Lee wrote:
> >>>>> From: Yangtao Li <frank@allwinnertech.com>
> >>>>>
> >>>>> For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of
> >>>>> calculation. On the other hand, the newer SOC may store other data in
> >>>>> the space other than 12bit sensor data. Add mask operation to read data
> >>>>> to avoid conversion error.
> >>>>>
> >>>>> Signed-off-by: Yangtao Li <frank@allwinnertech.com>
> >>>>> Reviewed-by: Yangtao Li <tiny.windzz@gmail.com>
> >>>>
> >>>> Can you clarify these SoB ?
> >>>
> >>> Previously I used 'Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>',
> >>> maybe this should be removed directly?
> >>>
> >>>>
> >>>> Frank Lee==Yangtao Li==frank@allwinnertech.com==tiny.windzz@gmail.com ?
> >>>>
> >>>
> >>> Yeah.
> >>
> >> You are not supposed to add reviewed-by yourself. Please remove it.
> > 
> > Should I resend the entire series or just the thermal patch?
> > What about those that have been applied.
> 
> I can not speak on behalf of other maintainers.
> 
> The simplest would be to ask them directly.
> 
> If you want to go forward with the thermal changes, you can send them
> separately but Maxim's Ack will be needed anyway.

Given that I had a few other comments on the other patches, I guess you
can resend the whole series, it will be simpler to track down.

Maxime

Patch
diff mbox series

diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c
index 74d73be16496..f423d44b9290 100644
--- a/drivers/thermal/sun8i_thermal.c
+++ b/drivers/thermal/sun8i_thermal.c
@@ -244,7 +244,7 @@  static int sun50i_h6_ths_calibrate(struct ths_device *tmdev,
 	ft_temp = (caldata[0] & FT_TEMP_MASK) * 100;
 
 	for (i = 0; i < tmdev->chip->sensor_num; i++) {
-		int sensor_reg = caldata[i + 1];
+		int sensor_reg = caldata[i + 1] & TEMP_CALIB_MASK;
 		int cdata, offset;
 		int sensor_temp = tmdev->chip->calc_temp(tmdev, i, sensor_reg);