From patchwork Wed Feb 6 10:54:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14625 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 9E4E92423C for ; Wed, 6 Feb 2013 10:56:15 +0000 (UTC) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by fiordland.canonical.com (Postfix) with ESMTP id 3E2ACA187B7 for ; Wed, 6 Feb 2013 10:56:15 +0000 (UTC) Received: by mail-vb0-f45.google.com with SMTP id p1so736192vbi.18 for ; Wed, 06 Feb 2013 02:56:14 -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=KZhWdoCtreoDKaUkY+WZcD9zor70KKcwWMGRlB3gH+I=; b=jGGT5dE9Jww5sBQyGjQEjtWs0RjlYHgTy7QAp0ciDkpTdUH2lpiZXIg0InBJasFdB5 aDCnvNLgfWMPJVDPjQhK1uwAp5RACQnXYNTvNLz+sASWfx0MKoU4uMaVLqDOZbtYdxEA hFLw+HKMXMMACas638fde3tSjfuFwvZVlUZq4mnNXJmBLJ5Ke8UPW8Trw0tLGZqW5EHJ 4MbCpPFzAOdllwni8LxgR8NHUUmb+M41QsB738A7oGxub4d4/ysKhCJs4iMemLxgovT1 DQzWjM27yFjC674Ph1yWVZ+bE7wB1eB3JyiVlZ409eXMJWPp0dIqP1KCEXHBMG41QVlL iBYQ== X-Received: by 10.52.66.168 with SMTP id g8mr2053662vdt.27.1360148174776; Wed, 06 Feb 2013 02:56:14 -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 zo8csp13023vec; Wed, 6 Feb 2013 02:56:14 -0800 (PST) X-Received: by 10.194.171.198 with SMTP id aw6mr49020871wjc.3.1360148124430; Wed, 06 Feb 2013 02:55:24 -0800 (PST) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id m17si512401wiv.49.2013.02.06.02.55.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:24 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.178 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-f178.google.com with SMTP id o1so1414463wic.17 for ; Wed, 06 Feb 2013 02:55:24 -0800 (PST) X-Received: by 10.180.85.8 with SMTP id d8mr4189020wiz.4.1360148124032; Wed, 06 Feb 2013 02:55: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 be1sm2406649wib.10.2013.02.06.02.55.23 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:23 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, linus.walleij@linaro.org, Lee Jones Subject: [PATCH 48/49] regulator: ab8500: Use regulator_list_voltage_table() to look-up voltages Date: Wed, 6 Feb 2013 10:54:10 +0000 Message-Id: <1360148051-7560-49-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360148051-7560-1-git-send-email-lee.jones@linaro.org> References: <1360148051-7560-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQl/3X1Wo9xSaon1FW+ItpSqBNwaNgaF1D9kZt1ZqOy8uK+q0IAZmIhJhoGSEQg+Bk7j6jN7 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 ee7ce92..3b8ace5 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 = { @@ -1139,8 +1139,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 = { @@ -1222,8 +1220,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), }, }; @@ -1234,7 +1230,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 = { @@ -1477,7 +1473,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 = { @@ -1580,6 +1576,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 */ @@ -1593,8 +1590,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 = { @@ -1604,6 +1599,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 */ @@ -1617,8 +1613,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 = { @@ -1727,6 +1721,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, @@ -1736,8 +1731,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), }, /*