From patchwork Wed Oct 17 07:38:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10644821 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 1EF93109C for ; Wed, 17 Oct 2018 07:38:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E62D2A7A4 for ; Wed, 17 Oct 2018 07:38:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02AF12A7C0; Wed, 17 Oct 2018 07:38:49 +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=ham 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 50EE82A7A4 for ; Wed, 17 Oct 2018 07:38:49 +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: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:In-Reply-To:References: List-Owner; bh=crPPNN5avO2k9knKWuTCGI//Cwe6KcIYIvX/pkUYIj4=; b=K5chwS79vE3BNc mMhiKUL9PMho7YjQn51Ig/nbz/CCfn1a36Kon14iDeDoVl4nfHpTpUqAyxww1Bw0ekNkVc4v+yWgu QhymfJUMNxkOk4gfOZwMjRfUJAlrRFLI9jOGV08s7AtiH7vj7yXqtn47da5YS66DXBlkCFoN4BWGE Ztye/L2iMmOMeeCl01WUEX7+kOJ9fOKcOOnV8KO2F72sHYP0fgg+6Ajq9YHmiwFKo6ccmwMlxyGNh 6PxmZ3U/EVMv/aHE4mYTzTWAvmRG424JxnMRxVNerIIsK8+Tfuqrtwunbka/CoSYnqLZwSUI2tyYa u+cIHnGCK7JocVV/Kg4Q==; 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 1gCgPe-000693-Jx; Wed, 17 Oct 2018 07:38:38 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCgPZ-000674-PK for linux-arm-kernel@lists.infradead.org; Wed, 17 Oct 2018 07:38:35 +0000 Received: by mail-pg1-x543.google.com with SMTP id 23-v6so12105762pgc.8 for ; Wed, 17 Oct 2018 00:38:23 -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:mime-version :content-transfer-encoding; bh=USYbes4v0eaqngGpJIcIjAEzjrIK9SeRTLnnkAWpfBU=; b=CZ7dxiXPC+/+n0e+ADRMvgrdzZgKVbFQV6ilb0KO4fc8pcqzJ6jcO+5jogCvDQN1JQ z5Ca5+UmXgurguNwUEVT8P0fKXjs1SSEnE3AYk+yfreXKQiE3ZRUi+LzRmULjUsE0WH6 M0ACkR7Yw5WjoANUGhrhJaORzhMIRZp5WfU7M3DUyTfMno8nW81aGjo+vAmOu6ytseat +jC4Juj+ga0uexgBKXYBPCuWNsRHh5dvR1Y8FzKEsKwhMZ+PGq8FNbXp7ri+RiQRiWMZ LbRqKFCPbYl1iSZH7f1LRSG1mUndOrZq0QmsrVI4Kd9Tt6Z0O3O3n1HnWYBOZlr6ZLE2 Djyw== 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:mime-version :content-transfer-encoding; bh=USYbes4v0eaqngGpJIcIjAEzjrIK9SeRTLnnkAWpfBU=; b=s/z2X7Owmh10vS92icI2Ku4d9/aAScmYLWXQKv65q2JWKzMwLAXvTSW6jEnSU+IGEI Ov+SSoEm6wvUvff/FYvwAJIeGoGVa5PXlYCa9hTY5C6UCuBC5Ruigm3XBTNCQ++JaNIt 6+1ixFDuh0WqZtU3NdcEbCwze3BZfQVEv4YJiVktgilcLNXxoHSK+5VjhAnn4aiRlWNq ryzDf1vf51KjbcDWD5aA70HpcU+EP1gvtHZGCDa2QFas4y3OnpHTVJ9VGWHqsYSef7zf M6g2OOXWjx69h/Sq8TS/JgwNqJnAi0o4VvHFdbsYGbZFAGNzh1w+Y3FRe/DywZlwVZkZ yZ/Q== X-Gm-Message-State: ABuFfohhQmz8/GfJsFuW+uvd+x9iHFZficPrEro9KrFFISZKCFSQkLF4 hlk/8GS3lhMBVbA9ibgRZ1E= X-Google-Smtp-Source: ACcGV62s+CKKAHa7sX5Y/EJtbyUrdPhxSkMjaaBneh3EkCUaVZd4l1B6CqLnkTMJA/j278OVACIuIA== X-Received: by 2002:a62:60c1:: with SMTP id u184-v6mr25545717pfb.114.1539761903077; Wed, 17 Oct 2018 00:38:23 -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 o12-v6sm23426387pfh.20.2018.10.17.00.38.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Oct 2018 00:38:22 -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 v5 0/9] Add support for audiocodec in Allwinner A64 Date: Wed, 17 Oct 2018 00:38:04 -0700 Message-Id: <20181017073813.14127-1-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_003833_849592_ED34876C X-CRM114-Status: GOOD ( 15.15 ) 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 This series adds Allwinner A64 audiocodec support into sun4i-i2s, sun8i-codec drivers, introduces new sun50i-codec-analog driver and enables sound on Pine64, SoPine boards and Pinebook. I2S for audiocodec in A64 is different from other 3 I2S modules but similar to one in A10, digital part of codec is compatible with A33 and analog controls part is completely different from other SoCs - it shares only few bits in few registers, so adding support for it into existing sun8i-codec-analog would mean duplicating all the widgets, controls and some routes and making it hard to read. Therefore it makes sense to introduce new driver. v2: - Use simple-amplifier for speaker amp on Pinebook - Rename sun50i-a64-i2s to sun50i-a64-codec-i2s to preserve compatible string for other 3 I2S modules in A64 in case if there's any incompatibility with H3 v3: - renamed sunxi-adda-pr-regmap to sun8i-adda-pr-regmap - use ilog2() to calculate reg value for LRCK div instead of using a table v4: - dts: don't use 'Mic' and 'Headset Mic' widgets from sun8i-codec, define our board-level widgets instead. v5: - collect all the tags - drop the change to sun8i_codec_clk_div Marcus Cooper (1): ASoC: sun4i-i2s: Add compatibility with A64 codec I2S Vasily Khoruzhick (8): ASoC: sun8i-codec: Don't hardcode BCLK / LRCK ratio ASoC: sun8i-codec-analog: split regmap code into separate driver ASoC: dt-binding: Add bindings for Allwinner A64 codec's analog path controls ASoC: sunxi: Add new driver for Allwinner A64 codec's analog path controls ASoC: sunxi: allow the sun8i-codec driver to be built on ARM64 arm64: dts: allwinner: a64: add nodes necessary for analog sound support arm64: dts: allwinner: a64: enable sound on Pine64 and SoPine arm64: dts: allwinner: a64: enable sound on Pinebook .../devicetree/bindings/sound/sun4i-i2s.txt | 2 + .../bindings/sound/sun50i-codec-analog.txt | 12 + .../boot/dts/allwinner/sun50i-a64-pine64.dts | 29 ++ .../dts/allwinner/sun50i-a64-pinebook.dts | 42 ++ .../allwinner/sun50i-a64-sopine-baseboard.dts | 29 ++ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 58 +++ sound/soc/sunxi/Kconfig | 17 +- sound/soc/sunxi/Makefile | 2 + sound/soc/sunxi/sun4i-i2s.c | 21 + sound/soc/sunxi/sun50i-codec-analog.c | 444 ++++++++++++++++++ sound/soc/sunxi/sun8i-adda-pr-regmap.c | 102 ++++ sound/soc/sunxi/sun8i-adda-pr-regmap.h | 7 + sound/soc/sunxi/sun8i-codec-analog.c | 79 +--- sound/soc/sunxi/sun8i-codec.c | 22 +- 14 files changed, 785 insertions(+), 81 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt create mode 100644 sound/soc/sunxi/sun50i-codec-analog.c create mode 100644 sound/soc/sunxi/sun8i-adda-pr-regmap.c create mode 100644 sound/soc/sunxi/sun8i-adda-pr-regmap.h