Lines Matching +full:atc2603c +full:- +full:regulator
1 // SPDX-License-Identifier: GPL-2.0+
36 * internally protected by a mutex which is acquired non-atomically. in regmap_lock_mutex()
98 .name = "atc2603c",
126 { .name = "atc260x-regulator" },
127 { .name = "atc260x-pwrc" },
129 .name = "atc260x-onkey",
136 { .name = "atc260x-regulator" },
137 { .name = "atc260x-pwrc" },
139 .name = "atc260x-onkey",
163 const struct atc260x_init_regs *regs = atc260x->init_regs; in atc260x_cmu_reset()
166 regmap_update_bits(atc260x->regmap, regs->cmu_devrst, in atc260x_cmu_reset()
167 regs->cmu_devrst_ints, ~regs->cmu_devrst_ints); in atc260x_cmu_reset()
169 /* De-assert reset */ in atc260x_cmu_reset()
170 regmap_update_bits(atc260x->regmap, regs->cmu_devrst, in atc260x_cmu_reset()
171 regs->cmu_devrst_ints, regs->cmu_devrst_ints); in atc260x_cmu_reset()
176 const struct atc260x_init_regs *regs = atc260x->init_regs; in atc260x_dev_init()
182 regmap_write(atc260x->regmap, regs->ints_msk, 0); in atc260x_dev_init()
185 regmap_update_bits(atc260x->regmap, regs->pad_en, in atc260x_dev_init()
186 regs->pad_en_extirq, regs->pad_en_extirq); in atc260x_dev_init()
200 struct device *dev = atc260x->dev; in atc260x_match_device()
205 return -ENODEV; in atc260x_match_device()
207 atc260x->ic_type = (unsigned long)of_data; in atc260x_match_device()
209 switch (atc260x->ic_type) { in atc260x_match_device()
210 case ATC2603C: in atc260x_match_device()
212 atc260x->regmap_irq_chip = &atc2603c_regmap_irq_chip; in atc260x_match_device()
213 atc260x->cells = atc2603c_mfd_cells; in atc260x_match_device()
214 atc260x->nr_cells = ARRAY_SIZE(atc2603c_mfd_cells); in atc260x_match_device()
215 atc260x->type_name = "atc2603c"; in atc260x_match_device()
216 atc260x->rev_reg = ATC2603C_CHIP_VER; in atc260x_match_device()
217 atc260x->init_regs = &atc2603c_init_regs; in atc260x_match_device()
221 atc260x->regmap_irq_chip = &atc2609a_regmap_irq_chip; in atc260x_match_device()
222 atc260x->cells = atc2609a_mfd_cells; in atc260x_match_device()
223 atc260x->nr_cells = ARRAY_SIZE(atc2609a_mfd_cells); in atc260x_match_device()
224 atc260x->type_name = "atc2609a"; in atc260x_match_device()
225 atc260x->rev_reg = ATC2609A_CHIP_VER; in atc260x_match_device()
226 atc260x->init_regs = &atc2609a_init_regs; in atc260x_match_device()
230 atc260x->ic_type); in atc260x_match_device()
231 return -EINVAL; in atc260x_match_device()
234 atc260x->regmap_mutex = devm_kzalloc(dev, sizeof(*atc260x->regmap_mutex), in atc260x_match_device()
236 if (!atc260x->regmap_mutex) in atc260x_match_device()
237 return -ENOMEM; in atc260x_match_device()
239 mutex_init(atc260x->regmap_mutex); in atc260x_match_device()
241 regmap_cfg->lock = regmap_lock_mutex, in atc260x_match_device()
242 regmap_cfg->unlock = regmap_unlock_mutex, in atc260x_match_device()
243 regmap_cfg->lock_arg = atc260x->regmap_mutex; in atc260x_match_device()
260 struct device *dev = atc260x->dev; in atc260x_device_probe()
264 if (!atc260x->irq) { in atc260x_device_probe()
266 return -EINVAL; in atc260x_device_probe()
272 ret = regmap_read(atc260x->regmap, atc260x->rev_reg, &chip_rev); in atc260x_device_probe()
280 return -EINVAL; in atc260x_device_probe()
283 atc260x->ic_ver = __ffs(chip_rev + 1U); in atc260x_device_probe()
286 atc260x->type_name, 'A' + atc260x->ic_ver); in atc260x_device_probe()
288 ret = devm_regmap_add_irq_chip(dev, atc260x->regmap, atc260x->irq, IRQF_ONESHOT, in atc260x_device_probe()
289 -1, atc260x->regmap_irq_chip, &atc260x->irq_data); in atc260x_device_probe()
296 atc260x->cells, atc260x->nr_cells, NULL, 0, in atc260x_device_probe()
297 regmap_irq_get_domain(atc260x->irq_data)); in atc260x_device_probe()
300 regmap_del_irq_chip(atc260x->irq, atc260x->irq_data); in atc260x_device_probe()