Lines Matching refs:tps65912

29 int tps65912_set_bits(struct tps65912 *tps65912, u8 reg, u8 mask)  in tps65912_set_bits()  argument
34 mutex_lock(&tps65912->io_mutex); in tps65912_set_bits()
36 err = tps65912->read(tps65912, reg, 1, &data); in tps65912_set_bits()
38 dev_err(tps65912->dev, "Read from reg 0x%x failed\n", reg); in tps65912_set_bits()
43 err = tps65912->write(tps65912, reg, 1, &data); in tps65912_set_bits()
45 dev_err(tps65912->dev, "Write to reg 0x%x failed\n", reg); in tps65912_set_bits()
48 mutex_unlock(&tps65912->io_mutex); in tps65912_set_bits()
53 int tps65912_clear_bits(struct tps65912 *tps65912, u8 reg, u8 mask) in tps65912_clear_bits() argument
58 mutex_lock(&tps65912->io_mutex); in tps65912_clear_bits()
59 err = tps65912->read(tps65912, reg, 1, &data); in tps65912_clear_bits()
61 dev_err(tps65912->dev, "Read from reg 0x%x failed\n", reg); in tps65912_clear_bits()
66 err = tps65912->write(tps65912, reg, 1, &data); in tps65912_clear_bits()
68 dev_err(tps65912->dev, "Write to reg 0x%x failed\n", reg); in tps65912_clear_bits()
71 mutex_unlock(&tps65912->io_mutex); in tps65912_clear_bits()
76 static inline int tps65912_read(struct tps65912 *tps65912, u8 reg) in tps65912_read() argument
81 err = tps65912->read(tps65912, reg, 1, &val); in tps65912_read()
88 static inline int tps65912_write(struct tps65912 *tps65912, u8 reg, u8 val) in tps65912_write() argument
90 return tps65912->write(tps65912, reg, 1, &val); in tps65912_write()
93 int tps65912_reg_read(struct tps65912 *tps65912, u8 reg) in tps65912_reg_read() argument
97 mutex_lock(&tps65912->io_mutex); in tps65912_reg_read()
99 data = tps65912_read(tps65912, reg); in tps65912_reg_read()
101 dev_err(tps65912->dev, "Read from reg 0x%x failed\n", reg); in tps65912_reg_read()
103 mutex_unlock(&tps65912->io_mutex); in tps65912_reg_read()
108 int tps65912_reg_write(struct tps65912 *tps65912, u8 reg, u8 val) in tps65912_reg_write() argument
112 mutex_lock(&tps65912->io_mutex); in tps65912_reg_write()
114 err = tps65912_write(tps65912, reg, val); in tps65912_reg_write()
116 dev_err(tps65912->dev, "Write for reg 0x%x failed\n", reg); in tps65912_reg_write()
118 mutex_unlock(&tps65912->io_mutex); in tps65912_reg_write()
123 int tps65912_device_init(struct tps65912 *tps65912) in tps65912_device_init() argument
125 struct tps65912_board *pmic_plat_data = dev_get_platdata(tps65912->dev); in tps65912_device_init()
133 mutex_init(&tps65912->io_mutex); in tps65912_device_init()
134 dev_set_drvdata(tps65912->dev, tps65912); in tps65912_device_init()
141 tps65912->read(tps65912, TPS65912_I2C_SPI_CFG, 1, &value); in tps65912_device_init()
143 tps65912->write(tps65912, TPS65912_I2C_SPI_CFG, 1, &dcdc_avs); in tps65912_device_init()
146 ret = mfd_add_devices(tps65912->dev, -1, in tps65912_device_init()
154 ret = tps65912_irq_init(tps65912, init_data->irq, init_data); in tps65912_device_init()
163 mfd_remove_devices(tps65912->dev); in tps65912_device_init()
167 void tps65912_device_exit(struct tps65912 *tps65912) in tps65912_device_exit() argument
169 mfd_remove_devices(tps65912->dev); in tps65912_device_exit()
170 tps65912_irq_exit(tps65912); in tps65912_device_exit()