[U-Boot] [PATCH] power: twl4030: Add CONFIG_CMD_POWEROFF support

With the addition of twl4030_power_off(), let's allow the 'poweroff' command to run this function when CONFIG_CMD_POWEROFF is enabled.
Tested on a DM3730 with twl4030 PMIC.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c index 8866bf1..ab98d68 100644 --- a/drivers/power/twl4030.c +++ b/drivers/power/twl4030.c @@ -171,3 +171,12 @@ void twl4030_power_mmc_init(int dev_index) mdelay(100); /* ramp-up delay from Linux code */ } } + +#ifdef CONFIG_CMD_POWEROFF +int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + twl4030_power_off(); + + return 0; +} +#endif

On Mon, Apr 24, 2017 at 01:34:43PM -0500, Adam Ford wrote:
With the addition of twl4030_power_off(), let's allow the 'poweroff' command to run this function when CONFIG_CMD_POWEROFF is enabled.
Tested on a DM3730 with twl4030 PMIC.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c index 8866bf1..ab98d68 100644
Reviewed-by: Tom Rini trini@konsulko.com
... any chance you've got moving TWL4030 stuff to Kconfig on your TODO list? :)

On Tue, Apr 25, 2017 at 3:10 PM, Tom Rini trini@konsulko.com wrote:
On Mon, Apr 24, 2017 at 01:34:43PM -0500, Adam Ford wrote:
With the addition of twl4030_power_off(), let's allow the 'poweroff' command to run this function when CONFIG_CMD_POWEROFF is enabled.
Tested on a DM3730 with twl4030 PMIC.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c index 8866bf1..ab98d68 100644
Reviewed-by: Tom Rini trini@konsulko.com
... any chance you've got moving TWL4030 stuff to Kconfig on your TODO list? :)
I will try to work something in in the next few days
adam
-- Tom

On Tue, Apr 25, 2017 at 7:51 PM, Adam Ford aford173@gmail.com wrote:
On Tue, Apr 25, 2017 at 3:10 PM, Tom Rini trini@konsulko.com wrote:
On Mon, Apr 24, 2017 at 01:34:43PM -0500, Adam Ford wrote:
With the addition of twl4030_power_off(), let's allow the 'poweroff' command to run this function when CONFIG_CMD_POWEROFF is enabled.
Tested on a DM3730 with twl4030 PMIC.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c index 8866bf1..ab98d68 100644
Reviewed-by: Tom Rini trini@konsulko.com
... any chance you've got moving TWL4030 stuff to Kconfig on your TODO list? :)
I will try to work something in in the next few days
I just posted a new 2-patch thread for the CONFIG_TWL4030_POWER.
adam
-- Tom

Hi Adam
On 04/25/2017 03:34 AM, Adam Ford wrote:
With the addition of twl4030_power_off(), let's allow the 'poweroff' command to run this function when CONFIG_CMD_POWEROFF is enabled.
Tested on a DM3730 with twl4030 PMIC.
Signed-off-by: Adam Ford aford173@gmail.com
Reviewed-by: Jaehoon Chung jh80.chung@samsung.com
diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c index 8866bf1..ab98d68 100644 --- a/drivers/power/twl4030.c +++ b/drivers/power/twl4030.c @@ -171,3 +171,12 @@ void twl4030_power_mmc_init(int dev_index) mdelay(100); /* ramp-up delay from Linux code */ } }
+#ifdef CONFIG_CMD_POWEROFF +int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{
- twl4030_power_off();
- return 0;
+} +#endif

On Mon, Apr 24, 2017 at 01:34:43PM -0500, Adam Ford wrote:
With the addition of twl4030_power_off(), let's allow the 'poweroff' command to run this function when CONFIG_CMD_POWEROFF is enabled.
Tested on a DM3730 with twl4030 PMIC.
Signed-off-by: Adam Ford aford173@gmail.com Reviewed-by: Tom Rini trini@konsulko.com Reviewed-by: Jaehoon Chung jh80.chung@samsung.com
diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c index 8866bf1..ab98d68 100644
Applied to u-boot/master, thanks!
participants (3)
-
Adam Ford
-
Jaehoon Chung
-
Tom Rini