[U-Boot] [PATCH v2 10/18] pinctrl: MediaTek: add pinctrl driver for MT7629 SoC
Simon Glass
sjg at chromium.org
Thu Oct 25 03:29:47 UTC 2018
Hi Ryder,
On 12 October 2018 at 01:00, Ryder Lee <ryder.lee at mediatek.com> wrote:
> This patch adds pinctrl support for MT7629 SoC. The IO core found on
> the SoC has the registers for pinctrl, pinconf and gpio mixed up in
> the same register range. Hence the driver also implements the gpio
> functionality through UCLASS_GPIO.
>
> This also creates a common file as there might be other chips that use
> the same binding and driver, then being a little more abstract could
> help in the long run.
>
> Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
> ---
> arch/arm/include/asm/arch-mediatek/gpio.h | 9 +
> drivers/pinctrl/Kconfig | 1 +
> drivers/pinctrl/Makefile | 1 +
> drivers/pinctrl/mediatek/Kconfig | 11 +
> drivers/pinctrl/mediatek/Makefile | 6 +
> drivers/pinctrl/mediatek/pinctrl-mt7629.c | 488 +++++++++++++++++++++++
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 552 ++++++++++++++++++++++++++
> drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 182 +++++++++
> 8 files changed, 1250 insertions(+)
> create mode 100644 arch/arm/include/asm/arch-mediatek/gpio.h
> create mode 100644 drivers/pinctrl/mediatek/Kconfig
> create mode 100644 drivers/pinctrl/mediatek/Makefile
> create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7629.c
> create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.h
>
[..]
> +int mtk_pinctrl_probe(struct udevice *dev, struct mtk_pinctrl_soc *soc)
> +{
> + struct mtk_pinctrl_priv *priv = dev_get_priv(dev);
> + int ret;
> +
> + priv->base = dev_read_addr_ptr(dev);
> + if (priv->base == (void *)FDT_ADDR_T_NONE)
> + return -EINVAL;
> +
> + priv->soc = soc;
> +
> + ret = mtk_gpiochip_register(dev);
> + if (ret)
> + return ret;
> +
> + return 0;
> +}
How come this function is exported? It should be probed like any other driver.
Regards,
Simon
More information about the U-Boot
mailing list