From patchwork Sat May 6 16:57:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9715051 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 A09EA60387 for ; Sat, 6 May 2017 17:11:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D37A28616 for ; Sat, 6 May 2017 17:11:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8183328621; Sat, 6 May 2017 17:11:31 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B41C72861E for ; Sat, 6 May 2017 17:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=xs0JHVB+qRMr7NeCu/3stl4j/PRQqfi5KwYrod23Xy8=; b=ENs050y0JHfxrKgooTl0HWwNdV SGALkzSrMAnfo+A21K7W8dtuVq4jqweW1cr+spTfpx1Ks8jFb2zGje5hwk5wr+MaTcfMRw0HIkvvC iVSPUg/AfMG5WjZwv0ZnOhp0ub9e1Kl25Gh1gbpv/Ht3brktckb/UXsXbwsEn4YzkuaK3N+fWu1co 7ayA2+3nPN835XLJHnrrePy8F/MAuj/2oauE+okh23dNS5A0ZOL7MrwlPq7G0dSd/+qabcqw+hN4t N3LKEfn0D5hTsu7MxyYZP87l87aZ1Nr+gbCxV4cq+G6tcxSKQ5aQNxPmOms0OAH3eizVCjsvy07Tw TQ7V0Zng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d73Et-0004sV-T5; Sat, 06 May 2017 17:11:27 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d732L-0006C7-GR; Sat, 06 May 2017 16:58:31 +0000 Received: by mail-wm0-x244.google.com with SMTP id z129so6959075wmb.1; Sat, 06 May 2017 09:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rnni9A3kPiOM9oZHI3yyEUzy1OQSpqN2ZQSihuDdv6A=; b=L004r9B/EF378TiosXzx2oHJlhaOtxmNbB6dIVFCYiyjGL6pPD/AAVexSdW0cda2zc b1jRwpQoxbQ2EdJJIVaZG1+qBsRnRYLLBcu9x+zhtbl9nOKNk0O6LW474//Ykahw4p8A 1kWoloQ763fgqDFhtq7639/eKKYeaFyRn2i/hkQhMKnu5DSQVdU2OBz2lDpZf9a4E1W9 J0UG9bz2P2jha03qRmGR0UbruwPLe1Ydw4BDl6ZI+jO6Rmbd1JQG0WAG4UpONR374C4M lW+OluW49xvNpWGEJ5PZAVYWpelIf3qX45TNXjzpUo9S4+x0bK/sFLbW8RFMvDvA4buR hPPA== 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=rnni9A3kPiOM9oZHI3yyEUzy1OQSpqN2ZQSihuDdv6A=; b=Eb+JkQEUkNiKJf7lzjMx6Bay3EXNblOWmKY9/0zc0QaOoeXQYLkdfGTO2YmsP5vk5B qpMbg+PGM1/qFyKSZziR+nIDZ8wbM7qx9yZ5Rne7PkwCiEkAHdeFfjqU9zpexcdX9BWQ Is2VjTmV7D9PvNkb0PSkS0KKgupVIJOl4Oo7EaSzv6+S9au71KkXVV9Bmwr5AsZyuanb 3SrZDXISGcwEFBM5RaIOzKlgADTwD50nadoutxQN1sDCejnADD+0fMXXF5NSjHPkSJXO Wih0StrUjvHvjFXyfIxixfH/bDL8+29flDwsQg4kDruKBD2FIs2yaCyfA7N9d3hcyAs9 uhKQ== X-Gm-Message-State: AODbwcBNMa7prqu83qbkaLzHF5YbtygmcyYbg7/NqiEU8LcKotDxS543 mF+xk3TdAel0yw== X-Received: by 10.28.168.3 with SMTP id r3mr4983773wme.33.1494089887769; Sat, 06 May 2017 09:58:07 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD3E78B041DCA91B6F8D469E4.dip0.t-ipconnect.de. [2003:dc:d3e7:8b04:1dca:91b6:f8d4:69e4]) by smtp.googlemail.com with ESMTPSA id 30sm6961858wrp.6.2017.05.06.09.58.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 May 2017 09:58:07 -0700 (PDT) From: Martin Blumenstingl To: linus.walleij@linaro.org, carlo@caione.org, khilman@baylibre.com, linux-gpio@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH v2 2/4] pinctrl: meson: meson8: add support for the I2S and SPDIF pins Date: Sat, 6 May 2017 18:57:49 +0200 Message-Id: <20170506165751.12442-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170506165751.12442-1-martin.blumenstingl@googlemail.com> References: <20170504184932.5372-1-martin.blumenstingl@googlemail.com> <20170506165751.12442-1-martin.blumenstingl@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170506_095829_721426_4EFA1560 X-CRM114-Status: GOOD ( 10.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds support for the I2S and SPDIF input and output pins, similar to what we have on GXBB and GXL. Signed-off-by: Martin Blumenstingl --- drivers/pinctrl/meson/pinctrl-meson8.c | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/pinctrl/meson/pinctrl-meson8.c b/drivers/pinctrl/meson/pinctrl-meson8.c index 0ec638655a42..6e36a9602999 100644 --- a/drivers/pinctrl/meson/pinctrl-meson8.c +++ b/drivers/pinctrl/meson/pinctrl-meson8.c @@ -224,6 +224,18 @@ static const unsigned int i2c_sck_c0_pins[] = { PIN(GPIOY_1, 0) }; static const unsigned int pwm_a_y_pins[] = { PIN(GPIOY_16, 0) }; +static const unsigned int i2s_out_ch45_pins[] = { PIN(GPIOY_0, 0) }; +static const unsigned int i2s_out_ch23_pins[] = { PIN(GPIOY_1, 0) }; +static const unsigned int i2s_out_ch01_pins[] = { PIN(GPIOY_4, 0) }; +static const unsigned int i2s_in_ch01_pins[] = { PIN(GPIOY_5, 0) }; +static const unsigned int i2s_lr_clk_in_pins[] = { PIN(GPIOY_6, 0) }; +static const unsigned int i2s_ao_clk_in_pins[] = { PIN(GPIOY_7, 0) }; +static const unsigned int i2s_am_clk_pins[] = { PIN(GPIOY_8, 0) }; +static const unsigned int i2s_out_ch78_pins[] = { PIN(GPIOY_9, 0) }; + +static const unsigned int spdif_in_pins[] = { PIN(GPIOY_2, 0) }; +static const unsigned int spdif_out_pins[] = { PIN(GPIOY_3, 0) }; + /* bank DV */ static const unsigned int dvin_rgb_pins[] = { PIN(GPIODV_0, 0), PIN(GPIODV_1, 0), PIN(GPIODV_2, 0), PIN(GPIODV_3, 0), @@ -398,6 +410,11 @@ static const unsigned int i2c_mst_sda_ao_pins[] = { PIN(GPIOAO_5, AO_OFF) }; static const unsigned int pwm_f_ao_pins[] = { PIN(GPIO_TEST_N, AO_OFF) }; +static const unsigned int i2s_am_clk_out_ao_pins[] = { PIN(GPIOAO_8, AO_OFF) }; +static const unsigned int i2s_ao_clk_out_ao_pins[] = { PIN(GPIOAO_9, AO_OFF) }; +static const unsigned int i2s_lr_clk_out_ao_pins[] = { PIN(GPIOAO_10, AO_OFF) }; +static const unsigned int i2s_out_ch01_ao_pins[] = { PIN(GPIOAO_11, AO_OFF) }; + static struct meson_pmx_group meson8_cbus_groups[] = { GPIO_GROUP(GPIOX_0, 0), GPIO_GROUP(GPIOX_1, 0), @@ -558,6 +575,18 @@ static struct meson_pmx_group meson8_cbus_groups[] = { GROUP(pwm_a_y, 9, 14), + GROUP(i2s_out_ch45, 1, 10), + GROUP(i2s_out_ch23, 1, 19), + GROUP(i2s_out_ch01, 1, 6), + GROUP(i2s_in_ch01, 1, 5), + GROUP(i2s_lr_clk_in, 1, 4), + GROUP(i2s_ao_clk_in, 1, 2), + GROUP(i2s_am_clk, 1, 0), + GROUP(i2s_out_ch78, 1, 11), + + GROUP(spdif_in, 1, 8), + GROUP(spdif_out, 1, 7), + /* bank DV */ GROUP(dvin_rgb, 0, 6), GROUP(dvin_vs, 0, 9), @@ -733,6 +762,11 @@ static struct meson_pmx_group meson8_aobus_groups[] = { GROUP(i2c_mst_sda_ao, 0, 5), GROUP(pwm_f_ao, 0, 19), + + GROUP(i2s_am_clk_out_ao, 0, 30), + GROUP(i2s_ao_clk_out_ao, 0, 29), + GROUP(i2s_lr_clk_out_ao, 0, 28), + GROUP(i2s_out_ch01_ao, 0, 27), }; static const char * const gpio_groups[] = { @@ -860,6 +894,12 @@ static const char * const i2c_b_groups[] = { "i2c_sda_b", "i2c_sck_b" }; +static const char * const i2s_groups[] = { + "i2s_out_ch45", "i2s_out_ch23_pins", "i2s_out_ch01_pins", + "i2s_in_ch01_pins", "i2s_lr_clk_in_pins", "i2s_ao_clk_in_pins", + "i2s_am_clk_pins", "i2s_out_ch78_pins" +}; + static const char * const sd_c_groups[] = { "sd_d0_c", "sd_d1_c", "sd_d2_c", "sd_d3_c", "sd_cmd_c", "sd_clk_c" @@ -910,6 +950,10 @@ static const char * const sdxc_b_groups[] = { "sdxc_d13_b", "sdxc_d0_b", "sdxc_clk_b", "sdxc_cmd_b" }; +static const char * const spdif_groups[] = { + "spdif_in", "spdif_out" +}; + static const char * const uart_ao_groups[] = { "uart_tx_ao_a", "uart_rx_ao_a", "uart_cts_ao_a", "uart_rts_ao_a" }; @@ -934,6 +978,11 @@ static const char * const pwm_f_ao_groups[] = { "pwm_f_ao" }; +static const char * const i2s_ao_groups[] = { + "i2s_am_clk_out_ao", "i2s_ao_clk_out_ao", "i2s_lr_clk_out_ao", + "i2s_out_ch01_ao" +}; + static struct meson_pmx_func meson8_cbus_functions[] = { FUNCTION(gpio), FUNCTION(sd_a), @@ -966,6 +1015,8 @@ static struct meson_pmx_func meson8_cbus_functions[] = { FUNCTION(pwm_c), FUNCTION(pwm_d), FUNCTION(pwm_e), + FUNCTION(i2s), + FUNCTION(spdif), }; static struct meson_pmx_func meson8_aobus_functions[] = { @@ -975,6 +1026,7 @@ static struct meson_pmx_func meson8_aobus_functions[] = { FUNCTION(uart_ao_b), FUNCTION(i2c_mst_ao), FUNCTION(pwm_f_ao), + FUNCTION(i2s_ao), }; static struct meson_bank meson8_cbus_banks[] = {