diff options
author | Marcus Cooper <marcus.xm.cooper@stericsson.com> | 2012-08-29 11:56:19 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-03-06 23:35:50 -0500 |
commit | b3ea5f451e4e435b650e34142f8552002dc21297 (patch) | |
tree | f02eb06806e55f73691f157d716dc0f14be234c6 | |
parent | 257107ae6b9ba1f3822a8b079acef57a752dcc4c (diff) |
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: Marcus Cooper <marcus.xm.cooper@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Hakan BERG <hakan.berg@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r-- | drivers/power/ab8500_charger.c | 11 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ab8500-bm.h | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index bf8b479914cd..64accb235d2c 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #define VBUS_DET_DBNC1 0x01 | 54 | #define VBUS_DET_DBNC1 0x01 |
55 | #define OTP_ENABLE_WD 0x01 | 55 | #define OTP_ENABLE_WD 0x01 |
56 | #define DROP_COUNT_RESET 0x01 | 56 | #define DROP_COUNT_RESET 0x01 |
57 | #define USB_CH_DET 0x01 | ||
57 | 58 | ||
58 | #define MAIN_CH_INPUT_CURR_SHIFT 4 | 59 | #define MAIN_CH_INPUT_CURR_SHIFT 4 |
59 | #define VBUS_IN_CURR_LIM_SHIFT 4 | 60 | #define VBUS_IN_CURR_LIM_SHIFT 4 |
@@ -2348,8 +2349,9 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work) | |||
2348 | AB8500_CHARGER, AB8500_USBCH_CTRL1_REG, | 2349 | AB8500_CHARGER, AB8500_USBCH_CTRL1_REG, |
2349 | USB_CH_ENA, USB_CH_ENA); | 2350 | USB_CH_ENA, USB_CH_ENA); |
2350 | /*Enable charger detection*/ | 2351 | /*Enable charger detection*/ |
2351 | abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB, | 2352 | abx500_mask_and_set_register_interruptible(di->dev, |
2352 | AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x01); | 2353 | AB8500_USB, AB8500_USB_LINE_CTRL2_REG, |
2354 | USB_CH_DET, USB_CH_DET); | ||
2353 | di->invalid_charger_detect_state = 1; | 2355 | di->invalid_charger_detect_state = 1; |
2354 | /*exit and wait for new link status interrupt.*/ | 2356 | /*exit and wait for new link status interrupt.*/ |
2355 | return; | 2357 | return; |
@@ -2359,8 +2361,9 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work) | |||
2359 | dev_dbg(di->dev, | 2361 | dev_dbg(di->dev, |
2360 | "Invalid charger detected, state= 1\n"); | 2362 | "Invalid charger detected, state= 1\n"); |
2361 | /*Stop charger detection*/ | 2363 | /*Stop charger detection*/ |
2362 | abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB, | 2364 | abx500_mask_and_set_register_interruptible(di->dev, |
2363 | AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x00); | 2365 | AB8500_USB, AB8500_USB_LINE_CTRL2_REG, |
2366 | USB_CH_DET, 0x00); | ||
2364 | /*Check link status*/ | 2367 | /*Check link status*/ |
2365 | if (is_ab8500(di->parent)) | 2368 | if (is_ab8500(di->parent)) |
2366 | ret = abx500_get_register_interruptible(di->dev, | 2369 | ret = abx500_get_register_interruptible(di->dev, |
diff --git a/include/linux/mfd/abx500/ab8500-bm.h b/include/linux/mfd/abx500/ab8500-bm.h index ee1c1626c886..f5214dc651f9 100644 --- a/include/linux/mfd/abx500/ab8500-bm.h +++ b/include/linux/mfd/abx500/ab8500-bm.h | |||
@@ -23,6 +23,7 @@ | |||
23 | * Bank : 0x5 | 23 | * Bank : 0x5 |
24 | */ | 24 | */ |
25 | #define AB8500_USB_LINE_STAT_REG 0x80 | 25 | #define AB8500_USB_LINE_STAT_REG 0x80 |
26 | #define AB8500_USB_LINE_CTRL2_REG 0x82 | ||
26 | #define AB8500_USB_LINK1_STAT_REG 0x94 | 27 | #define AB8500_USB_LINK1_STAT_REG 0x94 |
27 | 28 | ||
28 | /* | 29 | /* |