Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-13 Thread Eduardo Valentin
hey, On Tue, Dec 13, 2016 at 10:43:40AM +0100, Niklas Söderlund wrote: > Hi Eduardo, > > Thanks for your feedback. I will skip commenting where Wolfram already > have. > > On 2016-12-12 19:50:54 -0800, Eduardo Valentin wrote: > > > > > > +/* Structure for thermal temperature calculation */

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-13 Thread Niklas Söderlund
On 2016-12-13 09:39:04 +0100, Wolfram Sang wrote: > > > Perhaps the macros should be called e.g. FIXPT_MUL() and FIXPT_DIV()? > > Yes, that naming would be more readable to me. > FIXPT_ is a much better prefix, will update in next version. Thanks for the suggestion Geert. -- Regards, Niklas

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-13 Thread Niklas Söderlund
Hi Geert, Thanks for your feedback. On 2016-12-13 09:19:53 +0100, Geert Uytterhoeven wrote: > Hi Niklas, > > On Mon, Dec 12, 2016 at 3:18 PM, Niklas Söderlund > wrote: > > +/* > > + * Linear approximation for temperature > > + * > > + * [reg] = [temp] * a + b =>

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-13 Thread Niklas Söderlund
Hi Eduardo, Thanks for your feedback. I will skip commenting where Wolfram already have. On 2016-12-12 19:50:54 -0800, Eduardo Valentin wrote: > > +/* Structure for thermal temperature calculation */ > > +struct equation_coefs { > > + int a1; > > + int b1; > > + int a2; > > + int b2;

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-13 Thread Wolfram Sang
> Perhaps the macros should be called e.g. FIXPT_MUL() and FIXPT_DIV()? Yes, that naming would be more readable to me. signature.asc Description: PGP signature

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-13 Thread Geert Uytterhoeven
On Mon, Dec 12, 2016 at 10:45 PM, Wolfram Sang wrote: >> +/* >> + * Linear approximation for temperature >> + * >> + * [reg] = [temp] * a + b => [temp] = ([reg] - b) / a >> + * >> + * The constants a and b are calculated using two triplets of int values >> PTAT >> + * and

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-13 Thread Geert Uytterhoeven
Hi Niklas, On Mon, Dec 12, 2016 at 3:18 PM, Niklas Söderlund wrote: > +/* > + * Linear approximation for temperature > + * > + * [reg] = [temp] * a + b => [temp] = ([reg] - b) / a > + * > + * The constants a and b are calculated using two triplets of int values

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-12 Thread Wolfram Sang
Hi, > > + * > > + * The constants a and b are calculated using two triplets of int values > > PTAT > > + * and THCODE. PTAT and THCODE can either be read from hardware or use hard > > + * coded values from driver. The formula to calculate a and b are taken > > from > > + * BSP and sparsely

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-12 Thread Eduardo Valentin
Hey, On Mon, Dec 12, 2016 at 03:18:02PM +0100, Niklas Söderlund wrote: > From: Wolfram Sang > > Add support for R-Car Gen3 thermal sensors. Polling only for now, > interrupts will be added incrementally. Same goes for reading fuses. > This is documented

Re: [PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-12 Thread Wolfram Sang
Hi Niklas, thanks for this work! > +/* > + * Linear approximation for temperature > + * > + * [reg] = [temp] * a + b => [temp] = ([reg] - b) / a > + * > + * The constants a and b are calculated using two triplets of int values PTAT > + * and THCODE. PTAT and THCODE can either be read from

[PATCHv5 2/5] thermal: rcar_gen3_thermal: Add R-Car Gen3 thermal driver

2016-12-12 Thread Niklas Söderlund
From: Wolfram Sang Add support for R-Car Gen3 thermal sensors. Polling only for now, interrupts will be added incrementally. Same goes for reading fuses. This is documented already, but no hardware available for now. Signed-off-by: Hien Dang