From patchwork Wed Feb 6 10:53:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14618 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 DD14C2423C for ; Wed, 6 Feb 2013 10:56:06 +0000 (UTC) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by fiordland.canonical.com (Postfix) with ESMTP id 7B54EA18B58 for ; Wed, 6 Feb 2013 10:56:06 +0000 (UTC) Received: by mail-vc0-f169.google.com with SMTP id n10so770728vcn.0 for ; Wed, 06 Feb 2013 02:56:06 -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=RaRV/8LXsxhRuxdPDLNr32PlFIDcLBeOQafPQ+gSnVo=; b=TLcVU0/rxYbVYQpd8LnSIaq5T7+yM9Jkmhl+VYXixH/4Z7cwqYmvFvbw56A9GUHt/P Kpg3UQ20gQgnpiguA/kFCAqhiKIf3w6zWlch71cnun3C/NmpmbF6tlWKQrD4ttzV3YjF 9gUyv0mB+XHM4lBKupJNBQ4NQ0K67HdsMcxJN3IjJwQxiYc+Dgw/5f0zyJhjN/Po3yon 7g9yNZIAQvMFdeuSDtiwDM/eDT4PQI2Gm8NImEnOrAiTDIutoB/T2lhWDidNmdgU3Yah vnitWCgEot66nkueFPiBmqGr3jvP6LuladcCQwgGOFypQQFwbiGvbzyFNloBnoOtzr9T CGIw== X-Received: by 10.220.153.143 with SMTP id k15mr31704930vcw.33.1360148165985; Wed, 06 Feb 2013 02:56:05 -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 zo8csp13011vec; Wed, 6 Feb 2013 02:56:05 -0800 (PST) X-Received: by 10.194.48.74 with SMTP id j10mr48710452wjn.36.1360148115776; Wed, 06 Feb 2013 02:55:15 -0800 (PST) Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by mx.google.com with ESMTPS id dd4si505666wib.93.2013.02.06.02.55.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:15 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.49 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.49; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.49 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-wg0-f49.google.com with SMTP id 15so964897wgd.28 for ; Wed, 06 Feb 2013 02:55:15 -0800 (PST) X-Received: by 10.194.85.234 with SMTP id k10mr48779958wjz.53.1360148109097; Wed, 06 Feb 2013 02:55:09 -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.08 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Feb 2013 02:55:08 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, linus.walleij@linaro.org, Mustapha Ben Zoubeir , Lee Jones Subject: [PATCH 32/49] regulator: ab8500: Delete useless fixed_uV field Date: Wed, 6 Feb 2013 10:53:54 +0000 Message-Id: <1360148051-7560-33-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: ALoCoQlo28tzoxthsOZFXmvCyRytWUylxX1oSKqYAANM8bkf3j30MeNhi1XW9+nRt+R7n8rACh0P 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 */