diff mbox series

hwmon : (mr75203) fix macro typo

Message ID 20211216083302.986-1-a.demidov@yadro.com (mailing list archive)
State Changes Requested
Headers show
Series hwmon : (mr75203) fix macro typo | expand

Commit Message

Arseny Demidov Dec. 16, 2021, 8:33 a.m. UTC
In the file mr75203.c we have a macro named POWER_DELAY_CYCLE_256,
the correct value should be 0x100. The register ip_tmr is expressed
in units of IP clk cycles, in accordance with the datasheet.
Typical power-up delays for Temperature Sensor are 256 cycles i.e. 0x100.

Signed-off-by: Arseny Demidov <a.demidov@yadro.com>
---
 drivers/hwmon/mr75203.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Dec. 16, 2021, 2:19 p.m. UTC | #1
On Thu, Dec 16, 2021 at 11:33:02AM +0300, Arseny Demidov wrote:
> In the file mr75203.c we have a macro named POWER_DELAY_CYCLE_256,
> the correct value should be 0x100. The register ip_tmr is expressed
> in units of IP clk cycles, in accordance with the datasheet.
> Typical power-up delays for Temperature Sensor are 256 cycles i.e. 0x100.

Should you provide Fixes tag?

...

> -#define POWER_DELAY_CYCLE_256	0x80
> +#define POWER_DELAY_CYCLE_256	0x100
>  #define POWER_DELAY_CYCLE_64	0x40

I;m wondering why they are in hex? Perhaps the decimal is better for both.
Guenter Roeck Dec. 17, 2021, 4:05 p.m. UTC | #2
On 12/16/21 6:19 AM, Andy Shevchenko wrote:
> On Thu, Dec 16, 2021 at 11:33:02AM +0300, Arseny Demidov wrote:
>> In the file mr75203.c we have a macro named POWER_DELAY_CYCLE_256,
>> the correct value should be 0x100. The register ip_tmr is expressed
>> in units of IP clk cycles, in accordance with the datasheet.
>> Typical power-up delays for Temperature Sensor are 256 cycles i.e. 0x100.
> 
> Should you provide Fixes tag?

Yes. Also, please update the subject. This is not about "fix macro typo".
it fixes a wrong/bad delay value.

> 
> ...
> 
>> -#define POWER_DELAY_CYCLE_256	0x80
>> +#define POWER_DELAY_CYCLE_256	0x100
>>   #define POWER_DELAY_CYCLE_64	0x40
> 
> I;m wondering why they are in hex? Perhaps the decimal is better for both.
> 
Maybe, but that is POV, and I tend to leave it up to driver authors to decide.
It is definitely not something we would want to change as part of a bug fix.

Thanks,
Guenter
Andy Shevchenko Dec. 17, 2021, 4:45 p.m. UTC | #3
On Fri, Dec 17, 2021 at 08:05:17AM -0800, Guenter Roeck wrote:
> On 12/16/21 6:19 AM, Andy Shevchenko wrote:
> > On Thu, Dec 16, 2021 at 11:33:02AM +0300, Arseny Demidov wrote:

...

> > > -#define POWER_DELAY_CYCLE_256	0x80
> > > +#define POWER_DELAY_CYCLE_256	0x100
> > >   #define POWER_DELAY_CYCLE_64	0x40
> > 
> > I;m wondering why they are in hex? Perhaps the decimal is better for both.
> > 
> Maybe, but that is POV, and I tend to leave it up to driver authors to decide.
> It is definitely not something we would want to change as part of a bug fix.

Agreed on both points.
diff mbox series

Patch

diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c
index 868243dba1ee..1ba1e3145969 100644
--- a/drivers/hwmon/mr75203.c
+++ b/drivers/hwmon/mr75203.c
@@ -93,7 +93,7 @@ 
 #define VM_CH_REQ	BIT(21)
 
 #define IP_TMR			0x05
-#define POWER_DELAY_CYCLE_256	0x80
+#define POWER_DELAY_CYCLE_256	0x100
 #define POWER_DELAY_CYCLE_64	0x40
 
 #define PVT_POLL_DELAY_US	20