From patchwork Mon Oct 15 16:09:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 984254 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RAzUI4X1"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Yk0n5ZPLz9s5b for ; Tue, 16 Oct 2018 03:09:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726526AbeJOXzg (ORCPT ); Mon, 15 Oct 2018 19:55:36 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39211 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbeJOXzg (ORCPT ); Mon, 15 Oct 2018 19:55:36 -0400 Received: by mail-pf1-f195.google.com with SMTP id c25-v6so9916795pfe.6 for ; Mon, 15 Oct 2018 09:09:44 -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=xDBNXSm1lSi2KohmDk72SPrOC6yhlFM0oYoHIo/3b1o=; b=RAzUI4X1UCY2EUOPvUu56Lprk99x+TlW3aENBpnqtnwLjDCF3OhdLcy+ehRZl7Ptl1 Uq0S3qKb+S7SEZI34yLysNO3oluOAtmG9nyMkIpO8csUNUcn1aqFv/9YJYtClHMLISR/ Mk40i2dQ+4aPTwMv7iap3qtoAyD6xngCt91tAqQNGKoBsWywZSqI2mmUSKeFqbajBMpu 0FvbWSV3h4UqsKoXd3Z/hST64Xxne3UpKGH+dF1WxTlU6IqDch9L83ILz/dsPQ8X7h64 w7eSCLQ4ZoMjRE9pUjyNirbTYufWxX3b6q22dxOpi/KSUNN7/mvnJn6xaeNQ6QHfmgh+ 68Ng== 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=xDBNXSm1lSi2KohmDk72SPrOC6yhlFM0oYoHIo/3b1o=; b=hqrXeD2EJl7gm7wq/QABXDOzfYIbLScANcf1Rgql5ZCvZLYUiLzt+ra20OPevIG500 YC0xZSPFSPLJyg0pXz79Xzdjpm013yXbllK0fgYz/VF6YTQ4OAWIQLDAjJkBeju7Hh91 PSF2NYpVR/+4bYFKrd8m9VGr6dOHv2lEkbnhiLu3w4LcZSAn1PTaOkxntyn7fTTyAuJ/ 16bK2zauH0SsbRIERS3f08eQRbGe/BjhIGfaFuCdnCv78K/k1YTAu2g6YCNptsfjFWiq AA8/w7MVqX6tfvqpYcZ4sbfcCYOdBLIVAtOkRZqV8cC3jwvwNOquRvf43loAve9vOyYt qFOw== X-Gm-Message-State: ABuFfohP1mYmVE6IMasdPyS9Vkf/ffqg9E6a+bm0SEmmcRGW99MS9P8q R6EVn/YpcK8/RguoSxHanJw= X-Google-Smtp-Source: ACcGV63qbOwpy/4+7bqVG37jJfSiIit0tLfS727Ah6bD8v2BfzbnuPkrAfvshkCLHZLHDhexbE/Rcg== X-Received: by 2002:a62:2982:: with SMTP id p124-v6mr17900712pfp.128.1539619783842; Mon, 15 Oct 2018 09:09:43 -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 84-v6sm17513962pfs.108.2018.10.15.09.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 09:09:43 -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 Cc: Vasily Khoruzhick Subject: [PATCH v3 0/9] Add support for audiocodec in Allwinner A64 Date: Mon, 15 Oct 2018 09:09:25 -0700 Message-Id: <20181015160934.20948-1-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 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 | 30 ++ .../dts/allwinner/sun50i-a64-pinebook.dts | 42 ++ .../allwinner/sun50i-a64-sopine-baseboard.dts | 30 ++ 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, 789 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