diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0034-beaglebone-connect-batterycape-GPIO-to-gpio-charger.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0034-beaglebone-connect-batterycape-GPIO-to-gpio-charger.patch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0034-beaglebone-connect-batterycape-GPIO-to-gpio-charger.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0034-beaglebone-connect-batterycape-GPIO-to-gpio-charger.patch new file mode 100644 index 00000000..0a3c70ab --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0034-beaglebone-connect-batterycape-GPIO-to-gpio-charger.patch | |||
@@ -0,0 +1,84 @@ | |||
1 | From 759b49957081a1ccecf7302efc85c5141d00fe69 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Wed, 25 Apr 2012 12:35:07 +0200 | ||
4 | Subject: [PATCH 34/35] beaglebone: connect batterycape GPIO to gpio-charger | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | arch/arm/mach-omap2/board-am335xevm.c | 46 ++++++++++++++++++++++++++++++++- | ||
9 | 1 files changed, 45 insertions(+), 1 deletions(-) | ||
10 | |||
11 | diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c | ||
12 | index 7a4b766..2bc9b14 100644 | ||
13 | --- a/arch/arm/mach-omap2/board-am335xevm.c | ||
14 | +++ b/arch/arm/mach-omap2/board-am335xevm.c | ||
15 | @@ -133,6 +133,36 @@ static const struct display_panel disp_panel = { | ||
16 | COLOR_ACTIVE, | ||
17 | }; | ||
18 | |||
19 | + | ||
20 | +#if defined(CONFIG_CHARGER_GPIO) | ||
21 | + | ||
22 | +#include <linux/power_supply.h> | ||
23 | +#include <linux/power/gpio-charger.h> | ||
24 | + | ||
25 | +/* charger */ | ||
26 | +static char *beaglebone_batteries[] = { | ||
27 | + "battery", | ||
28 | +}; | ||
29 | + | ||
30 | +static struct gpio_charger_platform_data beaglebone_charger_pdata = { | ||
31 | + .name = "battery-cape", | ||
32 | + .type = POWER_SUPPLY_TYPE_BATTERY, | ||
33 | + .gpio = GPIO_TO_PIN(1,16), | ||
34 | + .gpio_active_low = 0, | ||
35 | + .supplied_to = beaglebone_batteries, | ||
36 | + .num_supplicants = ARRAY_SIZE(beaglebone_batteries), | ||
37 | +}; | ||
38 | + | ||
39 | +static struct platform_device beaglebone_charger_device = { | ||
40 | + .name = "gpio-charger", | ||
41 | + .dev = { | ||
42 | + .platform_data = &beaglebone_charger_pdata, | ||
43 | + }, | ||
44 | +}; | ||
45 | + | ||
46 | +#endif /* gpio-charger */ | ||
47 | + | ||
48 | + | ||
49 | /* LCD backlight platform Data */ | ||
50 | #define AM335X_BACKLIGHT_MAX_BRIGHTNESS 100 | ||
51 | #define AM335X_BACKLIGHT_DEFAULT_BRIGHTNESS 50 | ||
52 | @@ -504,6 +534,13 @@ static struct pinmux_config haptics_pin_mux[] = { | ||
53 | {NULL, 0}, | ||
54 | }; | ||
55 | |||
56 | +/* Module pin mux for battery cape */ | ||
57 | +static struct pinmux_config batterycape_pin_mux[] = { | ||
58 | + {"gpmc_a0.gpio1_16", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT}, | ||
59 | + {NULL, 0}, | ||
60 | +}; | ||
61 | + | ||
62 | + | ||
63 | /* Module pin mux for LCDC */ | ||
64 | static struct pinmux_config lcdc_pin_mux[] = { | ||
65 | {"lcd_data0.lcd_data0", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | ||
66 | @@ -2201,7 +2238,14 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context | ||
67 | pr_info("BeagleBone cape: initializing battery cape\n"); | ||
68 | // gpio1_6, P9_15 lowbat output | ||
69 | // AIN4, P9_33 vbat | ||
70 | - //foo_init(0,0); | ||
71 | + setup_pin_mux(batterycape_pin_mux); | ||
72 | + #if defined(CONFIG_CHARGER_GPIO) | ||
73 | + int err; | ||
74 | + err = platform_device_register(&beaglebone_charger_device); | ||
75 | + if (err) | ||
76 | + pr_err("failed to register BeagleBone battery cape gpio\n"); | ||
77 | + | ||
78 | + #endif | ||
79 | } | ||
80 | |||
81 | if (!strncmp("BB-BONE-SERL", cape_config.partnumber, 12)) { | ||
82 | -- | ||
83 | 1.7.7.6 | ||
84 | |||