Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2946415imm; Thu, 24 May 2018 19:38:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpEdjHEIUed9j/1irnHOtQNcL5OYegckmpBIuiIrsoMRUfaVQgx9dWXyozlEkACjmiepheK X-Received: by 2002:a17:902:758a:: with SMTP id j10-v6mr605884pll.109.1527215938935; Thu, 24 May 2018 19:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527215938; cv=none; d=google.com; s=arc-20160816; b=MIHQDZEg++n2w4TuvYdOiiuQ3HZhARrvCsXfPvdc1B+h7/Pyy5jTn71Yss2VKtCmZN fxsueeixJBADSmhIwyR4La7E2WO1t5VQAarCyTlWbNwritb92UnsV7nFOfGj3uyCL8Hz PfXzeUjD24otxFcWr1EYsRF4bwQQkZZBc8ARGMPP3mVFHKAUOkD0tGLAhjdr2+8FF7om IQyKbw6d3Ud2HEh+N1K43YeCi55CZzPdk9L5CHxG+6VehZyV4+6YWCg2gqgNUA+pQi+d AN9ViLWduPn3xPoTiFGa13QNIcLU1Bo5RjuGfazsMd3IOpUAeoES390nhcHcleoa2Cr3 Irdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=0RcNxSQ0Qu0ODM0TMQxTLP9/VoO8smKddKhT/NY9pJk=; b=IebtVhyny2wLaE82iBdp8hiXePj7wcmWGjlEShKZ+revrwcs9Lugi2VkBYJfEybXB1 Jf6KVAgsEQanANi4eclyuoWJygVrn1NrkP9p5v5hQL7J/8SfV7NsJdpjkQl/y9Gs6EDk /um/RrsbAW605FTSPjYQPxhu8Je3oSIsBVn3rFKT3h2gd632eyRpPunMAa+EzfPN9IOo wyC6sp9qrXZ1tZ5JcGMuoQdDLGyAHx6ouLv3SPwH9HyamxogLpbMgA73IafNR+sZluAd 69pF2OFP2W/Hg3hKKKJOULbikbRRQdbauCMuF8Fe6k2wUIePmZ6E0Bw5qzgj9Xoo6UZF klog== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=WPhMizjJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12-v6si6083380pgt.175.2018.05.24.19.38.44; Thu, 24 May 2018 19:38:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=WPhMizjJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034529AbeEXTOG (ORCPT + 99 others); Thu, 24 May 2018 15:14:06 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:55818 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034517AbeEXTOB (ORCPT ); Thu, 24 May 2018 15:14:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=0RcNxSQ0Qu0ODM0TMQxTLP9/VoO8smKddKhT/NY9pJk=; b=WPhMizjJNNlX sGfvSYokl63F+WJ/8ib+siogAAHFHyU6XI7tek05YXvcPNp0uXnfmuFBh3VsOB6+WCeushg+Kqtah DlBqWNd/h1c/lYXOywSvOqGdTpgrNpiiii93iqnnLjHDKmk+EoyGOwYZRxnAzpr0wbg5R7dZ3fllI Hcn7c=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLvgV-0006Kq-IJ; Thu, 24 May 2018 19:13:59 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fLvgV-0005Bw-1l; Thu, 24 May 2018 20:13:59 +0100 From: Mark Brown To: Linus Walleij Cc: Lee Jones , Mark Brown , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Lee Jones , linux-kernel@vger.kernel.org Subject: Applied "regulator: s5m8767: Pass descriptor instead of GPIO number" to the regulator tree In-Reply-To: <20180212131717.27193-15-linus.walleij@linaro.org> Message-Id: Date: Thu, 24 May 2018 20:13:59 +0100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: s5m8767: Pass descriptor instead of GPIO number has been applied to the regulator tree at https://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 9ae5cc75ceaacf69cc50b9fd4713276c2aa62eb9 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 14 May 2018 10:06:32 +0200 Subject: [PATCH] regulator: s5m8767: Pass descriptor instead of GPIO number Instead of passing a global GPIO number for the enable GPIO, pass a descriptor looked up from the device tree node for the regulator. This regulator supports passing platform data, but enable/sleep regulators are looked up from the device tree exclusively, so we can need not touch other files. Signed-off-by: Linus Walleij Acked-by: Lee Jones Signed-off-by: Mark Brown --- drivers/regulator/s5m8767.c | 26 +++++++++++++++----------- include/linux/mfd/samsung/core.h | 4 +++- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 4836947e1521..b8443a360646 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -459,15 +460,14 @@ static void s5m8767_regulator_config_ext_control(struct s5m8767_info *s5m8767, return; } - if (!gpio_is_valid(rdata->ext_control_gpio)) { + if (!rdata->ext_control_gpiod) { dev_warn(s5m8767->dev, "ext-control for %s: GPIO not valid, ignoring\n", - rdata->reg_node->name); + rdata->reg_node->name); return; } - config->ena_gpio = rdata->ext_control_gpio; - config->ena_gpio_flags = GPIOF_OUT_INIT_HIGH; + config->ena_gpiod = rdata->ext_control_gpiod; } /* @@ -577,8 +577,14 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, continue; } - rdata->ext_control_gpio = of_get_named_gpio(reg_np, - "s5m8767,pmic-ext-control-gpios", 0); + rdata->ext_control_gpiod = devm_gpiod_get_from_of_node(&pdev->dev, + reg_np, + "s5m8767,pmic-ext-control-gpios", + 0, + GPIOD_OUT_HIGH, + "s5m8767"); + if (IS_ERR(rdata->ext_control_gpiod)) + return PTR_ERR(rdata->ext_control_gpiod); rdata->id = i; rdata->initdata = of_get_regulator_init_data( @@ -954,10 +960,8 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) config.driver_data = s5m8767; config.regmap = iodev->regmap_pmic; config.of_node = pdata->regulators[i].reg_node; - config.ena_gpio = -EINVAL; - config.ena_gpio_flags = 0; - config.ena_gpio_initialized = true; - if (gpio_is_valid(pdata->regulators[i].ext_control_gpio)) + config.ena_gpiod = NULL; + if (pdata->regulators[i].ext_control_gpiod) s5m8767_regulator_config_ext_control(s5m8767, &pdata->regulators[i], &config); @@ -970,7 +974,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) return ret; } - if (gpio_is_valid(pdata->regulators[i].ext_control_gpio)) { + if (pdata->regulators[i].ext_control_gpiod) { ret = s5m8767_enable_ext_control(s5m8767, rdev); if (ret < 0) { dev_err(s5m8767->dev, diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 5a23dd4df432..28f4ae76271d 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -39,6 +39,8 @@ #define STEP_12_5_MV 12500 #define STEP_6_25_MV 6250 +struct gpio_desc; + enum sec_device_type { S5M8751X, S5M8763X, @@ -151,7 +153,7 @@ struct sec_regulator_data { int id; struct regulator_init_data *initdata; struct device_node *reg_node; - int ext_control_gpio; + struct gpio_desc *ext_control_gpiod; }; /* -- 2.17.0