提交 b3ea5f45 编写于 作者: M Marcus Cooper 提交者: Lee Jones

ab8500-charger: Add UsbLineCtrl2 reference

When the state of USB Charge detection is changed then the calls
use a define for another register in other bank. This change
creates a new define for the correct register and removes the
magic numbers that are present.
Signed-off-by: NMarcus Cooper <marcus.xm.cooper@stericsson.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
Reviewed-by: NHakan BERG <hakan.berg@stericsson.com>
Reviewed-by: NJonas ABERG <jonas.aberg@stericsson.com>
上级 257107ae
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#define VBUS_DET_DBNC1 0x01 #define VBUS_DET_DBNC1 0x01
#define OTP_ENABLE_WD 0x01 #define OTP_ENABLE_WD 0x01
#define DROP_COUNT_RESET 0x01 #define DROP_COUNT_RESET 0x01
#define USB_CH_DET 0x01
#define MAIN_CH_INPUT_CURR_SHIFT 4 #define MAIN_CH_INPUT_CURR_SHIFT 4
#define VBUS_IN_CURR_LIM_SHIFT 4 #define VBUS_IN_CURR_LIM_SHIFT 4
...@@ -2348,8 +2349,9 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work) ...@@ -2348,8 +2349,9 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)
AB8500_CHARGER, AB8500_USBCH_CTRL1_REG, AB8500_CHARGER, AB8500_USBCH_CTRL1_REG,
USB_CH_ENA, USB_CH_ENA); USB_CH_ENA, USB_CH_ENA);
/*Enable charger detection*/ /*Enable charger detection*/
abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB, abx500_mask_and_set_register_interruptible(di->dev,
AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x01); AB8500_USB, AB8500_USB_LINE_CTRL2_REG,
USB_CH_DET, USB_CH_DET);
di->invalid_charger_detect_state = 1; di->invalid_charger_detect_state = 1;
/*exit and wait for new link status interrupt.*/ /*exit and wait for new link status interrupt.*/
return; return;
...@@ -2359,8 +2361,9 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work) ...@@ -2359,8 +2361,9 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)
dev_dbg(di->dev, dev_dbg(di->dev,
"Invalid charger detected, state= 1\n"); "Invalid charger detected, state= 1\n");
/*Stop charger detection*/ /*Stop charger detection*/
abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB, abx500_mask_and_set_register_interruptible(di->dev,
AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x00); AB8500_USB, AB8500_USB_LINE_CTRL2_REG,
USB_CH_DET, 0x00);
/*Check link status*/ /*Check link status*/
if (is_ab8500(di->parent)) if (is_ab8500(di->parent))
ret = abx500_get_register_interruptible(di->dev, ret = abx500_get_register_interruptible(di->dev,
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Bank : 0x5 * Bank : 0x5
*/ */
#define AB8500_USB_LINE_STAT_REG 0x80 #define AB8500_USB_LINE_STAT_REG 0x80
#define AB8500_USB_LINE_CTRL2_REG 0x82
#define AB8500_USB_LINK1_STAT_REG 0x94 #define AB8500_USB_LINK1_STAT_REG 0x94
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册