Re: [PATCH 3/5] i2c: riic: Add RZ/G2L support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Biju,

On Fri, Jun 11, 2021 at 6:56 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> RZ/G2L i2c controller is compatible with RZ/A i2c controller.
> By default IP is in reset state, so need to perform release
> reset before accessing any register.
>
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -941,6 +941,7 @@ config I2C_QUP
>  config I2C_RIIC
>         tristate "Renesas RIIC adapter"
>         depends on ARCH_RENESAS || COMPILE_TEST
> +       select RESET_CONTROLLER

if ARCH_R9A07G044?

> --- a/drivers/i2c/busses/i2c-riic.c
> +++ b/drivers/i2c/busses/i2c-riic.c
_kzalloc(&pdev->dev, sizeof(*riic), GFP_KERNEL);
>         if (!riic)
> @@ -412,6 +421,17 @@ static int riic_i2c_probe(struct platform_device *pdev)
>                 return PTR_ERR(riic->clk);
>         }
>
> +       type = (enum riic_type)of_device_get_match_data(&pdev->dev);
> +       if (type == RIIC_RZ_G2L) {
> +               rstc = devm_reset_control_get(&pdev->dev, NULL);
> +               if (IS_ERR(rstc)) {
> +                       dev_err(&pdev->dev, "Error: missing reset ctrl\n");
> +                       return PTR_ERR(rstc);
> +               }
> +
> +               reset_control_deassert(rstc);

Just wondering: does it harm if the driver is unloaded or unbounded,
and rebound while the I2C controller is not in reset state?

> +       }
> +
>         for (i = 0; i < ARRAY_SIZE(riic_irqs); i++) {
>                 res = platform_get_resource(pdev, IORESOURCE_IRQ, riic_irqs[i].res_num);
>                 if (!res)
> @@ -472,6 +492,7 @@ static int riic_i2c_remove(struct platform_device *pdev)
>  }
>
>  static const struct of_device_id riic_i2c_dt_ids[] = {
> +       { .compatible = "renesas,riic-r9a07g044", .data = (void *)RIIC_RZ_G2L },
>         { .compatible = "renesas,riic-rz" },

Please fill in .data, to avoid relying implicitly on RIIC_RZ_A being zero.

>         { /* Sentinel */ },
>  };

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux