From patchwork Thu Sep 27 20:09:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11828 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 1A21B24140 for ; Thu, 27 Sep 2012 20:10:38 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id A60FDA18351 for ; Thu, 27 Sep 2012 20:10:37 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234855iej.11 for ; Thu, 27 Sep 2012 13:10:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=DFOTtF67Ag9QVzTyqXCOcoQwksQ3x6Xsuqgi4JmK9Y0=; b=H+RV9yiN3A8L5oYx+qoEyeaRuGExgNgBSBFX2NsK4DwG0LyPKApVfPQNuC6YiIZZJh NK5Rlz7USiwazcuZO3jD1ZA54QBudr2AaNt0gYwPHNSlln+RFDIfdB2egMU8dHtGpkaz 58uqA59Xz9FMtDIVPvhgqtm//YnfjrkEYtE8ClMkqvjBmGE3h+oEkPPHcVJg39tgpcre 568TCPlt9yKb3LRAgylLzhfH7IiB98FEFqMK6Z45mMwns+0mpikWzmrvZJSSzEWpH0pd L76T3VxQBPyb90jDpPcwV3mbgUEoQa+pWOrY/VQJZPl9U9D4SMVBGc9n0eJPAa2ljFRt o2qA== Received: by 10.50.217.227 with SMTP id pb3mr15360423igc.28.1348776636128; Thu, 27 Sep 2012 13:10:36 -0700 (PDT) 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.50.184.232 with SMTP id ex8csp436418igc; Thu, 27 Sep 2012 13:10:34 -0700 (PDT) Received: by 10.50.178.106 with SMTP id cx10mr13807809igc.24.1348776634767; Thu, 27 Sep 2012 13:10:34 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id pi9si5467641pbb.12.2012.09.27.13.10.34 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) smtp.mail=mathieu.poirier@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md4so1686045pbc.37 for ; Thu, 27 Sep 2012 13:10:34 -0700 (PDT) Received: by 10.68.232.163 with SMTP id tp3mr14586931pbc.44.1348776634510; Thu, 27 Sep 2012 13:10:34 -0700 (PDT) Received: from localhost.localdomain (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPS id sa2sm1587890pbc.4.2012.09.27.13.10.33 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:33 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 55/57] power: ab8500_charger: Add UsbLineCtrl2 reference Date: Thu, 27 Sep 2012 14:09:12 -0600 Message-Id: <1348776554-10019-56-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348776554-10019-1-git-send-email-mathieu.poirier@linaro.org> References: <1348776554-10019-1-git-send-email-mathieu.poirier@linaro.org> X-Gm-Message-State: ALoCoQk4kFxzkFd+/EIIEygveHe902P5I4FBpz8zgmNcy4xybfDWXI/WPk49roz+ZMK5tPdLHjul 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: Mathieu Poirier Reviewed-by: Hakan BERG Reviewed-by: Jonas ABERG Conflicts: drivers/power/ab8500_charger.c --- drivers/power/ab8500_charger.c | 11 +++++------ include/linux/mfd/abx500/ab8500-bm.h | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index 7f8f362..afb4fda 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c @@ -51,6 +51,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 @@ -2287,9 +2288,8 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work) 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); + 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; @@ -2300,9 +2300,8 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work) "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); + 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 721bd6d..6b69ad5 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 /*