Lines Matching refs:iio_evgen

44 static struct iio_dummy_eventgen *iio_evgen;  variable
50 iio_evgen = kzalloc(sizeof(*iio_evgen), GFP_KERNEL); in iio_dummy_evgen_create()
51 if (!iio_evgen) in iio_dummy_evgen_create()
54 iio_evgen->irq_sim_domain = irq_domain_create_sim(NULL, in iio_dummy_evgen_create()
56 if (IS_ERR(iio_evgen->irq_sim_domain)) { in iio_dummy_evgen_create()
57 ret = PTR_ERR(iio_evgen->irq_sim_domain); in iio_dummy_evgen_create()
58 kfree(iio_evgen); in iio_dummy_evgen_create()
62 mutex_init(&iio_evgen->lock); in iio_dummy_evgen_create()
77 if (!iio_evgen) in iio_dummy_evgen_get_irq()
80 mutex_lock(&iio_evgen->lock); in iio_dummy_evgen_get_irq()
82 if (!iio_evgen->inuse[i]) { in iio_dummy_evgen_get_irq()
83 ret = irq_create_mapping(iio_evgen->irq_sim_domain, i); in iio_dummy_evgen_get_irq()
84 iio_evgen->inuse[i] = true; in iio_dummy_evgen_get_irq()
88 mutex_unlock(&iio_evgen->lock); in iio_dummy_evgen_get_irq()
106 mutex_lock(&iio_evgen->lock); in iio_dummy_evgen_release_irq()
107 iio_evgen->inuse[irqd_to_hwirq(irqd)] = false; in iio_dummy_evgen_release_irq()
109 mutex_unlock(&iio_evgen->lock); in iio_dummy_evgen_release_irq()
117 return &iio_evgen->regs[irqd_to_hwirq(irqd)]; in iio_dummy_evgen_get_regs()
124 irq_domain_remove_sim(iio_evgen->irq_sim_domain); in iio_dummy_evgen_free()
125 kfree(iio_evgen); in iio_dummy_evgen_free()
146 iio_evgen->regs[this_attr->address].reg_id = this_attr->address; in iio_evgen_poke()
147 iio_evgen->regs[this_attr->address].reg_data = event; in iio_evgen_poke()
149 irq = irq_find_mapping(iio_evgen->irq_sim_domain, this_attr->address); in iio_evgen_poke()