diff mbox series

hwmon : (mr75203) fix macro typo

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

Commit Message

Arseny Demidov Dec. 15, 2021, 11:30 a.m. UTC
In the file mr75203.c we have a macro named
POWER_DELAY_CYCLE_256, the correct value should be 0x100

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

Comments

Guenter Roeck Dec. 15, 2021, 11:59 a.m. UTC | #1
On 12/15/21 3:30 AM, Arseny Demidov wrote:
> In the file mr75203.c we have a macro named
> POWER_DELAY_CYCLE_256, the correct value should be 0x100
> 

How do you know that ? Do you have access to the datasheet, or
is it just an assumption based on the name of the define ?

Guenter

> Signed-off-by: Arseny Demidov <a.demidov@yadro.com>
> ---
>   drivers/hwmon/mr75203.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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
>
Guenter Roeck Dec. 15, 2021, 12:31 p.m. UTC | #2
On 12/15/21 3:59 AM, Guenter Roeck wrote:
> On 12/15/21 3:30 AM, Arseny Demidov wrote:
>> In the file mr75203.c we have a macro named
>> POWER_DELAY_CYCLE_256, the correct value should be 0x100
>>
> 
> How do you know that ? Do you have access to the datasheet, or
> is it just an assumption based on the name of the define ?
> 

Also, how do you know that the value is wrong, not the name
of the define ?

Guenter

> Guenter
> 
>> Signed-off-by: Arseny Demidov <a.demidov@yadro.com>
>> ---
>>   drivers/hwmon/mr75203.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 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
>>
>
Arseny Demidov Dec. 15, 2021, 12:36 p.m. UTC | #3
Yes, I have access to the datasheet and caught an error on simulation IP-block.
The datasheet says that register "Expressed in units of IP clk cycles."
Typical power-up delays for Temperature Sensor are 256 cycles i. e. 0x100

-----Original Message-----
From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
Sent: Wednesday, December 15, 2021 3:31 PM
To: Arseny Demidov <arsdemal@gmail.com>
Cc: Arseny Demidov <a.demidov@yadro.com>; Jean Delvare <jdelvare@suse.com>; linux-hwmon@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon : (mr75203) fix macro typo

On 12/15/21 3:59 AM, Guenter Roeck wrote:
> On 12/15/21 3:30 AM, Arseny Demidov wrote:
>> In the file mr75203.c we have a macro named POWER_DELAY_CYCLE_256, 
>> the correct value should be 0x100
>>
> 
> How do you know that ? Do you have access to the datasheet, or is it 
> just an assumption based on the name of the define ?
> 

Also, how do you know that the value is wrong, not the name of the define ?

Guenter

> Guenter
> 
>> Signed-off-by: Arseny Demidov <a.demidov@yadro.com>
>> ---
>>   drivers/hwmon/mr75203.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 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
>>
>
Guenter Roeck Dec. 15, 2021, 4:27 p.m. UTC | #4
On Wed, Dec 15, 2021 at 12:36:32PM +0000, Arseny Demidov wrote:
> Yes, I have access to the datasheet and caught an error on simulation IP-block.

> The datasheet says that register "Expressed in units of IP clk cycles."
> Typical power-up delays for Temperature Sensor are 256 cycles i. e. 0x100

Please add that information to the commit description. Also,
please copy Rahul Tanwar <rahul.tanwar@linux.intel.com> and
Andy Shevchenko <andriy.shevchenko@intel.com> on your patch.

Thanks,
Guenter

> 
> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Wednesday, December 15, 2021 3:31 PM
> To: Arseny Demidov <arsdemal@gmail.com>
> Cc: Arseny Demidov <a.demidov@yadro.com>; Jean Delvare <jdelvare@suse.com>; linux-hwmon@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] hwmon : (mr75203) fix macro typo
> 
> On 12/15/21 3:59 AM, Guenter Roeck wrote:
> > On 12/15/21 3:30 AM, Arseny Demidov wrote:
> >> In the file mr75203.c we have a macro named POWER_DELAY_CYCLE_256, 
> >> the correct value should be 0x100
> >>
> > 
> > How do you know that ? Do you have access to the datasheet, or is it 
> > just an assumption based on the name of the define ?
> > 
> 
> Also, how do you know that the value is wrong, not the name of the define ?
> 
> Guenter
> 
> > Guenter
> > 
> >> Signed-off-by: Arseny Demidov <a.demidov@yadro.com>
> >> ---
> >>   drivers/hwmon/mr75203.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> 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
> >>
> > 
>
Andy Shevchenko Dec. 16, 2021, 2:26 p.m. UTC | #5
On Wed, Dec 15, 2021 at 11:37 PM Guenter Roeck <linux@roeck-us.net> wrote:
> On Wed, Dec 15, 2021 at 12:36:32PM +0000, Arseny Demidov wrote:

> Please add that information to the commit description. Also,
> please copy Rahul Tanwar <rahul.tanwar@linux.intel.com> and
> Andy Shevchenko <andriy.shevchenko@intel.com> on your patch.

I see how my name appeared here:)
Okay, I have no access to the datasheet, I believe Rahul is the best
person here to answer this question.
Guenter Roeck Dec. 16, 2021, 2:40 p.m. UTC | #6
On 12/16/21 6:26 AM, Andy Shevchenko wrote:
> On Wed, Dec 15, 2021 at 11:37 PM Guenter Roeck <linux@roeck-us.net> wrote:
>> On Wed, Dec 15, 2021 at 12:36:32PM +0000, Arseny Demidov wrote:
> 
>> Please add that information to the commit description. Also,
>> please copy Rahul Tanwar <rahul.tanwar@linux.intel.com> and
>> Andy Shevchenko <andriy.shevchenko@intel.com> on your patch.
> 
> I see how my name appeared here:)
> Okay, I have no access to the datasheet, I believe Rahul is the best
> person here to answer this question.
> 

You reviewed the original patch, so I thought it would be appropriate
to copy you on this patch.

Guenter
Andy Shevchenko Dec. 16, 2021, 2:54 p.m. UTC | #7
On Thu, Dec 16, 2021 at 4:40 PM Guenter Roeck <linux@roeck-us.net> wrote:
> On 12/16/21 6:26 AM, Andy Shevchenko wrote:
> > On Wed, Dec 15, 2021 at 11:37 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >> On Wed, Dec 15, 2021 at 12:36:32PM +0000, Arseny Demidov wrote:
> >
> >> Please add that information to the commit description. Also,
> >> please copy Rahul Tanwar <rahul.tanwar@linux.intel.com> and
> >> Andy Shevchenko <andriy.shevchenko@intel.com> on your patch.
> >
> > I see how my name appeared here:)
> > Okay, I have no access to the datasheet, I believe Rahul is the best
> > person here to answer this question.
> >
>
> You reviewed the original patch, so I thought it would be appropriate
> to copy you on this patch.

Yes, yes, no objections to that!
Just because I have no access to the datasheet, I relied on what Rahul used.
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