[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aErOOSxt0ovCIeSA@smile.fi.intel.com>
Date: Thu, 12 Jun 2025 15:55:21 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andi Shyti <andi.shyti@...nel.org>
Cc: Akhil R <akhilrajeev@...dia.com>, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, thierry.reding@...il.com, jonathanh@...dia.com,
ldewangan@...dia.com, digetx@...il.com, p.zabel@...gutronix.de,
linux-i2c@...r.kernel.org, devicetree@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/3] i2c: tegra: make reset an optional property
On Thu, Jun 12, 2025 at 02:57:36AM +0200, Andi Shyti wrote:
...
> > +static int tegra_i2c_master_reset(struct tegra_i2c_dev *i2c_dev)
> > +{
> > + if (!i2c_dev->hw->has_mst_reset)
> > + return -EOPNOTSUPP;
> > +
> > + i2c_writel(i2c_dev, 0x1, I2C_MASTER_RESET_CNTRL);
> > + udelay(2);
> > +
> > + i2c_writel(i2c_dev, 0x0, I2C_MASTER_RESET_CNTRL);
> > + udelay(2);
> > +
> > + return 0;
> > +}
> > +
> > static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
> > {
> > u32 val, clk_divisor, clk_multiplier, tsu_thd, tlow, thigh, non_hs_mode;
> > @@ -621,8 +641,10 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
> > */
> > if (handle)
> > err = acpi_evaluate_object(handle, "_RST", NULL, NULL);
> > - else
> > + else if (i2c_dev->rst)
> > err = reset_control_reset(i2c_dev->rst);
> > + else
> > + err = tegra_i2c_master_reset(i2c_dev);
>
> Can you please take a look here? Should the reset happen in ACPI?
This is a good question. Without seeing all the implementations of _RST method
for the platforms based on this SoC it's hard to say. Ideally the _RST (which
is called above) must handle it properly, but firmwares have bugs...
TL;DR: I think the approach is correct, and if any bug in ACPI will be found,
the workaround (quirk) needs to be added here later on.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists