From patchwork Fri Nov 17 10:41:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 10062607 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 0A9B960352 for ; Fri, 17 Nov 2017 10:41:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07D7B2A6D0 for ; Fri, 17 Nov 2017 10:41:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0E002A7A0; Fri, 17 Nov 2017 10:41:44 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 9AA722A6D0 for ; Fri, 17 Nov 2017 10:41:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751257AbdKQKlo (ORCPT ); Fri, 17 Nov 2017 05:41:44 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38199 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751079AbdKQKll (ORCPT ); Fri, 17 Nov 2017 05:41:41 -0500 Received: by mail-wm0-f68.google.com with SMTP id z3so5513380wme.3; Fri, 17 Nov 2017 02:41:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=GxyQT8NuV7HU1FpkJaw93Wb8nOKIhKxDOrGcpSyAeNU=; b=iCr/EBmmQQf3mpDBOtefJqBwLs9zJiTSL02JXJqFgHhRQPecLzycD4Elhbyg12Dn5I QW9TnoSN0Ja3ue6HL+3fGmV9x25+thj9tNyjAxuwshU+yy1nFnBkfHMYvuDLHScnQddA VMCrzJQtBnOZohVDJhahdJDdOQ5WWLOm2wOxNYZz2IrTS+2GSpop9jrPOvrt8HiyWMsc EQTVNUMgXSCXeVZYy527h0+hnfFvRNocu3jst/ShQPXxmHiTfUZNGaK1Xunm3GvUdamy l/mz7hskD8tApJ3wsGFhxO3/8HyLyWqgkc+yC2Yaeo5D9W065UwZ/AUrhMfAnAUUP7xK p07A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=GxyQT8NuV7HU1FpkJaw93Wb8nOKIhKxDOrGcpSyAeNU=; b=Zzj2w8rAzYv4tsIrCARbRY890eILnS9JwBcHfenNLqms5M5xRQU8JBbnYpAvxSZoMw gdMwWQpER+F671CgkYBQHPlkLYDezqTh8aYnFPBMClf8niKoag/Sb6G7EF0Fg0mDE0J5 JHiBezzcsWLGMCm1GQg/pkhv8YUrLqK/az3AV5fukzrAavQqQU/NTq49Qqq4nlzQOwqe nj7wmUu1jpR4W3kN4bgQHyQ1Vnkfo8/m2YTPc+QgZ+gm5cMHO2jno+B3UHnUzmfvbp9l Jkejg9vmv0AT+OgL5KfC3014kK5hVN7KDgznxG3MWwiII63XQ3FnB0PhVLwzTJ+Dkh0t h+zg== X-Gm-Message-State: AJaThX60rBSQ6l4+9HKnCg7VnQQr86yuTMuMkZV3NkbVI8y3eXt9nyle BJuBDavEOw8OoM8nsMw+0gx8btU= X-Google-Smtp-Source: AGs4zMY24MNWYEYO6chyJ8jFfQNnlb7IYsGoU9hFOvgTYJjZuSmxSWKc3TTqQp4qrPdIw+vyRF5CGw== X-Received: by 10.28.111.218 with SMTP id c87mr3645298wmi.91.1510915299670; Fri, 17 Nov 2017 02:41:39 -0800 (PST) Received: from groucho.site (ipbcc0ce42.dynamic.kabel-deutschland.de. [188.192.206.66]) by smtp.gmail.com with ESMTPSA id u33sm2570098wrf.42.2017.11.17.02.41.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 02:41:39 -0800 (PST) From: Ulrich Hecht To: linux-renesas-soc@vger.kernel.org Cc: linux-can@vger.kernel.org, devicetree@vger.kernel.org, wsa@the-dreams.de, horms@verge.net.au, geert@linux-m68k.org, magnus.damm@gmail.com, chris.paterson2@renesas.com, ramesh.shanmugasundaram@bp.renesas.com, Ulrich Hecht Subject: [PATCH 1/7] pinctrl: sh-pfc: r8a77995: Add CAN support Date: Fri, 17 Nov 2017 11:41:23 +0100 Message-Id: <1510915289-15059-2-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510915289-15059-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1510915289-15059-1-git-send-email-ulrich.hecht+renesas@gmail.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 This patch adds CAN[0-1] pinmux support to the r8a77995 SoC. Signed-off-by: Ulrich Hecht Reviewed-by: Geert Uytterhoeven --- drivers/pinctrl/sh-pfc/pfc-r8a77995.c | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c index 89b7541..616854d 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a77995.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a77995.c @@ -1057,6 +1057,45 @@ static const unsigned int avb0_avtp_capture_b_mux[] = { AVB0_AVTP_CAPTURE_B_MARK, }; +/* - CAN ------------------------------------------------------------------ */ +static const unsigned int can0_data_a_pins[] = { + /* TX, RX */ + RCAR_GP_PIN(4, 28), RCAR_GP_PIN(4, 31), +}; +static const unsigned int can0_data_a_mux[] = { + CAN0_TX_A_MARK, CAN0_RX_A_MARK, +}; +static const unsigned int can0_data_b_pins[] = { + /* TX, RX */ + RCAR_GP_PIN(4, 22), RCAR_GP_PIN(4, 5), +}; +static const unsigned int can0_data_b_mux[] = { + CAN0_TX_B_MARK, CAN0_RX_B_MARK, +}; +static const unsigned int can1_data_a_pins[] = { + /* TX, RX */ + RCAR_GP_PIN(4, 30), RCAR_GP_PIN(4, 29), +}; +static const unsigned int can1_data_a_mux[] = { + CAN1_TX_A_MARK, CAN1_RX_A_MARK, +}; +static const unsigned int can1_data_b_pins[] = { + /* TX, RX */ + RCAR_GP_PIN(4, 7), RCAR_GP_PIN(4, 6), +}; +static const unsigned int can1_data_b_mux[] = { + CAN1_TX_B_MARK, CAN1_RX_B_MARK, +}; + +/* - CAN Clock -------------------------------------------------------------- */ +static const unsigned int can_clk_pins[] = { + /* CLK */ + RCAR_GP_PIN(5, 2), +}; +static const unsigned int can_clk_mux[] = { + CAN_CLK_MARK, +}; + /* - I2C -------------------------------------------------------------------- */ static const unsigned int i2c0_pins[] = { /* SCL, SDA */ @@ -1504,6 +1543,11 @@ static const struct sh_pfc_pin_group pinmux_groups[] = { SH_PFC_PIN_GROUP(avb0_avtp_pps_b), SH_PFC_PIN_GROUP(avb0_avtp_match_b), SH_PFC_PIN_GROUP(avb0_avtp_capture_b), + SH_PFC_PIN_GROUP(can0_data_a), + SH_PFC_PIN_GROUP(can0_data_b), + SH_PFC_PIN_GROUP(can1_data_a), + SH_PFC_PIN_GROUP(can1_data_b), + SH_PFC_PIN_GROUP(can_clk), SH_PFC_PIN_GROUP(i2c0), SH_PFC_PIN_GROUP(i2c1), SH_PFC_PIN_GROUP(i2c2_a), @@ -1581,6 +1625,18 @@ static const char * const avb0_groups[] = { "avb0_avtp_capture_b", }; +static const char * const can0_groups[] = { + "can0_data_a", + "can0_data_b", +}; +static const char * const can1_groups[] = { + "can1_data_a", + "can1_data_b", +}; +static const char * const can_clk_groups[] = { + "can_clk", +}; + static const char * const i2c0_groups[] = { "i2c0", }; @@ -1691,6 +1747,9 @@ static const char * const usb0_groups[] = { static const struct sh_pfc_function pinmux_functions[] = { SH_PFC_FUNCTION(audio_clk), SH_PFC_FUNCTION(avb0), + SH_PFC_FUNCTION(can0), + SH_PFC_FUNCTION(can1), + SH_PFC_FUNCTION(can_clk), SH_PFC_FUNCTION(i2c0), SH_PFC_FUNCTION(i2c1), SH_PFC_FUNCTION(i2c2),