[PATCH v1 11/15] aspeed: Add I2C Driver

Simon Glass sjg at chromium.org
Wed Apr 19 10:12:01 AEST 2017


On 17 April 2017 at 13:00, Maxim Sloyko <maxims at google.com> wrote:
> Add Device Model based I2C driver for ast2500/ast2400 SoCs.
> The driver is very limited, it only supports master mode and
> synchronous byte-by-byte reads/writes, no DMA or Pool Buffers.
>
> Signed-off-by: Maxim Sloyko <maxims at google.com>
>
> ---
>
> Changes in v1:
> - Style fixes
>
>
> ---
>  drivers/i2c/Kconfig   |   9 ++
>  drivers/i2c/Makefile  |   1 +
>  drivers/i2c/ast_i2c.c | 357 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  drivers/i2c/ast_i2c.h | 132 +++++++++++++++++++
>  4 files changed, 499 insertions(+)
>  create mode 100644 drivers/i2c/ast_i2c.c
>  create mode 100644 drivers/i2c/ast_i2c.h

Reviewed-by: Simon Glass <sjg at chromium.org>

nit below

[..]
> +static int ast_i2c_ofdata_to_platdata(struct udevice *dev)
> +{
> +       struct ast_i2c_priv *priv = dev_get_priv(dev);
> +       int ret;
> +
> +       priv->regs = dev_get_addr_ptr(dev);
> +       if (IS_ERR(priv->regs))
> +               return PTR_ERR(priv->regs);

Should be

 if (!priv->regs)

I think

> +
> +       ret = clk_get_by_index(dev, 0, &priv->clk);
> +       if (ret < 0) {
> +               debug("%s: Can't get clock for %s: %d\n", __func__, dev->name,
> +                     ret);
> +               return ret;

Regards,
Simon


More information about the openbmc mailing list