aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorAdam Hampson <ahampson@sta.samsung.com>2011-10-19 10:15:46 -0700
committerSimon Wilson <simonwilson@google.com>2011-10-24 12:18:46 -0700
commita2a266f82ca330534b48c2d1f12dadc9200efd8a (patch)
tree6098c465c65e04a4ba2c5e5e72664bc1f1ac9d0e /arch/arm/mach-omap2
parentd05524691b1a08e8435263c7060243b1f0717103 (diff)
downloadkernel_samsung_tuna-a2a266f82ca330534b48c2d1f12dadc9200efd8a.zip
kernel_samsung_tuna-a2a266f82ca330534b48c2d1f12dadc9200efd8a.tar.gz
kernel_samsung_tuna-a2a266f82ca330534b48c2d1f12dadc9200efd8a.tar.bz2
ARM: tuna: pogo: Enable fast charging for pogo
When in the pogo dock send the charger event through the OTG notifier. Change-Id: I0539d8f15321bdbfc9bc86124242aed4ac4f5e0b Signed-off-by: Adam Hampson <ahampson@sta.samsung.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/board-tuna-connector.c12
-rw-r--r--arch/arm/mach-omap2/board-tuna-pogo.c10
-rw-r--r--arch/arm/mach-omap2/board-tuna.c2
-rw-r--r--arch/arm/mach-omap2/board-tuna.h2
4 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/board-tuna-connector.c b/arch/arm/mach-omap2/board-tuna-connector.c
index 46b6153..4d702c6 100644
--- a/arch/arm/mach-omap2/board-tuna-connector.c
+++ b/arch/arm/mach-omap2/board-tuna-connector.c
@@ -715,6 +715,18 @@ static void sii9234_vbus_present(bool on)
tuna_otg->otg.gadget);
}
+void tuna_otg_pogo_charger(bool on)
+{
+ struct tuna_otg *tuna_otg = &tuna_otg_xceiv;
+
+ tuna_otg->otg.state = OTG_STATE_B_IDLE;
+ tuna_otg->otg.default_a = false;
+ tuna_otg->otg.last_event = on ? USB_EVENT_CHARGER : USB_EVENT_NONE;
+ atomic_notifier_call_chain(&tuna_otg->otg.notifier,
+ on ? USB_EVENT_CHARGER : USB_EVENT_NONE,
+ tuna_otg->otg.gadget);
+}
+
static struct sii9234_platform_data sii9234_pdata = {
.prio = TUNA_OTG_ID_SII9234_PRIO,
.enable = tuna_mux_usb_to_mhl,
diff --git a/arch/arm/mach-omap2/board-tuna-pogo.c b/arch/arm/mach-omap2/board-tuna-pogo.c
index 54ea22f..04663be 100644
--- a/arch/arm/mach-omap2/board-tuna-pogo.c
+++ b/arch/arm/mach-omap2/board-tuna-pogo.c
@@ -26,6 +26,7 @@
#include <linux/irq.h>
#include <linux/sched.h>
#include <linux/completion.h>
+#include <linux/usb/otg.h>
#include <asm/div64.h>
@@ -137,6 +138,9 @@ static irqreturn_t pogo_det_irq_thread(int irq, void *data)
pr_info("POGO Car Dock Detected, ID period"
" %dms\n",
id_period);
+
+ tuna_otg_pogo_charger(true);
+
pogo->dock_type = POGO_DOCK_CAR;
switch_set_state(&pogo->dock_switch,
POGO_DOCK_CAR);
@@ -148,6 +152,9 @@ static irqreturn_t pogo_det_irq_thread(int irq, void *data)
pr_info("POGO Desk Dock Detected, ID period"
" %dms\n",
id_period);
+
+ tuna_otg_pogo_charger(true);
+
pogo->dock_type = POGO_DOCK_DESK;
switch_set_state(&pogo->dock_switch,
POGO_DOCK_DESK);
@@ -180,6 +187,9 @@ static irqreturn_t pogo_det_irq_thread(int irq, void *data)
if (pogo->dock_type != POGO_DOCK_UNDOCKED) {
pogo->dock_type = POGO_DOCK_UNDOCKED;
pr_info("POGO Dock Detached\n");
+
+ tuna_otg_pogo_charger(false);
+
switch_set_state(&pogo->dock_switch,
POGO_DOCK_UNDOCKED);
switch_set_state(&pogo->audio_switch,
diff --git a/arch/arm/mach-omap2/board-tuna.c b/arch/arm/mach-omap2/board-tuna.c
index a27d0c7..19941f6 100644
--- a/arch/arm/mach-omap2/board-tuna.c
+++ b/arch/arm/mach-omap2/board-tuna.c
@@ -1305,8 +1305,8 @@ static void __init tuna_init(void)
omap4_tuna_jack_init();
omap4_tuna_sensors_init();
omap4_tuna_led_init();
- omap4_tuna_pogo_init();
omap4_tuna_connector_init();
+ omap4_tuna_pogo_init();
#ifdef CONFIG_OMAP_HSI_DEVICE
if (TUNA_TYPE_MAGURO == omap4_tuna_get_type())
omap_hsi_init();
diff --git a/arch/arm/mach-omap2/board-tuna.h b/arch/arm/mach-omap2/board-tuna.h
index 5f2ec1c..b0b3b73 100644
--- a/arch/arm/mach-omap2/board-tuna.h
+++ b/arch/arm/mach-omap2/board-tuna.h
@@ -41,6 +41,8 @@ void omap4_tuna_emif_init(void);
void omap4_ehci_init(void);
void modem_toro_init(void);
+void tuna_otg_pogo_charger(bool on);
+
extern struct mmc_platform_data tuna_wifi_data;
extern struct class *sec_class;