[PATCH 17/31] i2c: add support for MediaTek I2C interface

Weijie Gao weijie.gao at mediatek.com
Mon Aug 8 05:00:32 CEST 2022


On Thu, 2022-08-04 at 07:57 -0600, Simon Glass wrote:
> Hi Weijie,
> 
> On Wed, 3 Aug 2022 at 21:38, Weijie Gao <weijie.gao at mediatek.com>
> wrote:
> > 
> > This patch adds support for MediaTek I2C interface
> > 
> > Signed-off-by: Weijie Gao <weijie.gao at mediatek.com>
> > ---
> >  drivers/i2c/Kconfig   |   9 +
> >  drivers/i2c/Makefile  |   1 +
> >  drivers/i2c/mtk_i2c.c | 822
> > ++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 832 insertions(+)
> >  create mode 100644 drivers/i2c/mtk_i2c.c
> > 
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> [..]
> 
> > diff --git a/drivers/i2c/mtk_i2c.c b/drivers/i2c/mtk_i2c.c
> > new file mode 100644
> > index 0000000000..1d4a93f8c9
> > --- /dev/null
> > +++ b/drivers/i2c/mtk_i2c.c
> > @@ -0,0 +1,822 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright (C) 2022 MediaTek Inc. All Rights Reserved.
> > + *
> > + * Author: Mingming Lee <Mingming.Lee at mediatek.com>
> > + *
> > + * MediaTek I2C Interface driver
> > + */
> > +
> > +#include <clk.h>
> > +#include <cpu_func.h>
> > +#include <dm.h>
> > +#include <i2c.h>
> > +#include <log.h>
> > +#include <asm/cache.h>
> > +#include <asm/io.h>
> > +#include <linux/delay.h>
> > +#include <linux/errno.h>
> > +
> 
> [..]
> 
> > +
> > +U_BOOT_DRIVER(mtk_i2c) = {
> > +       .name           = "mtk_i2c",
> > +       .id             = UCLASS_I2C,
> > +       .of_match       = mtk_i2c_ids,
> > +       .of_to_plat     = mtk_i2c_ofdata_to_platdata,
> 
> mtk_i2c_of_to_plat (for consistency)

OK.

> 
> > +       .probe          = mtk_i2c_probe,
> > +       .priv_auto      = sizeof(struct mtk_i2c_priv),
> > +       .ops            = &mtk_i2c_ops,
> > +};
> > --
> > 2.17.1
> > 
> 
> Regards,
> Simon


More information about the U-Boot mailing list