Re: [PATCH net-next 09/12] gpio: tc956x: add TC956x/QPS615 support

Alex Elder
2026-05-03T01:45:54Z

On 5/1/26 1:36 PM, Andrew Lunn wrote:
>> + * There is a TC956X PCI power controller driver that accesses the
>> + * direction and output value registers for GPIOs 2 and 3. These
>> + * GPIOs control the reset signal for the two downstream PCIe ports.
>> + * Their values will never change during operation of this driver, and
>> + * this driver reserves these two GPIOS.
>
> Why doesn't this power controller driver actually use this driver to
> control the GPIOs? Chicken/egg?

I am not the one with authority on this, but yes, that's my
understanding. *Something* about this chip requires that the
PCIe ports need to have some configuration done on them *before*
PCIe is powered up. So that driver uses the I2C interface to
apply these settings. Meanwhile this driver uses the PCIe-mapped
memory to manage the GPIO registers.

> Maybe add a comment why gpio-regmap.c cannot be used. You probably
> need to instantiate it twice, but i still think you will end up with
> less code.

It's possible gpio-regmap.c *could* be used. We started with
vendor code and this code got separated at some point along
the way. It was working, and I don't think I pursued other
options at that point. I'll look at this possibility before we
send out the next version.

What do you mean instantiate it twice?

-Alex

>
> Andrew