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: 985157 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="CZ7dxiXP"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42ZkYs3ClLz9s9h for ; Wed, 17 Oct 2018 18:38:25 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727214AbeJQPcq (ORCPT ); Wed, 17 Oct 2018 11:32:46 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37215 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbeJQPcq (ORCPT ); Wed, 17 Oct 2018 11:32:46 -0400 Received: by mail-pg1-f196.google.com with SMTP id c10-v6so12114309pgq.4 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=VIOywOmCAlRsHLVqwPR6FMkZ1Mc/NI+mCRFzQ8GOHqUCvYs8zdmQpPzPiLnhS7ZhU7 CDF+NZPaShxNEVENfsahZMZgNXyfdJgN5ZopQia4gG48VEAiZXOYe7y0NfvwgLZkTvbG M6+0BG1JgkzAdTBseB3YMU8vurIOPd91gKuWIpnYrXGzprER5446G2wozdHgTPX0OCVv JP0B9sj5SC+z0Wp6EAijW7PzJQmgTWzqmajW6dVHCW/Czqghap9dqvJljoype79GzBDq 6zopCNadNd3ZTpJEogZzoVGnAY1AezwV6BiM+RZnxcbUUivdbfNFI3nvtKQ/qXxt6YyN rzHQ== X-Gm-Message-State: ABuFfoj4ekS9RNrS35CAgSQY8eDatZCl4K1UArIvOnD6tfro6U1RkaMt Jsc6czgU/KtYtnlGYFb9sl8= 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 Cc: Vasily Khoruzhick 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 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. 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 Acked-by: Maxime Ripard