aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mfd/wm8350/core.h26
-rw-r--r--include/linux/mfd/wm8350/supply.h23
2 files changed, 48 insertions, 1 deletions
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index cc190055b9c4..d2614dfc9397 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -57,6 +57,9 @@
57#define WM8350_OVER_CURRENT_INT_STATUS_MASK 0x25 57#define WM8350_OVER_CURRENT_INT_STATUS_MASK 0x25
58#define WM8350_GPIO_INT_STATUS_MASK 0x26 58#define WM8350_GPIO_INT_STATUS_MASK 0x26
59#define WM8350_COMPARATOR_INT_STATUS_MASK 0x27 59#define WM8350_COMPARATOR_INT_STATUS_MASK 0x27
60#define WM8350_MISC_OVERRIDES 0xE3
61#define WM8350_COMPARATOR_OVERRIDES 0xE7
62#define WM8350_STATE_MACHINE_STATUS 0xE9
60 63
61#define WM8350_MAX_REGISTER 0xFF 64#define WM8350_MAX_REGISTER 0xFF
62 65
@@ -523,6 +526,29 @@
523#define WM8350_DC2_STS 0x0002 526#define WM8350_DC2_STS 0x0002
524#define WM8350_DC1_STS 0x0001 527#define WM8350_DC1_STS 0x0001
525 528
529/*
530 * R227 (0xE3) - Misc Overrides
531 */
532#define WM8350_USB_LIMIT_OVRDE 0x0400
533
534/*
535 * R227 (0xE7) - Comparator Overrides
536 */
537#define WM8350_USB_FB_OVRDE 0x8000
538#define WM8350_WALL_FB_OVRDE 0x4000
539#define WM8350_BATT_FB_OVRDE 0x2000
540
541
542/*
543 * R233 (0xE9) - State Machinine Status
544 */
545#define WM8350_USB_SM_MASK 0x0700
546#define WM8350_USB_SM_SHIFT 8
547
548#define WM8350_USB_SM_100_SLV 1
549#define WM8350_USB_SM_500_SLV 5
550#define WM8350_USB_SM_STDBY_SLV 7
551
526/* WM8350 wake up conditions */ 552/* WM8350 wake up conditions */
527#define WM8350_IRQ_WKUP_OFF_STATE 43 553#define WM8350_IRQ_WKUP_OFF_STATE 43
528#define WM8350_IRQ_WKUP_HIB_STATE 44 554#define WM8350_IRQ_WKUP_HIB_STATE 44
diff --git a/include/linux/mfd/wm8350/supply.h b/include/linux/mfd/wm8350/supply.h
index 1c8f3cde79b0..79721513fa9f 100644
--- a/include/linux/mfd/wm8350/supply.h
+++ b/include/linux/mfd/wm8350/supply.h
@@ -13,7 +13,8 @@
13#ifndef __LINUX_MFD_WM8350_SUPPLY_H_ 13#ifndef __LINUX_MFD_WM8350_SUPPLY_H_
14#define __LINUX_MFD_WM8350_SUPPLY_H_ 14#define __LINUX_MFD_WM8350_SUPPLY_H_
15 15
16#include <linux/platform_device.h> 16#include <linux/mutex.h>
17#include <linux/power_supply.h>
17 18
18/* 19/*
19 * Charger registers 20 * Charger registers
@@ -104,8 +105,28 @@
104#define WM8350_IRQ_EXT_WALL_FB 37 105#define WM8350_IRQ_EXT_WALL_FB 37
105#define WM8350_IRQ_EXT_BAT_FB 38 106#define WM8350_IRQ_EXT_BAT_FB 38
106 107
108/*
109 * Policy to control charger state machine.
110 */
111struct wm8350_charger_policy {
112
113 /* charger state machine policy - set in machine driver */
114 int eoc_mA; /* end of charge current (mA) */
115 int charge_mV; /* charge voltage */
116 int fast_limit_mA; /* fast charge current limit */
117 int fast_limit_USB_mA; /* USB fast charge current limit */
118 int charge_timeout; /* charge timeout (mins) */
119 int trickle_start_mV; /* trickle charge starts at mV */
120 int trickle_charge_mA; /* trickle charge current */
121 int trickle_charge_USB_mA; /* USB trickle charge current */
122};
123
107struct wm8350_power { 124struct wm8350_power {
108 struct platform_device *pdev; 125 struct platform_device *pdev;
126 struct power_supply battery;
127 struct power_supply usb;
128 struct power_supply ac;
129 struct wm8350_charger_policy *policy;
109}; 130};
110 131
111#endif 132#endif