Re: [PATCH v5 4/4] gpio: gpio-tps6594: add GPIO support for TPS6594 PMIC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux