Received: by 10.223.185.116 with SMTP id b49csp1042695wrg; Fri, 16 Feb 2018 11:20:57 -0800 (PST) X-Google-Smtp-Source: AH8x226OBv0mZU5I60ppkVhw/Vb8s/PVFBGXUTpitZ8Mhq+346g/4nGhF/eS2YZIrRX8oo2zcfi1 X-Received: by 10.98.101.195 with SMTP id z186mr6987544pfb.47.1518808857221; Fri, 16 Feb 2018 11:20:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518808857; cv=none; d=google.com; s=arc-20160816; b=FPiNtbipHT+YgFQT9euF1lBwHj5i9pDGjK3Cz3a0chqQT3+7D4UBpWwe0U69aPuglH m1ziFoFC/g2IQDsvvNTZfoWRtwXeDGTurzo6hTIzLw+yLx4YrVK7m1N5mh7CD53WfyoL RY85uh8px9uz7tVvRs7nHkdXmsuFteriDUaXHutN6+nkOJgH8X1aYR3n6UTD9SlVI6he +P9BnMIsZqnMUR0ePdOEWPenfW+sEx/ITb21h4ekBwH0lN90K4LW/PatRJhsBex3i9SN zJWPHdoF9+n9KIz3HK+ef6gBG9I+ubGCotQ002ztTSnIfdTu0z7IY0VBZuHGdpfMa0GV /CvQ== 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=TgKwumZEZitv06Tv0TTMwUjr8uyUYrjlE8o5HLvyuXw=; b=YpdZMFyltLAv6lG8rUWdlYqo6T+ONBUUP1LwQSHtGQTPBZl+gbKpTybGR5NLgcEa8O ZVTJtYsQaGBdRFV+AZDSlRPLsptpdgGOj+fpfRD71XW2l3euLDl3QS1oePBn87nRfXMZ Dst3FStbPMAqMoPEnZRi6LVfhR/yqHrIPFeODbWw1p1XY/dnfuAwy+bJ2lQMMwe/xJCv AwCLfVyH45DPMd/EReyftjH2W4zO4wEw8cdiefj8FhsgoZXhuqgNnnK+CJcoZnELS85c nDXDa/r84WbcypTWGnfB4B1rzkJm5YZhcUs/b368zd+4pKVhNVgtG6Z8uYKm2TYBFqMT gr+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=J15zbn4v; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si3177717pgv.124.2018.02.16.11.20.42; Fri, 16 Feb 2018 11:20:57 -0800 (PST) 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=J15zbn4v; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161745AbeBPRMW (ORCPT + 99 others); Fri, 16 Feb 2018 12:12:22 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:48224 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161066AbeBPRMU (ORCPT ); Fri, 16 Feb 2018 12:12:20 -0500 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=TgKwumZEZitv06Tv0TTMwUjr8uyUYrjlE8o5HLvyuXw=; b=J15zbn4vswz4 ep7DHR8omME5/aXGvbC7nGRM9jK7lqG2Rc6uFNFbok235srTglr4wUylqE8NZlxIZbzCxyam7nVcs g1J8tMZ1EV7/dGeOZTCTEhji78rcrhsb92W+edn6ERTn3G277b0xlHByYyCxWRxgyuJW6zDHzMb0b RSyXc=; 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 1emjYY-0004uG-DG; Fri, 16 Feb 2018 17:12:18 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1emjYX-00083l-VR; Fri, 16 Feb 2018 17:12:17 +0000 From: Mark Brown To: Linus Walleij Cc: Mark Brown , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Applied "regulator: da9211: Pass descriptors instead of GPIO numbers" to the regulator tree In-Reply-To: <20180212131717.27193-7-linus.walleij@linaro.org> Message-Id: Date: Fri, 16 Feb 2018 17:12:17 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: da9211: Pass descriptors instead of GPIO numbers 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 11da04af0d3b4c24ab057dd17f54dbc854d735de Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 12 Feb 2018 14:17:02 +0100 Subject: [PATCH] regulator: da9211: Pass descriptors instead of GPIO numbers This augments the DA9211 regulator driver to fetch its GPIO descriptors directly from the device tree using the newly exported devm_get_gpiod_from_child(). Signed-off-by: Linus Walleij Signed-off-by: Mark Brown --- drivers/regulator/da9211-regulator.c | 23 +++++++++++------------ include/linux/regulator/da9211.h | 4 +++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/regulator/da9211-regulator.c b/drivers/regulator/da9211-regulator.c index 9b8f47617724..6c122b3df5d0 100644 --- a/drivers/regulator/da9211-regulator.c +++ b/drivers/regulator/da9211-regulator.c @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -25,7 +24,7 @@ #include #include #include -#include +#include #include #include #include "da9211-regulator.h" @@ -294,9 +293,12 @@ static struct da9211_pdata *da9211_parse_regulators_dt( pdata->init_data[n] = da9211_matches[i].init_data; pdata->reg_node[n] = da9211_matches[i].of_node; - pdata->gpio_ren[n] = - of_get_named_gpio(da9211_matches[i].of_node, - "enable-gpios", 0); + pdata->gpiod_ren[n] = devm_gpiod_get_from_of_node(dev, + da9211_matches[i].of_node, + "enable", + 0, + GPIOD_OUT_HIGH, + "da9211-enable"); n++; } @@ -382,13 +384,10 @@ static int da9211_regulator_init(struct da9211 *chip) config.regmap = chip->regmap; config.of_node = chip->pdata->reg_node[i]; - if (gpio_is_valid(chip->pdata->gpio_ren[i])) { - config.ena_gpio = chip->pdata->gpio_ren[i]; - config.ena_gpio_initialized = true; - } else { - config.ena_gpio = -EINVAL; - config.ena_gpio_initialized = false; - } + if (chip->pdata->gpiod_ren[i]) + config.ena_gpiod = chip->pdata->gpiod_ren[i]; + else + config.ena_gpiod = NULL; chip->rdev[i] = devm_regulator_register(chip->dev, &da9211_regulators[i], &config); diff --git a/include/linux/regulator/da9211.h b/include/linux/regulator/da9211.h index f2fd2d3bf58f..d1f2073e4d5f 100644 --- a/include/linux/regulator/da9211.h +++ b/include/linux/regulator/da9211.h @@ -21,6 +21,8 @@ #define DA9211_MAX_REGULATORS 2 +struct gpio_desc; + enum da9211_chip_id { DA9211, DA9212, @@ -39,7 +41,7 @@ struct da9211_pdata { * 2 : 2 phase 2 buck */ int num_buck; - int gpio_ren[DA9211_MAX_REGULATORS]; + struct gpio_desc *gpiod_ren[DA9211_MAX_REGULATORS]; struct device_node *reg_node[DA9211_MAX_REGULATORS]; struct regulator_init_data *init_data[DA9211_MAX_REGULATORS]; }; -- 2.16.1