Manivannan Sadhasivam 278dd091e9
PCI/pwrctl: Create pwrctl device only if at least one power supply is present
Currently, pwrctl devices are created if the corresponding PCI nodes are
defined in devicetree. But this is not correct, because not all PCI nodes
require pwrctl support. Pwrctl comes into the picture only when the device
requires kernel to manage its power state. This can be determined using the
power supply properties present in the devicetree node of the device.

Add of_pci_supply_present() to check whether the devicetree contains at
least one power supply property for a device. If one is present, create a
pwrctl device for that PCI node.

Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 8fb18619d910 ("PCI/pwrctl: Create platform devices for child OF nodes of the port node")
Link: https://lore.kernel.org/r/20241025-pci-pwrctl-rework-v2-2-568756156cbe@linaro.org
Tested-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tested-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
[bhelgaas: rename of_pci_is_supply_present() to of_pci_supply_present() for
readability]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Cc: stable+noautosel@kernel.org		# Depends on of_platform_device_create() rework
2024-11-21 16:01:04 +00:00
..
2024-09-23 12:47:06 -07:00
2024-09-23 12:47:06 -07:00
2024-09-23 12:47:06 -07:00
2024-09-23 12:47:06 -07:00
2024-09-23 12:47:06 -07:00
2024-04-09 09:33:15 -05:00
2021-06-16 17:20:40 -05:00
2024-09-19 14:24:00 -05:00
2024-08-23 12:46:22 -05:00
2024-09-23 12:47:06 -07:00
2024-09-19 14:25:32 -05:00
2024-09-19 14:25:34 -05:00
2024-09-23 12:47:06 -07:00
2023-09-28 16:49:44 -05:00
2023-10-24 16:55:45 -05:00
2023-11-02 14:05:18 -10:00