• Guenter Roeck's avatar
    hwmon: (max6650) Introduce pwm_to_dac and dac_to_pwm · b2905bb8
    Guenter Roeck authored
    Consolidate conversion from pwm value to dac value and from dac value
    to pwm value into helper functions.
    
    While doing this, only update the cached dac value if writing it
    to the chip was successful after an update. Also, put macro argument
    of DIV_FROM_REG() into (), and simplify return statement of
    max6650_set_cur_state().
    
    Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    b2905bb8
max6650.c 20.2 KB