mbox series

[v7,0/6] hwmon: (dell-smm-hwmon) Convert to new hwmon registration api

Message ID 20210728221557.8891-1-W_Armin@gmx.de (mailing list archive)
Headers show
Series hwmon: (dell-smm-hwmon) Convert to new hwmon registration api | expand

Message

Armin Wolf July 28, 2021, 10:15 p.m. UTC
From: Armin Wolf <W_Armin@gmx.de>

This patch series is converting the dell-smm-hwmon driver
to the new hwmon registration API. In order to do so,
it introduces a platform device in the first patch, and
applies some optimisations in the next three patches.
The switch to the new hwmon registration API is done in
the next patch. The last patch is fixing a small bug.

The caching of the fan/temp values was modified to better fit
the new hwmon API.

The patches work fine for my Dell Latitude C600, but i whould
appreciate someone testing the code on another model too.

Changes in v7:
- Add commit explaining why pwm1_enable has to be write-only

Changes in v6:
- Make pwm1_enable permissions write-only
- Do not test fan speed in dell_smm_is_visible()

Changes in v5:
- Fix checkpatch warning after patch 5/6
- Hide fanX_label if fan type calls are disallowed

Changes in v4:
- Make fan detection behave like before patch 5/6
- Update coverletter title

Changes in v3:
- Update description of patch 1/6 and remove empty change
- Let pwm1_enable remain write-only
- Include a small bugfix

Changes in v2:
- Fix coverletter title
- Update docs regarding pwm1_enable

Armin Wolf (6):
  hwmon: (dell-smm-hwmon) Use platform device
  hwmon: (dell-smm-hwmon) Mark functions as __init
  hwmon: (dell-smm-hwmon) Use devm_add_action_or_reset()
  hwmon: (dell-smm-hwmon) Move variables into a driver private data
    structure
  hwmon: (dell-smm-hwmon) Convert to
    devm_hwmon_device_register_with_info()
  hwmon: (dell-smm-hwmon) Fix fan mutliplier detection for 3rd fan

 drivers/hwmon/dell-smm-hwmon.c | 853 ++++++++++++++++-----------------
 1 file changed, 425 insertions(+), 428 deletions(-)

--
2.20.1

Comments

Guenter Roeck July 28, 2021, 10:43 p.m. UTC | #1
On 7/28/21 3:15 PM, W_Armin@gmx.de wrote:
> From: Armin Wolf <W_Armin@gmx.de>
> 
> This patch series is converting the dell-smm-hwmon driver
> to the new hwmon registration API. In order to do so,
> it introduces a platform device in the first patch, and
> applies some optimisations in the next three patches.
> The switch to the new hwmon registration API is done in
> the next patch. The last patch is fixing a small bug.
> 
> The caching of the fan/temp values was modified to better fit
> the new hwmon API.
> 
> The patches work fine for my Dell Latitude C600, but i whould
> appreciate someone testing the code on another model too.
> 

At this point I'd suggest to queue the series up in -next and see
what happens. I don't think we'll get additional feedback.

Thought ? Objections ?

Guenter

