summaryrefslogtreecommitdiff
path: root/drivers/pmdomain
diff options
context:
space:
mode:
authorStefan Wahren <wahrenst@gmx.net>2024-07-28 13:41:48 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2024-08-14 14:22:39 +0200
commiteb3896ea9e2829c8c3aa2e86d3f90765b06a41c6 (patch)
tree6cd0c67a742f5942056dfb3dc725aeba2b614159 /drivers/pmdomain
parent49d2a1ec68eebc436851ccc64135661bad5fc27d (diff)
pmdomain: raspberrypi-power: Add logging to rpi_firmware_set_power
The Raspberry Pi power driver heavily relies on the logging of the underlying firmware driver. This results in disadvantages like unspecific error messages or limited debugging options. So implement the logging for the most important function rpi_firmware_set_power. Signed-off-by: Stefan Wahren <wahrenst@gmx.net> Link: https://lore.kernel.org/r/20240728114200.75559-5-wahrenst@gmx.net Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/pmdomain')
-rw-r--r--drivers/pmdomain/bcm/raspberrypi-power.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/drivers/pmdomain/bcm/raspberrypi-power.c b/drivers/pmdomain/bcm/raspberrypi-power.c
index 39d9a52200c3..fadedfc9c645 100644
--- a/drivers/pmdomain/bcm/raspberrypi-power.c
+++ b/drivers/pmdomain/bcm/raspberrypi-power.c
@@ -48,33 +48,39 @@ struct rpi_power_domain_packet {
* Asks the firmware to enable or disable power on a specific power
* domain.
*/
-static int rpi_firmware_set_power(struct rpi_power_domain *rpi_domain, bool on)
+static int rpi_firmware_set_power(struct generic_pm_domain *domain, bool on)
{
+ struct rpi_power_domain *rpi_domain =
+ container_of(domain, struct rpi_power_domain, base);
+ bool old_interface = rpi_domain->old_interface;
struct rpi_power_domain_packet packet;
+ int ret;
packet.domain = rpi_domain->domain;
packet.state = on;
- return rpi_firmware_property(rpi_domain->fw,
- rpi_domain->old_interface ?
- RPI_FIRMWARE_SET_POWER_STATE :
- RPI_FIRMWARE_SET_DOMAIN_STATE,
- &packet, sizeof(packet));
+
+ ret = rpi_firmware_property(rpi_domain->fw, old_interface ?
+ RPI_FIRMWARE_SET_POWER_STATE :
+ RPI_FIRMWARE_SET_DOMAIN_STATE,
+ &packet, sizeof(packet));
+ if (ret)
+ dev_err(&domain->dev, "Failed to set %s to %u (%d)\n",
+ old_interface ? "power" : "domain", on, ret);
+ else
+ dev_dbg(&domain->dev, "Set %s to %u\n",
+ old_interface ? "power" : "domain", on);
+
+ return ret;
}
static int rpi_domain_off(struct generic_pm_domain *domain)
{
- struct rpi_power_domain *rpi_domain =
- container_of(domain, struct rpi_power_domain, base);
-
- return rpi_firmware_set_power(rpi_domain, false);
+ return rpi_firmware_set_power(domain, false);
}
static int rpi_domain_on(struct generic_pm_domain *domain)
{
- struct rpi_power_domain *rpi_domain =
- container_of(domain, struct rpi_power_domain, base);
-
- return rpi_firmware_set_power(rpi_domain, true);
+ return rpi_firmware_set_power(domain, true);
}
static void rpi_common_init_power_domain(struct rpi_power_domains *rpi_domains,