Am 2022-11-23 06:35, schrieb Matt Ranostay:
+static int tps6594_regmap_xlate(struct gpio_regmap *gpio, + unsigned int base, unsigned int offset, + unsigned int *reg, unsigned int *mask) +{ + if (base == TPS6594_GPIO_CONF) { + *reg = base + offset; + *mask = GPIO_CFG_MASK; + } else { + unsigned int line = offset % GPIO_BANK_SIZE; + unsigned int stride = offset / GPIO_BANK_SIZE; + + *reg = base + stride; + *mask = BIT(line); + }
This looks like a duplcate from gpio_regmap_simple_xlate(). Maybe we can export it and do if (base == TPS6594_GPIO_CONF) { *reg = base + offset; *mask = GPIO_CFG_MASK; } else { return gpio_regmap_simple_xlate(gpio, base, offset, reg, mask); } Apart from that Reviewed-by: Michael Walle <michael@xxxxxxxx> -michael