summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArun Murthy <arun.murthy@stericsson.com>2011-05-26 16:48:47 +0530
committerLee Jones <lee.jones@linaro.org>2012-01-05 10:06:18 +0000
commit59bece38ad27b213b5cfd41ba369b8124e719d00 (patch)
tree4599356f5ba238e9a25d150eeead59ee4ffda482 /include
parentf345574feabab003de6f7b448e46eccef7383899 (diff)
power: abx500-chargalg: charging algorithm
A generic charging algorithm for all abx500 varants. It is a high level algorithm and hence doesn't include any low level or hardware interaction. Each of the abx500 charging drivers will implement low level hardware interaction function and provide inputs to this generic charging algorithm to monitor and implement the charging functionality. ST-Ericsson Linux next: Not Tested ST-Ericsson ID: WP256401 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I8634160b2e67132ae68a09fda7a9fd9d36dd23d2 Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23150 Reviewed-by: QATEST Reviewed-by: Johan PALSSON <johan.palsson@stericsson.com> Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/abx500/ux500_chargalg.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/mfd/abx500/ux500_chargalg.h b/include/linux/mfd/abx500/ux500_chargalg.h
new file mode 100644
index 00000000000..f04e47ff56a
--- /dev/null
+++ b/include/linux/mfd/abx500/ux500_chargalg.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2011
+ * Author: Johan Gardsmark <johan.gardsmark@stericsson.com> for ST-Ericsson.
+ * License terms: GNU General Public License (GPL), version 2
+ */
+
+#ifndef _UX500_CHARGALG_H
+#define _UX500_CHARGALG_H
+
+#include <linux/power_supply.h>
+
+#define psy_to_ux500_charger(x) container_of((x), \
+ struct ux500_charger, psy)
+
+/* Forward declaration */
+struct ux500_charger;
+
+struct ux500_charger_ops {
+ int (*enable) (struct ux500_charger *, int, int, int);
+ int (*kick_wd) (struct ux500_charger *);
+ int (*update_curr) (struct ux500_charger *, int);
+};
+
+/**
+ * struct ux500_charger - power supply ux500 charger sub class
+ * @psy power supply base class
+ * @ops ux500 charger operations
+ * @max_out_volt maximum output charger voltage in mV
+ * @max_out_curr maximum output charger current in mA
+ */
+struct ux500_charger {
+ struct power_supply psy;
+ struct ux500_charger_ops ops;
+ int max_out_volt;
+ int max_out_curr;
+};
+
+#endif