From patchwork Thu Mar 21 15:59:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 2315261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id CC3FEDF264 for ; Thu, 21 Mar 2013 16:38:35 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UIiRz-0004Hk-FV; Thu, 21 Mar 2013 16:34:47 +0000 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UIhvl-0001VS-PE for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2013 16:01:31 +0000 Received: by mail-we0-f169.google.com with SMTP id x56so1632473wey.14 for ; Thu, 21 Mar 2013 09:01:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=t8lvKDU8tlBx1iffKF4Qyf7dIG+SUO+h8BUBm33pB44=; b=LYL7zucf+WJDrV+TeDOkt8p34GOC7hTzGhSf2WXjCONgZW7kOb+mJQVwk08HEFhNDm wRbLCIj/npWd47GCoYQhnGsMSqtGj/1LlUO0eNAyASFIRebuj0GmD6jL2z7nalGCHLCw XTqs1k6Ao2Ah9tgcbMPL3sXrr+2ipMT6B+ONQq9TZNu0R/5ugmBqJr/1vAtoasQkC9he a5Aw3Dh+17nCDqHc+VmNbksR8KKWT/bWI5T79Pyp7IHBHjS5kXg0env1KAHE9rS7c7zS XwbS7Z60RdnnCy6hPdu0Bezec1v2XkiTY4khIBFjJPUWZ2YIatK8MOadUy7ObwlQwjxy DarQ== X-Received: by 10.180.94.135 with SMTP id dc7mr5931797wib.11.1363881686015; Thu, 21 Mar 2013 09:01:26 -0700 (PDT) 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 h10sm6110847wic.8.2013.03.21.09.01.24 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:01:25 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Subject: [PATCH 42/46] regulator: ab8500: Use regulator_list_voltage_table() to look-up voltages Date: Thu, 21 Mar 2013 15:59:39 +0000 Message-Id: <1363881583-15234-43-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363881583-15234-1-git-send-email-lee.jones@linaro.org> References: <1363881583-15234-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnfa0vSITRlpSp6wI1LLIFeTXxS+KM88ZlOZWjMzKn6Qf8daaeQaeYKD1pru7oS4jB2Zmy8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130321_120130_176554_F2771D69 X-CRM114-Status: GOOD ( 11.16 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The regulator framework offers a generic regulator_list_voltage_table() function which can directly look-up a regulator's voltage capabilities using a table provided through the desc structure. This patch ensures that information is available. Signed-off-by: Lee Jones --- drivers/regulator/ab8500.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 13948c8..e82b0ad 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -926,7 +926,7 @@ static struct ab8500_regulator_info * Variable Voltage Regulators * name, min mV, max mV, * update bank, reg, mask, enable val - * volt bank, reg, mask, table, table length + * volt bank, reg, mask */ [AB8505_LDO_AUX1] = { .desc = { @@ -1140,8 +1140,6 @@ static struct ab8500_regulator_info .voltage_reg = 0x57, .voltage_mask = 0x7, .voltage_shift = 4, - .voltages = ldo_vaudio_voltages, - .voltages_len = ARRAY_SIZE(ldo_vaudio_voltages), }, [AB8505_LDO_ANAMIC1] = { .desc = { @@ -1223,8 +1221,6 @@ static struct ab8500_regulator_info .voltage_bank = 0x04, .voltage_reg = 0x29, .voltage_mask = 0x7, - .voltages = ldo_vana_voltages, - .voltages_len = ARRAY_SIZE(ldo_vana_voltages), }, }; @@ -1235,7 +1231,7 @@ static struct ab8500_regulator_info * Variable Voltage Regulators * name, min mV, max mV, * update bank, reg, mask, enable val - * volt bank, reg, mask, table, table length + * volt bank, reg, mask */ [AB9540_LDO_AUX1] = { .desc = { @@ -1478,7 +1474,7 @@ static struct ab8500_regulator_info * Variable Voltage Regulators * name, min mV, max mV, * update bank, reg, mask, enable val - * volt bank, reg, mask, table, table length + * volt bank, reg, mask */ [AB8540_LDO_AUX1] = { .desc = { @@ -1581,6 +1577,7 @@ static struct ab8500_regulator_info .id = AB8540_LDO_AUX5, .owner = THIS_MODULE, .n_voltages = ARRAY_SIZE(ldo_vaux56_ab8540_voltages), + .volt_table = ldo_vaux56_ab8540_voltages, }, .load_lp_uA = 20000, /* values for Vaux5Regu register */ @@ -1594,8 +1591,6 @@ static struct ab8500_regulator_info .voltage_bank = 0x04, .voltage_reg = 0x33, .voltage_mask = 0x3f, - .voltages = ldo_vaux56_ab8540_voltages, - .voltages_len = ARRAY_SIZE(ldo_vaux56_ab8540_voltages), }, [AB8540_LDO_AUX6] = { .desc = { @@ -1605,6 +1600,7 @@ static struct ab8500_regulator_info .id = AB8540_LDO_AUX6, .owner = THIS_MODULE, .n_voltages = ARRAY_SIZE(ldo_vaux56_ab8540_voltages), + .volt_table = ldo_vaux56_ab8540_voltages, }, .load_lp_uA = 20000, /* values for Vaux6Regu register */ @@ -1618,8 +1614,6 @@ static struct ab8500_regulator_info .voltage_bank = 0x04, .voltage_reg = 0x36, .voltage_mask = 0x3f, - .voltages = ldo_vaux56_ab8540_voltages, - .voltages_len = ARRAY_SIZE(ldo_vaux56_ab8540_voltages), }, [AB8540_LDO_INTCORE] = { .desc = { @@ -1732,6 +1726,7 @@ static struct ab8500_regulator_info .id = AB8540_LDO_DMIC, .owner = THIS_MODULE, .n_voltages = ARRAY_SIZE(ldo_vdmic_voltages), + .volt_table = ldo_vdmic_voltages, }, .load_lp_uA = 1000, .update_bank = 0x03, @@ -1741,8 +1736,6 @@ static struct ab8500_regulator_info .voltage_bank = 0x03, .voltage_reg = 0x83, .voltage_mask = 0xc0, - .voltages = ldo_vdmic_voltages, - .voltages_len = ARRAY_SIZE(ldo_vdmic_voltages), }, /*