public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Yicong Yang <yangyicong@huawei.com>
Cc: Yicong Yang <yangyicong@hisilicon.com>,
	jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com,
	wsa@kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org, prime.zeng@hisilicon.com,
	linuxarm@huawei.com, irina.tirdea@intel.com,
	linus.walleij@linaro.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: hisi: Add generic GPIO bus recovery support
Date: Wed, 9 Feb 2022 14:12:50 +0200	[thread overview]
Message-ID: <YgOvwg4pEiVF99fu@smile.fi.intel.com> (raw)
In-Reply-To: <5de8e304-05b7-48ec-6b8f-e1f856e86697@huawei.com>

On Tue, Feb 08, 2022 at 10:15:44AM +0800, Yicong Yang wrote:
> On 2022/2/7 19:20, Andy Shevchenko wrote:
> > On Mon, Feb 07, 2022 at 01:17:49PM +0200, Andy Shevchenko wrote:
> >> On Tue, Jan 25, 2022 at 08:49:29PM +0800, Yicong Yang wrote:
> >>> Add generic GPIO bus recovery support for i2c-hisi driver
> >>> by registering the recovery information with core provided
> >>> i2c_generic_scl_recovery() method.
> >>>
> >>> As the SCL/SDA pins are multiplexed with GPIO, we need to
> >>> switch the pins mux to GPIO before recovery and switch back
> >>> after recovery. It's implemented by the ACPI method in
> >>> the i2c_bus_recovery_info->{prepare,unprepare}_recovery()
> >>> method.
> >>
> >> NAK.
> >>
> >> ACPI has its own resources for that. What is missed is the layer between ACPI
> >> and pin control.
> 
> I think that's where the problem is and why we use this approach. When I looked into
> devm_pinctrl_get(), it stops when fails to retrieve the pin info from device tree.
> So I cannot use it on our ACPI server for the pinmux.
> 
> I looked into the history that Irina raised an RFC for adding the ACPI support in pinctrl[1],
> but at that time seems it lacks some standard support. But maybe now we can support it?

Not that way. ACPI has its own resources as I pointed out. Irina tried to
mimic DT, which has been refused by maintainers. Since that ACPI gained
the native resources.

> But based on the current situation maybe the implementation of this patch suits best.
> And currently we don't have a pinctrl driver for doing the multiplexing (though I think it's
> easy to add one but maybe only configures 2 pins for now).

This patch (i2c hisi) is a hack on all levels, starting with ACPI DSDT.
Please, fix tables to use PinConfig() / PinFunction() (or corresponding
*Group() variants) in the DSDT for the starter.

> [1] https://lore.kernel.org/all/CACRpkdbj==q5wp2Z5-ZXkbfeXa4y+beLF_3YN-vS3CtyAKGwkg@mail.gmail.com/
> 
> Thanks,
> Yicong
> 
> > To be more precise,
> > 
> > https://uefi.org/specs/ACPI/6.4/19_ASL_Reference/ACPI_Source_Language_Reference.html?highlight=pinfunction#pinconfig-pin-configuration-descriptor-macro
> > 
> > https://uefi.org/specs/ACPI/6.4/19_ASL_Reference/ACPI_Source_Language_Reference.html?highlight=pinfunction#pinfunction-pin-function-descriptor-macro
> > 
> > https://uefi.org/specs/ACPI/6.4/19_ASL_Reference/ACPI_Source_Language_Reference.html?highlight=pinfunction#pingroup-pin-group-descriptor-macro
> > 
> > https://uefi.org/specs/ACPI/6.4/19_ASL_Reference/ACPI_Source_Language_Reference.html?highlight=pinfunction#pingroupconfig-pin-group-configuration-descriptor-macro

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-02-09 12:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 12:49 [PATCH 0/2] Add I2C bus recovery support on Kunpeng 920/930 Yicong Yang
2022-01-25 12:49 ` [PATCH 1/2] i2c: hisi: Add generic GPIO bus recovery support Yicong Yang
2022-02-07 11:17   ` Andy Shevchenko
2022-02-07 11:20     ` Andy Shevchenko
2022-02-08  2:15       ` Yicong Yang
2022-02-09 12:12         ` Andy Shevchenko [this message]
2022-01-25 12:49 ` [PATCH 2/2] i2c: designware: Add ACPI assisted " Yicong Yang
2022-02-07  7:37 ` [PATCH 0/2] Add I2C bus recovery support on Kunpeng 920/930 Yicong Yang
2022-02-07 11:21   ` Andy Shevchenko

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=YgOvwg4pEiVF99fu@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=irina.tirdea@intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=wsa@kernel.org \
    --cc=yangyicong@hisilicon.com \
    --cc=yangyicong@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox