Lines Matching +full:regulator +full:- +full:v4
1 // SPDX-License-Identifier: GPL-2.0
15 #include <linux/regulator/consumer.h>
69 return regmap_read(st->regmap, addr, val); in ltc2991_read_reg()
71 ret = regmap_bulk_read(st->regmap, addr, ®vals, reg_len); in ltc2991_read_reg()
109 reg = LTC2991_CHANNEL_V_MSB(channel - 1); in ltc2991_read_in()
113 return -EOPNOTSUPP; in ltc2991_read_in()
126 /* Vx-Vy, 19.075uV/LSB */ in ltc2991_get_curr()
128 st->r_sense_uohm[channel]); in ltc2991_get_curr()
144 return -EOPNOTSUPP; in ltc2991_read_curr()
178 return -EOPNOTSUPP; in ltc2991_read_temp()
193 return -EOPNOTSUPP; in ltc2991_read()
209 if (st->temp_en[(channel - 1) / 2]) in ltc2991_is_visible()
213 if (!st->r_sense_uohm[(channel - 1) / 2]) in ltc2991_is_visible()
220 if (st->r_sense_uohm[channel]) in ltc2991_is_visible()
229 st->temp_en[channel]) in ltc2991_is_visible()
294 "failed to enable regulator\n"); in ltc2991_init()
302 return -EINVAL; in ltc2991_init()
305 "shunt-resistor-micro-ohms", in ltc2991_init()
309 return dev_err_probe(dev, -EINVAL, in ltc2991_init()
312 st->r_sense_uohm[addr] = val; in ltc2991_init()
333 "adi,temperature-enable"); in ltc2991_init()
335 st->temp_en[addr] = ret; in ltc2991_init()
356 ret = regmap_write(st->regmap, LTC2991_V5_V8_CTRL, v5_v8_reg_data); in ltc2991_init()
359 "Error: Failed to set V5-V8 CTRL reg.\n"); in ltc2991_init()
361 ret = regmap_write(st->regmap, LTC2991_V1_V4_CTRL, v1_v4_reg_data); in ltc2991_init()
364 "Error: Failed to set V1-V4 CTRL reg.\n"); in ltc2991_init()
366 ret = regmap_write(st->regmap, LTC2991_PWM_TH_LSB_T_INT, in ltc2991_init()
373 return regmap_write(st->regmap, LTC2991_CH_EN_TRIGGER, in ltc2991_init()
385 st = devm_kzalloc(&client->dev, sizeof(*st), GFP_KERNEL); in ltc2991_i2c_probe()
387 return -ENOMEM; in ltc2991_i2c_probe()
389 st->regmap = devm_regmap_init_i2c(client, <c2991_regmap_config); in ltc2991_i2c_probe()
390 if (IS_ERR(st->regmap)) in ltc2991_i2c_probe()
391 return PTR_ERR(st->regmap); in ltc2991_i2c_probe()
393 ret = ltc2991_init(st, &client->dev); in ltc2991_i2c_probe()
397 hwmon_dev = devm_hwmon_device_register_with_info(&client->dev, in ltc2991_i2c_probe()
398 client->name, st, in ltc2991_i2c_probe()