Lines Matching refs:cd
42 struct mst_intc_chip_data *cd = irq_data_get_irq_chip_data(d); in mst_set_irq() local
49 raw_spin_lock_irqsave(&cd->lock, flags); in mst_set_irq()
50 val = readw_relaxed(cd->base + offset) | mask; in mst_set_irq()
51 writew_relaxed(val, cd->base + offset); in mst_set_irq()
52 raw_spin_unlock_irqrestore(&cd->lock, flags); in mst_set_irq()
58 struct mst_intc_chip_data *cd = irq_data_get_irq_chip_data(d); in mst_clear_irq() local
65 raw_spin_lock_irqsave(&cd->lock, flags); in mst_clear_irq()
66 val = readw_relaxed(cd->base + offset) & ~mask; in mst_clear_irq()
67 writew_relaxed(val, cd->base + offset); in mst_clear_irq()
68 raw_spin_unlock_irqrestore(&cd->lock, flags); in mst_clear_irq()
85 struct mst_intc_chip_data *cd = irq_data_get_irq_chip_data(d); in mst_intc_eoi_irq() local
87 if (!cd->no_eoi) in mst_intc_eoi_irq()
128 static void mst_intc_polarity_save(struct mst_intc_chip_data *cd) in mst_intc_polarity_save() argument
131 void __iomem *addr = cd->base + INTC_REV_POLARITY; in mst_intc_polarity_save()
133 for (i = 0; i < DIV_ROUND_UP(cd->nr_irqs, 16); i++) in mst_intc_polarity_save()
134 cd->saved_polarity_conf[i] = readw_relaxed(addr + i * 4); in mst_intc_polarity_save()
137 static void mst_intc_polarity_restore(struct mst_intc_chip_data *cd) in mst_intc_polarity_restore() argument
140 void __iomem *addr = cd->base + INTC_REV_POLARITY; in mst_intc_polarity_restore()
142 for (i = 0; i < DIV_ROUND_UP(cd->nr_irqs, 16); i++) in mst_intc_polarity_restore()
143 writew_relaxed(cd->saved_polarity_conf[i], addr + i * 4); in mst_intc_polarity_restore()
148 struct mst_intc_chip_data *cd; in mst_irq_resume() local
150 list_for_each_entry(cd, &mst_intc_list, entry) in mst_irq_resume()
151 mst_intc_polarity_restore(cd); in mst_irq_resume()
156 struct mst_intc_chip_data *cd; in mst_irq_suspend() local
158 list_for_each_entry(cd, &mst_intc_list, entry) in mst_irq_suspend()
159 mst_intc_polarity_save(cd); in mst_irq_suspend()
181 struct mst_intc_chip_data *cd = d->host_data; in mst_intc_domain_translate() local
191 if (fwspec->param[1] >= cd->nr_irqs) in mst_intc_domain_translate()
208 struct mst_intc_chip_data *cd = domain->host_data; in mst_intc_domain_alloc() local
226 parent_fwspec.param[1] = cd->irq_start + hwirq; in mst_intc_domain_alloc()
249 struct mst_intc_chip_data *cd; in mst_intc_of_init() local
262 cd = kzalloc(sizeof(*cd), GFP_KERNEL); in mst_intc_of_init()
263 if (!cd) in mst_intc_of_init()
266 cd->base = of_iomap(dn, 0); in mst_intc_of_init()
267 if (!cd->base) { in mst_intc_of_init()
268 kfree(cd); in mst_intc_of_init()
272 cd->no_eoi = of_property_read_bool(dn, "mstar,intc-no-eoi"); in mst_intc_of_init()
273 raw_spin_lock_init(&cd->lock); in mst_intc_of_init()
274 cd->irq_start = irq_start; in mst_intc_of_init()
275 cd->nr_irqs = irq_end - irq_start + 1; in mst_intc_of_init()
276 domain = irq_domain_add_hierarchy(domain_parent, 0, cd->nr_irqs, dn, in mst_intc_of_init()
277 &mst_intc_domain_ops, cd); in mst_intc_of_init()
279 iounmap(cd->base); in mst_intc_of_init()
280 kfree(cd); in mst_intc_of_init()
285 INIT_LIST_HEAD(&cd->entry); in mst_intc_of_init()
286 list_add_tail(&cd->entry, &mst_intc_list); in mst_intc_of_init()