linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] hwmon: (oxp-sensors) Cleanup device type handling
@ 2024-12-26 17:00 tjakobi
  2024-12-26 17:00 ` [PATCH 1/4] hwmon: (oxp-sensors) Separate logic from device-specific data tjakobi
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: tjakobi @ 2024-12-26 17:00 UTC (permalink / raw)
  To: linux-hwmon, linux-kernel; +Cc: Tobias Jakobi

From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>

Hello,

this series tries to cleanup the handling of the various device types
in the oxp-sensors drivers. The current approach is error-prone
since it relies on ever-growing switch-statements, which are
present in multiple functions. Adding a single new device involves
touching a bunch of functions.

That this is problematic is already demonstrated by this bug in
the driver: While oxp_pwm_disable() handles the aya_neo_air_1s
model, the inverse function oxp_pwm_enable() does not handle the
model. This is obviously wrong and a result of the current design.

Introduce a different design with better separation of logic and
data. While at it, also fix some typos, wording and add a cache
for the PWM enable mode.

With best wishes,
Tobias

Tobias Jakobi (4):
  hwmon: (oxp-sensors) Separate logic from device-specific data
  hwmon: (oxp-sensors) Fix typos in documentation
  hwmon: (oxp-sensors) Fix wording in code comment
  hwmon: (oxp-sensors) Cache state of PWM enable mode

 Documentation/hwmon/oxp-sensors.rst |   2 +-
 drivers/hwmon/oxp-sensors.c         | 576 +++++++++++++---------------
 2 files changed, 275 insertions(+), 303 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-01-07 17:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-26 17:00 [PATCH 0/4] hwmon: (oxp-sensors) Cleanup device type handling tjakobi
2024-12-26 17:00 ` [PATCH 1/4] hwmon: (oxp-sensors) Separate logic from device-specific data tjakobi
2024-12-26 20:54   ` Guenter Roeck
2024-12-26 22:59     ` Tobias Jakobi
2025-01-07 17:33       ` Guenter Roeck
2024-12-26 21:04   ` Guenter Roeck
2024-12-26 23:05     ` Tobias Jakobi
2025-01-07 17:34       ` Guenter Roeck
2024-12-26 17:00 ` [PATCH 2/4] hwmon: (oxp-sensors) Fix typos in documentation tjakobi
2024-12-26 17:00 ` [PATCH 3/4] hwmon: (oxp-sensors) Fix wording in code comment tjakobi
2024-12-26 20:52   ` Guenter Roeck
2024-12-26 22:56     ` Tobias Jakobi
2025-01-07 17:24       ` Guenter Roeck
2024-12-26 17:00 ` [PATCH 4/4] hwmon: (oxp-sensors) Cache state of PWM enable mode tjakobi
2024-12-26 21:05   ` Guenter Roeck
2024-12-26 23:13     ` Tobias Jakobi
2025-01-07 17:43       ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).