From patchwork Wed Apr 27 16:35:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 615735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-yw0-x238.google.com (mail-yw0-x238.google.com [IPv6:2607:f8b0:4002:c05::238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qw5DK4LFjz9t6g for ; Thu, 28 Apr 2016 02:35:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=wwCvm0yR; dkim-atps=neutral Received: by mail-yw0-x238.google.com with SMTP id k18sf18548752ywe.1 for ; Wed, 27 Apr 2016 09:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:mime-version:from:to:cc:in-reply-to:message-id:date:subject :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=NLQ61OKpVx2yOqrx7NiWtx3+p8PBtpM1NIeKIb6W00A=; b=wwCvm0yR116I+YWu7VwXYUsOvqVVU6D4XmWpfXXtr4scTxY/nVkmYGsOd77OvO4QlJ c1Y28bi82hgUxWgbGCNX7f/ZVFqsuA5eG9zgjX0v6MS4WTjW59PpN8ROqla4JF7FixHK Jb3DueWvmU1T8EYknnyPn8CWtc800ugJX/m71OsF0ESAzQdyob2Hg+RTcO8HQ7rwz+jc LKyrwKBxOtldUZEpfVqHYgZ8UiV33bOor/yhIjmYPILSu3eaiHSzs52+xBxr+cmsmBTq cZ7O5D2kE11rpc2UY+Kfx8HqOvot8lHyQx12gciDwgTYgs9lytSIdvk8WaWzNI0Y+s3P tUng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:mime-version:from:to:cc:in-reply-to :message-id:date:subject:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=NLQ61OKpVx2yOqrx7NiWtx3+p8PBtpM1NIeKIb6W00A=; b=Q7Jb6WfUKu9RNm6MYFfEKqjtUPTrcZd/kSwhfrMO9k0U44s4jxqJdMbq6P8Sv/P2M5 OcEglConp+tX9Sam0Skwe1F4I5JE0DnqSu6DOgvmB+5m1J4Az9OCpbh1oVDAn2V07YQX u9KMzjAMCXmBSRL9YSm4l3yghWMIvoyiVUzVZULFMc/hgM+Y5QYpvyPXaeOJ26kjofaV AKhgPc2XH1+iXU8GAPbvpNQwkL9M8EQnBSyQjbYVPKsJtw+qMWQ5wtvnciAA7s8Ak/oq Oi1AF2bFN3dU8fwOTI71A8TUugn/jMTvRm1vdhVi64MYpmDSOd3pcqoe2/w67JVpAWSM 2H7g== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AOPr4FWITUs1tUyOGMgDbjWJAM9QJJbpcW0g0w9biy+huc3UEDrV7458mVYD0JWECgD4oQ== X-Received: by 10.50.98.70 with SMTP id eg6mr530537igb.4.1461774926350; Wed, 27 Apr 2016 09:35:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.107.18.198 with SMTP id 67ls258662ios.76.gmail; Wed, 27 Apr 2016 09:35:25 -0700 (PDT) X-Received: by 10.107.170.102 with SMTP id t99mr6810661ioe.9.1461774925971; Wed, 27 Apr 2016 09:35:25 -0700 (PDT) Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk. [2400:8900::f03c:91ff:fedb:4f4]) by gmr-mx.google.com with ESMTPS id y20si761838pfa.2.2016.04.27.09.35.25 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 27 Apr 2016 09:35:25 -0700 (PDT) Received-SPF: pass (google.com: domain of broonie@sirena.org.uk designates 2400:8900::f03c:91ff:fedb:4f4 as permitted sender) client-ip=2400:8900::f03c:91ff:fedb:4f4; Received: from debutante.sirena.org.uk ([2a01:348:6:8808:fab::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1avSQl-0005t3-Is; Wed, 27 Apr 2016 16:35:17 +0000 Received: from broonie by debutante with local (Exim 4.87) (envelope-from ) id 1avSQi-0004XP-Kn; Wed, 27 Apr 2016 17:35:12 +0100 From: Mark Brown To: Wadim Egorov Cc: Mark Brown , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, rtc-linux@googlegroups.com, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, lee.jones@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, mturquette@baylibre.com, sboyd@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org, a.zummo@towertech.it, alexandre.belloni@free-electrons.com, dianders@chromium.org, zyw@rock-chips.com In-Reply-To: <1461682450-22173-2-git-send-email-w.egorov@phytec.de> Message-Id: Date: Wed, 27 Apr 2016 17:35:12 +0100 X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mezzanine.sirena.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 Subject: [rtc-linux] Applied "regulator: rk808: Add rk808_reg_ops_ranges for LDO3" to the regulator tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) X-Original-Sender: broonie@kernel.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of broonie@sirena.org.uk designates 2400:8900::f03c:91ff:fedb:4f4 as permitted sender) smtp.mailfrom=broonie@sirena.org.uk Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , The patch regulator: rk808: Add rk808_reg_ops_ranges for LDO3 has been applied to the regulator tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 129d7cf98f5c739014ae5aa0311e48f6a64b0758 Mon Sep 17 00:00:00 2001 From: Wadim Egorov Date: Tue, 26 Apr 2016 16:54:04 +0200 Subject: [PATCH] regulator: rk808: Add rk808_reg_ops_ranges for LDO3 LDO_REG3 descriptor is using linear_ranges. Add and use proper ops for LDO_REG3. Signed-off-by: Wadim Egorov Signed-off-by: Mark Brown --- drivers/regulator/rk808-regulator.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index 67f72feed815..6601ab5fcc2d 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -238,6 +238,21 @@ static int rk808_set_suspend_voltage(struct regulator_dev *rdev, int uv) sel); } +static int rk808_set_suspend_voltage_range(struct regulator_dev *rdev, int uv) +{ + unsigned int reg; + int sel = regulator_map_voltage_linear_range(rdev, uv, uv); + + if (sel < 0) + return -EINVAL; + + reg = rdev->desc->vsel_reg + RK808_SLP_REG_OFFSET; + + return regmap_update_bits(rdev->regmap, reg, + rdev->desc->vsel_mask, + sel); +} + static int rk808_set_suspend_enable(struct regulator_dev *rdev) { unsigned int reg; @@ -288,6 +303,19 @@ static struct regulator_ops rk808_reg_ops = { .set_suspend_disable = rk808_set_suspend_disable, }; +static struct regulator_ops rk808_reg_ops_ranges = { + .list_voltage = regulator_list_voltage_linear_range, + .map_voltage = regulator_map_voltage_linear_range, + .get_voltage_sel = regulator_get_voltage_sel_regmap, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, + .set_suspend_voltage = rk808_set_suspend_voltage_range, + .set_suspend_enable = rk808_set_suspend_enable, + .set_suspend_disable = rk808_set_suspend_disable, +}; + static struct regulator_ops rk808_switch_ops = { .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -383,7 +411,7 @@ static const struct regulator_desc rk808_reg[] = { .name = "LDO_REG3", .supply_name = "vcc7", .id = RK808_ID_LDO3, - .ops = &rk808_reg_ops, + .ops = &rk808_reg_ops_ranges, .type = REGULATOR_VOLTAGE, .n_voltages = 16, .linear_ranges = rk808_ldo3_voltage_ranges,