From patchwork Thu Sep 27 20:08:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11805 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 7BF7624140 for ; Thu, 27 Sep 2012 20:10:01 +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 2E7C2A18B18 for ; Thu, 27 Sep 2012 20:10:01 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234801iej.11 for ; Thu, 27 Sep 2012 13:10:01 -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=90PzcV2aJrgw9Ty5yGm5SkR1GwlVtQIyW9LN6qR2WOE=; b=kFe2+VAsOXuDDb4mBOsgnpPSdg7odWfPF4Oc6YchI28OcQ/n+8Epjd/q7QiPCGv2d+ YiWt1NP6mdlxDqnLHiv6XgjX3CuTB4YtR8gbie7irFot8JI7m1BHwUTQfxOdwhPf7jif Pdw6FXzIlhJYoi4H5nMlNEyXrijOuJXA3VvPEkBROFbVivzQACcdCZ1WO8i2cuwjG1SI pvvPy0AKonkZg17NQ70NkeSJstiO114vuftj8Cyl0NdiZT2dvrHznMelecHAJcd9FxJU zwVrkmWwFEFDb8uHKfQmgDdEtFhOxrSvTvnc6B0juRzpq6vX9qjH0577v/9yUYmZRrl7 a5sg== Received: by 10.50.160.165 with SMTP id xl5mr5874680igb.0.1348776600987; Thu, 27 Sep 2012 13:10:00 -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 ex8csp436336igc; Thu, 27 Sep 2012 13:10:00 -0700 (PDT) Received: by 10.68.230.232 with SMTP id tb8mr14525493pbc.19.1348776600292; Thu, 27 Sep 2012 13:10:00 -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.00 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:10:00 -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:00 -0700 (PDT) Received: by 10.68.228.98 with SMTP id sh2mr14525372pbc.95.1348776600059; Thu, 27 Sep 2012 13:10:00 -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.09.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:59 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 32/57] power: ab8500_charger: Do not touch VBUSOVV bits Date: Thu, 27 Sep 2012 14:08:49 -0600 Message-Id: <1348776554-10019-33-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: ALoCoQkdKklfoyn3qPfqEPXzQuw4CTV7eI+e4MGANZex6sU+ewrQ59zEQPKD4d0UXGkf2xKoS1EF From: Jonas Aaberg Do not touch the VBUSOVV in USBCHTRL2 when running on AB8505. Signed-off-by: Jonas Aaberg Signed-off-by: Mathieu Poirier Reviewed-by: Marcus COOPER --- drivers/power/ab8500_charger.c | 22 ++++++++++++++++------ include/linux/mfd/abx500/ab8500.h | 10 ++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index 071c7c2..2a323cf 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c @@ -2667,13 +2667,23 @@ static int ab8500_charger_init_hw_registers(struct ab8500_charger *di) } } - /* VBUS OVV set to 6.3V and enable automatic current limitiation */ - ret = abx500_set_register_interruptible(di->dev, - AB8500_CHARGER, - AB8500_USBCH_CTRL2_REG, - VBUS_OVV_SELECT_6P3V | VBUS_AUTO_IN_CURR_LIM_ENA); + if (is_ab9540_2p0(di->parent) || is_ab8505_2p0(di->parent)) + ret = abx500_mask_and_set_register_interruptible(di->dev, + AB8500_CHARGER, + AB8500_USBCH_CTRL2_REG, + VBUS_AUTO_IN_CURR_LIM_ENA, + VBUS_AUTO_IN_CURR_LIM_ENA); + else + /* + * VBUS OVV set to 6.3V and enable automatic current limitation + */ + ret = abx500_set_register_interruptible(di->dev, + AB8500_CHARGER, + AB8500_USBCH_CTRL2_REG, + VBUS_OVV_SELECT_6P3V | VBUS_AUTO_IN_CURR_LIM_ENA); if (ret) { - dev_err(di->dev, "failed to set VBUS OVV\n"); + dev_err(di->dev, + "failed to set automatic current limitation\n"); goto out; } diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 087b445..5a4b186 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h @@ -351,6 +351,16 @@ static inline int is_ab8500_2p0(struct ab8500 *ab) return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0)); } +static inline int is_ab8505_2p0(struct ab8500 *ab) +{ + return (is_ab8505(ab) && (ab->chip_id == AB8500_CUT2P0)); +} + +static inline int is_ab9540_2p0(struct ab8500 *ab) +{ + return (is_ab9540(ab) && (ab->chip_id == AB8500_CUT2P0)); +} + int ab8500_irq_get_virq(struct ab8500 *ab8500, int irq); #endif /* MFD_AB8500_H */