From patchwork Mon Jan 16 12:12:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 9518555 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B148360209 for ; Mon, 16 Jan 2017 12:13:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9692A28343 for ; Mon, 16 Jan 2017 12:13:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A7E028388; Mon, 16 Jan 2017 12:13:09 +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=-5.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, URIBL_RHS_DOB 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 3F28228342 for ; Mon, 16 Jan 2017 12:13:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751243AbdAPMNI (ORCPT ); Mon, 16 Jan 2017 07:13:08 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:51584 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbdAPMNI (ORCPT ); Mon, 16 Jan 2017 07:13:08 -0500 Received: from w540.lan (unknown [IPv6:2001:b07:6442:1ac4:38b5:50c7:502d:c070]) (Authenticated sender: jacopo@jmondi.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 851771720BE; Mon, 16 Jan 2017 13:13:05 +0100 (CET) From: Jacopo Mondi To: magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, geert+renesas@glider.be, chris.brandt@renesas.com, linus.walleij@linaro.org Cc: linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH v3 2/8] pinctrl: sh-pfc: r7s72100: Configure I/O mode Date: Mon, 16 Jan 2017 13:12:46 +0100 Message-Id: <1484568772-18137-3-git-send-email-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484568772-18137-1-git-send-email-jacopo+renesas@jmondi.org> References: <1484568772-18137-1-git-send-email-jacopo+renesas@jmondi.org> 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 When selecting an alternate function for one pin, set the PIPCn.PIPCnm bit to 1 to enable direct IO mode control (the alternate function drives the pin direction) and disable input buffer and bidirection control functionalities (PIBCn.PIBCnm = 0 and PBDCn.PDBCnm = 0). Enable input buffer and bidirection control for port mode configuration. Signed-off-by: Jacopo Mondi --- drivers/pinctrl/sh-pfc/pfc-r7s72100.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/sh-pfc/pfc-r7s72100.c b/drivers/pinctrl/sh-pfc/pfc-r7s72100.c index 72e1dff..1923a11 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r7s72100.c +++ b/drivers/pinctrl/sh-pfc/pfc-r7s72100.c @@ -54,13 +54,16 @@ enum { #define _P_GPIO(bank, _pin, _name, sfx, cfg) \ _GP_GPIO(16, bank, _pin, _name, sfx, cfg) -#define _P_DATA(bank, pin, name, sfx, cfg) \ - PINMUX_DATA(name##_DATA, name##_PMC_0, \ - name##_PIBC_1, name##_PBDC_1) +#define _P_DATA(bank, pin, n, sfx, cfg) \ + PINMUX_DATA(n##_DATA, n##_PMC_0, \ + n##_PIPC_0, n##_PIBC_1, n##_PBDC_1) -#define _P_FN(n, fn, pfcae, pfce, pfc) \ +#define _P_FN(n, fn, pfcae, pfce, pfc) \ PINMUX_DATA(n##_MARK_FN##fn, n##_PMC_1, \ - n##_PFCAE_##pfcae, n##_PFCE_##pfce, n##_PFC_##pfc) + n##_PFCAE_##pfcae, \ + n##_PFCE_##pfce, \ + n##_PFC_##pfc, \ + n##_PIPC_1, n##_PIBC_0, n##_PBDC_0) #define _P_MARK_FN1(bank, pin, name, sfx, cfg) _P_FN(name, 1, 0, 0, 0) #define _P_MARK_FN2(bank, pin, name, sfx, cfg) _P_FN(name, 2, 0, 0, 1)