Lines Matching refs:h

51 	struct regulator_irq *h;  in regulator_notifier_isr_work()  local
58 h = container_of(work, struct regulator_irq, in regulator_notifier_isr_work()
60 d = &h->desc; in regulator_notifier_isr_work()
61 rid = &h->rdata; in regulator_notifier_isr_work()
65 if (d->fatal_cnt && h->retry_cnt > d->fatal_cnt) { in regulator_notifier_isr_work()
90 h->retry_cnt++; in regulator_notifier_isr_work()
112 h->retry_cnt++; in regulator_notifier_isr_work()
140 h->retry_cnt = 0; in regulator_notifier_isr_work()
143 enable_irq(h->irq); in regulator_notifier_isr_work()
149 mod_delayed_work(system_wq, &h->isr_work, in regulator_notifier_isr_work()
152 mod_delayed_work(system_highpri_wq, &h->isr_work, in regulator_notifier_isr_work()
158 struct regulator_irq *h = data; in regulator_notifier_isr() local
165 d = &h->desc; in regulator_notifier_isr()
166 rid = &h->rdata; in regulator_notifier_isr()
170 h->retry_cnt++; in regulator_notifier_isr()
197 h->retry_cnt = 0; in regulator_notifier_isr()
252 schedule_delayed_work(&h->isr_work, in regulator_notifier_isr()
256 &h->isr_work, in regulator_notifier_isr()
263 if (d->fatal_cnt && h->retry_cnt > d->fatal_cnt) { in regulator_notifier_isr()
280 static int init_rdev_state(struct device *dev, struct regulator_irq *h, in init_rdev_state() argument
286 h->rdata.states = devm_kzalloc(dev, sizeof(*h->rdata.states) * in init_rdev_state()
288 if (!h->rdata.states) in init_rdev_state()
291 h->rdata.num_states = rdev_amount; in init_rdev_state()
292 h->rdata.data = h->desc.data; in init_rdev_state()
295 h->rdata.states[i].possible_errs = common_err; in init_rdev_state()
297 h->rdata.states[i].possible_errs |= *rdev_err++; in init_rdev_state()
298 h->rdata.states[i].rdev = *rdev++; in init_rdev_state()
304 static void init_rdev_errors(struct regulator_irq *h) in init_rdev_errors() argument
308 for (i = 0; i < h->rdata.num_states; i++) in init_rdev_errors()
309 if (h->rdata.states[i].possible_errs) in init_rdev_errors()
310 h->rdata.states[i].rdev->use_cached_err = true; in init_rdev_errors()
343 struct regulator_irq *h; in regulator_irq_helper() local
349 h = devm_kzalloc(dev, sizeof(*h), GFP_KERNEL); in regulator_irq_helper()
350 if (!h) in regulator_irq_helper()
353 h->irq = irq; in regulator_irq_helper()
354 h->desc = *d; in regulator_irq_helper()
355 h->desc.name = devm_kstrdup(dev, d->name, GFP_KERNEL); in regulator_irq_helper()
356 if (!h->desc.name) in regulator_irq_helper()
359 ret = init_rdev_state(dev, h, rdev, common_errs, per_rdev_errs, in regulator_irq_helper()
364 init_rdev_errors(h); in regulator_irq_helper()
366 if (h->desc.irq_off_ms) in regulator_irq_helper()
367 INIT_DELAYED_WORK(&h->isr_work, regulator_notifier_isr_work); in regulator_irq_helper()
369 ret = request_threaded_irq(h->irq, NULL, regulator_notifier_isr, in regulator_irq_helper()
370 IRQF_ONESHOT | irq_flags, h->desc.name, h); in regulator_irq_helper()
377 return h; in regulator_irq_helper()
393 struct regulator_irq *h = *handle; in regulator_irq_helper_cancel() local
395 free_irq(h->irq, h); in regulator_irq_helper_cancel()
396 if (h->desc.irq_off_ms) in regulator_irq_helper_cancel()
397 cancel_delayed_work_sync(&h->isr_work); in regulator_irq_helper_cancel()
399 h = NULL; in regulator_irq_helper_cancel()