From patchwork Fri Feb 15 12:44:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14871 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D650723E2E for ; Fri, 15 Feb 2013 12:46:46 +0000 (UTC) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by fiordland.canonical.com (Postfix) with ESMTP id 7DCC1A18715 for ; Fri, 15 Feb 2013 12:46:46 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so2154030vbn.0 for ; Fri, 15 Feb 2013 04:46:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=dXYsX5jlqV1scHG+i4rJR4vU4ZG0Wqp215cdwXfbyxo=; b=IrA4z3UwkOZpzDR9rHTUGCeHjdV7KEvl79LCNMOCZ1B54NaDrMNJ7WFrGYF6RCfdHY ng7eqajSYlrr6J+fo8sTBtm6r0bJqFmM6kGUgHBYWI/EJ6PGO1zijvJTRV9si7OxNRtf 7X3wPQk9Ce9c/aSpmjj5QiAryXehY/tZRJe1FL/s6jLgg+2s9UGdE+iSmFyh0ze9bz6V Jc3Mb/5HY82Z7MCLwS2P0RnvwAy0jt2VqWPzbP/Iy6D3g8AjSwyW+utcst9cOcqbzYqU ciyj0o3GglTDfPNoJZl5qxGbmz7MNfSwPZ2JZyKndi70G+i2SUoUTJIdr958ThZONk56 tjvQ== X-Received: by 10.52.175.66 with SMTP id by2mr2633014vdc.53.1360932405991; Fri, 15 Feb 2013 04:46:45 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.221.4.5 with SMTP id oa5csp10885vcb; Fri, 15 Feb 2013 04:46:42 -0800 (PST) X-Received: by 10.180.98.232 with SMTP id el8mr2246678wib.22.1360932399582; Fri, 15 Feb 2013 04:46:39 -0800 (PST) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by mx.google.com with ESMTPS id t7si1032914wiw.97.2013.02.15.04.46.39 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:46:39 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.45 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.45 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wg0-f45.google.com with SMTP id dq12so2786357wgb.12 for ; Fri, 15 Feb 2013 04:46:39 -0800 (PST) X-Received: by 10.180.102.7 with SMTP id fk7mr3817431wib.27.1360932399177; Fri, 15 Feb 2013 04:46:39 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id bs6sm5133904wib.4.2013.02.15.04.46.37 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:46:38 -0800 (PST) From: Lee Jones 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 , Lee Jones Subject: [PATCH 26/40] ab8500-charger: Add UsbLineCtrl2 reference Date: Fri, 15 Feb 2013 12:44:56 +0000 Message-Id: <1360932310-30065-27-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> References: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlL0uNTjlIx74VFP4s7RleojJCAXyuUlCvF/0GuN4jVoXQHMoY9IkgUW6pQvqPUOxTwfDhf From: Marcus Cooper 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 Signed-off-by: Lee Jones Reviewed-by: Hakan BERG Reviewed-by: Jonas ABERG --- 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 /*