Thread (19 messages) 19 messages, 4 authors, 2013-12-04

[PATCH v7] gpio: Add MOXA ART GPIO driver

From: arnd@arndb.de (Arnd Bergmann)
Date: 2013-11-29 19:06:43
Also in: linux-devicetree, linux-gpio, lkml

On Friday 29 November 2013, Jonas Jensen wrote:
Add GPIO driver for MOXA ART SoCs.

Signed-off-by: Jonas Jensen <redacted>
Acked-by: Arnd Bergmann <arnd@arndb.de>

One more comment, no need to resend for another review if this is the only
thing you want to change:
+struct moxart_gpio_chip {
+	struct gpio_chip gpio;
+	void __iomem *moxart_gpio_base;
+};
If you rename 'moxart_gpio_base' to 'base'
+static int moxart_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+	struct moxart_gpio_chip *gc = to_moxart_gpio(chip);
+	u32 ret = readl(gc->moxart_gpio_base + GPIO_PIN_DIRECTION);
+
+	if (ret & BIT(offset))
+		return !!(readl(gc->moxart_gpio_base + GPIO_DATA_OUT) &
+			  BIT(offset));
+	else
+		return !!(readl(gc->moxart_gpio_base + GPIO_DATA_IN) &
+			  BIT(offset));
+}
These will fit in one line with no loss of readability.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help