Lines Matching refs:iio_evgen
46 static struct iio_dummy_eventgen *iio_evgen; variable
52 iio_evgen = kzalloc(sizeof(*iio_evgen), GFP_KERNEL); in iio_dummy_evgen_create()
53 if (!iio_evgen) in iio_dummy_evgen_create()
56 iio_evgen->irq_sim_domain = irq_domain_create_sim(NULL, in iio_dummy_evgen_create()
58 if (IS_ERR(iio_evgen->irq_sim_domain)) { in iio_dummy_evgen_create()
59 ret = PTR_ERR(iio_evgen->irq_sim_domain); in iio_dummy_evgen_create()
60 kfree(iio_evgen); in iio_dummy_evgen_create()
64 mutex_init(&iio_evgen->lock); in iio_dummy_evgen_create()
79 if (!iio_evgen) in iio_dummy_evgen_get_irq()
82 mutex_lock(&iio_evgen->lock); in iio_dummy_evgen_get_irq()
84 if (!iio_evgen->inuse[i]) { in iio_dummy_evgen_get_irq()
85 ret = irq_create_mapping(iio_evgen->irq_sim_domain, i); in iio_dummy_evgen_get_irq()
86 iio_evgen->inuse[i] = true; in iio_dummy_evgen_get_irq()
90 mutex_unlock(&iio_evgen->lock); in iio_dummy_evgen_get_irq()
108 mutex_lock(&iio_evgen->lock); in iio_dummy_evgen_release_irq()
109 iio_evgen->inuse[irqd_to_hwirq(irqd)] = false; in iio_dummy_evgen_release_irq()
111 mutex_unlock(&iio_evgen->lock); in iio_dummy_evgen_release_irq()
119 return &iio_evgen->regs[irqd_to_hwirq(irqd)]; in iio_dummy_evgen_get_regs()
126 irq_domain_remove_sim(iio_evgen->irq_sim_domain); in iio_dummy_evgen_free()
127 kfree(iio_evgen); in iio_dummy_evgen_free()
148 iio_evgen->regs[this_attr->address].reg_id = this_attr->address; in iio_evgen_poke()
149 iio_evgen->regs[this_attr->address].reg_data = event; in iio_evgen_poke()
151 irq = irq_find_mapping(iio_evgen->irq_sim_domain, this_attr->address); in iio_evgen_poke()