Re: [PATCH V3 3/3] gpio: modepin: Add driver support for modepin GPIO controller
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
Date: 2021-08-18 08:52:10
Also in:
linux-devicetree, linux-gpio, lkml
On 18.08.21 10:10, Piyush Mehta wrote:
This patch adds driver support for the zynqmp modepin GPIO controller. GPIO modepin driver set and get the value and status of the PS_MODE pin, based on device-tree pin configuration. These four mode pins are configurable as input/output. The mode pin has a control register, which have lower four-bits [0:3] are configurable as input/output, next four-bits can be used for reading the data as input[4:7], and next setting the output pin state output[8:11]. Signed-off-by: Piyush Mehta <redacted> Acked-by: Michal Simek <redacted> Reviewed-by: Linus Walleij <redacted> ---
+/**
+ * modepin_gpio_dir_in - Set the direction of the specified GPIO pin as input
+ * @chip: gpio_chip instance to be worked on
+ * @pin: gpio pin number within the device
+ *
+ * Return: 0 always
+ */
+static int modepin_gpio_dir_in(struct gpio_chip *chip, unsigned int pin)
+{
+ return 0;
+}You say the gpio controller can configure pins as inputs or outputs. Yet, .direction_input is doing nothing. So it's not clear to me, how this sequence could work: - set gpio output high (writes bootmode) - set gpio to input (no-op, pin will remain high, not high impedance) I didn't check the previous discussions, but if this indeed works as intended, the how should be written here into the driver. That is a more useful comment than kernel doc for a stub function. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel