public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ryder Lee <ryder.lee@mediatek.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 10/18] pinctrl: MediaTek: add pinctrl driver for MT7629 SoC
Date: Thu, 25 Oct 2018 14:08:15 +0800	[thread overview]
Message-ID: <1540447695.32603.16.camel@mtkswgap22> (raw)
In-Reply-To: <CAPnjgZ3oox-h-fgtqz0xBHUjwJ6E8Yq3DB=yugoFoCOv7Txbeg@mail.gmail.com>

Hi Simon,

On Wed, 2018-10-24 at 21:29 -0600, Simon Glass wrote:
> Hi Ryder,
> 
> On 12 October 2018 at 01:00, Ryder Lee <ryder.lee@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@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.

It makes no difference. We could reuse it for other MTK chips in this
way.

In pinctrl-mt7623.c (patch 11/18):

static int mtk_pinctrl_mt7623_probe(struct udevice *dev)
{

//common probed function
	mtk_pinctrl_probe(dev, &mt7623_data);

//proprietary operations for the chip....
	mt7623_bonding_disable(dev);
        ....
}

The similar usage is meson_pinctrl_probe() in pinctrl-meson.c

Ryder

  reply	other threads:[~2018-10-25  6:08 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12  7:00 [U-Boot] [PATCH v2 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629 Ryder Lee
2018-10-12  7:00 ` [U-Boot] [PATCH v2 01/18] tools: MediaTek: add MTK boot header generation to mkimage Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-25 13:11     ` Ryder Lee
2018-10-12  7:00 ` [U-Boot] [PATCH v2 02/18] arm: dts: MediaTek: add device tree for MT7629 Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-12  7:00 ` [U-Boot] [PATCH v2 03/18] arm: dts: MediaTek: add device tree for MT7623 Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-12  7:00 ` [U-Boot] [PATCH v2 04/18] arm: MediaTek: add basic support for MT7629 boards Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-25  6:44     ` Ryder Lee
2018-10-12  7:00 ` [U-Boot] [PATCH v2 05/18] arm: MediaTek: add basic support for MT7623 boards Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-25  6:40     ` Ryder Lee
2018-10-12  7:00 ` [U-Boot] [PATCH v2 06/18] clk: MediaTek: add clock driver for MT7629 SoC Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-25  6:37     ` Ryder Lee
2018-11-03  6:08       ` Simon Glass
2018-10-12  7:00 ` [U-Boot] [PATCH v2 07/18] clk: MediaTek: add clock driver for MT7623 SoC Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-12  7:00 ` [U-Boot] [PATCH v2 08/18] timer: MediaTek: add timer driver for MediaTek SoCs Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-12  7:00 ` [U-Boot] [PATCH v2 09/18] watchdog: MediaTek: add watchdog " Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-12  7:00 ` [U-Boot] [PATCH v2 10/18] pinctrl: MediaTek: add pinctrl driver for MT7629 SoC Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-25  6:08     ` Ryder Lee [this message]
2018-11-03  6:08       ` Simon Glass
2018-10-12  7:01 ` [U-Boot] [PATCH v2 11/18] pinctrl: MediaTek: add pinctrl driver for MT7623 SoC Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-25  6:13     ` Ryder Lee
2018-11-03  6:08       ` Simon Glass
2018-10-12  7:01 ` [U-Boot] [PATCH v2 12/18] power domain: MediaTek: add power domain driver for MT7629 SoC Ryder Lee
2018-10-25  3:29   ` Simon Glass
2018-10-12  7:01 ` [U-Boot] [PATCH v2 13/18] power domain: MediaTek: add power domain driver for MT7623 SoC Ryder Lee
2018-10-25  3:30   ` Simon Glass
2018-10-12  7:01 ` [U-Boot] [PATCH v2 14/18] serial: 16550: allow the driver to support MediaTek serial Ryder Lee
2018-10-25  3:30   ` Simon Glass
2018-10-12  7:01 ` [U-Boot] [PATCH v2 15/18] ram: MediaTek: add DDR3 driver for MT7629 SoC Ryder Lee
2018-10-25  3:30   ` Simon Glass
2018-10-25  9:38     ` Ryder Lee
2018-10-26 16:53       ` Simon Glass
2018-10-12  7:01 ` [U-Boot] [PATCH v2 16/18] mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoC Ryder Lee
2018-10-25  3:30   ` Simon Glass
2018-10-12  7:01 ` [U-Boot] [PATCH v2 17/18] spi: mtk_qspi: add qspi driver for MT7629 SoC Ryder Lee
2018-10-25  3:30   ` Simon Glass
2018-10-26  6:33   ` Jagan Teki
2018-11-14  9:04   ` Jagan Teki
2018-11-14 12:53     ` Guochun Mao
2018-11-21  9:38       ` Jagan Teki
2018-11-21 11:46         ` Guochun Mao
2018-11-22  6:21           ` Jagan Teki
2018-11-22  8:58             ` Guochun Mao
2018-11-23  5:43               ` Jagan Teki
2018-11-23  8:24                 ` Guochun Mao
2018-10-12  7:01 ` [U-Boot] [PATCH v2 18/18] MAINTAINERS: add an entry for MediaTek Ryder Lee
2018-10-25  3:30   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1540447695.32603.16.camel@mtkswgap22 \
    --to=ryder.lee@mediatek.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox