Commit c1155c64 authored by Jonghwa Lee's avatar Jonghwa Lee Committed by Sebastian Reichel

power: charger-manager: Use alarmtimer for battery monitoring in suspend.

To guerantee proper charing and managing batteries even in suspend,
charger-manager has used rtc device with rtc framework interface.
However, it is better to use alarmtimer for cleaner and more appropriate
operation.
This patch makes driver to use alarmtimer for polling work in suspend and
removes all deprecated codes related with using rtc interface.
Signed-off-by: default avatarJonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent a538cf04
...@@ -315,7 +315,7 @@ config CHARGER_GPIO ...@@ -315,7 +315,7 @@ config CHARGER_GPIO
config CHARGER_MANAGER config CHARGER_MANAGER
bool "Battery charger manager for multiple chargers" bool "Battery charger manager for multiple chargers"
depends on REGULATOR && RTC_CLASS depends on REGULATOR
select EXTCON select EXTCON
help help
Say Y to enable charger-manager support, which allows multiple Say Y to enable charger-manager support, which allows multiple
......
This diff is collapsed.
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/power_supply.h> #include <linux/power_supply.h>
#include <linux/extcon.h> #include <linux/extcon.h>
#include <linux/alarmtimer.h>
enum data_source { enum data_source {
CM_BATTERY_PRESENT, CM_BATTERY_PRESENT,
...@@ -44,29 +45,6 @@ enum cm_event_types { ...@@ -44,29 +45,6 @@ enum cm_event_types {
CM_EVENT_OTHERS, CM_EVENT_OTHERS,
}; };
/**
* struct charger_global_desc
* @rtc_name: the name of RTC used to wake up the system from suspend.
* @rtc_only_wakeup:
* If the system is woken up by waekup-sources other than the RTC or
* callbacks, Charger Manager should recognize with
* rtc_only_wakeup() returning false.
* If the RTC given to CM is the only wakeup reason,
* rtc_only_wakeup should return true.
* @assume_timer_stops_in_suspend:
* Assume that the jiffy timer stops in suspend-to-RAM.
* When enabled, CM does not rely on jiffies value in
* suspend_again and assumes that jiffies value does not
* change during suspend.
*/
struct charger_global_desc {
char *rtc_name;
bool (*rtc_only_wakeup)(void);
bool assume_timer_stops_in_suspend;
};
/** /**
* struct charger_cable * struct charger_cable
* @extcon_name: the name of extcon device. * @extcon_name: the name of extcon device.
...@@ -266,22 +244,14 @@ struct charger_manager { ...@@ -266,22 +244,14 @@ struct charger_manager {
char psy_name_buf[PSY_NAME_MAX + 1]; char psy_name_buf[PSY_NAME_MAX + 1];
struct power_supply charger_psy; struct power_supply charger_psy;
bool status_save_ext_pwr_inserted;
bool status_save_batt;
u64 charging_start_time; u64 charging_start_time;
u64 charging_end_time; u64 charging_end_time;
}; };
#ifdef CONFIG_CHARGER_MANAGER #ifdef CONFIG_CHARGER_MANAGER
extern int setup_charger_manager(struct charger_global_desc *gd);
extern bool cm_suspend_again(void);
extern void cm_notify_event(struct power_supply *psy, extern void cm_notify_event(struct power_supply *psy,
enum cm_event_types type, char *msg); enum cm_event_types type, char *msg);
#else #else
static inline int setup_charger_manager(struct charger_global_desc *gd)
{ return 0; }
static inline bool cm_suspend_again(void) { return false; }
static inline void cm_notify_event(struct power_supply *psy, static inline void cm_notify_event(struct power_supply *psy,
enum cm_event_types type, char *msg) { } enum cm_event_types type, char *msg) { }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment