Lines Matching refs:tps65910
222 static int tps65910_irq_init(struct tps65910 *tps65910, int irq, in tps65910_irq_init() argument
229 dev_warn(tps65910->dev, "No interrupt support, no core IRQ\n"); in tps65910_irq_init()
234 dev_warn(tps65910->dev, "No interrupt support, no pdata\n"); in tps65910_irq_init()
238 switch (tps65910_chip_id(tps65910)) { in tps65910_irq_init()
247 tps65910->chip_irq = irq; in tps65910_irq_init()
248 ret = devm_regmap_add_irq_chip(tps65910->dev, tps65910->regmap, in tps65910_irq_init()
249 tps65910->chip_irq, in tps65910_irq_init()
251 tps6591x_irqs_chip, &tps65910->irq_data); in tps65910_irq_init()
253 dev_warn(tps65910->dev, "Failed to add irq_chip %d\n", ret); in tps65910_irq_init()
254 tps65910->chip_irq = 0; in tps65910_irq_init()
261 struct tps65910 *tps65910 = dev_get_drvdata(dev); in is_volatile_reg() local
270 if (tps65910_chip_id(tps65910) == TPS65910) in is_volatile_reg()
287 static int tps65910_ck32k_init(struct tps65910 *tps65910, in tps65910_ck32k_init() argument
295 ret = tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, in tps65910_ck32k_init()
298 dev_err(tps65910->dev, "clear ck32k_ctrl failed: %d\n", ret); in tps65910_ck32k_init()
305 static int tps65910_sleepinit(struct tps65910 *tps65910, in tps65910_sleepinit() argument
314 dev = tps65910->dev; in tps65910_sleepinit()
317 ret = tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL, in tps65910_sleepinit()
325 ret = tps65910_reg_set_bits(tps65910, in tps65910_sleepinit()
335 ret = tps65910_reg_set_bits(tps65910, in tps65910_sleepinit()
345 ret = tps65910_reg_set_bits(tps65910, in tps65910_sleepinit()
357 tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, in tps65910_sleepinit()
435 struct tps65910 *tps65910; in tps65910_power_off() local
437 tps65910 = dev_get_drvdata(&tps65910_i2c_client->dev); in tps65910_power_off()
439 if (tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL, in tps65910_power_off()
443 tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, in tps65910_power_off()
450 struct tps65910 *tps65910; in tps65910_i2c_probe() local
471 tps65910 = devm_kzalloc(&i2c->dev, sizeof(*tps65910), GFP_KERNEL); in tps65910_i2c_probe()
472 if (tps65910 == NULL) in tps65910_i2c_probe()
475 tps65910->of_plat_data = of_pmic_plat_data; in tps65910_i2c_probe()
476 i2c_set_clientdata(i2c, tps65910); in tps65910_i2c_probe()
477 tps65910->dev = &i2c->dev; in tps65910_i2c_probe()
478 tps65910->i2c_client = i2c; in tps65910_i2c_probe()
479 tps65910->id = chip_id; in tps65910_i2c_probe()
486 tps65910->regmap = devm_regmap_init_i2c(i2c, &tps65910_regmap_config); in tps65910_i2c_probe()
487 if (IS_ERR(tps65910->regmap)) { in tps65910_i2c_probe()
488 ret = PTR_ERR(tps65910->regmap); in tps65910_i2c_probe()
496 tps65910_irq_init(tps65910, init_data->irq, init_data); in tps65910_i2c_probe()
497 tps65910_ck32k_init(tps65910, pmic_plat_data); in tps65910_i2c_probe()
498 tps65910_sleepinit(tps65910, pmic_plat_data); in tps65910_i2c_probe()
505 ret = devm_mfd_add_devices(tps65910->dev, -1, in tps65910_i2c_probe()
508 regmap_irq_get_domain(tps65910->irq_data)); in tps65910_i2c_probe()