Thread (13 messages) 13 messages, 6 authors, 2021-11-04

Re: [PATCH v3 4/5] pinctrl: add pinctrl/GPIO driver for Apple SoCs

From: Alyssa Rosenzweig <hidden>
Date: 2021-10-16 18:07:41
Also in: linux-gpio

+static int apple_gpio_gpio_get_direction(struct gpio_chip *chip,
+					 unsigned int offset)
+{
+	struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
+	unsigned int reg = apple_gpio_get_reg(pctl, offset);
+
+	return (FIELD_GET(REG_GPIOx_MODE, reg) == REG_GPIOx_OUT) ?
+		       GPIO_LINE_DIRECTION_OUT :
+			     GPIO_LINE_DIRECTION_IN;
+}
Nit: weird spacing.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help