aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-handheld-4.4/locomo/0021-ARM-pxa-declare-battery-device-on-poodle.patch
blob: de34c7ea3e299ef1a9b31d46f780987968d35927 (plain)
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
60
61
62
63
64
65
From 587ab248224ed14171100ebacc91ffc0d6de90a5 Mon Sep 17 00:00:00 2001
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Date: Tue, 2 Dec 2014 20:34:50 +0300
Subject: [PATCH 21/44] ARM: pxa: declare battery device on poodle

Declare a battery platform device for SL-5600 (poodle) platform.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-pxa/poodle.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index c775fdd..9269703 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -466,6 +466,11 @@ static struct platform_device poodle_power_device = {
 	.dev.platform_data	= &poodle_power_data,
 };
 
+static struct platform_device poodle_battery_device = {
+	.name			= "poodle-battery",
+	.id			= -1,
+};
+
 static struct platform_device *devices[] __initdata = {
 	&poodle_locomo_device,
 	&poodle_scoop_device,
@@ -474,6 +479,7 @@ static struct platform_device *devices[] __initdata = {
 	&sharpsl_nand_device,
 	&sharpsl_rom_device,
 	&poodle_power_device,
+	&poodle_battery_device,
 };
 
 static struct i2c_board_info __initdata poodle_i2c_devices[] = {
@@ -523,6 +529,17 @@ static struct gpiod_lookup_table poodle_lcd_gpios_table = {
 		GPIO_LOOKUP("locomo-gpio", 7, "MOD", GPIO_ACTIVE_HIGH),
 		{ },
 	},
+}, poodle_battery_gpios_table = {
+	.dev_id = "poodle-battery",
+	.table = {
+		GPIO_LOOKUP("gpio-0", 13, "bat-cover", GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP("gpio-0", 16, "bat-full", GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP("locomo-gpio", 13, "charge-power", GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP("gpio-1", 6, "charge-on", GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP("gpio-1", 4, "charge-bypass", GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP("gpio-0", 21, "adc-temp", GPIO_ACTIVE_HIGH),
+		{ },
+	},
 };
 
 static void poodle_poweroff(void)
@@ -552,6 +569,7 @@ static void __init poodle_init(void)
 	gpiod_add_lookup_table(&poodle_audio_gpios_table);
 	gpiod_add_lookup_table(&poodle_bl_gpios_table);
 	gpiod_add_lookup_table(&poodle_lcd_gpios_table);
+	gpiod_add_lookup_table(&poodle_battery_gpios_table);
 
 	ret = platform_add_devices(devices, ARRAY_SIZE(devices));
 	if (ret)
-- 
1.9.1