pinctrl: intel: Try to retrieve driver data for pure platform drivers

The Denverton pinctrl device can be instantiated by the Intel LPC
driver as an MFD platform device named "denverton-pinctrl".

On affected systems the platform device does not carry the INTC3000
ACPI match data itself. As a result, intel_pinctrl_probe_by_hid()
fails to obtain the SoC data using device_get_match_data() and
returns -ENODATA.

This might be also true for other platforms that can be enumerated
by ACPI _HID. Fix the above by trying the pure platform driver data
in case the firmware node is not set or doesn't carry the necessary
information.

Reported-by: Radek Válko <rvalko@lipicko.cz>
Closes: https://lore.kernel.org/r/20260827184259.32386-1-rvalko@lipicko.cz
Tested-by: Radek Válko <rvalko@lipicko.cz>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
Andy Shevchenko 2026-09-03 13:46:14 +02:00
parent c824f2278a
commit c016587866

View File

@ -1702,13 +1702,32 @@ int intel_pinctrl_probe(struct platform_device *pdev,
}
EXPORT_SYMBOL_NS_GPL(intel_pinctrl_probe, "PINCTRL_INTEL");
static const struct intel_pinctrl_soc_data *
intel_pinctrl_get_soc_data_by_hid(const struct platform_device *pdev)
{
const struct intel_pinctrl_soc_data *data;
const struct device *dev = &pdev->dev;
const struct platform_device_id *id;
data = device_get_match_data(dev);
if (data)
return data;
id = platform_get_device_id(pdev);
if (!id)
return ERR_PTR(-ENODEV);
data = (const struct intel_pinctrl_soc_data *)id->driver_data;
return data ?: ERR_PTR(-ENODATA);
}
int intel_pinctrl_probe_by_hid(struct platform_device *pdev)
{
const struct intel_pinctrl_soc_data *data;
data = device_get_match_data(&pdev->dev);
if (!data)
return -ENODATA;
data = intel_pinctrl_get_soc_data_by_hid(pdev);
if (IS_ERR(data))
return PTR_ERR(data);
return intel_pinctrl_probe(pdev, data);
}