Re: [PATCH 1/2] i2c: hisi: Add generic GPIO bus recovery support

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

 



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@xxxxxxxxxxxxxx/
> 
> 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





[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