summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-04-18 14:07:24 +0200
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>2018-04-26 00:49:52 +0200
commita78c0c30ec73e90d1b5d8b06f593091d9b9f76d3 (patch)
tree2aeef5350bd810a0ad803ed03224fc6702fe3508
parentpower: supply: axp288_fuelguage: Do not bind when the fg function is not used (diff)
downloadlinux-a78c0c30ec73e90d1b5d8b06f593091d9b9f76d3.tar.xz
linux-a78c0c30ec73e90d1b5d8b06f593091d9b9f76d3.zip
power: supply: axp288_fuel_gauge: Remove polling from the driver
Userspace class/power_supply consumers such as upower, already know some supplies need to be polled to get up2date info. Doing this in the kernel and then waking up userspace just causes unnecessary wakeups and i2c transfers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
-rw-r--r--drivers/power/supply/axp288_fuel_gauge.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
index dabcf0c6ea95..084c8ba9749d 100644
--- a/drivers/power/supply/axp288_fuel_gauge.c
+++ b/drivers/power/supply/axp288_fuel_gauge.c
@@ -24,7 +24,6 @@
#include <linux/regmap.h>
#include <linux/jiffies.h>
#include <linux/interrupt.h>
-#include <linux/workqueue.h>
#include <linux/mfd/axp20x.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
@@ -88,7 +87,6 @@
#define FG_LOW_CAP_CRIT_THR 4 /* 4 perc */
#define FG_LOW_CAP_SHDN_THR 0 /* 0 perc */
-#define STATUS_MON_DELAY_JIFFIES (HZ * 60) /*60 sec */
#define NR_RETRY_CNT 3
#define DEV_NAME "axp288_fuel_gauge"
@@ -128,7 +126,6 @@ struct axp288_fg_info {
struct mutex lock;
int status;
int max_volt;
- struct delayed_work status_monitor;
struct dentry *debug_file;
};
@@ -592,16 +589,6 @@ static int fuel_gauge_property_is_writeable(struct power_supply *psy,
return ret;
}
-static void fuel_gauge_status_monitor(struct work_struct *work)
-{
- struct axp288_fg_info *info = container_of(work,
- struct axp288_fg_info, status_monitor.work);
-
- fuel_gauge_get_status(info);
- power_supply_changed(info->bat);
- schedule_delayed_work(&info->status_monitor, STATUS_MON_DELAY_JIFFIES);
-}
-
static irqreturn_t fuel_gauge_thread_handler(int irq, void *dev)
{
struct axp288_fg_info *info = dev;
@@ -781,7 +768,6 @@ static int axp288_fuel_gauge_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, info);
mutex_init(&info->lock);
- INIT_DELAYED_WORK(&info->status_monitor, fuel_gauge_status_monitor);
for (i = 0; i < IIO_CHANNEL_NUM; i++) {
/*
@@ -841,7 +827,6 @@ static int axp288_fuel_gauge_probe(struct platform_device *pdev)
fuel_gauge_create_debugfs(info);
fuel_gauge_init_irq(info);
- schedule_delayed_work(&info->status_monitor, STATUS_MON_DELAY_JIFFIES);
return 0;
@@ -864,7 +849,6 @@ static int axp288_fuel_gauge_remove(struct platform_device *pdev)
struct axp288_fg_info *info = platform_get_drvdata(pdev);
int i;
- cancel_delayed_work_sync(&info->status_monitor);
power_supply_unregister(info->bat);
fuel_gauge_remove_debugfs(info);