diff options
Diffstat (limited to 'drivers/hwmon/ltc4282.c')
-rw-r--r-- | drivers/hwmon/ltc4282.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/hwmon/ltc4282.c b/drivers/hwmon/ltc4282.c index 7f38d2696239..dbb30abcd343 100644 --- a/drivers/hwmon/ltc4282.c +++ b/drivers/hwmon/ltc4282.c @@ -177,13 +177,15 @@ static const unsigned int ltc4282_out_rates[] = { LTC4282_CLKOUT_CNV, LTC4282_CLKOUT_SYSTEM }; -static long ltc4282_round_rate(struct clk_hw *hw, unsigned long rate, - unsigned long *parent_rate) +static int ltc4282_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) { - int idx = find_closest(rate, ltc4282_out_rates, + int idx = find_closest(req->rate, ltc4282_out_rates, ARRAY_SIZE(ltc4282_out_rates)); - return ltc4282_out_rates[idx]; + req->rate = ltc4282_out_rates[idx]; + + return 0; } static unsigned long ltc4282_recalc_rate(struct clk_hw *hw, @@ -1124,7 +1126,7 @@ static ssize_t ltc4282_energy_show(struct device *dev, static const struct clk_ops ltc4282_ops = { .recalc_rate = ltc4282_recalc_rate, - .round_rate = ltc4282_round_rate, + .determine_rate = ltc4282_determine_rate, .set_rate = ltc4282_set_rate, .disable = ltc4282_disable, }; @@ -1512,13 +1514,6 @@ static int ltc4282_setup(struct ltc4282_state *st, struct device *dev) } if (device_property_read_bool(dev, "adi,fault-log-enable")) { - ret = regmap_set_bits(st->map, LTC4282_ADC_CTRL, - LTC4282_FAULT_LOG_EN_MASK); - if (ret) - return ret; - } - - if (device_property_read_bool(dev, "adi,fault-log-enable")) { ret = regmap_set_bits(st->map, LTC4282_ADC_CTRL, LTC4282_FAULT_LOG_EN_MASK); if (ret) return ret; @@ -1603,7 +1598,7 @@ static const struct hwmon_ops ltc4282_hwmon_ops = { .read_string = ltc4282_read_labels, }; -static const struct hwmon_chip_info ltc2947_chip_info = { +static const struct hwmon_chip_info ltc4282_chip_info = { .ops = <c4282_hwmon_ops, .info = ltc4282_info, }; @@ -1724,7 +1719,7 @@ static int ltc4282_probe(struct i2c_client *i2c) mutex_init(&st->lock); hwmon = devm_hwmon_device_register_with_info(dev, "ltc4282", st, - <c2947_chip_info, + <c4282_chip_info, ltc4282_groups); if (IS_ERR(hwmon)) return PTR_ERR(hwmon); |