[PATCH RFC/RFT 1/2] gpio: qcom: add new driver for SPMI gpios

Neil Armstrong neil.armstrong at linaro.org
Mon Apr 7 09:34:10 CEST 2025


On 05/04/2025 17:56, Alexey Minnekhanov wrote:
> On 4/1/25 12:47, Neil Armstrong via groups.io wrote:
>> The current qcom_pmic_gpio driver is too limited and doesn't
>> support state tracking for all pins like the Linux driver.
>>
>> Adding full pinconf support would require adding the state
>> and it's much simpler to restart from scratch with a new
>> driver based on the Linux one adapted to the U-Boot GPIO
>> and Pinctrl APIs.
>>
>> For now only the PMICs I've been able to validate are
>> added in the compatible list but we should be able to
>> add the entire list from the Linux driver.
>>
>> There's a few difference from the Linux driver:
>> - no IRQ support
>> - uses the U-Boot GPIO flags that maps very well
>> - uses the gpio-ranges to get the pins count
>> - no debugfs but prints the pin state via pinmux callback
>>
>> It uses the same CONFIG entry as the old one, since
>> the ultimate goal is to migrate entirely on this new
>> driver once we verify it doesn't break the older
>> platforms.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong at linaro.org>
>> ---
>>   drivers/gpio/Makefile         |    2 +-
>>   drivers/gpio/qcom_spmi_gpio.c | 1034 +++++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 1035 insertions(+), 1 deletion(-)
>>
> 
> ...
> 
>> +
>> +static const struct udevice_id qcom_spmi_pmic_gpio_ids[] = {
>> +    { .compatible = "qcom,pm8550b-gpio" },
>> +    { .compatible = "qcom,pm8550ve-gpio" },
>> +    { .compatible = "qcom,pm8550vs-gpio" },
>> +    { .compatible = "qcom,pmk8550-gpio" },
>> +    { .compatible = "qcom,pmr735d-gpio" },
>> +    { }
>> +};
>> +
> 
> I've added 2 compatibles here to the top of that list
> 
> +       { .compatible = "qcom,pm660-gpio" },
> +       { .compatible = "qcom,pm660l-gpio" },
> 
> and was able to confirm with "dm tree" that new driver is in use and it works fine (Volume Up key works and I'm able to navigate U-Boot menu).
> 
> Tested-by: Alexey Minnekhanov <alexeymin at postmarketos.org>

Thanks for testing !

Neil

> 
> ---
> Regards,
> Alexey Minnekhanov



More information about the U-Boot mailing list