From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754339AbbG2OOh (ORCPT ); Wed, 29 Jul 2015 10:14:37 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:45312 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753615AbbG2OOe (ORCPT ); Wed, 29 Jul 2015 10:14:34 -0400 From: Mark Brown To: Mikko Perttunen , Mark Brown Cc: linux-kernel@vger.kernel.org In-Reply-To: Message-Id: Date: Wed, 29 Jul 2015 15:14:22 +0100 X-SA-Exim-Connect-IP: 146.198.193.35 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Applied "regulator: max8973: Set VSEL regmap ops if DVS GPIO is not set" 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) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: max8973: Set VSEL regmap ops if DVS GPIO is not set 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 b10c7f3cc948107fb992d3a14eeaa0fdfb5c95da Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Tue, 28 Jul 2015 11:34:11 +0300 Subject: [PATCH] regulator: max8973: Set VSEL regmap ops if DVS GPIO is not set Use regmap helpers for get_voltage_sel and set_voltage_sel ops if the DVS GPIO is not set. The DVS GPIO allows on the fly selection of the VSEL register from two choices. However, if it is not set, the VSEL register will stay fixed and we can use the regmap ops. This allows use of the *hardware_vsel* regulator APIs. Signed-off-by: Mikko Perttunen Signed-off-by: Mark Brown --- drivers/regulator/max8973-regulator.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c index f673659..8857cc0 100644 --- a/drivers/regulator/max8973-regulator.c +++ b/drivers/regulator/max8973-regulator.c @@ -637,6 +637,15 @@ static int max8973_probe(struct i2c_client *client, max->lru_index[i] = i; max->lru_index[0] = max->curr_vout_reg; max->lru_index[max->curr_vout_reg] = 0; + } else { + /* + * If there is no DVS GPIO, the VOUT register + * address is fixed. + */ + max->ops.set_voltage_sel = regulator_set_voltage_sel_regmap; + max->ops.get_voltage_sel = regulator_get_voltage_sel_regmap; + max->desc.vsel_reg = max->curr_vout_reg; + max->desc.vsel_mask = MAX8973_VOUT_MASK; } if (pdata_from_dt) -- 2.1.4