Lines Matching refs:chip_data
37 struct mtk_sysirq_chip_data *chip_data = data->chip_data; in mtk_sysirq_set_type() local
38 u8 intpol_idx = chip_data->intpol_idx[hwirq]; in mtk_sysirq_set_type()
44 base = chip_data->intpol_bases[intpol_idx]; in mtk_sysirq_set_type()
45 reg_index = chip_data->which_word[hwirq]; in mtk_sysirq_set_type()
48 spin_lock_irqsave(&chip_data->lock, flags); in mtk_sysirq_set_type()
64 spin_unlock_irqrestore(&chip_data->lock, flags); in mtk_sysirq_set_type()
134 struct mtk_sysirq_chip_data *chip_data; in mtk_sysirq_of_init() local
143 chip_data = kzalloc(sizeof(*chip_data), GFP_KERNEL); in mtk_sysirq_of_init()
144 if (!chip_data) in mtk_sysirq_of_init()
156 chip_data->intpol_words = kcalloc(nr_intpol_bases, in mtk_sysirq_of_init()
157 sizeof(*chip_data->intpol_words), in mtk_sysirq_of_init()
159 if (!chip_data->intpol_words) { in mtk_sysirq_of_init()
164 chip_data->intpol_bases = kcalloc(nr_intpol_bases, in mtk_sysirq_of_init()
165 sizeof(*chip_data->intpol_bases), in mtk_sysirq_of_init()
167 if (!chip_data->intpol_bases) { in mtk_sysirq_of_init()
178 chip_data->intpol_words[i] = size / 4; in mtk_sysirq_of_init()
179 chip_data->intpol_bases[i] = of_iomap(node, i); in mtk_sysirq_of_init()
180 if (ret || !chip_data->intpol_bases[i]) { in mtk_sysirq_of_init()
187 chip_data->intpol_idx = kcalloc(intpol_num, in mtk_sysirq_of_init()
188 sizeof(*chip_data->intpol_idx), in mtk_sysirq_of_init()
190 if (!chip_data->intpol_idx) { in mtk_sysirq_of_init()
195 chip_data->which_word = kcalloc(intpol_num, in mtk_sysirq_of_init()
196 sizeof(*chip_data->which_word), in mtk_sysirq_of_init()
198 if (!chip_data->which_word) { in mtk_sysirq_of_init()
210 for (j = 0; word >= chip_data->intpol_words[j] ; j++) in mtk_sysirq_of_init()
211 word -= chip_data->intpol_words[j]; in mtk_sysirq_of_init()
213 chip_data->intpol_idx[i] = j; in mtk_sysirq_of_init()
214 chip_data->which_word[i] = word; in mtk_sysirq_of_init()
218 &sysirq_domain_ops, chip_data); in mtk_sysirq_of_init()
223 spin_lock_init(&chip_data->lock); in mtk_sysirq_of_init()
228 kfree(chip_data->which_word); in mtk_sysirq_of_init()
230 kfree(chip_data->intpol_idx); in mtk_sysirq_of_init()
233 if (chip_data->intpol_bases[i]) in mtk_sysirq_of_init()
234 iounmap(chip_data->intpol_bases[i]); in mtk_sysirq_of_init()
235 kfree(chip_data->intpol_bases); in mtk_sysirq_of_init()
237 kfree(chip_data->intpol_words); in mtk_sysirq_of_init()
239 kfree(chip_data); in mtk_sysirq_of_init()