• Guenter Roeck's avatar
    hwmon: (core) New hwmon registration API · d560168b
    Guenter Roeck authored
    Up to now, each hwmon driver has to implement its own sysfs attributes.
    This requires a lot of template code, and distracts from the driver's core
    function to read and write chip registers.
    
    To be able to reduce driver complexity, move sensor attribute handling
    and thermal zone registration into hwmon core. By using the new API,
    driver code and data size is typically reduced by 20-70%, depending
    on driver complexity and the number of sysfs attributes supported.
    
    With this patch, the new API only supports thermal sensors. Support for
    other sensor types will be added with subsequent patches.
    Acked-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
    Reviewed-by: default avatarJonathan Cameron <jic23@kernel.org>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    d560168b
hwmon.c 17.1 KB