Lines Matching refs:tps
43 int tps65218_reg_read(struct tps65218 *tps, unsigned int reg, in tps65218_reg_read() argument
46 return regmap_read(tps->regmap, reg, val); in tps65218_reg_read()
58 int tps65218_reg_write(struct tps65218 *tps, unsigned int reg, in tps65218_reg_write() argument
66 return regmap_write(tps->regmap, reg, val); in tps65218_reg_write()
69 ret = regmap_write(tps->regmap, TPS65218_REG_PASSWORD, in tps65218_reg_write()
74 return regmap_write(tps->regmap, reg, val); in tps65218_reg_write()
90 static int tps65218_update_bits(struct tps65218 *tps, unsigned int reg, in tps65218_update_bits() argument
96 ret = tps65218_reg_read(tps, reg, &data); in tps65218_update_bits()
98 dev_err(tps->dev, "Read from reg 0x%x failed\n", reg); in tps65218_update_bits()
105 mutex_lock(&tps->tps_lock); in tps65218_update_bits()
106 ret = tps65218_reg_write(tps, reg, data, level); in tps65218_update_bits()
108 dev_err(tps->dev, "Write for reg 0x%x failed\n", reg); in tps65218_update_bits()
109 mutex_unlock(&tps->tps_lock); in tps65218_update_bits()
114 int tps65218_set_bits(struct tps65218 *tps, unsigned int reg, in tps65218_set_bits() argument
117 return tps65218_update_bits(tps, reg, mask, val, level); in tps65218_set_bits()
121 int tps65218_clear_bits(struct tps65218 *tps, unsigned int reg, in tps65218_clear_bits() argument
124 return tps65218_update_bits(tps, reg, mask, 0, level); in tps65218_clear_bits()
219 struct tps65218 *tps; in tps65218_probe() local
230 tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); in tps65218_probe()
231 if (!tps) in tps65218_probe()
234 i2c_set_clientdata(client, tps); in tps65218_probe()
235 tps->dev = &client->dev; in tps65218_probe()
236 tps->irq = client->irq; in tps65218_probe()
237 tps->regmap = devm_regmap_init_i2c(client, &tps65218_regmap_config); in tps65218_probe()
238 if (IS_ERR(tps->regmap)) { in tps65218_probe()
239 ret = PTR_ERR(tps->regmap); in tps65218_probe()
240 dev_err(tps->dev, "Failed to allocate register map: %d\n", in tps65218_probe()
245 mutex_init(&tps->tps_lock); in tps65218_probe()
247 ret = regmap_add_irq_chip(tps->regmap, tps->irq, in tps65218_probe()
249 &tps->irq_data); in tps65218_probe()
261 regmap_del_irq_chip(tps->irq, tps->irq_data); in tps65218_probe()
268 struct tps65218 *tps = i2c_get_clientdata(client); in tps65218_remove() local
270 regmap_del_irq_chip(tps->irq, tps->irq_data); in tps65218_remove()