All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "Philipp Zabel" <p.zabel@pengutronix.de>,
	"Chris Brandt" <chris.brandt@renesas.com>,
	"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Jarkko Nikula" <jarkko.nikula@linux.intel.com>,
	"Jean Delvare" <jdelvare@suse.de>,
	"Khalil Blaiech" <kblaiech@mellanox.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@canonical.com>,
	"Bence Csókás" <bence98@sch.bme.hu>,
	"Yicong Yang" <yangyicong@hisilicon.com>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Linux I2C" <linux-i2c@vger.kernel.org>,
	"Chris Paterson" <Chris.Paterson2@renesas.com>,
	"Biju Das" <biju.das@bp.renesas.com>,
	"Prabhakar Mahadev Lad" <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 3/5] i2c: riic: Add RZ/G2L support
Date: Mon, 14 Jun 2021 14:38:23 +0200	[thread overview]
Message-ID: <CAMuHMdWWgehDTxTcm8=ooq2-4BkY0jgo+hwfrM_PHc6iw6aP8A@mail.gmail.com> (raw)
In-Reply-To: <20210611165624.30749-4-biju.das.jz@bp.renesas.com>

Hi Biju,

On Fri, Jun 11, 2021 at 6:56 PM Biju Das <biju.das.jz@bp.renesas.com> 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@bp.renesas.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

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@linux-m68k.org

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

  reply	other threads:[~2021-06-14 12:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11 16:56 [PATCH 0/5] Add RZ/G2L I2C support Biju Das
2021-06-11 16:56 ` [PATCH 1/5] dt-bindings: i2c: renesas,riic: Document RZ/G2L I2C controller Biju Das
2021-06-14 12:43   ` Geert Uytterhoeven
2021-06-11 16:56 ` [PATCH 2/5] drivers: clk: renesas: r9a07g044-cpg: Add I2C Clocks Biju Das
2021-06-14 12:32   ` Geert Uytterhoeven
2021-06-11 16:56 ` [PATCH 3/5] i2c: riic: Add RZ/G2L support Biju Das
2021-06-14 12:38   ` Geert Uytterhoeven [this message]
2021-06-14 16:04     ` Biju Das
2021-06-14 13:27   ` Philipp Zabel
2021-06-14 13:38     ` Geert Uytterhoeven
2021-06-14 17:20     ` Biju Das
2021-06-11 16:56 ` [PATCH 4/5] arm64: dts: renesas: r9a07g044: Add I2C nodes Biju Das
2021-06-14 12:45   ` Geert Uytterhoeven
2021-06-11 16:56 ` [PATCH 5/5] arm64: defconfig: Enable RIIC Biju Das
2021-06-11 16:56   ` Biju Das
2021-06-14 12:45   ` Geert Uytterhoeven
2021-06-14 12:45     ` Geert Uytterhoeven
2021-08-13  9:55     ` Geert Uytterhoeven
2021-08-13  9:55       ` Geert Uytterhoeven

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='CAMuHMdWWgehDTxTcm8=ooq2-4BkY0jgo+hwfrM_PHc6iw6aP8A@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=Chris.Paterson2@renesas.com \
    --cc=arnd@arndb.de \
    --cc=bence98@sch.bme.hu \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=biju.das@bp.renesas.com \
    --cc=chris.brandt@renesas.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jdelvare@suse.de \
    --cc=kblaiech@mellanox.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=rppt@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yangyicong@hisilicon.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.