AM437x: Add rtc-only + DDR mode support
Subsystems (6)
v2 cover AM437x: Add rtc-only + DDR mode support
RTC plus DDR in self-refresh is a power saving mode where in the entire system including the different voltage rails from PMIC are shutdown except the ones feeding on to RTC and DDR. DDR is kept in self-refresh hence the contents are preserved.
RTC ALARM2 is connected to PMIC_EN line. TPS65218 PMIC has granular voltage rail control. The voltage rail feeding RTC is kept on while the rest of the PMIC regulators are powered off.
Once the ALARM2 is triggered we enter the mode with DDR in self-refresh and RTC Ticking. After a predetermined time an RTC ALARM1 triggers waking up the system. The control goes to bootloader. The bootloader then checks RTC scratchpad registers to confirm it was an rtc_only wakeup and follows a different path, configure bare minimal clocks for ddr and then jumps to the resume address in another RTC scratchpad registers and transfers the control to Kernel. Kernel then restores the saved context.
The patch series adds rtc-only + DDR mode support am am437x Tested DS0, rtc+ddr back and forth on am437x-gp-evm board.
This mode works only with u-boot built with am43xx_evm_rtconly_defconfig
Additional patch is needed for omap-gpio save restore which will come as fixes later.
Hardware Description of this mode can be found here:
http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf Page 2884.
Keerthy (5):
rtc: OMAP: Add support for rtc-only mode
rtc: interface: Add power_off_program to rtc_class_ops
arm: mach-omap2: pm33xx: Add support for rtc+ddr in self refresh mode
soc: ti: pm33xx: Push the am33xx_push_sram_idle to the top
soc: ti: pm33xx: AM437X: Add rtc_only with ddr in self-refresh support
arch/arm/mach-omap2/pm33xx-core.c | 76 +++++++- drivers/rtc/interface.c | 12 ++ drivers/rtc/rtc-omap.c | 49 ++++- drivers/soc/ti/Kconfig | 5 +- drivers/soc/ti/pm33xx.c | 272 ++++++++++++++++++++++----- include/linux/platform_data/pm33xx.h | 5 + include/linux/rtc.h | 2 + 7 files changed, 360 insertions(+), 61 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/5 rtc: OMAP: Add support for rtc-only mode
Prepare rtc driver for rtc-only with DDR in self-refresh mode. omap_rtc_power_off now should cater to two features:
1) RTC plus DDR in self-refresh is power a saving mode where in the entire system including the different voltage rails from PMIC are shutdown except the ones feeding on to RTC and DDR. DDR is kept in self-refresh hence the contents are preserved. RTC ALARM2 is connected to PMIC_EN line once we the ALARM2 is triggered we enter the mode with DDR in self-refresh and RTC Ticking. After a predetermined time an RTC ALARM1 triggers waking up the system[1]. The control goes to bootloader. The bootloader then checks RTC scratchpad registers to confirm it was an rtc_only wakeup and follows a different path, configure bare minimal clocks for ddr and then jumps to the resume address in another RTC scratchpad registers and transfers the control to Kernel. Kernel then restores the saved context. omap_rtc_power_off_program does the ALARM2 programming part.
[1] http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf Page 2884
2) Power-off: This is usual poweroff mode. omap_rtc_power_off calls the above omap_rtc_power_off_program function and in addition to that programs the OMAP_RTC_PMIC_REG for any external wake ups for PMIC like the pushbutton and shuts off the PMIC.
Hence the split in omap_rtc_power_off.
--- drivers/rtc/rtc-omap.c | 48 +++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 8 deletions(-)
drivers/rtc/rtc-omap.c +40 -8
@@ -403,15 +403,12 @@ static int omap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)static struct omap_rtc *omap_rtc_power_off_rtc; -/* -* omap_rtc_poweroff: RTC-controlled power off -* -* The RTC can be used to control an external PMIC via the pmic_power_en pin, -* which can be configured to transition to OFF on ALARM2 events. -* -* Called with local interrupts disabled. +/** +* omap_rtc_power_off_program: Set the pmic power off sequence. The RTC +* generates pmic_pwr_enable control, which can be used to control an external +* PMIC. */ -static void omap_rtc_power_off (void ) +static int omap_rtc_power_off_program (struct device *dev) {struct omap_rtc *rtc = omap_rtc_power_off_rtc;struct rtc_time tm;
@@ -425,6 +422,9 @@ static void omap_rtc_power_off(void)rtc_writel (rtc,OMAP_RTC_PMIC_REG , val |OMAP_RTC_PMIC_POWER_EN_EN ); again: +/* Clear any existing ALARM2 event */ +rtc_writel (rtc,OMAP_RTC_STATUS_REG ,OMAP_RTC_STATUS_ALARM2 ); +/* set alarm one second from now */ omap_rtc_read_time_raw (rtc, &tm); seconds = tm.tm_sec;
@@ -461,6 +461,38 @@ static void omap_rtc_power_off(void) rtc->type->lock (rtc); +return 0 ; +} + +/* +* omap_rtc_poweroff: RTC-controlled power off +* +* The RTC can be used to control an external PMIC via the pmic_power_en pin, +* which can be configured to transition to OFF on ALARM2 events. +* +* Notes: +* The one-second alarm offset is the shortest offset possible as the alarm +* registers must be set before the next timer update and the offset +* calculation is too heavy for everything to be done within a single access +* period (~15 us). +* +* Called with local interrupts disabled. +*/ +static void omap_rtc_power_off (void ) +{ +struct rtc_device *rtc = omap_rtc_power_off_rtc->rtc; +u32 val; + +omap_rtc_power_off_program (rtc->dev.parent); + +/* Set PMIC power enable and EXT_WAKEUP in case PB power on is used */ + omap_rtc_power_off_rtc->type->unlock (omap_rtc_power_off_rtc); + val =rtc_readl (omap_rtc_power_off_rtc,OMAP_RTC_PMIC_REG ); + val |=OMAP_RTC_PMIC_POWER_EN_EN |OMAP_RTC_PMIC_EXT_WKUP_POL (0 ) | +OMAP_RTC_PMIC_EXT_WKUP_EN (0 ); +rtc_writel (omap_rtc_power_off_rtc,OMAP_RTC_PMIC_REG , val); + omap_rtc_power_off_rtc->type->lock (omap_rtc_power_off_rtc); +/* * Wait for alarm to trigger (within one second) and external PMIC to * power off the system. Add a 500 ms margin for external latencies
Signature · 1 line
2.17.1
PATCH v2 2/5 rtc: interface: Add power_off_program to rtc_class_ops
In reply to KeerthyAdd an interface function to set up the rtc for a power_off mode.
--- drivers/rtc/interface.c | 12 ++++++++++++ drivers/rtc/rtc-omap.c | 1 + include/linux/rtc.h | 2 ++ 3 files changed, 15 insertions(+)
drivers/rtc/interface.c +12 -0
@@ -1070,3 +1070,15 @@ int rtc_set_offset(struct rtc_device *rtc, long offset)trace_rtc_set_offset (offset, ret);return ret; } + +/** +* rtc_power_off_program - Some of the rtc are hooked on to PMIC_EN +* line and can be used to power off the SoC. +* +* Kernel interface to program rtc to power off +*/ +int rtc_power_off_program (struct rtc_device *rtc) +{ +return rtc->ops->power_off_program (rtc->dev.parent); +} +EXPORT_SYMBOL_GPL (rtc_power_off_program);
drivers/rtc/rtc-omap.c +1 -0
@@ -507,6 +507,7 @@ static const struct rtc_class_ops omap_rtc_ops = { .read_alarm = omap_rtc_read_alarm, .set_alarm = omap_rtc_set_alarm, .alarm_irq_enable = omap_rtc_alarm_irq_enable, + .power_off_program = omap_rtc_power_off_program, };static const struct omap_rtc_device_type omap_rtc_default_type = {
include/linux/rtc.h +2 -0
@@ -84,6 +84,7 @@ struct rtc_class_ops {int (*alarm_irq_enable)(struct device *,unsigned int enabled);int (*read_offset)(struct device *,long *offset);int (*set_offset)(struct device *,long offset); +int (*power_off_program)(struct device *dev); };struct rtc_device ;
@@ -211,6 +212,7 @@ void rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer *timer);int rtc_read_offset (struct rtc_device *rtc,long *offset);int rtc_set_offset (struct rtc_device *rtc,long offset);void rtc_timer_do_work (struct work_struct *work); +int rtc_power_off_program (struct rtc_device *rtc);static inline bool is_leap_year (unsigned int year) {
Signature · 1 line
2.17.1
PATCH v2 3/5 arm: mach-omap2: pm33xx: Add support for rtc+ddr in self refresh mode
In reply to KeerthyAdd support for rtc+ddr in self refresh mode. Add addtional pm hooks for save/restore and rtc suspend/resume.
---
Changes in v2:
* White list check of the boards which have HW support got this mode
arch/arm/mach-omap2/pm33xx-core.c | 76 +++++++++++++++++++++++++++- include/linux/platform_data/pm33xx.h | 5 ++ 2 files changed, 80 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/pm33xx-core.c +75 -1
@@ -10,6 +10,12 @@#include <asm/suspend.h> #include <linux/errno.h> #include <linux/platform_data/pm33xx.h> +#include <linux/clk.h> +#include <linux/platform_data/gpio-omap.h> +#include <linux/pinctrl/pinmux.h> +#include <linux/wkup_m3_ipc.h> +#include <linux/of.h> +#include <linux/rtc.h> #include "cm33xx.h" #include "common.h"
@@ -38,6 +44,29 @@ static int am43xx_map_scu(void)return 0 ; } +static int am33xx_check_off_mode_enable (void ) +{ +if (enable_off_mode) +pr_warn ("WARNING: This platform does not support off-mode, entering DeepSleep suspend.\n" ); + +/* off mode not supported on am335x so return 0 always */ +return 0 ; +} + +static int am43xx_check_off_mode_enable (void ) +{ +/* +* Check for am437x-gp-evm which has the right Hardware design to +* support this mode reliably. +*/ +if (of_machine_is_compatible ("ti,am437x-gp-evm" ) && enable_off_mode) { +return enable_off_mode; + }else { +pr_warn ("WARNING: This platform does not support off-mode, entering DeepSleep suspend.\n" ); +return 0 ; + } +} +static int amx3_common_init (void ) { gfx_pwrdm =pwrdm_lookup ("gfx_pwrdm" );
@@ -139,7 +168,9 @@ static int am43xx_suspend(unsigned int state, int (*fn)(unsigned long),scu_power_mode (scu_base,SCU_PM_POWEROFF ); ret =cpu_suspend (args, fn);scu_power_mode (scu_base,SCU_PM_NORMAL ); -amx3_post_suspend_common (); + +if (!am43xx_check_off_mode_enable ()) +amx3_post_suspend_common ();return ret; }
@@ -161,10 +192,48 @@ void __iomem *am43xx_get_rtc_base_addr(void)return omap_hwmod_get_mpu_rt_va (rtc_oh); } +static void am43xx_save_context (void ) +{ +} + +static void am33xx_save_context (void ) +{ +omap_intc_save_context (); +} + +static void am33xx_restore_context (void ) +{ +omap_intc_restore_context (); +} + +static void am43xx_restore_context (void ) +{ +/* +* HACK: restore dpll_per_clkdcoldo register contents, to avoid +* breaking suspend-resume +*/ +writel_relaxed (0x0 ,AM33XX_L4_WK_IO_ADDRESS (0x44df2e14 )); +} + +static void am43xx_prepare_rtc_suspend (void ) +{ +omap_hwmod_enable (rtc_oh); +} + +static void am43xx_prepare_rtc_resume (void ) +{ +omap_hwmod_idle (rtc_oh); +} +static struct am33xx_pm_platform_data am33xx_ops = { .init = am33xx_suspend_init, .soc_suspend = am33xx_suspend, .get_sram_addrs = amx3_get_sram_addrs, + .save_context = am33xx_save_context, + .restore_context = am33xx_restore_context, + .prepare_rtc_suspend = am43xx_prepare_rtc_suspend, + .prepare_rtc_resume = am43xx_prepare_rtc_resume, + .check_off_mode_enable = am33xx_check_off_mode_enable, .get_rtc_base_addr = am43xx_get_rtc_base_addr, };
@@ -172,6 +241,11 @@ static struct am33xx_pm_platform_data am43xx_ops = { .init = am43xx_suspend_init, .soc_suspend = am43xx_suspend, .get_sram_addrs = amx3_get_sram_addrs, + .save_context = am43xx_save_context, + .restore_context = am43xx_restore_context, + .prepare_rtc_suspend = am43xx_prepare_rtc_suspend, + .prepare_rtc_resume = am43xx_prepare_rtc_resume, + .check_off_mode_enable = am43xx_check_off_mode_enable, .get_rtc_base_addr = am43xx_get_rtc_base_addr, };
include/linux/platform_data/pm33xx.h +5 -0
@@ -51,6 +51,11 @@ struct am33xx_pm_platform_data { unsigned long args);struct am33xx_pm_sram_addr *(*get_sram_addrs)(void );void __iomem *(*get_rtc_base_addr)(void ); +void (*save_context)(void ); +void (*restore_context)(void ); +void (*prepare_rtc_suspend)(void ); +void (*prepare_rtc_resume)(void ); +int (*check_off_mode_enable)(void ); };struct am33xx_pm_sram_data {
Signature · 1 line
2.17.1
PATCH v2 4/5 soc: ti: pm33xx: Push the am33xx_push_sram_idle to the top
In reply to KeerthyPush the am33xx_push_sram_idle function to the top as a preparation for rtc+ddr mode as the function will be called by multiple functions currently present before it.
--- drivers/soc/ti/pm33xx.c | 100 ++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 50 deletions(-)
drivers/soc/ti/pm33xx.c +50 -50
@@ -49,6 +49,56 @@ static u32 sram_suspend_address(unsigned long addr) AMX3_PM_SRAM_SYMBOL_OFFSET(addr)); } +static int am33xx_push_sram_idle (void ) +{ +struct am33xx_pm_ro_sram_data ro_sram_data; +int ret; +u32 table_addr, ro_data_addr; +void *copy_addr; + + ro_sram_data.amx3_pm_sram_data_virt = ocmcram_location_data; + ro_sram_data.amx3_pm_sram_data_phys = +gen_pool_virt_to_phys (sram_pool_data, ocmcram_location_data); + ro_sram_data.rtc_base_virt = pm_ops->get_rtc_base_addr (); + +/* Save physical address to calculate resume offset during pm init */ + am33xx_do_wfi_sram_phys =gen_pool_virt_to_phys (sram_pool, + ocmcram_location); + + am33xx_do_wfi_sram =sram_exec_copy (sram_pool, (void *)ocmcram_location, + pm_sram->do_wfi, + *pm_sram->do_wfi_sz); +if (!am33xx_do_wfi_sram) { +dev_err (pm33xx_dev, +"PM: %s: am33xx_do_wfi copy to sram failed\n" , + __func__); +return -ENODEV ; + } + + table_addr = +sram_suspend_address ((unsigned long )pm_sram->emif_sram_table); + ret =ti_emif_copy_pm_function_table (sram_pool, (void *)table_addr); +if (ret) { +dev_dbg (pm33xx_dev, +"PM: %s: EMIF function copy failed\n" , __func__); +return -EPROBE_DEFER ; + } + + ro_data_addr = +sram_suspend_address ((unsigned long )pm_sram->ro_sram_data); + copy_addr =sram_exec_copy (sram_pool, (void *)ro_data_addr, + &ro_sram_data, +sizeof (ro_sram_data)); +if (!copy_addr) { +dev_err (pm33xx_dev, +"PM: %s: ro_sram_data copy to sram failed\n" , + __func__); +return -ENODEV ; + } + +return 0 ; +} +#ifdef CONFIG_SUSPEND static int am33xx_pm_suspend (suspend_state_t suspend_state) {
@@ -219,56 +269,6 @@ static int am33xx_pm_alloc_sram(void)return ret; } -static int am33xx_push_sram_idle (void ) -{ -struct am33xx_pm_ro_sram_data ro_sram_data; -int ret; -u32 table_addr, ro_data_addr; -void *copy_addr; - - ro_sram_data.amx3_pm_sram_data_virt = ocmcram_location_data; - ro_sram_data.amx3_pm_sram_data_phys = -gen_pool_virt_to_phys (sram_pool_data, ocmcram_location_data); - ro_sram_data.rtc_base_virt = pm_ops->get_rtc_base_addr (); - -/* Save physical address to calculate resume offset during pm init */ - am33xx_do_wfi_sram_phys =gen_pool_virt_to_phys (sram_pool, - ocmcram_location); - - am33xx_do_wfi_sram =sram_exec_copy (sram_pool, (void *)ocmcram_location, - pm_sram->do_wfi, - *pm_sram->do_wfi_sz); -if (!am33xx_do_wfi_sram) { -dev_err (pm33xx_dev, -"PM: %s: am33xx_do_wfi copy to sram failed\n" , - __func__); -return -ENODEV ; - } - - table_addr = -sram_suspend_address ((unsigned long )pm_sram->emif_sram_table); - ret =ti_emif_copy_pm_function_table (sram_pool, (void *)table_addr); -if (ret) { -dev_dbg (pm33xx_dev, -"PM: %s: EMIF function copy failed\n" , __func__); -return -EPROBE_DEFER ; - } - - ro_data_addr = -sram_suspend_address ((unsigned long )pm_sram->ro_sram_data); - copy_addr =sram_exec_copy (sram_pool, (void *)ro_data_addr, - &ro_sram_data, -sizeof (ro_sram_data)); -if (!copy_addr) { -dev_err (pm33xx_dev, -"PM: %s: ro_sram_data copy to sram failed\n" , - __func__); -return -ENODEV ; - } - -return 0 ; -} -static int am33xx_pm_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;
Signature · 1 line
2.17.1
PATCH v2 5/5 soc: ti: pm33xx: AM437X: Add rtc_only with ddr in self-refresh support
In reply to KeerthyDuring RTC-only suspend, power is lost to the wkup domain, so we need to save and restore the state of that domain. We also need to store some information within the RTC registers so that u-boot can do the right thing at powerup.
The state is entered by getting the RTC to bring the pmic_power_en line low which will instruct the PMIC to disable the appropriate power rails after putting DDR into self-refresh mode. To bring pmic_power_en low, we need to get an ALARM2 event. Since we are running from SRAM at that point, it means calculating what the next second is (via ASM) and programming that into the RTC. This patch also adds support for wake up source detection.
--- drivers/soc/ti/Kconfig | 5 +- drivers/soc/ti/pm33xx.c | 190 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 184 insertions(+), 11 deletions(-)
drivers/soc/ti/Kconfig +3 -2
@@ -45,11 +45,12 @@ config KEYSTONE_NAVIGATOR_DMA config AMX3_PM tristate "AMx3 Power Management" depends on SOC_AM33XX || SOC_AM43XX - depends on WKUP_M3_IPC && TI_EMIF_SRAM && SRAM + depends on WKUP_M3_IPC && TI_EMIF_SRAM && SRAM && RTC_DRV_OMAP help Enable power management on AM335x and AM437x. Required for suspend to mem and standby states on both AM335x and AM437x platforms and for deeper cpuidle - c-states on AM335x. + c-states on AM335x. Also required for rtc and ddr in self-refresh low + power mode on AM437x platforms. config WKUP_M3_IPC tristate "TI AMx3 Wkup-M3 IPC Driver"
drivers/soc/ti/pm33xx.c +181 -9
296 lines not on this page · raw message
Signature · 1 line
2.17.1
Tony Lindgren
maintainerRe: [PATCH v2 2/5] rtc: interface: Add power_off_program to rtc_class_ops
In reply to KeerthyQuoted 20 lines · Keerthy
Add an interface function to set up the rtc for a
power_offmode.Signed-off-by Keerthy <[email protected]>--- drivers/rtc/interface.c | 12 ++++++++++++ drivers/rtc/rtc-omap.c | 1 + include/linux/rtc.h | 2 ++ 3 files changed, 15 insertions(+)drivers/rtc/interface.c +2
-0@@ -1070,3 +1070,15 @@ int rtc_set_offset(struct rtc_device *rtc, long offset)trace_rtc_set_offset (offset, ret);return ret; } + +/**
drivers/rtc/interface.c int rtc_set_offset(struct rtc_device *rtc, long offset) · line 1084
Quoted 10 lines
drivers/rtc/interface.c +10
-0+* rtc_power_off_program - Some of the rtc are hooked on to PMIC_EN +* line and can be used to power off the SoC. +* +* Kernel interface to program rtc to power off +*/ +int rtc_power_off_program (struct rtc_device *rtc) +{ +return rtc->ops->power_off_program (rtc->dev.parent); +} +EXPORT_SYMBOL_GPL (rtc_power_off_program);
This whole series looks OK to me. Not sure about the naming for rtc_power_off_program(), would rtc_power_off_device() be more generic?
Regards,
Tony
Tony Lindgren
maintainerRe: [PATCH v2 4/5] soc: ti: pm33xx: Push the am33xx_push_sram_idle to the top
In reply to KeerthyQuoted 3 lines · Keerthy
Push the
am33xx_push_sram_idlefunction to the top as a preparation for rtc+ddr mode as the function will be called by multiple functions currently present before it.
How about say "Move the am33xx_push_sram_idle function to the top..." instead? And mention no functional changes assuming there aren't any.
Regards,
Tony
Alexandre Belloni
maintainerRe: [PATCH v2 2/5] rtc: interface: Add power_off_program to rtc_class_ops
In reply to Tony LindgrenQuoted 27 lines · Tony Lindgren
Quoted 26 lines · Keerthy
Add an interface function to set up the rtc for a
power_offmode.Signed-off-by Keerthy <[email protected]>--- drivers/rtc/interface.c | 12 ++++++++++++ drivers/rtc/rtc-omap.c | 1 + include/linux/rtc.h | 2 ++ 3 files changed, 15 insertions(+)drivers/rtc/interface.c +8
-0@@ -1070,3 +1070,15 @@ int rtc_set_offset(struct rtc_device *rtc, long offset)trace_rtc_set_offset (offset, ret);return ret; } + +/** +* rtc_power_off_program - Some of the rtc are hooked on to PMIC_EN +* line and can be used to power off the SoC. +* +* Kernel interface to program rtc to power off +*/ +int rtc_power_off_program (struct rtc_device *rtc)
Quoted 9 lines
drivers/rtc/interface.c int rtc_set_offset(struct rtc_device *rtc, long offset) · line 1084
Quoted 4 lines
drivers/rtc/interface.c +4
-0+{ +return rtc->ops->power_off_program (rtc->dev.parent); +} +EXPORT_SYMBOL_GPL (rtc_power_off_program);This whole series looks OK to me. Not sure about the naming for
rtc_power_off_program(), wouldrtc_power_off_device()be more generic?
Well, even if this is more generic, this feels way too ad-hoc to me. The series is adding a function and a callback to the core for, from what I understand, only one particular board.
You may as well simply export the function directly from the rtc-omap driver as anyway, this is added as a dependency in the last patch.
Something else I would be open to but I'm not completely sure this fits your use case is a new interface that would take an alarm index as a parameter to allow setting any alarm on the RTC. This would at least be usable for multiple other drivers.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: [PATCH v2 2/5] rtc: interface: Add power_off_program to rtc_class_ops
Quoted 42 lines · Alexandre Belloni
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Keerthy
Add an interface function to set up the rtc for a
power_offmode.Signed-off-by Keerthy <[email protected]>--- drivers/rtc/interface.c | 12 ++++++++++++ drivers/rtc/rtc-omap.c | 1 + include/linux/rtc.h | 2 ++ 3 files changed, 15 insertions(+)drivers/rtc/interface.c +8
-0@@ -1070,3 +1070,15 @@ int rtc_set_offset(struct rtc_device *rtc, long offset)trace_rtc_set_offset (offset, ret);return ret; } + +/** +* rtc_power_off_program - Some of the rtc are hooked on to PMIC_EN +* line and can be used to power off the SoC. +* +* Kernel interface to program rtc to power off +*/ +int rtc_power_off_program (struct rtc_device *rtc)Quoted 9 lines
drivers/rtc/interface.c int rtc_set_offset(struct rtc_device *rtc, long offset) · line 1084
Quoted 4 lines
drivers/rtc/interface.c +4
-0+{ +return rtc->ops->power_off_program (rtc->dev.parent); +} +EXPORT_SYMBOL_GPL (rtc_power_off_program);This whole series looks OK to me. Not sure about the naming for
rtc_power_off_program(), wouldrtc_power_off_device()be more generic?Well, even if this is more generic, this feels way too ad-hoc to me. The series is adding a function and a callback to the core for, from what I understand, only one particular board.
Quoted 7 lines
You may as well simply export the function directly from the rtc-omap driver as anyway, this is added as a dependency in the last patch.
Something else I would be open to but I'm not completely sure this fits your use case is a new interface that would take an alarm index as a parameter to allow setting any alarm on the RTC. This would at least be usable for multiple other drivers.
Agreed that this is pretty specific to am43 as of now. As you suggested i will export out omap_rtc_poweroff_program. I will post v3 with the interface patch removed.
Thanks for your feedback.
Quoted 1 line
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2 4/5] soc: ti: pm33xx: Push the am33xx_push_sram_idle to the top
In reply to Tony LindgrenQuoted 8 lines · Tony Lindgren
Quoted 3 lines · Keerthy
Push the
am33xx_push_sram_idlefunction to the top as a preparation for rtc+ddr mode as the function will be called by multiple functions currently present before it.How about say "Move the
am33xx_push_sram_idlefunction to the top..." instead? And mention no functional changes assuming there aren't any.
Sure will edit commit description in the next version.
Quoted 5 lines
Regards,
Tony
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel