hwmon: (lm85) add support for LM96000 high frequencies
authorJeremy Gebben <jgebben@sweptlaser.com>
Mon, 4 Feb 2019 20:19:06 +0000 (13:19 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 18 Feb 2019 22:23:29 +0000 (14:23 -0800)
The LM96000 expands the freqency field from 3 to 4 bits, to
add more frequencies in the 22.5 to 30 kHz ranges.

Signed-off-by: Jeremy Gebben <jgebben@sweptlaser.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/lm85
drivers/hwmon/lm85.c

index 4f531f4acc3f45911606fdab74eeaf4ff2f2fea2..2329c383efe40cc5f37ce80a015a63d244dda834 100644 (file)
@@ -140,6 +140,9 @@ of voltage and temperature channels.
 SMSC EMC6D103S is similar to EMC6D103, but does not support pwm#_auto_pwm_minctl
 and temp#_auto_temp_off.
 
+The LM96000 supports additional high frequency PWM modes (22.5 kHz, 24 kHz,
+25.7 kHz, 27.7 kHz and 30 kHz), which can be configured on a per-PWM basis.
+
 Hardware Configurations
 -----------------------
 
index b23cf8e4c54bf2131425b0c35206a203f470b848..a95d48316f064103b488f09648a62bd4b1dc5773 100644 (file)
@@ -202,6 +202,11 @@ static const int lm85_freq_map[] = { /* 1 Hz */
        10, 15, 23, 30, 38, 47, 61, 94
 };
 
+static const int lm96000_freq_map[] = { /* 1 Hz */
+       10, 15, 23, 30, 38, 47, 61, 94,
+       22500, 24000, 25700, 25700, 27700, 27700, 30000, 30000
+};
+
 static const int adm1027_freq_map[] = { /* 1 Hz */
        11, 15, 22, 29, 35, 44, 59, 88
 };
@@ -1574,6 +1579,10 @@ static int lm85_probe(struct i2c_client *client, const struct i2c_device_id *id)
                data->freq_map = adm1027_freq_map;
                data->freq_map_size = ARRAY_SIZE(adm1027_freq_map);
                break;
+       case lm96000:
+               data->freq_map = lm96000_freq_map;
+               data->freq_map_size = ARRAY_SIZE(lm96000_freq_map);
+               break;
        default:
                data->freq_map = lm85_freq_map;
                data->freq_map_size = ARRAY_SIZE(lm85_freq_map);