From patchwork Tue Oct 16 03:02:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10642673 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 4401314E2 for ; Tue, 16 Oct 2018 03:06:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A02D28DAF for ; Tue, 16 Oct 2018 03:06:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1ACBB291EF; Tue, 16 Oct 2018 03:06:48 +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 7FECE28DAF for ; Tue, 16 Oct 2018 03:06:47 +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=lIHHpjWNv2w0pNDohf7oo/+d/xdXijEMEQxnZwyXhws=; b=sWfLx1g0ewdhHJ pIKFpRt6jZuG519PHGDnHgAsn7GBCtdQjBsEqsRRBThOd1gXiC/0hc+5ZrMwqVRVkMcWHNmnF1KcO LvvIOL0GIWdyBshKW8JbyXOk4qC2rNbP3DmsAugw9o65HxHPnRhv+8he9iYP6WWnWFjpYpPsYAdPR xxG+pE02cdvRIm7EM+FO+xKC5D/Yr4M7Vuic0fTbFBv9/hGJ1DNICVPPy/tUIYd4ZKxTSu+u1CnJm jXkl5JV3hOSo+4KPgLwkzqgjMSyQMsR7675ahTSr6RtnFK16PCr/XAITKA8XBmJkJPRpB8DG1Pmh3 ef84RTteO5GwQ8X9Zt9Q==; 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 1gCFgw-0002ch-BT; Tue, 16 Oct 2018 03:06:42 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCFdK-0008De-Ty for linux-arm-kernel@lists.infradead.org; Tue, 16 Oct 2018 03:03:21 +0000 Received: by mail-pf1-x442.google.com with SMTP id f78-v6so4915625pfe.1 for ; Mon, 15 Oct 2018 20:02:48 -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=g+F4ncJZ1RtWl4j2DvEn47Cj2dGUDIaQrS+gazKaRxU=; b=mkE3qZNEiBJTTVAQNSUXMMjuqm0674ZdLP268o0/VIfdHpcZY/BidMt2wQ9/4TWi4L nIX3XniM4TbZlqr4s5MQD9neVKhJ/t56Zf0iwLzWyU7XIyu9aN+NQ37dYJqV5i4smWFC GC6efqN5JQISrHlf6L2go8nZQgnoSZiSqvQz/BFRUV/lFAVYjkvGqpGfrM50LcPSU0hy 6ESfGRnK1Wmf2WFmUV48Yzc+xq6oFOTS9R9t3At4zQnyZxNBeMUHS1e3PJccU+nJ9Xe3 L2tvI5QW843DHQo1qXtqKV6b2hCjbihNqrRHHy/0MvyjEgnaoxrQqD1G0d3BZS1P6p9D XEQg== 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=g+F4ncJZ1RtWl4j2DvEn47Cj2dGUDIaQrS+gazKaRxU=; b=sETwz+ocjmlAJYcgzM/8fOdevnXqFQCi498vnNU6X5ONVRyYxfttnWyV2jHikFOvX1 zj8nEIvMFTHoRptW+fLspLdLk/M2uut5PVEkaPpcshvHasLeP2d1FcqwS0svuH5Nspxw d6vNKR8zqOSL9X5Qhs2/TlvHnyVg3s3hXQHg2EEz87DrTxcSM23FLJ5kfaHWZfGhAp6i omc9h91y/l4SWXv7Nvk/birBHueLMkA77Gd3CHWGpr7AWNNMvRzqUinjWdgONCmo59x2 at/IIyAy0qeOT4M91PLh0dWwXJMlbbIfNhNOdiGXFJNzehhfzyuwaBM/RoT6IOVsz7WB zX1g== X-Gm-Message-State: ABuFfohl6SHnAtbTM/PBkg927Q5D6bacdAJP8vmqDodRTcfCbFdfOxZB o7oCMKy2Rq5jzjzuoBVjtx0= X-Google-Smtp-Source: ACcGV63SnyjqNO+uRmsyyWeA8+y2FEUdSmXB9L0jMsB/TEaDx5BJlAziBTXzBJ2P8wvM37U2U6JO7Q== X-Received: by 2002:a62:2a15:: with SMTP id q21-v6mr4355504pfq.61.1539658967868; Mon, 15 Oct 2018 20:02:47 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 20:02:47 -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 0/9] Add support for audiocodec in Allwinner A64 Date: Mon, 15 Oct 2018 20:02:30 -0700 Message-Id: <20181016030239.15449-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-20181015_200259_049843_1A0DB792 X-CRM114-Status: GOOD ( 15.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: 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. 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 | 26 +- 14 files changed, 787 insertions(+), 83 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