> Changes in v7:
> - Add commit explaining why pwm1_enable has to be write-only
> 
> Changes in v6:
> - Make pwm1_enable permissions write-only
> - Do not test fan speed in dell_smm_is_visible()
> 
> Changes in v5:
> - Fix checkpatch warning after patch 5/6
> - Hide fanX_label if fan type calls are disallowed
> 
> Changes in v4:
> - Make fan detection behave like before patch 5/6
> - Update coverletter title
> 
> Changes in v3:
> - Update description of patch 1/6 and remove empty change
> - Let pwm1_enable remain write-only
> - Include a small bugfix
> 
> Changes in v2:
> - Fix coverletter title
> - Update docs regarding pwm1_enable
> 
> Armin Wolf (6):
>    hwmon: (dell-smm-hwmon) Use platform device
>    hwmon: (dell-smm-hwmon) Mark functions as __init
>    hwmon: (dell-smm-hwmon) Use devm_add_action_or_reset()
>    hwmon: (dell-smm-hwmon) Move variables into a driver private data
>      structure
>    hwmon: (dell-smm-hwmon) Convert to
>      devm_hwmon_device_register_with_info()
>    hwmon: (dell-smm-hwmon) Fix fan mutliplier detection for 3rd fan
> 
>   drivers/hwmon/dell-smm-hwmon.c | 853 ++++++++++++++++-----------------
>   1 file changed, 425 insertions(+), 428 deletions(-)
> 
> --
> 2.20.1
>
Armin Wolf July 28, 2021, 10:49 p.m. UTC | #2
Am 29.07.21 um 00:43 schrieb Guenter Roeck:
> On 7/28/21 3:15 PM, W_Armin@gmx.de wrote:
>> From: Armin Wolf <W_Armin@gmx.de>
>>
>> This patch series is converting the dell-smm-hwmon driver
>> to the new hwmon registration API. In order to do so,
>> it introduces a platform device in the first patch, and
>> applies some optimisations in the next three patches.
>> The switch to the new hwmon registration API is done in
>> the next patch. The last patch is fixing a small bug.
>>
>> The caching of the fan/temp values was modified to better fit
>> the new hwmon API.
>>
>> The patches work fine for my Dell Latitude C600, but i whould
>> appreciate someone testing the code on another model too.
>>
>
> At this point I'd suggest to queue the series up in -next and see
> what happens. I don't think we'll get additional feedback.
>
> Thought ? Objections ?
>
> Guenter
>
I agree, its unlikely that the code still has big issues, it works on
the C600.
The only thing still untested is reading fan rpm/changing fan control, but
i expect them to work.
>> Changes in v7:
>> - Add commit explaining why pwm1_enable has to be write-only
>>
>> Changes in v6:
>> - Make pwm1_enable permissions write-only
>> - Do not test fan speed in dell_smm_is_visible()
>>
>> Changes in v5:
>> - Fix checkpatch warning after patch 5/6
>> - Hide fanX_label if fan type calls are disallowed
>>
>> Changes in v4:
>> - Make fan detection behave like before patch 5/6
>> - Update coverletter title
>>
>> Changes in v3:
>> - Update description of patch 1/6 and remove empty change
>> - Let pwm1_enable remain write-only
>> - Include a small bugfix
>>
>> Changes in v2:
>> - Fix coverletter title
>> - Update docs regarding pwm1_enable
>>
>> Armin Wolf (6):
>>    hwmon: (dell-smm-hwmon) Use platform device
>>    hwmon: (dell-smm-hwmon) Mark functions as __init
>>    hwmon: (dell-smm-hwmon) Use devm_add_action_or_reset()
>>    hwmon: (dell-smm-hwmon) Move variables into a driver private data
>>      structure
>>    hwmon: (dell-smm-hwmon) Convert to
>>      devm_hwmon_device_register_with_info()
>>    hwmon: (dell-smm-hwmon) Fix fan mutliplier detection for 3rd fan
>>
>>   drivers/hwmon/dell-smm-hwmon.c | 853 ++++++++++++++++-----------------
>>   1 file changed, 425 insertions(+), 428 deletions(-)
>>
>> --
>> 2.20.1
>>
>
Guenter Roeck July 29, 2021, 2:26 a.m. UTC | #3
On 7/28/21 3:49 PM, Armin Wolf wrote:
> Am 29.07.21 um 00:43 schrieb Guenter Roeck:
>> On 7/28/21 3:15 PM, W_Armin@gmx.de wrote:
>>> From: Armin Wolf <W_Armin@gmx.de>
>>>
>>> This patch series is converting the dell-smm-hwmon driver
>>> to the new hwmon registration API. In order to do so,
>>> it introduces a platform device in the first patch, and
>>> applies some optimisations in the next three patches.
>>> The switch to the new hwmon registration API is done in
>>> the next patch. The last patch is fixing a small bug.
>>>
>>> The caching of the fan/temp values was modified to better fit
>>> the new hwmon API.
>>>
>>> The patches work fine for my Dell Latitude C600, but i whould
>>> appreciate someone testing the code on another model too.
>>>
>>
>> At this point I'd suggest to queue the series up in -next and see
>> what happens. I don't think we'll get additional feedback.
>>
>> Thought ? Objections ?
>>
>> Guenter
>>
> I agree, its unlikely that the code still has big issues, it works on
> the C600.
> The only thing still untested is reading fan rpm/changing fan control, but
> i expect them to work.

Let's see if Pali has any objections. If not, I'll apply the series tomorrow.

Guenter
Pali Rohár July 29, 2021, 7:24 a.m. UTC | #4
On Wednesday 28 July 2021 19:26:49 Guenter Roeck wrote:
> On 7/28/21 3:49 PM, Armin Wolf wrote:
> > Am 29.07.21 um 00:43 schrieb Guenter Roeck:
> > > On 7/28/21 3:15 PM, W_Armin@gmx.de wrote:
> > > > From: Armin Wolf <W_Armin@gmx.de>
> > > > 
> > > > This patch series is converting the dell-smm-hwmon driver
> > > > to the new hwmon registration API. In order to do so,
> > > > it introduces a platform device in the first patch, and
> > > > applies some optimisations in the next three patches.
> > > > The switch to the new hwmon registration API is done in
> > > > the next patch. The last patch is fixing a small bug.
> > > > 
> > > > The caching of the fan/temp values was modified to better fit
> > > > the new hwmon API.
> > > > 
> > > > The patches work fine for my Dell Latitude C600, but i whould
> > > > appreciate someone testing the code on another model too.
> > > > 
> > > 
> > > At this point I'd suggest to queue the series up in -next and see
> > > what happens. I don't think we'll get additional feedback.
> > > 
> > > Thought ? Objections ?
> > > 
> > > Guenter
> > > 
> > I agree, its unlikely that the code still has big issues, it works on
> > the C600.
> > The only thing still untested is reading fan rpm/changing fan control, but
> > i expect them to work.
> 
> Let's see if Pali has any objections. If not, I'll apply the series tomorrow.
> 
> Guenter
> 

Fine for me! Also I want to try to find some time to these patches on
more Dell laptops...