Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp391425ybl; Tue, 13 Aug 2019 23:10:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwU9NBTMyfdFJpM8wGbCCVQbOUeaD4wzOfuWWI9SwHTy6jifIDh1pFxP1vQq2RvWvU2+VKG X-Received: by 2002:a63:c44c:: with SMTP id m12mr36791032pgg.396.1565763013715; Tue, 13 Aug 2019 23:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565763013; cv=none; d=google.com; s=arc-20160816; b=LrlxK4Dnk4J20w2cB5o7Tlo6lf5vZfXfBStbQjdy7wH+EnMVlCj/85q2Uv0A24tqCe mdv5NxsnJh34g5Wy6UAZ2zgccvRgLM6OlGs8Rcr13Pqjg6H1NNKMPsfRhX5NTPEB0S/U ekzSkXtg6CgaLVHBKnXEw36yqF5Vghde073IIHLGoicc1z/7uXlsxSW5bX5WcOJFmTM3 5e1ZmWUhFZ8OCp9hYGs0iAXdOnUZCpnkARNK5+E/V6+4Jt4pFsakvQjLVDvYlkIIxEKw 1tdLEEeb1x00RG3nBZYAly07AOWv6iyZ+q75g2R7ds7gBArqY0ulwWbi025IRT77pVzV WrgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vSksoEM6AOP7H4nx5slyJOwVx6G+Lfd4yTDhKXFI4kw=; b=e1iRVncCAOSq9AfKFwR5srimy2pVY/xWNghuzXtTFHCGAPkM1feM8+K4JDO59T1zT0 qN+7aEUTEcjTN9HUiPEfb0yVkktH9dgPidzt6UWmPOW3YHKxHK1knQMpJaKJqHEFd7t/ mmt92V48ZHHCZNJiWuensky6edKnwj3RtAmwhvo0t9LXRoaGbshvSMEGvzDMLhhXoku2 8uKWyEdCKHs+OhEzbKIS9y2bWTSXzCnSICd02PYoz0gPbdZqAyBw5Gs6P5VKx7RT0y5X ONjO9SqA+Y+oW9J7aYCTsDcFOpf3BZ6YdoFpIe9AV3DbCWthxe9gd+WUixkD9x1DSJ9B NF7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Of6jkP71; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si10337262plr.112.2019.08.13.23.09.40; Tue, 13 Aug 2019 23:10:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Of6jkP71; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727206AbfHNGI7 (ORCPT + 99 others); Wed, 14 Aug 2019 02:08:59 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:36839 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbfHNGI7 (ORCPT ); Wed, 14 Aug 2019 02:08:59 -0400 Received: by mail-lf1-f65.google.com with SMTP id j17so24448230lfp.3 for ; Tue, 13 Aug 2019 23:08:57 -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=vSksoEM6AOP7H4nx5slyJOwVx6G+Lfd4yTDhKXFI4kw=; b=Of6jkP71r4l9hIWGhjXEn6k3ZQXEbpaIaO3H210UOh4VYtJCUbtF5QhSlMuKHIEWiF PPxk4tArZlRxJ4MWvamV/A6gUDEmTLgaMLTAeX+/oeNbUnGIeHxfJcr8CZg2y3Kjad0q t9VO5xOqidl9/XWlGmNmmLWvK2UO+1wDsI6BK4jRzJdgbDMFGaGkqmXNF8Ah0De7S8Hk tCujzldHtTcr4Se4O1SKV61TCZG7M71GzDoXhDMgIej8v5mywFfBi+LTACNiVPh+3bQh OEBwfx0fzGE6wsRVJlcTUy1/fBTbe/L53aY/QPzWikBip14hwF3Eugg4Ng7LW+kA6OCm Ebig== 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=vSksoEM6AOP7H4nx5slyJOwVx6G+Lfd4yTDhKXFI4kw=; b=J+ZgcQZXtj8Ipqv/VGaZVUrjywxPkogHzhMmRk9hD5KPTZkBaMRHd8b0Ws8tp/geg0 Qr+I0oavBlvtSMaNHEd1GSfiS08VfMAKkZkpgwx6pyHNMSiPIj4xh30CTi6q7l0jb//2 KRtqKjVew9xNqomxboxtpyZ1Xl4lsiCPxxUVzLRZqKjEJCP3oWs9dwXIJTcyDDmDZTY8 hAGqUqch9MOWFTU06/+xEZNL31e35tGHRJX+acM71ZCVo/PaPeuQ545hl/hDXRlUACDK 2mm2HEhBMMsAU1vmeoCM+uKaj+6/DCVd4j6okEtAKgkc0qXawKfN6aDHlB3l/s4ytDed JcAA== X-Gm-Message-State: APjAAAWcAtpoJQ/sUXb8HUDCdmCKxURMFnlW8g30mBDPoOQ2NVZPdwH9 OLzLlIcx+VSzOIY7nUlfzUY= X-Received: by 2002:a19:c1cc:: with SMTP id r195mr24200422lff.95.1565762936954; Tue, 13 Aug 2019 23:08:56 -0700 (PDT) Received: from localhost.localdomain (c213-102-74-69.bredband.comhem.se. [213.102.74.69]) by smtp.gmail.com with ESMTPSA id s10sm3124235ljm.35.2019.08.13.23.08.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 13 Aug 2019 23:08:55 -0700 (PDT) From: codekipper@gmail.com To: maxime.ripard@free-electrons.com, wens@csie.org, linux-sunxi@googlegroups.com Cc: linux-arm-kernel@lists.infradead.org, lgirdwood@gmail.com, broonie@kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, be17068@iperbole.bo.it, Marcus Cooper Subject: [PATCH v5 00/15] ASoC: sun4i-i2s: Updates to the driver Date: Wed, 14 Aug 2019 08:08:39 +0200 Message-Id: <20190814060854.26345-1-codekipper@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcus Cooper Hi All, here is a patch series to add some improvements to the sun4i-i2s driver found whilst getting slave clocking and hdmi audio working on the newer SoCs. As the LibreELEC project is progressing extremely well then there has been some activity getting H6 SoC support with surround sound working and these changes are also included. The functionality included with the new patch set has been extended to cover more sample resolutions, multi-lane data output for HDMI audio and some bug fixes that have been discovered along the way. I have changed some of the original reg fields into function calls as this made it easier to setup for multi-channel audio especially across different SoCs. I can see more usage of the tdm property since I last attempted to push these patches and the examples currently in mainline sort of the opposite to what I'm trying to achieve. When we first started looking at the i2s driver, the codecs that we were using allowed for the frame width to be determined based on the sampling resolution but in most use cases it seems that a fixed width is required(my highest priority should be to get HDMI audio support in). We're using the tdm property to override the old way to calculate the frame width. What I've seen in what has already been mainlined is that the i2s driver has a frame width that is fixed to 32 bits and this can be overridden using the tdm property. My test branch for this can be found at https://github.com/codekipper/linux-sunxi/commits/upstream-i2s , I've been using a Pine64 to test with; validating the new SoC block with HDMI audio and ensuring that I've not broken the old block by making sure that the audio codec still works. If we able to get the first three patches delivered then that is enough for HDMI audio support on the newer SoCs(H3, A64 etc). I still need to investigate the FIFO syncing issues which i've not had a chance to change or address the concerns that broonie and wens brought up. This change has been moved to the top of the patch stack. I would also like to make the multi-channel audio and audio mapping more configurable via the device tree. Currently what is implemented suites our current needs. BR, CK --- v5 changes compared to v4 are: - removed delivered patches. - Added more details to commit messages. - replaced some reg fields with function calls. - Added DSP_A and DSP_B support for H3 and later SoCs. - Added support for the Allwinner H6. v4 changes compared to v3 are: - Moved patches around so that the more controversial of patches are at the top of the stack. - Added more details to commit messages. - Fixed 20bit audio PCM format to use 4 bytes. - Reduced number of flags used to indicate a new SoC. v3 changes compared to v2 are: - added back slave mode changes - added back the use of tdm properties - changes to regmap and caching - removed loopback functionality - fixes to the channel offset mask v2 changes compared to v1 are: - removed slave mode changes which didn't set mclk and bclk div. - removed use of tdm and now use a dedicated property. - fix commit message to better explain reason for sign extending - add divider calculations for newer SoCs. - add support for multi-lane i2s data output. - add support for 20, 24 and 32 bit samples. - add loopback property so blocks can be tested without a codec. --- Jernej Skrabec (3): clk: sunxi-ng: h6: Allow I2S to change parent rate dt-bindings: ASoC: sun4i-i2s: Add H6 compatible ASoC: sun4i-i2s: Add support for H6 I2S Marcus Cooper (12): ASoC: sun4i-i2s: Add regmap field to sign extend sample ASoC: sun4i-i2s: Add set_tdm_slot functionality ASoC: sun4i-i2s: Correct divider calculations ASoC: sun4i-i2s: Support more formats on newer SoCs ASoC: sun4i-i2s: Add functions for RX and TX channel offsets ASoC: sun4i-i2s: Add functions for RX and TX channel enables ASoC: sun4i-i2s: Add functions for RX and TX channel selects ASoC: sun4i-i2s: Add functions for channel mapping ASoC: sun4i-i2s: Add multi-lane functionality ASoC: sun4i-i2s: Add multichannel functionality ASoc: sun4i-i2s: Add 20, 24 and 32 bit support ASoC: sun4i-i2s: Adjust regmap settings .../sound/allwinner,sun4i-a10-i2s.yaml | 2 + drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 8 +- sound/soc/sunxi/sun4i-i2s.c | 690 ++++++++++++++---- 3 files changed, 542 insertions(+), 158 deletions(-) -- 2.22.0