Received: by 10.223.185.116 with SMTP id b49csp2240899wrg; Mon, 12 Feb 2018 06:43:04 -0800 (PST) X-Google-Smtp-Source: AH8x227hFZQLXMud0sTxQh0TCRv62aJ0xY2YMjsDZ5o0GhB2NskmUzg3IQ5wB6byxUZgAlE/nggX X-Received: by 10.98.233.21 with SMTP id j21mr3461997pfh.123.1518446584763; Mon, 12 Feb 2018 06:43:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518446584; cv=none; d=google.com; s=arc-20160816; b=QsbzlZYQi57JeASZtMD/Z/uJpGq2PUmIf7lmn/KleU/QftPeO6uLVUY4aFec/IuRic bdvSrNUbcqHVF6bAMGapKIAnoBDaIIM7YMOs5frr71bsEdioLrC5LMBxvOfFTcppNh15 4gq37+bL0LMYmi9o7nOW7FYr6jG5vGf+CHVaIQi4Kfe5My8BvWr0gzrA1T8iP+kDp7aj Kjyu1RXeAfO6EiWlE9Okf7c3SyPBsZCe3DzOUkbuF7sFZ3AsbzvqBYCeMeDdfG4ZL2TS YTp9HFNbZWd+if3E3OUn43E5p4IHPSd1nawVjnhY3LITEaenZXk2j3irIsZsdnRV1SwY rMBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=yqdPznfAAMYDe469YxnJeMdLfr4FVNjY0fMYez2bl2E=; b=Aja5y3sRLqmElEV81OSHUEjCMnQ2JzV9oZByKEmmFrXcZ/gSP0hsYwpEBTZakEHAjx ZbOEJ5VS8cCyHpJYag3ylyQACjOmP8CXzLpQOVrotwMBVT1xDEoFPCaxiSjB+repVXqs CqXcNkL/5jEc9ediCwMbSJNo3Y95z2mU+V/g287CPDMime8MPIK1HCmqYGlpLjLqhDD+ FtCq2WyGo8g3ARGqSADO+pk9ULZV4HmvhPR/WXOI8yMbbgHAroWhTUcCsmq3Qb/CxVVk F6dX1OZzMEXfOHYMZQnI8BCZMvSFjftnYkkdTrx5x30OVai4mXIF5KJvoQeFlEzrmr4d sPBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GfDgZ/EX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s71si1787216pgc.17.2018.02.12.06.42.48; Mon, 12 Feb 2018 06:43:04 -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=pass header.i=@linaro.org header.s=google header.b=GfDgZ/EX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935458AbeBLNVx (ORCPT + 99 others); Mon, 12 Feb 2018 08:21:53 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34769 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935210AbeBLNRk (ORCPT ); Mon, 12 Feb 2018 08:17:40 -0500 Received: by mail-lf0-f67.google.com with SMTP id k19so20399701lfj.1 for ; Mon, 12 Feb 2018 05:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yqdPznfAAMYDe469YxnJeMdLfr4FVNjY0fMYez2bl2E=; b=GfDgZ/EXSjUWqAu0zeba8e8kJllXImgdPxKnOGHsuB4bEqZp9VAmbKE7kxQYy493V4 xvgppT9h3nYkRUpXEIOZYaUrr9as0hjYmiQsMvnWeB5gxhxJxM897+bvLzxXmTk+xlVD fZNB5m7Bhh+Isx6RF8DlvNTqhJWChsHgmQL8E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yqdPznfAAMYDe469YxnJeMdLfr4FVNjY0fMYez2bl2E=; b=oa3RixmTRYH0dEyXnsgeprcTQKUcnVQk4BFgZNbSEwUpx9lWzfAcheNPfJY1QyYRdH 2qdB8VzucS9xkDA1VkmyId7u0h+oUEsx945fIAwm9YF7wB23wczTTSaZ/LGpZNivOLgV BSDg1KHhSpLSJql0U8VSts9cytth+iFYbMtWNI5RZRKvyHLt1qtd3/HdvAEc1W8Lo658 p7p8T097mMo+hiPCksi8bjNje+kBBdTPRIjMR1hF/9A/P7BsS6SMN/uM1A4qNKyM8wYY mrS+9+MUjTFCCRFcxKtDttrz11K0MFF8dZuhzfLYMl931kUS/7RezbaYrRIkL6JVz6GL xZHA== X-Gm-Message-State: APf1xPAOlVTZOu9CH7qlpNgeEmizKG8pmmjWqu5tcctUUCTOxglNbUU7 7il7DzGFhcxhZOov2Emt/L5sXw== X-Received: by 10.46.9.22 with SMTP id 22mr7582525ljj.124.1518441459178; Mon, 12 Feb 2018 05:17:39 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id r88sm1584648lje.30.2018.02.12.05.17.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 05:17:38 -0800 (PST) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Linus Walleij , Lee Jones Subject: [PATCH 04/21] regulator: da9055: Pass descriptor instead of GPIO number Date: Mon, 12 Feb 2018 14:17:00 +0100 Message-Id: <20180212131717.27193-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180212131717.27193-1-linus.walleij@linaro.org> References: <20180212131717.27193-1-linus.walleij@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When setting up a fixed regulator on the DA9055, pass a descriptor instead of a global GPIO number. This facility is not used in the kernel so we can easily just say that this should be a descriptor if/when put to use. Cc: Lee Jones Signed-off-by: Linus Walleij --- Lee: would be nice if you could ACK this smallish patch to the MFD header. --- drivers/regulator/da9055-regulator.c | 4 ++-- include/linux/mfd/da9055/pdata.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c index d029c941a1e1..f40c3b8644ae 100644 --- a/drivers/regulator/da9055-regulator.c +++ b/drivers/regulator/da9055-regulator.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -455,8 +456,7 @@ static int da9055_gpio_init(struct da9055_regulator *regulator, char name[18]; int gpio_mux = pdata->gpio_ren[id]; - config->ena_gpio = pdata->ena_gpio[id]; - config->ena_gpio_flags = GPIOF_OUT_INIT_HIGH; + config->ena_gpiod = pdata->ena_gpiods[id]; config->ena_gpio_invert = 1; /* diff --git a/include/linux/mfd/da9055/pdata.h b/include/linux/mfd/da9055/pdata.h index 04e092be4b07..1a94fa2ac309 100644 --- a/include/linux/mfd/da9055/pdata.h +++ b/include/linux/mfd/da9055/pdata.h @@ -12,6 +12,7 @@ #define DA9055_MAX_REGULATORS 8 struct da9055; +struct gpio_desc; enum gpio_select { NO_GPIO = 0, @@ -47,7 +48,7 @@ struct da9055_pdata { * controls the regulator set A/B, 0 if not available. */ enum gpio_select *reg_rsel; - /* GPIOs to enable regulator, 0 if not available */ - int *ena_gpio; + /* GPIO descriptors to enable regulator, NULL if not available */ + struct gpio_desc **ena_gpiods; }; #endif /* __DA9055_PDATA_H */ -- 2.14.3