Lines Matching full:pmic_eic

68 	struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip);  in sprd_pmic_eic_update()  local
71 regmap_update_bits(pmic_eic->map, pmic_eic->offset + reg, in sprd_pmic_eic_update()
78 struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip); in sprd_pmic_eic_read() local
82 ret = regmap_read(pmic_eic->map, pmic_eic->offset + reg, &value); in sprd_pmic_eic_read()
122 struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip); in sprd_pmic_eic_set_debounce() local
127 ret = regmap_read(pmic_eic->map, pmic_eic->offset + reg, &value); in sprd_pmic_eic_set_debounce()
133 return regmap_write(pmic_eic->map, pmic_eic->offset + reg, value); in sprd_pmic_eic_set_debounce()
151 struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip); in sprd_pmic_eic_irq_mask() local
154 pmic_eic->reg[REG_IE] &= ~BIT(offset); in sprd_pmic_eic_irq_mask()
155 pmic_eic->reg[REG_TRIG] &= ~BIT(offset); in sprd_pmic_eic_irq_mask()
163 struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip); in sprd_pmic_eic_irq_unmask() local
168 pmic_eic->reg[REG_IE] |= BIT(offset); in sprd_pmic_eic_irq_unmask()
169 pmic_eic->reg[REG_TRIG] |= BIT(offset); in sprd_pmic_eic_irq_unmask()
176 struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip); in sprd_pmic_eic_irq_set_type() local
181 pmic_eic->reg[REG_IEV] |= BIT(offset); in sprd_pmic_eic_irq_set_type()
184 pmic_eic->reg[REG_IEV] &= ~BIT(offset); in sprd_pmic_eic_irq_set_type()
204 struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip); in sprd_pmic_eic_bus_lock() local
206 mutex_lock(&pmic_eic->buslock); in sprd_pmic_eic_bus_lock()
212 struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip); in sprd_pmic_eic_bus_sync_unlock() local
226 !!(pmic_eic->reg[REG_IEV] & BIT(offset))); in sprd_pmic_eic_bus_sync_unlock()
231 !!(pmic_eic->reg[REG_IE] & BIT(offset))); in sprd_pmic_eic_bus_sync_unlock()
234 !!(pmic_eic->reg[REG_TRIG] & BIT(offset))); in sprd_pmic_eic_bus_sync_unlock()
236 mutex_unlock(&pmic_eic->buslock); in sprd_pmic_eic_bus_sync_unlock()
270 struct sprd_pmic_eic *pmic_eic = data; in sprd_pmic_eic_irq_handler() local
271 struct gpio_chip *chip = &pmic_eic->chip; in sprd_pmic_eic_irq_handler()
276 ret = regmap_read(pmic_eic->map, pmic_eic->offset + SPRD_PMIC_EIC_MIS, in sprd_pmic_eic_irq_handler()
314 struct sprd_pmic_eic *pmic_eic; in sprd_pmic_eic_probe() local
317 pmic_eic = devm_kzalloc(&pdev->dev, sizeof(*pmic_eic), GFP_KERNEL); in sprd_pmic_eic_probe()
318 if (!pmic_eic) in sprd_pmic_eic_probe()
321 mutex_init(&pmic_eic->buslock); in sprd_pmic_eic_probe()
323 pmic_eic->irq = platform_get_irq(pdev, 0); in sprd_pmic_eic_probe()
324 if (pmic_eic->irq < 0) in sprd_pmic_eic_probe()
325 return pmic_eic->irq; in sprd_pmic_eic_probe()
327 pmic_eic->map = dev_get_regmap(pdev->dev.parent, NULL); in sprd_pmic_eic_probe()
328 if (!pmic_eic->map) in sprd_pmic_eic_probe()
331 ret = of_property_read_u32(pdev->dev.of_node, "reg", &pmic_eic->offset); in sprd_pmic_eic_probe()
337 ret = devm_request_threaded_irq(&pdev->dev, pmic_eic->irq, NULL, in sprd_pmic_eic_probe()
340 dev_name(&pdev->dev), pmic_eic); in sprd_pmic_eic_probe()
346 pmic_eic->chip.label = dev_name(&pdev->dev); in sprd_pmic_eic_probe()
347 pmic_eic->chip.ngpio = SPRD_PMIC_EIC_NR; in sprd_pmic_eic_probe()
348 pmic_eic->chip.base = -1; in sprd_pmic_eic_probe()
349 pmic_eic->chip.parent = &pdev->dev; in sprd_pmic_eic_probe()
350 pmic_eic->chip.direction_input = sprd_pmic_eic_direction_input; in sprd_pmic_eic_probe()
351 pmic_eic->chip.request = sprd_pmic_eic_request; in sprd_pmic_eic_probe()
352 pmic_eic->chip.free = sprd_pmic_eic_free; in sprd_pmic_eic_probe()
353 pmic_eic->chip.set_config = sprd_pmic_eic_set_config; in sprd_pmic_eic_probe()
354 pmic_eic->chip.set = sprd_pmic_eic_set; in sprd_pmic_eic_probe()
355 pmic_eic->chip.get = sprd_pmic_eic_get; in sprd_pmic_eic_probe()
356 pmic_eic->chip.can_sleep = true; in sprd_pmic_eic_probe()
358 irq = &pmic_eic->chip.irq; in sprd_pmic_eic_probe()
362 ret = devm_gpiochip_add_data(&pdev->dev, &pmic_eic->chip, pmic_eic); in sprd_pmic_eic_probe()