Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1732251ybb; Sat, 11 Apr 2020 10:25:09 -0700 (PDT) X-Google-Smtp-Source: APiQypIwF9bkDak+upvof+5WX1przPNb01BuDKvoCHeB+r/lgd0t1qgmxrkEU3SUY+gRE1v+cSTp X-Received: by 2002:a05:6214:132b:: with SMTP id c11mr9912268qvv.150.1586625909705; Sat, 11 Apr 2020 10:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586625909; cv=none; d=google.com; s=arc-20160816; b=VbRECwz9M4dZq4qk80oFzt+wEEjcqEeeYzugNJKz2qK6UtwqE+auDS7qq/Bcx6Zjj3 yZS55+tIIf1P3Wc0jk+qrAmldg0ucnSTKUZURLQBPtz9rt1GzSwSQZ9Of+NndNGPP5sP YnuOdDUmC508MJtuNzoq1v+0wFYyUgaopqcJqeqoAAS5+ol8FfP4PDHP01iBRmh4PtWy FjjW5FOpuBRn6QLl+Rte2QwH4qIVQYS+ektpS9TkeR++CnGZr+SiwE+QF+A8kMHLMzRp V7HiJYRJWRKqe84tIiT2gatJxsKwEZRWyRUXgIC5JFMqdS/N9xPn3gkjYw8PICRV1iv4 Cc2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:dkim-signature; bh=IENUKdV3r4iMlcVFVIzU9k/XHXmK+JhwttMkKQCFE4c=; b=DA9TB4m/10mLg+s0AkgZYWnK4fUfvIVAQnkZkaPGYXTKF1gC1j61/vtwrlzflkVYpW FB7y00fUKw7EAsfgNxt+lXXGLUpQHIFS6xnpij85yLy6MB/yd7K6w4P574mf1B4oda9A yLd2eQ+FZAKNkZEibHY3kkfRDpVzGdQGsZCjlBu2Umj+CGJGJ09u6dR0ItScndQJuGN/ TsP5kERjwJsIobNZHT2Yp4ZSSv7uGzz+S1d7pUiJn/TkuPF9ocWyoiKe2aIjGE89+Om6 EHcCDWm27A69HgW4cpG+uVKcnqCYewHC7zrRbiTPyq3d3ujPZslWBJGaVb/Ut1443ABW VeEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=VeZo7J5E; 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 a1si1116356qkl.349.2020.04.11.10.24.54; Sat, 11 Apr 2020 10:25:09 -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=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=VeZo7J5E; 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 S1726752AbgDKRX3 (ORCPT + 99 others); Sat, 11 Apr 2020 13:23:29 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43313 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726256AbgDKRX3 (ORCPT ); Sat, 11 Apr 2020 13:23:29 -0400 Received: by mail-wr1-f67.google.com with SMTP id i10so5629036wrv.10 for ; Sat, 11 Apr 2020 10:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=IENUKdV3r4iMlcVFVIzU9k/XHXmK+JhwttMkKQCFE4c=; b=VeZo7J5EpZU6R34YGYLNdxUW+AIN582hRgGwmK78/Rx5n0tVA0Ze6C7DprSSd9p3zT 7GR4+oTJaZO9jDCVu82by5wgBSMk0JlpBOXARKtF16e0uVXbDluZ+mNw7SNMkHE0eUdP FuIVHrUDd2CgpZ9FPyc1PsSG3GyXSpT16oIzei/WL72ItzEcbPRL0QYlP0hRXqIAqVZP aO1zrFfIiTBhX3pAbndCbUQmJPgqJEC+i6cwX6QlhFvWpGYN81M8XxBw/W/EOWWjwtSe gf8Ikkqh9Rw69EmQe/r1zXdVTJmf3PAMHBsRGAI+nlhd7Mb4iSZ+dOSnVXx3buxJX3kj xzgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=IENUKdV3r4iMlcVFVIzU9k/XHXmK+JhwttMkKQCFE4c=; b=RJ/BtifL+wkAXbzTMeSVTmulrZ7RJT3dZku4AWkAoHcRvduLEAupdpgd5pE4h1vplx +8gOFgr1DQhexJHD1OUFc3VOHGrVGKushIwIub8GMPC5wZ+AOstObVL21PF7HN403Tu2 6Mea1BufuBMAVZSStQiSoxAtB6TG63lKOlXrOK2baPUubLqjIXp0B2ecZJvBvLgiGxvR wrR/GpMBy4ZPz4JIl3MuL8dI2m2LQu7dLsZ6a1tyEDjrAejL5T3TZ2vLWLK/lJMU8fcu dOJmu1p+e5CThf4j13d7rRQfDpxgDL00bAzUd8+djuqCsgAE6I38PaF1VOWScSZ0PaSy vu0A== X-Gm-Message-State: AGi0PubmAb4dNilKsehFr8i1eIys0oQZUd9hdycvqjHpnv18U+JnGfCn tkmdE5M8ys2f+KIk8YtcaH+4jQ== X-Received: by 2002:adf:fc92:: with SMTP id g18mr1046596wrr.10.1586625808188; Sat, 11 Apr 2020 10:23:28 -0700 (PDT) Received: from localhost (cag06-3-82-243-161-21.fbx.proxad.net. [82.243.161.21]) by smtp.gmail.com with ESMTPSA id a205sm3621474wmh.29.2020.04.11.10.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Apr 2020 10:23:27 -0700 (PDT) References: <20200411170356.1578031-1-martin.blumenstingl@googlemail.com> <20200411170356.1578031-3-martin.blumenstingl@googlemail.com> User-agent: mu4e 1.3.3; emacs 26.3 From: Jerome Brunet To: Martin Blumenstingl , linus.walleij@linaro.org, linux-gpio@vger.kernel.org, linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC v1 2/2] pinctrl: meson: wire up the gpio_chip's set_config callback In-reply-to: <20200411170356.1578031-3-martin.blumenstingl@googlemail.com> Date: Sat, 11 Apr 2020 19:23:26 +0200 Message-ID: <1jlfn2szqp.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 11 Apr 2020 at 19:03, Martin Blumenstingl wrote: > Use gpiochip_generic_config for the gpio_chip's set_config callback so > GPIO flags like GPIO_PULL_UP or GPIO_PULL_DOWN can be used in the board > .dts descriptions. > This is required for some Meson8m2 boards where GPIO_BSD_EN provides the > "MUTE" signal and requires enabling the internal pull-up resistor. I think your addition makes sense but, FYI, there is another solution to your problem that should already work as it is. If the platform requires a pull-up, you could set the pinconf 'bias-pull-up' property in dt in the pinctrl definition passed to the device using the gpio. There is an example of that in meson-gx-libretech-pc.dtsi with the phy irq pin. > > Signed-off-by: Martin Blumenstingl > --- > drivers/pinctrl/meson/pinctrl-meson.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c > index 291f3078e7c7..079f8ee8d353 100644 > --- a/drivers/pinctrl/meson/pinctrl-meson.c > +++ b/drivers/pinctrl/meson/pinctrl-meson.c > @@ -603,6 +603,7 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc) > pc->chip.parent = pc->dev; > pc->chip.request = gpiochip_generic_request; > pc->chip.free = gpiochip_generic_free; > + pc->chip.set_config = gpiochip_generic_config; > pc->chip.get_direction = meson_gpio_get_direction; > pc->chip.direction_input = meson_gpio_direction_input; > pc->chip.direction_output = meson_gpio_direction_output;