From patchwork Thu Mar 21 15:59:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 2314981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id DD2EC400E6 for ; Thu, 21 Mar 2013 16:28:17 +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 1UIiI9-0005wh-JF; Thu, 21 Mar 2013 16:24:37 +0000 Received: from mail-wg0-f48.google.com ([74.125.82.48]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UIhvL-0001Lo-S2 for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2013 16:01:15 +0000 Received: by mail-wg0-f48.google.com with SMTP id 16so604819wgi.3 for ; Thu, 21 Mar 2013 09:00:59 -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=p/UoxYpu6R4zAonz92qRg8bUmSSY11JnXH4hw+Zl598=; b=UNKz3zL5p0pD8BSbhc9rFsJCPwypp365uRYAjIExAuT2OdpZmQt9Zn4NcC1CJumXT4 XmxDtnBLXhxZ2gnTplJGr5rMeFTWz8xwXMTfgVgLX/wO1QALqqnNjGKHixQlPUZaqP3H XtYbVdkyGcM9NgJaZ5saluJDtnBUCan2tZfJFwYZGU6MzrNo+ulWGaYugSydWM9P+05g aZBG2t5WCHecFIXjbtH6VGjA1oE8PH2FuV5KRZwHQh5Qb7gh9/htK98hR0xnIRu58jYR L6UcK//iFWxLO+MBO+wF1ZxHtXSD82hR6tyzVpOvjS688CDCulGYTXAizNYjYhtpqti7 CYaw== X-Received: by 10.194.121.6 with SMTP id lg6mr18250301wjb.22.1363881658870; Thu, 21 Mar 2013 09:00:58 -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.00.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:00:57 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Subject: [PATCH 28/46] regulator: ab8500: Delete useless fixed_uV field Date: Thu, 21 Mar 2013 15:59:25 +0000 Message-Id: <1363881583-15234-29-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: ALoCoQk2rEhf4ZkfRZIjv4Hy6BAO7ELn0jOZcYv/BysQoR+jRtW5GFbGrVN6VaiIMzNmpi0PRHFo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130321_120107_518332_0B9243F5 X-CRM114-Status: GOOD ( 14.49 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.48 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Mustapha Ben Zoubeir , 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 From: Mustapha Ben Zoubeir The fixed_uV property residing in ab8500_ext_regulator_info is currently unused. We remove it here. Signed-off-by: Mustapha Ben Zoubeir Signed-off-by: Lee Jones Reviewed-by: Daniel WILLERUD Reviewed-by: Mattias WALLIN Tested-by: Philippe LANGLAIS --- drivers/regulator/ab8500-ext.c | 45 ++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index e5e6453..f75d4f7 100644 --- a/drivers/regulator/ab8500-ext.c +++ b/drivers/regulator/ab8500-ext.c @@ -30,7 +30,6 @@ * @rdev: regulator device * @cfg: regulator configuration (extension of regulator FW configuration) * @is_enabled: status of regulator (on/off) - * @fixed_uV: typical voltage (for fixed voltage supplies) * @update_bank: bank to control on/off * @update_reg: register to control on/off * @update_mask: mask to enable/disable and set mode of regulator @@ -48,7 +47,6 @@ struct ab8500_ext_regulator_info { struct regulator_dev *rdev; struct ab8500_ext_regulator_cfg *cfg; bool is_enabled; - int fixed_uV; u8 update_bank; u8 update_reg; u8 update_mask; @@ -259,30 +257,33 @@ static unsigned int ab8500_ext_regulator_get_mode(struct regulator_dev *rdev) static int ab8500_ext_fixed_get_voltage(struct regulator_dev *rdev) { - struct ab8500_ext_regulator_info *info = rdev_get_drvdata(rdev); + struct regulation_constraints *regu_constraints = rdev->constraints; - if (info == NULL) { - dev_err(rdev_get_dev(rdev), "regulator info null pointer\n"); + if (regu_constraints == NULL) { + dev_err(rdev_get_dev(rdev), "regulator constraints null pointer\n"); return -EINVAL; } - - return info->fixed_uV; + if (regu_constraints->min_uV && regu_constraints->max_uV) { + if (regu_constraints->min_uV == regu_constraints->max_uV) + return regu_constraints->min_uV; + } + return -EINVAL; } static int ab8500_ext_list_voltage(struct regulator_dev *rdev, unsigned selector) { - struct ab8500_ext_regulator_info *info = rdev_get_drvdata(rdev); + struct regulation_constraints *regu_constraints = rdev->constraints; - if (info == NULL) { - dev_err(rdev_get_dev(rdev), "regulator info null pointer\n"); + if (regu_constraints == NULL) { + dev_err(rdev_get_dev(rdev), "regulator constraints null pointer\n"); return -EINVAL; } - /* return the uV for the fixed regulators */ - if (info->fixed_uV) - return info->fixed_uV; - + if (regu_constraints->min_uV && regu_constraints->max_uV) { + if (regu_constraints->min_uV == regu_constraints->max_uV) + return regu_constraints->min_uV; + } return -EINVAL; } @@ -319,7 +320,6 @@ static struct ab8500_ext_regulator_info .owner = THIS_MODULE, .n_voltages = 1, }, - .fixed_uV = 1800000, .update_bank = 0x04, .update_reg = 0x08, .update_mask = 0x03, @@ -337,7 +337,6 @@ static struct ab8500_ext_regulator_info .owner = THIS_MODULE, .n_voltages = 1, }, - .fixed_uV = 1360000, .update_bank = 0x04, .update_reg = 0x08, .update_mask = 0x0c, @@ -355,7 +354,6 @@ static struct ab8500_ext_regulator_info .owner = THIS_MODULE, .n_voltages = 1, }, - .fixed_uV = 3400000, .update_bank = 0x04, .update_reg = 0x08, .update_mask = 0x30, @@ -417,17 +415,14 @@ int ab8500_ext_regulator_init(struct platform_device *pdev) pdata->ext_regulator[i].driver_data; if (is_ab9540(ab8500)) { - if (info->desc.id == AB8500_EXT_SUPPLY1) { + if (info->desc.id == AB8500_EXT_SUPPLY1) info->desc.ops = &ab9540_ext_regulator_ops; - info->fixed_uV = 4500000; - } - if (info->desc.id == AB8500_EXT_SUPPLY2) - info->desc.ops = &ab9540_ext_regulator_ops; - - if (info->desc.id == AB8500_EXT_SUPPLY3) { + if (info->desc.id == AB8500_EXT_SUPPLY2) { info->desc.ops = &ab9540_ext_regulator_ops; - info->fixed_uV = 3300000; + info->desc.n_voltages = 0; } + if (info->desc.id == AB8500_EXT_SUPPLY3) + info->desc.ops = &ab9540_ext_regulator_ops; } /* register regulator with framework */