From patchwork Mon Feb 12 13:17:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 128083 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3204391ljc; Mon, 12 Feb 2018 05:21:56 -0800 (PST) X-Google-Smtp-Source: AH8x2269vN7obj2b3yK3AP90psgyT1Vq95yxOhyEOFSwgp2/hvU3l5PpPwRzcLf2YRwQIQxJGImc X-Received: by 2002:a17:902:4601:: with SMTP id o1-v6mr438539pld.210.1518441716761; Mon, 12 Feb 2018 05:21:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518441716; cv=none; d=google.com; s=arc-20160816; b=vJUmIup4p6nvRhPZIpyCwaddowTGLMnTMPG+tnh3Az/p7yexFRo8mhnTmub79w+EIw RhFp8wiVeJR7y1uBKqp1xrZ+9jDnAD7aCCHrPF5Wi27Gm2oCdp0a8ycWp9+Tn971TciX LjLjJ80Kw2MrcAx6DPm4lxapSFjEGldJbo1N5eTiVx9DSQt+nQTMZkkB6OAd1O/yaYvv XlFI/SOJjyqRXkCq1xM04/BpSiRnx+BHY5M9KIizvpKGyson45aHvBr+QyP4vn0ZyzSR fkjCJUKHjIvSxxUU4UphBebzWom+j94elKrho/RC/6q6RVi51dbTSu+zOrfao86OeVSa SxZg== 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 l9si2769133pff.155.2018.02.12.05.21.56; Mon, 12 Feb 2018 05:21:56 -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 S935461AbeBLNVx (ORCPT + 13 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(-) -- 2.14.3 Acked-by: Lee Jones 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 */