Lines Matching +full:invert +full:- +full:interrupt

1 // SPDX-License-Identifier: GPL-2.0-only
17 #include <linux/interrupt.h>
124 { "irq-gpios", &pca953x_irq_gpios, 1, ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER },
136 ret = acpi_dev_gpio_irq_get_by(ACPI_COMPANION(dev), "irq-gpios", 0); in pca953x_acpi_get_irq()
140 dev_info(dev, "ACPI interrupt quirk (IRQ %d)\n", ret); in pca953x_acpi_get_irq()
150 * relative. Since first controller (gpio-sch.c) and
151 * second (gpio-dwapb.c) are at the fixed bases, we may
173 #define NBANK(chip) DIV_ROUND_UP(chip->gpio_chip.ngpio, BANK_SZ)
179 int invert; member
186 .invert = PCA953X_INVERT,
193 .invert = PCA957X_INVRT,
225 return fls((chip->gpio_chip.ngpio - 1) / BANK_SZ); in pca953x_bank_shift()
247 * - Standard set, below 0x40, each port can be replicated up to 8 times
248 * - PCA953x standard
253 * - PCA957x with mixed up registers
260 * - Extended set, above 0x40, often chip specific.
261 * - PCAL6524/PCAL9555A with custom PCAL IRQ handling:
263 * Pull-up/pull-down enable reg 0x40 + 3 * bank_size RW
264 * Pull-up/pull-down select reg 0x40 + 4 * bank_size RW
265 * Interrupt mask register 0x40 + 5 * bank_size RW
266 * Interrupt status register 0x40 + 6 * bank_size R
268 * - Registers with bit 0x80 set, the AI bit
278 int offset = reg & (BIT(bank_shift) - 1); in pca953x_check_register()
282 if (!(chip->driver_data & PCA_PCAL)) in pca953x_check_register()
316 int temp = reg - 0x30; in pcal6534_check_register()
319 offset = temp - (bank * NBANK(chip)); in pcal6534_check_register()
326 int temp = reg - 0x54; in pcal6534_check_register()
329 offset = temp - (bank * NBANK(chip)); in pcal6534_check_register()
333 offset = reg - (bank * NBANK(chip)); in pcal6534_check_register()
352 if (PCA_CHIP_TYPE(chip->driver_data) == PCA957X_TYPE) { in pca953x_readable_register()
361 if (chip->driver_data & PCA_PCAL) { in pca953x_readable_register()
367 return chip->check_reg(chip, reg, bank); in pca953x_readable_register()
375 if (PCA_CHIP_TYPE(chip->driver_data) == PCA957X_TYPE) { in pca953x_writeable_register()
383 if (chip->driver_data & PCA_PCAL) in pca953x_writeable_register()
387 return chip->check_reg(chip, reg, bank); in pca953x_writeable_register()
395 if (PCA_CHIP_TYPE(chip->driver_data) == PCA957X_TYPE) in pca953x_volatile_register()
400 if (chip->driver_data & PCA_PCAL) in pca953x_volatile_register()
403 return chip->check_reg(chip, reg, bank); in pca953x_volatile_register()
483 u8 regaddr = chip->recalc_addr(chip, reg, 0); in pca953x_write_regs()
490 ret = regmap_bulk_write(chip->regmap, regaddr, value, NBANK(chip)); in pca953x_write_regs()
492 dev_err(&chip->client->dev, "failed writing register\n"); in pca953x_write_regs()
501 u8 regaddr = chip->recalc_addr(chip, reg, 0); in pca953x_read_regs()
505 ret = regmap_bulk_read(chip->regmap, regaddr, value, NBANK(chip)); in pca953x_read_regs()
507 dev_err(&chip->client->dev, "failed reading register\n"); in pca953x_read_regs()
520 u8 dirreg = chip->recalc_addr(chip, chip->regs->direction, off); in pca953x_gpio_direction_input()
524 mutex_lock(&chip->i2c_lock); in pca953x_gpio_direction_input()
525 ret = regmap_write_bits(chip->regmap, dirreg, bit, bit); in pca953x_gpio_direction_input()
526 mutex_unlock(&chip->i2c_lock); in pca953x_gpio_direction_input()
534 u8 dirreg = chip->recalc_addr(chip, chip->regs->direction, off); in pca953x_gpio_direction_output()
535 u8 outreg = chip->recalc_addr(chip, chip->regs->output, off); in pca953x_gpio_direction_output()
539 mutex_lock(&chip->i2c_lock); in pca953x_gpio_direction_output()
541 ret = regmap_write_bits(chip->regmap, outreg, bit, val ? bit : 0); in pca953x_gpio_direction_output()
546 ret = regmap_write_bits(chip->regmap, dirreg, bit, 0); in pca953x_gpio_direction_output()
548 mutex_unlock(&chip->i2c_lock); in pca953x_gpio_direction_output()
555 u8 inreg = chip->recalc_addr(chip, chip->regs->input, off); in pca953x_gpio_get_value()
560 mutex_lock(&chip->i2c_lock); in pca953x_gpio_get_value()
561 ret = regmap_read(chip->regmap, inreg, &reg_val); in pca953x_gpio_get_value()
562 mutex_unlock(&chip->i2c_lock); in pca953x_gpio_get_value()
572 u8 outreg = chip->recalc_addr(chip, chip->regs->output, off); in pca953x_gpio_set_value()
575 mutex_lock(&chip->i2c_lock); in pca953x_gpio_set_value()
576 regmap_write_bits(chip->regmap, outreg, bit, val ? bit : 0); in pca953x_gpio_set_value()
577 mutex_unlock(&chip->i2c_lock); in pca953x_gpio_set_value()
583 u8 dirreg = chip->recalc_addr(chip, chip->regs->direction, off); in pca953x_gpio_get_direction()
588 mutex_lock(&chip->i2c_lock); in pca953x_gpio_get_direction()
589 ret = regmap_read(chip->regmap, dirreg, &reg_val); in pca953x_gpio_get_direction()
590 mutex_unlock(&chip->i2c_lock); in pca953x_gpio_get_direction()
607 mutex_lock(&chip->i2c_lock); in pca953x_gpio_get_multiple()
608 ret = pca953x_read_regs(chip, chip->regs->input, reg_val); in pca953x_gpio_get_multiple()
609 mutex_unlock(&chip->i2c_lock); in pca953x_gpio_get_multiple()
613 bitmap_replace(bits, bits, reg_val, mask, gc->ngpio); in pca953x_gpio_get_multiple()
624 mutex_lock(&chip->i2c_lock); in pca953x_gpio_set_multiple()
625 ret = pca953x_read_regs(chip, chip->regs->output, reg_val); in pca953x_gpio_set_multiple()
629 bitmap_replace(reg_val, reg_val, bits, mask, gc->ngpio); in pca953x_gpio_set_multiple()
631 pca953x_write_regs(chip, chip->regs->output, reg_val); in pca953x_gpio_set_multiple()
633 mutex_unlock(&chip->i2c_lock); in pca953x_gpio_set_multiple()
642 u8 pull_en_reg = chip->recalc_addr(chip, PCAL953X_PULL_EN, offset); in pca953x_gpio_set_pull_up_down()
643 u8 pull_sel_reg = chip->recalc_addr(chip, PCAL953X_PULL_SEL, offset); in pca953x_gpio_set_pull_up_down()
648 * pull-up/pull-down configuration requires PCAL extended in pca953x_gpio_set_pull_up_down()
651 if (!(chip->driver_data & PCA_PCAL)) in pca953x_gpio_set_pull_up_down()
652 return -ENOTSUPP; in pca953x_gpio_set_pull_up_down()
654 mutex_lock(&chip->i2c_lock); in pca953x_gpio_set_pull_up_down()
656 /* Configure pull-up/pull-down */ in pca953x_gpio_set_pull_up_down()
658 ret = regmap_write_bits(chip->regmap, pull_sel_reg, bit, bit); in pca953x_gpio_set_pull_up_down()
660 ret = regmap_write_bits(chip->regmap, pull_sel_reg, bit, 0); in pca953x_gpio_set_pull_up_down()
666 /* Disable/Enable pull-up/pull-down */ in pca953x_gpio_set_pull_up_down()
668 ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, 0); in pca953x_gpio_set_pull_up_down()
670 ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, bit); in pca953x_gpio_set_pull_up_down()
673 mutex_unlock(&chip->i2c_lock); in pca953x_gpio_set_pull_up_down()
689 return -ENOTSUPP; in pca953x_gpio_set_config()
697 gc = &chip->gpio_chip; in pca953x_setup_gpio()
699 gc->direction_input = pca953x_gpio_direction_input; in pca953x_setup_gpio()
700 gc->direction_output = pca953x_gpio_direction_output; in pca953x_setup_gpio()
701 gc->get = pca953x_gpio_get_value; in pca953x_setup_gpio()
702 gc->set = pca953x_gpio_set_value; in pca953x_setup_gpio()
703 gc->get_direction = pca953x_gpio_get_direction; in pca953x_setup_gpio()
704 gc->get_multiple = pca953x_gpio_get_multiple; in pca953x_setup_gpio()
705 gc->set_multiple = pca953x_gpio_set_multiple; in pca953x_setup_gpio()
706 gc->set_config = pca953x_gpio_set_config; in pca953x_setup_gpio()
707 gc->can_sleep = true; in pca953x_setup_gpio()
709 gc->base = chip->gpio_start; in pca953x_setup_gpio()
710 gc->ngpio = gpios; in pca953x_setup_gpio()
711 gc->label = dev_name(&chip->client->dev); in pca953x_setup_gpio()
712 gc->parent = &chip->client->dev; in pca953x_setup_gpio()
713 gc->owner = THIS_MODULE; in pca953x_setup_gpio()
714 gc->names = chip->names; in pca953x_setup_gpio()
724 clear_bit(hwirq, chip->irq_mask); in pca953x_irq_mask()
735 set_bit(hwirq, chip->irq_mask); in pca953x_irq_unmask()
744 atomic_inc(&chip->wakeup_path); in pca953x_irq_set_wake()
746 atomic_dec(&chip->wakeup_path); in pca953x_irq_set_wake()
748 return irq_set_irq_wake(chip->client->irq, on); in pca953x_irq_set_wake()
756 mutex_lock(&chip->irq_lock); in pca953x_irq_bus_lock()
767 if (chip->driver_data & PCA_PCAL) { in pca953x_irq_bus_sync_unlock()
768 /* Enable latch on interrupt-enabled inputs */ in pca953x_irq_bus_sync_unlock()
769 pca953x_write_regs(chip, PCAL953X_IN_LATCH, chip->irq_mask); in pca953x_irq_bus_sync_unlock()
771 bitmap_complement(irq_mask, chip->irq_mask, gc->ngpio); in pca953x_irq_bus_sync_unlock()
778 pca953x_read_regs(chip, chip->regs->direction, reg_direction); in pca953x_irq_bus_sync_unlock()
780 bitmap_or(irq_mask, chip->irq_trig_fall, chip->irq_trig_raise, gc->ngpio); in pca953x_irq_bus_sync_unlock()
781 bitmap_complement(reg_direction, reg_direction, gc->ngpio); in pca953x_irq_bus_sync_unlock()
782 bitmap_and(irq_mask, irq_mask, reg_direction, gc->ngpio); in pca953x_irq_bus_sync_unlock()
784 /* Look for any newly setup interrupt */ in pca953x_irq_bus_sync_unlock()
785 for_each_set_bit(level, irq_mask, gc->ngpio) in pca953x_irq_bus_sync_unlock()
786 pca953x_gpio_direction_input(&chip->gpio_chip, level); in pca953x_irq_bus_sync_unlock()
788 mutex_unlock(&chip->irq_lock); in pca953x_irq_bus_sync_unlock()
798 dev_err(&chip->client->dev, "irq %d: unsupported type %d\n", in pca953x_irq_set_type()
799 d->irq, type); in pca953x_irq_set_type()
800 return -EINVAL; in pca953x_irq_set_type()
803 assign_bit(hwirq, chip->irq_trig_fall, type & IRQ_TYPE_EDGE_FALLING); in pca953x_irq_set_type()
804 assign_bit(hwirq, chip->irq_trig_raise, type & IRQ_TYPE_EDGE_RISING); in pca953x_irq_set_type()
815 clear_bit(hwirq, chip->irq_trig_raise); in pca953x_irq_shutdown()
816 clear_bit(hwirq, chip->irq_trig_fall); in pca953x_irq_shutdown()
823 seq_printf(p, dev_name(gc->parent)); in pca953x_irq_print_chip()
841 struct gpio_chip *gc = &chip->gpio_chip; in pca953x_irq_pending()
849 if (chip->driver_data & PCA_PCAL) { in pca953x_irq_pending()
850 /* Read the current interrupt status from the device */ in pca953x_irq_pending()
855 /* Check latched inputs and clear interrupt status */ in pca953x_irq_pending()
856 ret = pca953x_read_regs(chip, chip->regs->input, cur_stat); in pca953x_irq_pending()
861 bitmap_replace(new_stat, chip->irq_trig_fall, chip->irq_trig_raise, cur_stat, gc->ngpio); in pca953x_irq_pending()
863 bitmap_and(pending, new_stat, trigger, gc->ngpio); in pca953x_irq_pending()
865 return !bitmap_empty(pending, gc->ngpio); in pca953x_irq_pending()
868 ret = pca953x_read_regs(chip, chip->regs->input, cur_stat); in pca953x_irq_pending()
873 pca953x_read_regs(chip, chip->regs->direction, reg_direction); in pca953x_irq_pending()
875 bitmap_copy(old_stat, chip->irq_stat, gc->ngpio); in pca953x_irq_pending()
877 bitmap_and(new_stat, cur_stat, reg_direction, gc->ngpio); in pca953x_irq_pending()
878 bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio); in pca953x_irq_pending()
879 bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio); in pca953x_irq_pending()
881 bitmap_copy(chip->irq_stat, new_stat, gc->ngpio); in pca953x_irq_pending()
883 if (bitmap_empty(trigger, gc->ngpio)) in pca953x_irq_pending()
886 bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio); in pca953x_irq_pending()
887 bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio); in pca953x_irq_pending()
888 bitmap_or(new_stat, old_stat, cur_stat, gc->ngpio); in pca953x_irq_pending()
889 bitmap_and(pending, new_stat, trigger, gc->ngpio); in pca953x_irq_pending()
891 return !bitmap_empty(pending, gc->ngpio); in pca953x_irq_pending()
897 struct gpio_chip *gc = &chip->gpio_chip; in pca953x_irq_handler()
904 mutex_lock(&chip->i2c_lock); in pca953x_irq_handler()
906 mutex_unlock(&chip->i2c_lock); in pca953x_irq_handler()
911 for_each_set_bit(level, pending, gc->ngpio) { in pca953x_irq_handler()
912 int nested_irq = irq_find_mapping(gc->irq.domain, level); in pca953x_irq_handler()
915 dev_warn_ratelimited(gc->parent, "unmapped interrupt %d\n", level); in pca953x_irq_handler()
929 struct i2c_client *client = chip->client; in pca953x_irq_setup()
936 ret = pca953x_acpi_get_irq(&client->dev); in pca953x_irq_setup()
938 client->irq = ret; in pca953x_irq_setup()
941 if (!client->irq) in pca953x_irq_setup()
944 if (irq_base == -1) in pca953x_irq_setup()
947 if (!(chip->driver_data & PCA_INT)) in pca953x_irq_setup()
950 ret = pca953x_read_regs(chip, chip->regs->input, irq_stat); in pca953x_irq_setup()
956 * interrupt. We have to rely on the previous read for in pca953x_irq_setup()
959 pca953x_read_regs(chip, chip->regs->direction, reg_direction); in pca953x_irq_setup()
960 bitmap_and(chip->irq_stat, irq_stat, reg_direction, chip->gpio_chip.ngpio); in pca953x_irq_setup()
961 mutex_init(&chip->irq_lock); in pca953x_irq_setup()
963 girq = &chip->gpio_chip.irq; in pca953x_irq_setup()
966 girq->parent_handler = NULL; in pca953x_irq_setup()
967 girq->num_parents = 0; in pca953x_irq_setup()
968 girq->parents = NULL; in pca953x_irq_setup()
969 girq->default_type = IRQ_TYPE_NONE; in pca953x_irq_setup()
970 girq->handler = handle_simple_irq; in pca953x_irq_setup()
971 girq->threaded = true; in pca953x_irq_setup()
972 girq->first = irq_base; /* FIXME: get rid of this */ in pca953x_irq_setup()
974 ret = devm_request_threaded_irq(&client->dev, client->irq, in pca953x_irq_setup()
977 dev_name(&client->dev), chip); in pca953x_irq_setup()
979 dev_err(&client->dev, "failed to request irq %d\n", in pca953x_irq_setup()
980 client->irq); in pca953x_irq_setup()
991 struct i2c_client *client = chip->client; in pca953x_irq_setup()
993 if (client->irq && irq_base != -1 && (chip->driver_data & PCA_INT)) in pca953x_irq_setup()
994 dev_warn(&client->dev, "interrupt support not compiled in\n"); in pca953x_irq_setup()
1000 static int device_pca95xx_init(struct pca953x_chip *chip, u32 invert) in device_pca95xx_init() argument
1006 regaddr = chip->recalc_addr(chip, chip->regs->output, 0); in device_pca95xx_init()
1007 ret = regcache_sync_region(chip->regmap, regaddr, in device_pca95xx_init()
1008 regaddr + NBANK(chip) - 1); in device_pca95xx_init()
1012 regaddr = chip->recalc_addr(chip, chip->regs->direction, 0); in device_pca95xx_init()
1013 ret = regcache_sync_region(chip->regmap, regaddr, in device_pca95xx_init()
1014 regaddr + NBANK(chip) - 1); in device_pca95xx_init()
1019 if (invert) in device_pca95xx_init()
1024 ret = pca953x_write_regs(chip, chip->regs->invert, val); in device_pca95xx_init()
1029 static int device_pca957x_init(struct pca953x_chip *chip, u32 invert) in device_pca957x_init() argument
1035 ret = device_pca95xx_init(chip, invert); in device_pca957x_init()
1059 u32 invert = 0; in pca953x_probe() local
1063 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); in pca953x_probe()
1065 return -ENOMEM; in pca953x_probe()
1067 pdata = dev_get_platdata(&client->dev); in pca953x_probe()
1069 irq_base = pdata->irq_base; in pca953x_probe()
1070 chip->gpio_start = pdata->gpio_base; in pca953x_probe()
1071 invert = pdata->invert; in pca953x_probe()
1072 chip->names = pdata->names; in pca953x_probe()
1076 chip->gpio_start = -1; in pca953x_probe()
1080 * See if we need to de-assert a reset pin. in pca953x_probe()
1082 * There is no known ACPI-enabled platforms that are in pca953x_probe()
1086 reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", in pca953x_probe()
1092 chip->client = client; in pca953x_probe()
1094 reg = devm_regulator_get(&client->dev, "vcc"); in pca953x_probe()
1096 return dev_err_probe(&client->dev, PTR_ERR(reg), "reg get err\n"); in pca953x_probe()
1100 dev_err(&client->dev, "reg en err: %d\n", ret); in pca953x_probe()
1103 chip->regulator = reg; in pca953x_probe()
1106 chip->driver_data = i2c_id->driver_data; in pca953x_probe()
1110 match = device_get_match_data(&client->dev); in pca953x_probe()
1112 ret = -ENODEV; in pca953x_probe()
1116 chip->driver_data = (uintptr_t)match; in pca953x_probe()
1121 pca953x_setup_gpio(chip, chip->driver_data & PCA_GPIO_MASK); in pca953x_probe()
1123 if (NBANK(chip) > 2 || PCA_CHIP_TYPE(chip->driver_data) == PCA957X_TYPE) { in pca953x_probe()
1124 dev_info(&client->dev, "using AI\n"); in pca953x_probe()
1127 dev_info(&client->dev, "using no AI\n"); in pca953x_probe()
1131 if (PCA_CHIP_TYPE(chip->driver_data) == PCAL653X_TYPE) { in pca953x_probe()
1132 chip->recalc_addr = pcal6534_recalc_addr; in pca953x_probe()
1133 chip->check_reg = pcal6534_check_register; in pca953x_probe()
1135 chip->recalc_addr = pca953x_recalc_addr; in pca953x_probe()
1136 chip->check_reg = pca953x_check_register; in pca953x_probe()
1139 chip->regmap = devm_regmap_init_i2c(client, regmap_config); in pca953x_probe()
1140 if (IS_ERR(chip->regmap)) { in pca953x_probe()
1141 ret = PTR_ERR(chip->regmap); in pca953x_probe()
1145 regcache_mark_dirty(chip->regmap); in pca953x_probe()
1147 mutex_init(&chip->i2c_lock); in pca953x_probe()
1149 * In case we have an i2c-mux controlled by a GPIO provided by an in pca953x_probe()
1152 * subclass for chip->i2c_lock. in pca953x_probe()
1155 * false positives when the expander controlling the i2c-mux is on in pca953x_probe()
1161 * applied to all other i2c-controlled GPIO expanders (and potentially in pca953x_probe()
1162 * regmap-i2c). in pca953x_probe()
1164 lockdep_set_subclass(&chip->i2c_lock, in pca953x_probe()
1165 i2c_adapter_depth(client->adapter)); in pca953x_probe()
1170 if (PCA_CHIP_TYPE(chip->driver_data) == PCA957X_TYPE) { in pca953x_probe()
1171 chip->regs = &pca957x_regs; in pca953x_probe()
1172 ret = device_pca957x_init(chip, invert); in pca953x_probe()
1174 chip->regs = &pca953x_regs; in pca953x_probe()
1175 ret = device_pca95xx_init(chip, invert); in pca953x_probe()
1184 ret = devm_gpiochip_add_data(&client->dev, &chip->gpio_chip, chip); in pca953x_probe()
1188 if (pdata && pdata->setup) { in pca953x_probe()
1189 ret = pdata->setup(client, chip->gpio_chip.base, in pca953x_probe()
1190 chip->gpio_chip.ngpio, pdata->context); in pca953x_probe()
1192 dev_warn(&client->dev, "setup failed, %d\n", ret); in pca953x_probe()
1198 regulator_disable(chip->regulator); in pca953x_probe()
1204 struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev); in pca953x_remove()
1207 if (pdata && pdata->teardown) { in pca953x_remove()
1208 pdata->teardown(client, chip->gpio_chip.base, in pca953x_remove()
1209 chip->gpio_chip.ngpio, pdata->context); in pca953x_remove()
1212 regulator_disable(chip->regulator); in pca953x_remove()
1226 regaddr = chip->recalc_addr(chip, chip->regs->direction, 0); in pca953x_regcache_sync()
1227 ret = regcache_sync_region(chip->regmap, regaddr, regaddr + NBANK(chip) - 1); in pca953x_regcache_sync()
1233 regaddr = chip->recalc_addr(chip, chip->regs->output, 0); in pca953x_regcache_sync()
1234 ret = regcache_sync_region(chip->regmap, regaddr, regaddr + NBANK(chip) - 1); in pca953x_regcache_sync()
1241 if (chip->driver_data & PCA_PCAL) { in pca953x_regcache_sync()
1242 regaddr = chip->recalc_addr(chip, PCAL953X_IN_LATCH, 0); in pca953x_regcache_sync()
1243 ret = regcache_sync_region(chip->regmap, regaddr, in pca953x_regcache_sync()
1244 regaddr + NBANK(chip) - 1); in pca953x_regcache_sync()
1251 regaddr = chip->recalc_addr(chip, PCAL953X_INT_MASK, 0); in pca953x_regcache_sync()
1252 ret = regcache_sync_region(chip->regmap, regaddr, in pca953x_regcache_sync()
1253 regaddr + NBANK(chip) - 1); in pca953x_regcache_sync()
1269 mutex_lock(&chip->i2c_lock); in pca953x_suspend()
1270 regcache_cache_only(chip->regmap, true); in pca953x_suspend()
1271 mutex_unlock(&chip->i2c_lock); in pca953x_suspend()
1273 if (atomic_read(&chip->wakeup_path)) in pca953x_suspend()
1276 regulator_disable(chip->regulator); in pca953x_suspend()
1286 if (!atomic_read(&chip->wakeup_path)) { in pca953x_resume()
1287 ret = regulator_enable(chip->regulator); in pca953x_resume()
1294 mutex_lock(&chip->i2c_lock); in pca953x_resume()
1295 regcache_cache_only(chip->regmap, false); in pca953x_resume()
1296 regcache_mark_dirty(chip->regmap); in pca953x_resume()
1299 mutex_unlock(&chip->i2c_lock); in pca953x_resume()
1303 ret = regcache_sync(chip->regmap); in pca953x_resume()
1304 mutex_unlock(&chip->i2c_lock); in pca953x_resume()
1314 /* convenience to stop overlong match-table lines */