Lines Matching refs:ws16c48gpio

114 static int ws16c48_handle_pre_irq(void *const irq_drv_data) __acquires(&ws16c48gpio->lock)  in ws16c48_handle_pre_irq()
116 struct ws16c48_gpio *const ws16c48gpio = irq_drv_data; in ws16c48_handle_pre_irq() local
119 raw_spin_lock(&ws16c48gpio->lock); in ws16c48_handle_pre_irq()
124 static int ws16c48_handle_post_irq(void *const irq_drv_data) __releases(&ws16c48gpio->lock) in ws16c48_handle_post_irq()
126 struct ws16c48_gpio *const ws16c48gpio = irq_drv_data; in ws16c48_handle_post_irq() local
128 raw_spin_unlock(&ws16c48gpio->lock); in ws16c48_handle_post_irq()
136 struct ws16c48_gpio *const ws16c48gpio = irq_drv_data; in ws16c48_handle_mask_sync() local
140 raw_spin_lock_irqsave(&ws16c48gpio->lock, flags); in ws16c48_handle_mask_sync()
143 if (mask_buf == ws16c48gpio->irq_mask[index]) in ws16c48_handle_mask_sync()
145 ws16c48gpio->irq_mask[index] = mask_buf; in ws16c48_handle_mask_sync()
147 ret = regmap_write(ws16c48gpio->map, WS16C48_PAGE_LOCK, ENAB_PAGE); in ws16c48_handle_mask_sync()
152 ret = regmap_write(ws16c48gpio->map, WS16C48_ENAB + index, ~mask_buf); in ws16c48_handle_mask_sync()
156 ret = regmap_write(ws16c48gpio->map, WS16C48_PAGE_LOCK, INT_ID_PAGE); in ws16c48_handle_mask_sync()
161 raw_spin_unlock_irqrestore(&ws16c48gpio->lock, flags); in ws16c48_handle_mask_sync()
170 struct ws16c48_gpio *const ws16c48gpio = irq_drv_data; in ws16c48_set_type_config() local
186 raw_spin_lock_irqsave(&ws16c48gpio->lock, flags); in ws16c48_set_type_config()
188 ret = regmap_write(ws16c48gpio->map, WS16C48_PAGE_LOCK, POL_PAGE); in ws16c48_set_type_config()
193 ret = regmap_update_bits(ws16c48gpio->map, WS16C48_POL + idx, irq_data->mask, polarity); in ws16c48_set_type_config()
197 ret = regmap_write(ws16c48gpio->map, WS16C48_PAGE_LOCK, INT_ID_PAGE); in ws16c48_set_type_config()
202 raw_spin_unlock_irqrestore(&ws16c48gpio->lock, flags); in ws16c48_set_type_config()
247 struct ws16c48_gpio *ws16c48gpio; in ws16c48_probe() local
255 ws16c48gpio = devm_kzalloc(dev, sizeof(*ws16c48gpio), GFP_KERNEL); in ws16c48_probe()
256 if (!ws16c48gpio) in ws16c48_probe()
269 ws16c48gpio->map = devm_regmap_init_mmio(dev, regs, &ws16c48_regmap_config); in ws16c48_probe()
270 if (IS_ERR(ws16c48gpio->map)) in ws16c48_probe()
271 return dev_err_probe(dev, PTR_ERR(ws16c48gpio->map), in ws16c48_probe()
289 chip->irq_drv_data = ws16c48gpio; in ws16c48_probe()
291 raw_spin_lock_init(&ws16c48gpio->lock); in ws16c48_probe()
294 err = ws16c48_irq_init_hw(ws16c48gpio->map); in ws16c48_probe()
298 err = devm_regmap_add_irq_chip(dev, ws16c48gpio->map, irq[id], 0, 0, chip, &chip_data); in ws16c48_probe()
303 gpio_config.regmap = ws16c48gpio->map; in ws16c48_probe()