Lines Matching refs:di

45 static void mp886x_set_switch_freq(struct mp886x_device_info *di,  in mp886x_set_switch_freq()  argument
49 const struct mp886x_cfg_info *ci = di->ci; in mp886x_set_switch_freq()
60 dev_err(di->dev, "invalid frequency %d\n", freq); in mp886x_set_switch_freq()
117 struct mp886x_device_info *di = rdev_get_drvdata(rdev); in mp8869_get_voltage_sel() local
129 uv = mp8869_scale(uv, di->r[0], di->r[1]); in mp8869_get_voltage_sel()
177 struct mp886x_device_info *di = rdev_get_drvdata(rdev); in mp8867_set_voltage_sel() local
184 delta = di->sel - sel; in mp8867_set_voltage_sel()
188 di->sel = sel; in mp8867_set_voltage_sel()
195 struct mp886x_device_info *di = rdev_get_drvdata(rdev); in mp8867_get_voltage_sel() local
211 uv = mp8869_scale(uv, di->r[0], di->r[1]); in mp8867_get_voltage_sel()
254 static int mp886x_regulator_register(struct mp886x_device_info *di, in mp886x_regulator_register() argument
257 struct regulator_desc *rdesc = &di->desc; in mp886x_regulator_register()
262 rdesc->ops = di->ci->rops; in mp886x_regulator_register()
273 rdesc->ramp_delay_table = di->ci->slew_rates; in mp886x_regulator_register()
274 rdesc->n_ramp_values = ARRAY_SIZE(di->ci->slew_rates); in mp886x_regulator_register()
277 rdev = devm_regulator_register(di->dev, &di->desc, config); in mp886x_regulator_register()
280 di->sel = rdesc->ops->get_voltage_sel(rdev); in mp886x_regulator_register()
293 struct mp886x_device_info *di; in mp886x_i2c_probe() local
299 di = devm_kzalloc(dev, sizeof(struct mp886x_device_info), GFP_KERNEL); in mp886x_i2c_probe()
300 if (!di) in mp886x_i2c_probe()
303 di->regulator = of_get_regulator_init_data(dev, np, &di->desc); in mp886x_i2c_probe()
304 if (!di->regulator) { in mp886x_i2c_probe()
310 di->r, 2); in mp886x_i2c_probe()
314 di->en_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH); in mp886x_i2c_probe()
315 if (IS_ERR(di->en_gpio)) in mp886x_i2c_probe()
316 return PTR_ERR(di->en_gpio); in mp886x_i2c_probe()
318 di->ci = of_device_get_match_data(dev); in mp886x_i2c_probe()
319 di->dev = dev; in mp886x_i2c_probe()
326 i2c_set_clientdata(client, di); in mp886x_i2c_probe()
328 config.dev = di->dev; in mp886x_i2c_probe()
329 config.init_data = di->regulator; in mp886x_i2c_probe()
331 config.driver_data = di; in mp886x_i2c_probe()
335 mp886x_set_switch_freq(di, regmap, freq); in mp886x_i2c_probe()
337 ret = mp886x_regulator_register(di, &config); in mp886x_i2c_probe()