From: jtzhou@marvell.com (Jett.Zhou)
To: linux-arm-kernel@lists.infradead.org
Subject: [V3 4/4] ARM: MMP: add 88pm860x battery-charger support
Date: Fri, 6 Jul 2012 11:02:26 +0800 [thread overview]
Message-ID: <1341543746-6567-1-git-send-email-jtzhou@marvell.com> (raw)
In-Reply-To: <20120705141541.GO4111@opensource.wolfsonmicro.com>
Add 88pm860x chg_desc platform data for ttc platform.
Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
---
arch/arm/mach-mmp/ttc_dkb.c | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index 7a7de2b..5e70cbf 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -18,6 +18,8 @@
#include <linux/i2c/pca953x.h>
#include <linux/gpio.h>
#include <linux/mfd/88pm860x.h>
+#include <linux/regulator/consumer.h>
+#include <linux/power/charger-manager.h>
#include <linux/platform_data/mv_usb.h>
#include <asm/mach-types.h>
@@ -138,8 +140,32 @@ static struct pca953x_platform_data max7312_data[] = {
},
};
+static char *ttc_psy_chg_stat[] = {"usb", NULL};
+/*
+ * Temperature can be handled by battery monitor base on interrupt
+ * scheme, so dummy it to make sure charger-manager initialize ok.
+ */
+static int dummy_temp_out_of_range(int *mC)
+{
+ *mC = 2500;
+ return 0;
+}
+
+struct charger_desc chg_desc_data = {
+ .polling_mode = CM_POLL_ALWAYS,
+ .polling_interval_ms = 180000,
+ .battery_present = CM_FUEL_GAUGE,
+ .psy_charger_stat = &ttc_psy_chg_stat[0],
+ .psy_fuel_gauge = "battery-monitor",
+ .temperature_out_of_range = dummy_temp_out_of_range,
+};
+
static struct pm860x_platform_data ttc_dkb_pm8607_info = {
- .irq_base = IRQ_BOARD_START,
+ .chg_desc = &chg_desc_data,
+ .companion_addr = 0x11,
+ .irq_mode = 0,
+ .irq_base = IRQ_BOARD_START,
+ .i2c_port = GI2C_PORT,
};
static struct i2c_board_info ttc_dkb_i2c_info[] = {
--
1.7.0.4
prev parent reply other threads:[~2012-07-06 3:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-21 6:18 [V2 1/3] regulator: add pre-regulator support for 88pm860x Jett.Zhou
2012-06-21 10:15 ` Mark Brown
2012-06-21 11:31 ` [V3 " Jett.Zhou
2012-06-21 22:54 ` Mark Brown
2012-07-05 14:24 ` Samuel Ortiz
2012-07-05 14:15 ` Mark Brown
2012-07-06 1:59 ` jett zhou
2012-07-06 2:58 ` [V3 1/4] regulator: 88pm860x: add pre-regulator support for 88pm860x regulator Jett.Zhou
2012-09-13 7:47 ` Haojian Zhuang
2012-07-06 2:59 ` [V3 2/4] mfd: 88pm860x: add pre-regulator device for 88pm860x Jett.Zhou
2012-07-06 9:01 ` Samuel Ortiz
2012-07-06 3:02 ` [V3 3/4] power_supply: Enable battery-charger " Jett.Zhou
2012-07-14 8:12 ` Anton Vorontsov
2012-07-16 5:27 ` jett zhou
2012-07-27 8:28 ` [V4 " Jett.Zhou
2012-08-23 3:48 ` Anton Vorontsov
2012-08-23 4:43 ` Anton Vorontsov
2012-08-23 9:06 ` jett zhou
2012-08-23 12:22 ` Anton Vorontsov
2012-08-23 12:26 ` jett zhou
2012-09-13 7:48 ` Haojian Zhuang
2012-09-20 22:35 ` Anton Vorontsov
2012-09-21 1:01 ` Haojian Zhuang
2012-09-21 22:14 ` Samuel Ortiz
2012-09-21 22:39 ` Anton Vorontsov
2012-07-06 3:02 ` Jett.Zhou [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341543746-6567-1-git-send-email-jtzhou@marvell.com \
--to=jtzhou@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).