1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
From af782542882298b2cc239016c23ac5c274f6bd07 Mon Sep 17 00:00:00 2001
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Date: Tue, 2 Dec 2014 20:20:40 +0300
Subject: [PATCH 19/44] ARM: pxa: add gpio-charger configuration on poodle
Add declration of gpio-charger device for Sharp SL-5600 poodle device.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-pxa/poodle.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 04ae74ce..189309b 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -31,6 +31,7 @@
#include <linux/spi/ads7846.h>
#include <linux/spi/pxa2xx_spi.h>
#include <linux/mtd/sharpsl.h>
+#include <linux/power/gpio-charger.h>
#include <linux/memblock.h>
#include <linux/iio/machine.h>
#include <linux/mfd/locomo.h>
@@ -413,12 +414,31 @@ static struct platform_device sharpsl_rom_device = {
.dev.platform_data = &sharpsl_rom_data,
};
+static char *poodle_ac_supplied_to[] = {
+ "main-battery",
+};
+
+static struct gpio_charger_platform_data poodle_power_data = {
+ .name = "charger",
+ .type = POWER_SUPPLY_TYPE_MAINS,
+ .gpio = POODLE_GPIO_AC_IN,
+ .supplied_to = poodle_ac_supplied_to,
+ .num_supplicants = ARRAY_SIZE(poodle_ac_supplied_to),
+};
+
+static struct platform_device poodle_power_device = {
+ .name = "gpio-charger",
+ .id = -1,
+ .dev.platform_data = &poodle_power_data,
+};
+
static struct platform_device *devices[] __initdata = {
&poodle_locomo_device,
&poodle_scoop_device,
&poodle_audio_device,
&sharpsl_nand_device,
&sharpsl_rom_device,
+ &poodle_power_device,
};
static struct i2c_board_info __initdata poodle_i2c_devices[] = {
--
1.9.1
|