From: Lee Jones <lee@kernel.org>
To: Job Sava <jsava@criticallink.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Julien Panis <jpanis@baylibre.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org, jcormier@criticallink.com
Subject: Re: [PATCH 3/3] mfd: tps6594: Adds support for powering off the PMIC
Date: Fri, 13 Jun 2025 15:11:05 +0100 [thread overview]
Message-ID: <20250613141105.GG897353@google.com> (raw)
In-Reply-To: <20250520-linux-stable-tps6594-pwrbutton-v1-3-0cc5c6e0415c@criticallink.com>
On Tue, 20 May 2025, Job Sava wrote:
> When the FSM_I2C_TRIGGER register's bit 0 is set it triggers TRIGGER_I2C_0
> and the PMIC is transitioned to the STANDBY state
> (table 6-18: SLVSGG7 – DECEMBER 2023).
>
> An ON request is required to transition from STANDBY to ACTIVE.
>
> Signed-off-by: Job Sava <jsava@criticallink.com>
> ---
> drivers/mfd/tps6594-core.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/drivers/mfd/tps6594-core.c b/drivers/mfd/tps6594-core.c
> index 1b0b3d1bf6c4..f4c434c0d87a 100644
> --- a/drivers/mfd/tps6594-core.c
> +++ b/drivers/mfd/tps6594-core.c
> @@ -10,6 +10,7 @@
> #include <linux/interrupt.h>
> #include <linux/module.h>
> #include <linux/of.h>
> +#include <linux/reboot.h>
>
> #include <linux/mfd/core.h>
> #include <linux/mfd/tps6594.h>
> @@ -615,6 +616,19 @@ static int tps6594_enable_crc(struct tps6594 *tps)
> return ret;
> }
>
> +static int tps6594_soft_shutdown(struct tps6594 *tps)
Why do you have a whole separate function that itself is only called
once and only conducts a single one call to one other function?
> +{
> + return regmap_update_bits(tps->regmap, TPS6594_REG_FSM_I2C_TRIGGERS,
> + TPS6594_BIT_TRIGGER_I2C(0),
> + TPS6594_BIT_TRIGGER_I2C(0));
> +}
> +
> +static int tps6594_power_off_handler(struct sys_off_data *data)
> +{
> + tps6594_soft_shutdown(data->cb_data);
> + return NOTIFY_DONE;
> +}
> +
> int tps6594_device_init(struct tps6594 *tps, bool enable_crc)
> {
> struct device *dev = tps->dev;
> @@ -623,6 +637,7 @@ int tps6594_device_init(struct tps6594 *tps, bool enable_crc)
> const struct mfd_cell *cells;
> int n_cells;
> bool pwr_button;
> + bool system_power_controller;
>
> if (enable_crc) {
> ret = tps6594_enable_crc(tps);
> @@ -681,6 +696,15 @@ int tps6594_device_init(struct tps6594 *tps, bool enable_crc)
> return dev_err_probe(dev, ret, "Failed to add RTC child device\n");
> }
>
> + system_power_controller = of_property_read_bool(dev->of_node, "system-power-controller");
> + if (system_power_controller) {
> + ret = devm_register_power_off_handler(tps->dev,
> + tps6594_power_off_handler,
> + tps);
This alignment is odd.
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to register power-off handler\n");
> + }
> +
> return 0;
> }
> EXPORT_SYMBOL_GPL(tps6594_device_init);
>
> --
> 2.43.0
>
--
Lee Jones [李琼斯]
next prev parent reply other threads:[~2025-06-13 14:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 17:43 [PATCH 0/3] Powerbutton driver and powerdown request for TPS65224 PMIC Job Sava
2025-05-20 17:43 ` [PATCH 1/3] dt-bindings: mfd: Add power-button option for TI TPS6594 PMIC Job Sava
2025-05-21 10:01 ` Krzysztof Kozlowski
2025-05-23 13:46 ` Job Sava
2025-05-29 9:25 ` Krzysztof Kozlowski
2025-06-02 13:07 ` Job Sava
2025-06-03 6:51 ` Krzysztof Kozlowski
2025-06-17 16:07 ` Job Sava
2025-07-17 13:58 ` Michael Walle
2025-07-18 19:07 ` Jon Cormier
2025-07-21 6:42 ` Michael Walle
2025-07-30 13:52 ` Markus Schneider-Pargmann
2025-05-20 17:43 ` [PATCH 2/3] mfd: tps6594-pwrbutton: Add powerbutton functionality Job Sava
2025-05-20 18:15 ` Dmitry Torokhov
2025-06-13 14:09 ` Lee Jones
2025-06-17 15:54 ` Job Sava
2025-05-20 17:43 ` [PATCH 3/3] mfd: tps6594: Adds support for powering off the PMIC Job Sava
2025-06-13 14:11 ` Lee Jones [this message]
2025-06-17 16:00 ` Job Sava
2025-08-19 11:27 ` [PATCH 0/3] Powerbutton driver and powerdown request for TPS65224 PMIC Michael Walle
2025-08-19 11:30 ` Michael Walle
2025-08-19 16:22 ` Jon Cormier
2025-08-20 7:06 ` Michael Walle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250613141105.GG897353@google.com \
--to=lee@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jcormier@criticallink.com \
--cc=jpanis@baylibre.com \
--cc=jsava@criticallink.com \
--cc=krzk+dt@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).