From patchwork Mon Feb 4 11:53:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14469 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 5F34123F96 for ; Mon, 4 Feb 2013 11:56:27 +0000 (UTC) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by fiordland.canonical.com (Postfix) with ESMTP id D802DA192D3 for ; Mon, 4 Feb 2013 11:56:26 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id p1so3817911vcq.2 for ; Mon, 04 Feb 2013 03:56:26 -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=tc9BdjgysUhqs8VGajMNkBtsWgl0o4k/AHnxPa0RRJs=; b=bus3DJCr2o16fTrqSx3A7qG8X8w+P4pugUSGOudzYCJOrPJrJL7kNjZF00puegiX3p VBok+UP5CJTyj6L4y+P20hKVznRvOzeSpXchwhVJIcucuqFE2Xqmq0NH/t9xV6QbeSpu yhG9/3xopkwchd+g8qnTQNPsE7g4oSEdF4jz/uY3xzseAhxbXc7DLi8epDZX0GLBrNPe qtQLFcsiqX3bhHO+hNx67jQ8yvvKWQANW822zSMetJk9hgNyEm9ohRYVfwGFuomspE8R 9rULjrh5YSPS9n+wukCI0VzpZm0Q193vSiT/j+Bu3ST+SXxpO9WtKc9gyfA2+REFXK2q S9ig== X-Received: by 10.52.66.168 with SMTP id g8mr19457987vdt.27.1359978986378; Mon, 04 Feb 2013 03:56:26 -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.58.252.8 with SMTP id zo8csp83050vec; Mon, 4 Feb 2013 03:56:25 -0800 (PST) X-Received: by 10.180.84.162 with SMTP id a2mr9816043wiz.14.1359978985178; Mon, 04 Feb 2013 03:56:25 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx.google.com with ESMTPS id c13si5708604wjz.239.2013.02.04.03.56.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:56:25 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.181 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-wi0-f181.google.com with SMTP id hm6so1500952wib.2 for ; Mon, 04 Feb 2013 03:56:24 -0800 (PST) X-Received: by 10.180.100.163 with SMTP id ez3mr9786510wib.32.1359978984755; Mon, 04 Feb 2013 03:56:24 -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 j9sm12937128wia.5.2013.02.04.03.56.23 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:56:23 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Lee Jones , Bengt Jonsson Subject: [PATCH 20/73] regulator: ab8500-ext: Add VextSupply1 regulator Date: Mon, 4 Feb 2013 11:53:35 +0000 Message-Id: <1359978868-28736-21-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> References: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQlrHp+RaDpRBYzZR5AT82a5ajTtd8E7IaJAlQ85I15vUdDLVBKhj+tT3GQeRgIaQCCoRwVJ Remove suspend-force settings of VextSupply1 and add VextSupply1 in the external regulator driver. Signed-off-by: Bengt Jonsson Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500-regulators.c | 32 +++++++++++++++++++++++-- arch/arm/mach-ux500/board-mop500-regulators.h | 2 ++ drivers/regulator/ab8500-ext.c | 18 ++++++++++++++ include/linux/regulator/ab8500.h | 1 + 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c index 72fb449..38b70d7 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.c +++ b/arch/arm/mach-ux500/board-mop500-regulators.c @@ -11,6 +11,7 @@ #include #include #include +#include /* to identify older boards for fixes */ #include "board-mop500-regulators.h" static struct regulator_consumer_supply gpio_en_3v3_consumers[] = { @@ -278,13 +279,13 @@ static struct ab8500_regulator_reg_init ab8500_reg_init[] = { */ INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00), /* - * VextSupply1Regu = HW control + * VextSupply1Regu = force LP * VextSupply2Regu = HW control * VextSupply3Regu = force HP (-> STBB2=LP and TPS=LP) * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0 * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0 */ - INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x1a), + INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x1b), /* * Vaux1Regu = force HP * Vaux2Regu = force off @@ -456,6 +457,17 @@ static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = { * AB8500 external regulators */ static struct regulator_init_data ab8500_ext_regulators[] = { + /* fixed Vbat supplies VSMPS1_EXT_1V8 */ + [AB8500_EXT_SUPPLY1] = { + .constraints = { + .name = "ab8500-ext-supply1", + .min_uV = 1800000, + .max_uV = 1800000, + .initial_mode = REGULATOR_MODE_IDLE, + .boot_on = 1, + .always_on = 1, + }, + }, /* fixed Vbat supplies VSMPS3_EXT_3V4 and VSMPS4_EXT_3V4 */ [AB8500_EXT_SUPPLY3] = { .constraints = { @@ -479,3 +491,19 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = { .ext_regulator = ab8500_ext_regulators, .num_ext_regulator = ARRAY_SIZE(ab8500_ext_regulators), }; + +void mop500_regulator_init(void) +{ + struct regulator_init_data *regulator; + + /* + * Handle VextSupply1 on older boards than HREFP_V22_V1x + * (turn off in suspend) + */ + if (cpu_is_u8500v20() || cpu_is_u8500v21()) { + /* disable VextSupply1 in suspend */ + regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY1]; + regulator->constraints.state_mem.disabled = 1; + regulator->constraints.state_standby.disabled = 1; + } +} diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h index 9ca4869..3d4c412 100644 --- a/arch/arm/mach-ux500/board-mop500-regulators.h +++ b/arch/arm/mach-ux500/board-mop500-regulators.h @@ -18,4 +18,6 @@ extern struct ab8500_regulator_platform_data ab8500_regulator_plat_data; extern struct regulator_init_data tps61052_regulator; extern struct regulator_init_data gpio_en_3v3_regulator; +void mop500_regulator_init(void); + #endif diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index 2bf940d..a8fe1cb 100644 --- a/drivers/regulator/ab8500-ext.c +++ b/drivers/regulator/ab8500-ext.c @@ -300,6 +300,24 @@ static struct regulator_ops ab8500_ext_regulator_ops = { static struct ab8500_ext_regulator_info ab8500_ext_regulator_info[AB8500_NUM_EXT_REGULATORS] = { + [AB8500_EXT_SUPPLY1] = { + .desc = { + .name = "VEXTSUPPLY1", + .ops = &ab8500_ext_regulator_ops, + .type = REGULATOR_VOLTAGE, + .id = AB8500_EXT_SUPPLY1, + .owner = THIS_MODULE, + .n_voltages = 1, + }, + .fixed_uV = 1800000, + .update_bank = 0x04, + .update_reg = 0x08, + .update_mask = 0x03, + .update_val = 0x01, + .update_val_hp = 0x01, + .update_val_lp = 0x03, + .update_val_hw = 0x02, + }, [AB8500_EXT_SUPPLY3] = { .desc = { .name = "VEXTSUPPLY3", diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index 7436bdb..33308ff 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h @@ -160,6 +160,7 @@ struct ab8500_ext_regulator_cfg { }; enum ab8500_ext_regulator_id { + AB8500_EXT_SUPPLY1, AB8500_EXT_SUPPLY3, AB8500_NUM_EXT_REGULATORS, };