From patchwork Tue Nov 20 15:19:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 10690489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3FE313AD for ; Tue, 20 Nov 2018 15:19:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93B1D2AA22 for ; Tue, 20 Nov 2018 15:19:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8776A2AA2C; Tue, 20 Nov 2018 15:19:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04F542AA22 for ; Tue, 20 Nov 2018 15:19:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727633AbeKUBtB (ORCPT ); Tue, 20 Nov 2018 20:49:01 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:28671 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725977AbeKUBtB (ORCPT ); Tue, 20 Nov 2018 20:49:01 -0500 Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 21 Nov 2018 00:19:21 +0900 Received: from fabrizio-dev.ree.adwin.renesas.com (unknown [10.226.36.190]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 8E62540121CB; Wed, 21 Nov 2018 00:19:19 +0900 (JST) From: Fabrizio Castro To: Linus Walleij , Geert Uytterhoeven , Bartosz Golaszewski Cc: Fabrizio Castro , linux-gpio@vger.kernel.org, Simon Horman , Chris Paterson , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [RFC v3 0/2] Request GPIO when enabling interrupt Date: Tue, 20 Nov 2018 15:19:14 +0000 Message-Id: <1542727156-31432-1-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Dear All, here is a new iteration of the fix for the pinmuxing issue while requesting an interrupt. I don't like this implementation either as: * pinctrl_mux_gpio_request_enable is very similar to pinctrl_gpio_request, and the name I have picked up is not exactly brilliant... * it may cause an error message like "Pin X is busy, can't configure it as GPIO." (for cd-gpios pins for example) as it can't check the status of the pin before requesting it (can it?) * because it's discarding errors returned by pinctrl_mux_gpio_request_enable This problem needs fixing, but the solutions proposed so far don't look great, as they are not spectacularly neat. What's the best way to fix this? Ideas and comments very welcome! Thanks, Fab Fabrizio Castro (2): pinctrl: core: Add pinctrl_mux_gpio_request_enable gpio: rcar: Set pin as a GPIO when configuring an interrupt drivers/gpio/gpio-rcar.c | 3 +++ drivers/pinctrl/core.c | 34 ++++++++++++++++++++++++++++++++++ include/linux/pinctrl/consumer.h | 6 ++++++ 3 files changed, 43 insertions(+)