From patchwork Tue Oct 16 03:02:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10642675 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 EDFDF14E2 for ; Tue, 16 Oct 2018 03:07:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7D5D28DAF for ; Tue, 16 Oct 2018 03:07:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC067291EF; Tue, 16 Oct 2018 03:07: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=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 693FF28DAF for ; Tue, 16 Oct 2018 03:07:31 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=7J0AVJYeunj7jmUQSADzuxyIzmfEJZq/p66Tra9VQSA=; b=KXa/0J6KljPltH XqQFc1B47wVlzFghto43FbhVKgZ6F3b7olAYzxoTUAPwCIFXEzti5GNFF6eeEpldElECcrJRknH3x 9qnJkG3my7h977Q/RFESLNTdndnKu3hABEIXDyIImhfAFgM6p1Ijgzv9CPsma5YVhfJj1xusgbOYe o3Fjc1xMMskEC3MeL1WZVDzvadrBlkyiV2qGruLArQpWvWkTSRda1/ij2GlDNpnE8svZkXldERPyd D4WV6bxAezIt0GzPlJp4oXQbNmAwk8BtcRAJBq5SuiuiE0rRPWqQMRw0M0MP2JRTbf1+Xh+PdygfR 67ScehRhyyYU5aj9ZUgw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCFhY-0002sP-GK; Tue, 16 Oct 2018 03:07:20 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCFdM-0008EP-13 for linux-arm-kernel@lists.infradead.org; Tue, 16 Oct 2018 03:03:36 +0000 Received: by mail-pl1-x643.google.com with SMTP id y15-v6so10234201plr.12 for ; Mon, 15 Oct 2018 20:02:49 -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 :mime-version:content-transfer-encoding; bh=o+XXIb2+wNPQqRZWe0Ij8weMFzD9QZHAY2GG5+KDACg=; b=JwM5oLLsbPKvNXptXYRLZFA0Q9bxpfqSVrYE3yupQrUC0+D1sGKfjwQfn8IELcx4A8 HNlm/jJyX3NPbb2A3glEHrr9PAQOQDJlSaOVV/eW86AVwlL3oC+/VHQa8SsbysabJksS rBT6/UUb7PABMXVAAO4WX9FDA/IbR+i9NNU9KHaS7L/0G4LphYY8bhJpxoVj9E9pj3o6 xYApdq5DDhiefFcVz6K6OZFOPzcKop06ziAYMVxbwKkePSXbBXPbO1QkEsr0B0FyVxku TaPJZLAYRexxp/Fla0X9e8n8SzhYL/GSCSnXzoJQmdIWHmfpG0gv6/0d6cxPt2TgXrEU 7TcQ== 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:mime-version:content-transfer-encoding; bh=o+XXIb2+wNPQqRZWe0Ij8weMFzD9QZHAY2GG5+KDACg=; b=QHtMkAgk3PlYHKlOHPeIY5Kwi8HStPZOEZf1b3l4ZtOZ7qWf/rPdiVaAxY4UfJPoYt DQfdS7J9OELOHVnLNRfuc+poTFlBgtxt66f5mlDhleKNcsSDJ3tE8ajO1GjpAZfs1Rgf tnq0txvvZ94L3irxj6h1V8VTavHZdpL+KPxVuEILCloJIH0T/FSGMGUAQ+CPU7mUffWG FSHw3OLTfoaafoOP0OscG2SpC01vXGRkGCOjFNGxhqR4BnBZS46EDQqpWr1VPnGkBkoj AMJffzf3V/jJm4bkl2YTfk6ITu1X52CCJWppcaXY/lbPHTLVp6N6zeWW2v9c4uo7B8DJ 41hA== X-Gm-Message-State: ABuFfojaSr9lCZnH1M8agI/bYw6UrIzPkBwq+BEm9g97Gq09nF5rTVuE VX6xqbv6Nk8+NUhwjpdgrpQ= X-Google-Smtp-Source: ACcGV60qTH9fbUWHNyS9DxKTrFOtgWbDmQG1vgcd3ZNWJCJoiiRfnXUcEzl678FPyJsH3pEdL7f7Xg== X-Received: by 2002:a17:902:ba8d:: with SMTP id k13-v6mr19779877pls.12.1539658968918; Mon, 15 Oct 2018 20:02:48 -0700 (PDT) Received: from anarsoul-thinkpad.lan (216-71-193-140.dyn.novuscom.net. [216.71.193.140]) by smtp.gmail.com with ESMTPSA id p18-v6sm12812390pgi.5.2018.10.15.20.02.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 20:02:48 -0700 (PDT) From: Vasily Khoruzhick To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Maxime Ripard , Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Mylene JOSSERAND , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet Subject: [PATCH v4 1/9] ASoC: sun4i-i2s: Add compatibility with A64 codec I2S Date: Mon, 15 Oct 2018 20:02:31 -0700 Message-Id: <20181016030239.15449-2-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181016030239.15449-1-anarsoul@gmail.com> References: <20181016030239.15449-1-anarsoul@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181015_200300_225594_564DCE18 X-CRM114-Status: GOOD ( 14.87 ) 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: Vasily Khoruzhick 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 From: Marcus Cooper The I2S block used for the audio codec in the A64 differs from other 3 I2S modules in A64 and isn't compatible with H3. But it is very similar to what is found in A10(sun4i). However, its TX FIFO is located at a different address. Signed-off-by: Marcus Cooper Signed-off-by: Vasily Khoruzhick --- .../devicetree/bindings/sound/sun4i-i2s.txt | 2 ++ sound/soc/sunxi/sun4i-i2s.c | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt index b9d50d6cdef3..61e71c1729e0 100644 --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt @@ -10,6 +10,7 @@ Required properties: - "allwinner,sun6i-a31-i2s" - "allwinner,sun8i-a83t-i2s" - "allwinner,sun8i-h3-i2s" + - "allwinner,sun50i-a64-codec-i2s" - reg: physical base address of the controller and length of memory mapped region. - interrupts: should contain the I2S interrupt. @@ -26,6 +27,7 @@ Required properties for the following compatibles: - "allwinner,sun6i-a31-i2s" - "allwinner,sun8i-a83t-i2s" - "allwinner,sun8i-h3-i2s" + - "allwinner,sun50i-a64-codec-i2s" - resets: phandle to the reset line for this codec Example: diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index daa6c08cffbc..d5ec1a20499d 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -950,6 +950,23 @@ static const struct sun4i_i2s_quirks sun8i_h3_i2s_quirks = { .field_rxchansel = REG_FIELD(SUN8I_I2S_RX_CHAN_SEL_REG, 0, 2), }; +static const struct sun4i_i2s_quirks sun50i_a64_codec_i2s_quirks = { + .has_reset = true, + .reg_offset_txdata = SUN8I_I2S_FIFO_TX_REG, + .sun4i_i2s_regmap = &sun4i_i2s_regmap_config, + .has_slave_select_bit = true, + .field_clkdiv_mclk_en = REG_FIELD(SUN4I_I2S_CLK_DIV_REG, 7, 7), + .field_fmt_wss = REG_FIELD(SUN4I_I2S_FMT0_REG, 2, 3), + .field_fmt_sr = REG_FIELD(SUN4I_I2S_FMT0_REG, 4, 5), + .field_fmt_bclk = REG_FIELD(SUN4I_I2S_FMT0_REG, 6, 6), + .field_fmt_lrclk = REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7), + .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1), + .field_txchanmap = REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 31), + .field_rxchanmap = REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 31), + .field_txchansel = REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 2), + .field_rxchansel = REG_FIELD(SUN4I_I2S_RX_CHAN_SEL_REG, 0, 2), +}; + static int sun4i_i2s_init_regmap_fields(struct device *dev, struct sun4i_i2s *i2s) { @@ -1158,6 +1175,10 @@ static const struct of_device_id sun4i_i2s_match[] = { .compatible = "allwinner,sun8i-h3-i2s", .data = &sun8i_h3_i2s_quirks, }, + { + .compatible = "allwinner,sun50i-a64-codec-i2s", + .data = &sun50i_a64_codec_i2s_quirks, + }, {} }; MODULE_DEVICE_TABLE(of, sun4i_i2s_match);