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: 15516 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 DBBEB23E14 for ; Thu, 21 Mar 2013 16:01:29 +0000 (UTC) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by fiordland.canonical.com (Postfix) with ESMTP id 897DEA197A2 for ; Thu, 21 Mar 2013 16:01:28 +0000 (UTC) Received: by mail-vc0-f181.google.com with SMTP id hv10so2402699vcb.40 for ; Thu, 21 Mar 2013 09:01:28 -0700 (PDT) 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=t8lvKDU8tlBx1iffKF4Qyf7dIG+SUO+h8BUBm33pB44=; b=gZi7lhu7uJmCoyyrxzcbdQZsLvjEAmx7C34Y0Z4VKQJAkTVH/R37WfOTMB+ITnnBV7 DNseQXLFkk/PkKR2Ada/c2mdbJwXi2cSI8T5Bno26rGNw4wtfZCBBnTIZC+jrkXNtGxe 7311+zE5pOPGWVHn75BHdeoIzo+kpXslT0zEsiXmV/PSk5Ys696TOL3P8Eobb+mBNsFi JVsHYnojBTT36xvhSvVKoM2v0Z3u/j5XtuSOEvzMe8kPB95FCRpmPGvX+Zx5jJWh7S3H B5/jGh7ZcAont0UtJRI9h/aNiwbrfJxBUDPD3IfjybKyVmryifSAUDcOfxrd5viVR5Qs Gung== X-Received: by 10.220.150.74 with SMTP id x10mr14193992vcv.68.1363881688086; Thu, 21 Mar 2013 09:01:28 -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.58.233.198 with SMTP id ty6csp66838vec; Thu, 21 Mar 2013 09:01:27 -0700 (PDT) X-Received: by 10.180.74.131 with SMTP id t3mr5872473wiv.23.1363881686473; Thu, 21 Mar 2013 09:01:26 -0700 (PDT) Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]) by mx.google.com with ESMTPS id dq3si1431471wib.59.2013.03.21.09.01.26 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:01:26 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::232 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::232; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::232 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-we0-f178.google.com with SMTP id o45so2400279wer.23 for ; Thu, 21 Mar 2013 09:01:26 -0700 (PDT) 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 Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones 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: ALoCoQlhTemczUxJWKUfCN/fgZHGWc+WcZg8g+n588XeH2gqP+gX4zoVJIUx1Gls2fQTiKfgQS11 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), }, /*