Day20 - I2C Driver to hwmon¶
Goal¶
Convert custom sysfs-based driver into hwmon-based driver.
Step 1 - Implement temperature helper¶
- triggers update
- reads raw register
- converts to milli-degree
Step 2 - Define hwmon channel¶
Step 3 - Implement hwmon callbacks¶
is_visible¶
read¶
Step 4 - Register hwmon device¶
Step 5 - Attach extra attributes¶
Step 6 - Remove old sysfs interface¶
Remove:
Build & Load¶
Verify hwmon¶
Read temperature¶
Check custom attributes¶
Ensure old path removed¶
Should NOT contain: - temp_input
Debug Comparison (Optional)¶
Expected Result¶
- hwmon interface works
- standard naming
- debug attributes preserved
- no duplicate sysfs