All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: arnd@arndb.de, linus.walleij@stericsson.com,
	cbouatmailru@gmail.com, sameo@linux.intel.com,
	Marcus Cooper <marcus.xm.cooper@stericsson.com>,
	Lee Jones <lee.jones@linaro.org>
Subject: [PATCH 26/40] ab8500-charger: Add UsbLineCtrl2 reference
Date: Fri, 15 Feb 2013 12:44:56 +0000	[thread overview]
Message-ID: <1360932310-30065-27-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1360932310-30065-1-git-send-email-lee.jones@linaro.org>

From: Marcus Cooper <marcus.xm.cooper@stericsson.com>

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>
---
 drivers/power/ab8500_charger.c       |   11 +++++++----
 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 bf8b479..64accb2 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -54,6 +54,7 @@
 #define VBUS_DET_DBNC1			0x01
 #define OTP_ENABLE_WD			0x01
 #define DROP_COUNT_RESET		0x01
+#define USB_CH_DET			0x01
 
 #define MAIN_CH_INPUT_CURR_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)
 					AB8500_CHARGER, AB8500_USBCH_CTRL1_REG,
 					USB_CH_ENA, USB_CH_ENA);
 			/*Enable charger detection*/
-			abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB,
-					AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x01);
+			abx500_mask_and_set_register_interruptible(di->dev,
+					AB8500_USB, AB8500_USB_LINE_CTRL2_REG,
+					USB_CH_DET, USB_CH_DET);
 			di->invalid_charger_detect_state = 1;
 			/*exit and wait for new link status interrupt.*/
 			return;
@@ -2359,8 +2361,9 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)
 			dev_dbg(di->dev,
 					"Invalid charger detected, state= 1\n");
 			/*Stop charger detection*/
-			abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB,
-					AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x00);
+			abx500_mask_and_set_register_interruptible(di->dev,
+					AB8500_USB, AB8500_USB_LINE_CTRL2_REG,
+					USB_CH_DET, 0x00);
 			/*Check link status*/
 			if (is_ab8500(di->parent))
 				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 faccdbd..829c352 100644
--- a/include/linux/mfd/abx500/ab8500-bm.h
+++ b/include/linux/mfd/abx500/ab8500-bm.h
@@ -23,6 +23,7 @@
  * Bank : 0x5
  */
 #define AB8500_USB_LINE_STAT_REG	0x80
+#define AB8500_USB_LINE_CTRL2_REG	0x82
 #define AB8500_USB_LINK1_STAT_REG	0x94
 
 /*
-- 
1.7.10.4


WARNING: multiple messages have this Message-ID (diff)
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 26/40] ab8500-charger: Add UsbLineCtrl2 reference
Date: Fri, 15 Feb 2013 12:44:56 +0000	[thread overview]
Message-ID: <1360932310-30065-27-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1360932310-30065-1-git-send-email-lee.jones@linaro.org>

From: Marcus Cooper <marcus.xm.cooper@stericsson.com>

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>
---
 drivers/power/ab8500_charger.c       |   11 +++++++----
 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 bf8b479..64accb2 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -54,6 +54,7 @@
 #define VBUS_DET_DBNC1			0x01
 #define OTP_ENABLE_WD			0x01
 #define DROP_COUNT_RESET		0x01
+#define USB_CH_DET			0x01
 
 #define MAIN_CH_INPUT_CURR_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)
 					AB8500_CHARGER, AB8500_USBCH_CTRL1_REG,
 					USB_CH_ENA, USB_CH_ENA);
 			/*Enable charger detection*/
-			abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB,
-					AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x01);
+			abx500_mask_and_set_register_interruptible(di->dev,
+					AB8500_USB, AB8500_USB_LINE_CTRL2_REG,
+					USB_CH_DET, USB_CH_DET);
 			di->invalid_charger_detect_state = 1;
 			/*exit and wait for new link status interrupt.*/
 			return;
@@ -2359,8 +2361,9 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)
 			dev_dbg(di->dev,
 					"Invalid charger detected, state= 1\n");
 			/*Stop charger detection*/
-			abx500_mask_and_set_register_interruptible(di->dev, AB8500_USB,
-					AB8500_MCH_IPT_CURLVL_REG, 0x01, 0x00);
+			abx500_mask_and_set_register_interruptible(di->dev,
+					AB8500_USB, AB8500_USB_LINE_CTRL2_REG,
+					USB_CH_DET, 0x00);
 			/*Check link status*/
 			if (is_ab8500(di->parent))
 				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 faccdbd..829c352 100644
