Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Marcus Cooper and committed by
Lee Jones
b3ea5f45 257107ae

+8 -4
+7 -4
drivers/power/ab8500_charger.c
··· 54 54 #define VBUS_DET_DBNC1 0x01 55 55 #define OTP_ENABLE_WD 0x01 56 56 #define DROP_COUNT_RESET 0x01 57 + #define USB_CH_DET 0x01 57 58 58 59 #define MAIN_CH_INPUT_CURR_SHIFT 4 59 60 #define VBUS_IN_CURR_LIM_SHIFT 4 ··· 2349 2348 AB8500_CHARGER, AB8500_USBCH_CTRL1_REG, 2350 2349 USB_CH_ENA, USB_CH_ENA); 2351 2350 /*Enable charger detection*/ 2352 - abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB, 2353 - AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x01); 2351 + abx500_mask_and_set_register_interruptible(di->dev, 2352 + AB8500_USB, AB8500_USB_LINE_CTRL2_REG, 2353 + USB_CH_DET, USB_CH_DET); 2354 2354 di->invalid_charger_detect_state = 1; 2355 2355 /*exit and wait for new link status interrupt.*/ 2356 2356 return; ··· 2361 2359 dev_dbg(di->dev, 2362 2360 "Invalid charger detected, state= 1\n"); 2363 2361 /*Stop charger detection*/ 2364 - abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB, 2365 - AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x00); 2362 + abx500_mask_and_set_register_interruptible(di->dev, 2363 + AB8500_USB, AB8500_USB_LINE_CTRL2_REG, 2364 + USB_CH_DET, 0x00); 2366 2365 /*Check link status*/ 2367 2366 if (is_ab8500(di->parent)) 2368 2367 ret = abx500_get_register_interruptible(di->dev,
+1
include/linux/mfd/abx500/ab8500-bm.h
··· 23 23 * Bank : 0x5 24 24 */ 25 25 #define AB8500_USB_LINE_STAT_REG 0x80 26 + #define AB8500_USB_LINE_CTRL2_REG 0x82 26 27 #define AB8500_USB_LINK1_STAT_REG 0x94 27 28 28 29 /*