From patchwork Mon Feb 4 11:54:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14495 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 3F6C723F96 for ; Mon, 4 Feb 2013 11:57:19 +0000 (UTC) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by fiordland.canonical.com (Postfix) with ESMTP id D4443A19236 for ; Mon, 4 Feb 2013 11:57:18 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fr13so473700vbb.3 for ; Mon, 04 Feb 2013 03:57:18 -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=j0dF82FbU5mP6FUVp8q1GyKSKN2nhhnJbBSuKCHlNQNsR9R/sTmV7R57TVcwcSLCCT OnGV0h3+sdogzbKD5dbvFj81oHzzDkEokZMpdIx9OOog7J/tfAAoF6AEtkU+LK4ntoPd /m6iN+8GmvMVCov5Rn0r8tFdDTKwQhhcmzu36UPbuMd5EvP/WkjRB6MYo/3RVm4lUCFp s8h9n8RSk2NytI91+PgUvsFaHMaFXwyOGdXi59Ktp0TiNMXKKelW/rs/0RaNekNEKQAJ fZH02MgoKc3Rd1IgSxAtcf8RA8RlwUBV7juKAknho9Ncqv9ycDWNeQXCKSbXEDzVD+OX o2nA== X-Received: by 10.52.21.146 with SMTP id v18mr18931945vde.79.1359979038370; Mon, 04 Feb 2013 03:57:18 -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 zo8csp83097vec; Mon, 4 Feb 2013 03:57:17 -0800 (PST) X-Received: by 10.194.76.237 with SMTP id n13mr34792335wjw.57.1359979037108; Mon, 04 Feb 2013 03:57:17 -0800 (PST) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by mx.google.com with ESMTPS id y7si3474499wix.34.2013.02.04.03.57.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:57:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.176 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.176; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.176 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-f176.google.com with SMTP id hm14so2765410wib.9 for ; Mon, 04 Feb 2013 03:57:16 -0800 (PST) X-Received: by 10.194.172.228 with SMTP id bf4mr34745402wjc.38.1359979036673; Mon, 04 Feb 2013 03:57:16 -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 j9sm12937128wia.5.2013.02.04.03.57.15 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:57:15 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: Mustapha Ben Zoubeir , Lee Jones Subject: [PATCH 46/73] regulator: ab8500: Delete useless fixed_uV field Date: Mon, 4 Feb 2013 11:54:01 +0000 Message-Id: <1359978868-28736-47-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> References: <1359978868-28736-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQm/4CRDJw50A/3ZCZiZ4o0q5J1gDSG7ogNgcMnvvV6GCtq9Cl4fFOArNDq1UZFEJw2ovIFG 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 */