--- a/include/linux/mfd/abx500/ab8500-bm.h
+++ b/include/linux/mfd/abx500/ab8500-bm.h
@@ -23,6 +23,7 @@
  * Bank : 0x5
  */
 #define AB8500_USB_LINE_STAT_REG	0x80
+#define AB8500_USB_LINE_CTRL2_REG	0x82
 #define AB8500_USB_LINK1_STAT_REG	0x94
 
 /*
-- 
1.7.10.4

  parent reply	other threads:[~2013-02-15 12:51 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 12:44 [PATCH 00/40] Power: AB8500: Internal development push Lee Jones
2013-02-15 12:44 ` Lee Jones
2013-02-15 12:44 ` [PATCH 01/40] mfd: Differentiate between newly added abx500 based platforms Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 02/40] pm2301-charger: Enable SW EOC control on the ab9540 Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 03/40] abx500-chargalg: Store the AB8500 MFD parent device for platform differentiation Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 04/40] ab8500-fg: Add power cut feature for ab8505 and ab8540 Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 05/40] ab8500-fg: Report unscaled capacity Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 06/40] ab8500-charger: Add backup battery charge voltages on the ab8540 Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 07/40] ab8500-charger: Trivial coding style changes Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 08/40] ab8500-bm: Quick re-attach charging behaviour Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 09/40] pm2301-charger: Support for over voltage protection on the ab9540 Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 10/40] ab8500-bm: Charge only mode fixes for " Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 11/40] pm2301-charger: Force main charger detect Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 12/40] pm2301-charger: Resolve I2C detection problem on ab9540 Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 13/40] ab8500_charger: Prevent auto drop of VBUS Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 14/40] pm2301-charger: Die temp thermal protection Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 15/40] pm2301-charger: Wake system when ext charger is plugged-in Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 16/40] ab8500-btemp: Filter btemp readings Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 17/40] ab8500-fg: Allow capacity to raise from 1% when charging Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 18/40] ab8500-charger: Add AB8505_USB_LINK_STATUS Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 19/40] pm2301-charger: Always compile the PM2301 Charger driver with AB8500 Battery Mgnt Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 20/40] ab8500-bm: Add usb power path support Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 21/40] ab8500-btemp: Defer btemp filtering while initialising Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 22/40] ab8500-bm: Add support for the new ab8540 platform Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 23/40] ab8500-charger: Use USBLink1Status Register Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 24/40] abx500-chargalg: Prevent the watchdog from being kicked twice Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 25/40] ab8500-chargalg: Use hrtimer Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` Lee Jones [this message]
2013-02-15 12:44   ` [PATCH 26/40] ab8500-charger: Add UsbLineCtrl2 reference Lee Jones
2013-02-15 12:44 ` [PATCH 27/40] pm2301-charger: Adjust interrupt handler behavior Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 28/40] pm2301-charger: Add pm_runtime_resume & pm_runtime_suspend Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:44 ` [PATCH 29/40] ab8500-charger: Run detect workaround only on AB8500 Lee Jones
2013-02-15 12:44   ` Lee Jones
2013-02-15 12:45 ` [PATCH 30/40] pm2301-charger: Removed unused code from PM2301 driver Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 31/40] abx500-chargalg: Use module_platform_driver() rather Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 32/40] ab8500-charger: Remove duplicate code Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 33/40] pm2301-charger: lpn pin used only in C2C boards Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 34/40] pm2301-charger: Charging LED control for pm2301 Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 35/40] ab8500-bm: Trivially fix up some incorrect and out-of-date comments Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 36/40] pm2301-charger: Wake device on register access Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 37/40] pm2301-charger: Reference put missing after access Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 38/40] abx500-chargalg: Add charging current step interface Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 39/40] ab8500-fg: Change current calculation Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-02-15 12:45 ` [PATCH 40/40] ab8500-charger: Do not use [delayed_]work_pending() Lee Jones
2013-02-15 12:45   ` Lee Jones
2013-03-02 23:33 ` [PATCH 00/40] Power: AB8500: Internal development push Anton Vorontsov
2013-03-02 23:33   ` Anton Vorontsov
2013-03-04 10:08   ` Samuel Ortiz
2013-03-04 10:08     ` Samuel Ortiz
2013-03-04 17:49     ` Anton Vorontsov
2013-03-04 17:49       ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360932310-30065-27-git-send-email-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=arnd@arndb.de \
    --cc=cbouatmailru@gmail.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcus.xm.cooper@stericsson.com \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.