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: 984507 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="mkE3qZNE"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Z0VL4ClLz9sj9 for ; Tue, 16 Oct 2018 14:02:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727451AbeJPKu4 (ORCPT ); Tue, 16 Oct 2018 06:50:56 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33135 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726987AbeJPKu4 (ORCPT ); Tue, 16 Oct 2018 06:50:56 -0400 Received: by mail-pg1-f196.google.com with SMTP id y18-v6so10120727pge.0 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=eKotshGpkHSUEzFTURNZrlB1R3p6M5S7O6xZ/LVHKtTD9nMB9kjT+FrXpmh1GEQRMx EFTQEywYeoaJvaqdS46dyYP532XpOoP9waKGJJD0lxR2VMm26yesB1UT6ZWQUcxl8nPp bJMJca4CqGZhJhLCh9We9+mS+fwaYDNaYz+jZhpUUXgSFB93+f/vwTmxw1w0edFPDDQ6 0iNuiNC1+i3XOQFGR23NVtkYzWutpZDTZE29dMZX5iS76yuWVkwPdX6cH3vA+q7sEpEQ mjaymHVD1ML4PCauwg5CWmJ5co1fXn13zvvMAcCdSARxTKtC+G70nenhwU4Kc3npYUcw +TjA== X-Gm-Message-State: ABuFfogiefXwcj/lLCVEgjpBegfUHTgKzLzeKEECWTiz9QE4C72VUzxZ sYvyEGoGdzeTIfNjUVdTpg4= 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 Cc: Vasily Khoruzhick 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 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 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