From patchwork Sun Aug 12 13:31:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniu Rosca X-Patchwork-Id: 10563655 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-2.web.codeaurora.org (Postfix) with ESMTP id 8123A1510 for ; Sun, 12 Aug 2018 13:33:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7101D28784 for ; Sun, 12 Aug 2018 13:33:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63BB4287BF; Sun, 12 Aug 2018 13:33:08 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 E391F28784 for ; Sun, 12 Aug 2018 13:33:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727821AbeHLQLL (ORCPT ); Sun, 12 Aug 2018 12:11:11 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33536 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbeHLQLK (ORCPT ); Sun, 12 Aug 2018 12:11:10 -0400 Received: by mail-wm0-f66.google.com with SMTP id r24-v6so5392838wmh.0 for ; Sun, 12 Aug 2018 06:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A6fFZcCSZcmOfPY1PoJAIoZVIQLb+gUM8EN0XNNt8P0=; b=lh4WkAFM9qYFmmAuwkTWwZiPcUHEwqbp7EbStNsBofKhXfPxPaqWggvwp7GSVYtTAq Cy0xlW4aEg0KaJVPbX99YG8UZAj+EMcEk8uZlmH7/7zvQGuH1oM1PAx5S7SIsxuP1fXA r0Qt7n8qnzJlyn8gsZUeA0gqf+iIaXRFHT3OTvUbNYPCbfeuRN+PTkPWzTGcQWKcBYnc Jwyz8v/X34lFCAgspzM/bB5MpfEwkNFvB+FDgWSvMH5kZ51hwmAuEVFjQ5TCRO5+oZOc ublrg16ITCGr7dhOmZyHPj6qfagRBkXGini7jEWuFfpHnMvp9qBKSzIIPKDI3wnhCmPZ 9Mzg== 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=A6fFZcCSZcmOfPY1PoJAIoZVIQLb+gUM8EN0XNNt8P0=; b=TZDmnRhxovZwqCFTs+2nL8rUpIOjWgLQf1ijBRFQUxTGHkFD6MrQGHZ7Rd6GhdiXxY q5vx/SLfs8woZBgbJbtjkTz+WKSva6B1rMhlwaXFjk4Sx0gBXARC0+3YEHbj0cQ8s49F rxIxqppEByeGRwrT0xJEeTLFsyeMz9mcG0ZwMHRHyhmnVALI5BINpuOcOz/DiO0uDHG2 jueBtXYYT5Q2Qb20nYD939mP9mGqMO9eyfzsvvPByJnVDllCTZ4DcYyhYfzAxZRAfAHm AtPLNUGP4easZKOtgGKs+Baz6ejCWrmoAznFVX988Wi8xioCiu5utDVG0EIn5JVvxMcE nndA== X-Gm-Message-State: AOUpUlHC1HkKqZlwvefEe7XxJaNPhJ/3ec/BZDCSYjLhZ+eXSroSiSIQ nk53zJOgjnIcU4OHSCsBXwQ= X-Google-Smtp-Source: AA+uWPzXQD6hyPkKTigMZUJ5VNDZeGu+4YrKvbp2NCsEvE2Z74wi9Z7QroIDkH1JPSrcSEA6Rym9eg== X-Received: by 2002:a1c:9d02:: with SMTP id g2-v6mr5360499wme.122.1534080784873; Sun, 12 Aug 2018 06:33:04 -0700 (PDT) Received: from localhost.localdomain (ipb218f42f.dynamic.kabel-deutschland.de. [178.24.244.47]) by smtp.gmail.com with ESMTPSA id f6-v6sm14987436wrw.78.2018.08.12.06.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Aug 2018 06:33:04 -0700 (PDT) From: Eugeniu Rosca X-Google-Original-From: Eugeniu Rosca To: Simon Horman , Geert Uytterhoeven , Yoshihiro Shimoda , Sergei Shtylyov , Vladimir Barinov , Niklas Soderlund , Laurent Pinchart , Jacopo Mondi , Magnus Damm , Kieran Bingham , Takeshi Kihara , Ulrich Hecht , Kuninori Morimoto , linux-renesas-soc@vger.kernel.org Cc: Eugeniu Rosca , Eugeniu Rosca Subject: [PATCH v2 3/7] pinctrl: sh-pfc: r8a77965: Add HSCIF0 pins, groups, and functions Date: Sun, 12 Aug 2018 15:31:45 +0200 Message-Id: <20180812133149.7710-3-erosca@de.adit-jv.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180812133149.7710-1-erosca@de.adit-jv.com> References: <20180812133149.7710-1-erosca@de.adit-jv.com> 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 According to R-Car Gen3 HW manual Rev.1.00 Apr 2018, M3-N SoC implements five (0..4) HSCIF channels, similar to H3, M3-W and E3. The story behind this patch is tackling below dmesg warnings, which pop up when booting M3NULCB Kingfisher board: $ dmesg | grep sh-pfc sh-pfc e6060000.pin-controller: r8a77965_pfc support registered sh-pfc e6060000.pin-controller: function 'hscif0' not supported sh-pfc e6060000.pin-controller: invalid function hscif0 in map table sh-pfc e6060000.pin-controller: function 'hscif0' not supported sh-pfc e6060000.pin-controller: invalid function hscif0 in map table To fix them, extract the HSCIF0 part from below v4.15-rc1 commits: - commit 7a362e3488cb ("pinctrl: sh-pfc: r8a7795: Add HSCIF pins, groups, and functions") - commit 0e4e4999aac1 ("pinctrl: sh-pfc: r8a7796: Add HSCIF pins, groups, and functions") Note that `checkpatch --strict` throws several "CHECK: Please use a blank line after function/struct/union/enum declarations", which are ignored for the sake of staying in sync with the aforementioned commits. Signed-off-by: Eugeniu Rosca Reviewed-by: Simon Horman --- Changes in v2: - Newly added. - IMHO mirroring the mentioned H3 and M3-W sh-pfc commits *entirely* is a better option to avoid work fragmentation, but I leave this decision to the maintainer. --- drivers/pinctrl/sh-pfc/pfc-r8a77965.c | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c index d2bbee656381..fe16d194f69b 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c @@ -1758,6 +1758,28 @@ static const unsigned int du_disp_mux[] = { DU_DISP_MARK, }; +/* - HSCIF0 ----------------------------------------------------------------- */ +static const unsigned int hscif0_data_pins[] = { + /* RX, TX */ + RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 14), +}; +static const unsigned int hscif0_data_mux[] = { + HRX0_MARK, HTX0_MARK, +}; +static const unsigned int hscif0_clk_pins[] = { + /* SCK */ + RCAR_GP_PIN(5, 12), +}; +static const unsigned int hscif0_clk_mux[] = { + HSCK0_MARK, +}; +static const unsigned int hscif0_ctrl_pins[] = { + /* RTS, CTS */ + RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 15), +}; +static const unsigned int hscif0_ctrl_mux[] = { + HRTS0_N_MARK, HCTS0_N_MARK, +}; /* - I2C -------------------------------------------------------------------- */ static const unsigned int i2c1_a_pins[] = { /* SDA, SCL */ @@ -3169,6 +3191,9 @@ static const struct sh_pfc_pin_group pinmux_groups[] = { SH_PFC_PIN_GROUP(du_oddf), SH_PFC_PIN_GROUP(du_cde), SH_PFC_PIN_GROUP(du_disp), + SH_PFC_PIN_GROUP(hscif0_data), + SH_PFC_PIN_GROUP(hscif0_clk), + SH_PFC_PIN_GROUP(hscif0_ctrl), SH_PFC_PIN_GROUP(i2c1_a), SH_PFC_PIN_GROUP(i2c1_b), SH_PFC_PIN_GROUP(i2c2_a), @@ -3379,6 +3404,12 @@ static const char * const du_groups[] = { "du_disp", }; +static const char * const hscif0_groups[] = { + "hscif0_data", + "hscif0_clk", + "hscif0_ctrl", +}; + static const char * const i2c1_groups[] = { "i2c1_a", "i2c1_b", @@ -3651,6 +3682,7 @@ static const char * const usb30_groups[] = { static const struct sh_pfc_function pinmux_functions[] = { SH_PFC_FUNCTION(avb), SH_PFC_FUNCTION(du), + SH_PFC_FUNCTION(hscif0), SH_PFC_FUNCTION(i2c1), SH_PFC_FUNCTION(i2c2), SH_PFC_FUNCTION(i2c6),