From patchwork Mon Jul 10 18:42:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9833647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0610360350 for ; Mon, 10 Jul 2017 18:43:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE8FB2850D for ; Mon, 10 Jul 2017 18:43:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2FD928600; Mon, 10 Jul 2017 18:43:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68C5D2850D for ; Mon, 10 Jul 2017 18:43:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752509AbdGJSnS (ORCPT ); Mon, 10 Jul 2017 14:43:18 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:33880 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753245AbdGJSmg (ORCPT ); Mon, 10 Jul 2017 14:42:36 -0400 Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dUddc-0002K9-RO; Mon, 10 Jul 2017 18:42:31 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dUdda-0000JE-Ah; Mon, 10 Jul 2017 19:42:26 +0100 From: Mark Brown To: Sebastian Reichel Cc: Tony Lindgren , Mark Brown , Sebastian Reichel , Liam Girdwood , Mark Brown , Tony Lindgren , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20170710143341.25543-3-sebastian.reichel@collabora.co.uk> Message-Id: Date: Mon, 10 Jul 2017 19:42:26 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Applied "regulator: cpcap: Add OF mode mapping" to the regulator tree X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch regulator: cpcap: Add OF mode mapping 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 8c02843cb0f9f2c8857d9228ec56ce931e957f62 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Mon, 10 Jul 2017 16:33:40 +0200 Subject: [PATCH] regulator: cpcap: Add OF mode mapping Add device tree mode mapping capabilities to the cpcap driver. Acked-by: Tony Lindgren Signed-off-by: Sebastian Reichel Signed-off-by: Mark Brown --- drivers/regulator/cpcap-regulator.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/regulator/cpcap-regulator.c b/drivers/regulator/cpcap-regulator.c index ce1cab320f6f..f541b80f1b54 100644 --- a/drivers/regulator/cpcap-regulator.c +++ b/drivers/regulator/cpcap-regulator.c @@ -123,6 +123,7 @@ struct cpcap_regulator { .enable_val = (mode_val), \ .disable_val = (off_val), \ .ramp_delay = (volt_trans_time), \ + .of_map_mode = cpcap_map_mode, \ }, \ .assign_reg = (assignment_reg), \ .assign_mask = (assignment_mask), \ @@ -213,6 +214,18 @@ static int cpcap_regulator_disable(struct regulator_dev *rdev) return error; } +static unsigned int cpcap_map_mode(unsigned int mode) +{ + switch (mode) { + case CPCAP_BIT_AUDIO_NORMAL_MODE: + return REGULATOR_MODE_NORMAL; + case CPCAP_BIT_AUDIO_LOW_PWR: + return REGULATOR_MODE_STANDBY; + default: + return -EINVAL; + } +} + static unsigned int cpcap_regulator_get_mode(struct regulator_dev *rdev) { int value;