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: 15502 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 EC6E023E14 for ; Thu, 21 Mar 2013 16:01:01 +0000 (UTC) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by fiordland.canonical.com (Postfix) with ESMTP id 72901A19E70 for ; Thu, 21 Mar 2013 16:01:01 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id cz11so2558136veb.31 for ; Thu, 21 Mar 2013 09:01:01 -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=p/UoxYpu6R4zAonz92qRg8bUmSSY11JnXH4hw+Zl598=; b=YAnX8fmuQO3Ev1qgIxQCRX6KxCQmgS3od64PZzTyBF9qyZwxwGX8L8Jk9uK6YxwY8o 0+v/wd9nwLoye+ryxQBWSnkecXNXRHX9XTdldxsBqKmmX14yDIS38XW3ZO9XAzC42d0z X/V08/nV9S7P2CH5e00jkkMSOqD5l1JoszqpRzP6YJtejr5CeedeZnhqp3/uYu2CDPSi jUXZq36KB0TOEcbggBb62viD42r0MzRyJrjCfa4glrEWgq4SupNLFKbnuHoFjez2DVTK tm4Wt37c/CMC6jAYnPEYF6rQG96PfoeLU54M/oJXgYLKORTIY3tGWLLf0LZewRlAYBNc 4OeA== X-Received: by 10.220.150.74 with SMTP id x10mr14191174vcv.68.1363881660863; Thu, 21 Mar 2013 09:01:00 -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 ty6csp66804vec; Thu, 21 Mar 2013 09:00:59 -0700 (PDT) X-Received: by 10.180.92.97 with SMTP id cl1mr5890205wib.19.1363881659465; Thu, 21 Mar 2013 09:00:59 -0700 (PDT) Received: from mail-we0-x22c.google.com ([2a00:1450:400c:c03::22c]) by mx.google.com with ESMTPS id eb9si1414518wib.115.2013.03.21.09.00.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 09:00:59 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::22c is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c03::22c; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c03::22c 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-f172.google.com with SMTP id u50so1371530wey.31 for ; Thu, 21 Mar 2013 09:00:59 -0700 (PDT) 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 Cc: arnd@arndb.de, linus.walleij@stericsson.com, Mustapha Ben Zoubeir , Lee Jones 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: ALoCoQl/MemmBag2aIBiti1ddPR5Zg5bcGMGExmb9+8oWsjVWRuLz0j8padIMt/xq/B/pfmrc6Wt 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 */