Received: by 10.223.185.116 with SMTP id b49csp3856580wrg; Mon, 19 Feb 2018 07:08:22 -0800 (PST) X-Google-Smtp-Source: AH8x225RB836HcQlLuUJPHfmVR9kiWB00x1sAme0c8sp806SZbL9VgUpZy3mHyDsYnftZC0VVR1A X-Received: by 10.99.127.70 with SMTP id p6mr12637817pgn.203.1519052902312; Mon, 19 Feb 2018 07:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519052902; cv=none; d=google.com; s=arc-20160816; b=La8kiA1gEld55japQG156bCqhMqyPPudyQc5P2V0ZHuURneonK3ACjo6MO2RdHXNbH lXpH8LehwT51LNwgGDZs2x0ZaXfX1yXjSTmzpAL73//tewY0wmafK/W+/5SFJen4dXQs DhYWbkWEbZ5vSFYT6AwSOQKepp+ED1cQ4Anpz+xGi4Dm7h2HJT8Ag77/0a7ee2hzK2nI AtG4Wp1nkQgmXpmdmGCd3MmnDw0FaSceLsY7hHuH0waXyrcuLR5ikKADjgFZLnAR3Jd/ 2VjAvn7LSmBdU/C91Ka9SIKwjrkgv7g9AIDK4QHZNIZyZjq/MMqgbPJm7NkD/RkhAKKy dUJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=1gFRRhwcN3nKyeGiTCnLHU9jq9XDynN9Z2amgxU8KpA=; b=Oe9zJxBDyNTEDXH3QmCfoWNOHe5xtPBfMiN+1NYeRDAjlpgF4jbpfb0Y5w8HJLjwtJ izwZmO3HSn6wQAYmVwFF2DFNuV+2FFAkxQR4N+rOHZ0LZaUM0tSnyzn2axLZujvlCB6j qEEOp2R9UexORjqCmm7XUmmwPXp7zPf+Z7ujNEziBk/W6J+tcsOpR9u4/dM9q+ngA9RH pwpvjhElCUeiFaMcKPTpFqeOFAX2k3rWQqUlqguQTLtVJeEn1LK3jGSjl5zqHzjoOFio ZzrSf8vYTjfB48KnvBqZYAl71Rg7PWHzbjrHKIiqJWCPfSK8B0r5AdVlEnrMOBMyrV6x +YqA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15si8159525pgs.328.2018.02.19.07.08.03; Mon, 19 Feb 2018 07:08:22 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753090AbeBSPGC (ORCPT + 99 others); Mon, 19 Feb 2018 10:06:02 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:65397 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbeBSPFp (ORCPT ); Mon, 19 Feb 2018 10:05:45 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w1JEwgPV007619; Mon, 19 Feb 2018 16:00:42 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2g6b1w9kme-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 19 Feb 2018 16:00:42 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7AD593A; Mon, 19 Feb 2018 15:00:40 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 247775530; Mon, 19 Feb 2018 15:00:40 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.94) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 19 Feb 2018 16:00:39 +0100 Received: from localhost (10.201.23.16) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 19 Feb 2018 16:00:39 +0100 From: Olivier Moysan To: , , , , , , , , , , , , , CC: , Subject: [RFC PATCH 0/3] ASoC: stm32: add S/PDIF support to SAI Date: Mon, 19 Feb 2018 16:00:34 +0100 Message-ID: <1519052437-24011-1-git-send-email-olivier.moysan@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.16] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-19_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch-set adds S/PDIF IEC6958 protocol support to STM32 SAI. Only S/PDIF playback is supported here, as SAI peripheral does not support S/PDIF capture. SAI peripheral does not take as input full IEC60958 frames as it generates preamble and parity bit. However, it cannot handle raw PCM data, as it is not designed to insert channel status and user data in the generated IEC frames. Moreover, SAI data register format does not match exactly IEC60958 subframe format. (see figure below). Channel status (C) and User data (U) are at 26-25 bits position, in data register, instead of 30-29 bits position. IEC60958 subframe bits: 31-28 27-4 3-0 P C U V data (16|24 bits) preamble SAI data register format: 27-24 23-0 P C U V data (16|24 bits) The impact in software is that the data have to be processed before DMA transfer. These constraints should be managed at driver level to minimize the impact on application. This means that a callback is necessary to perform data processing (shift and channel status insertion) This patch-set introduces a callback to allow processing on samples. The implementation is based on previous discussions available here: https://patchwork.kernel.org/patch/9570255/ BRs Olivier Olivier Moysan (3): ASoC: stm32: Add S/PDIF to SAI bindings ASoC: dmaengine_pcm: add processing support ASoC: stm32: sai: Add support of S/PDIF playback .../devicetree/bindings/sound/st,stm32-sai.txt | 6 + include/sound/dmaengine_pcm.h | 3 + sound/soc/soc-generic-dmaengine-pcm.c | 62 ++++++++- sound/soc/stm/stm32_sai.c | 2 + sound/soc/stm/stm32_sai.h | 2 + sound/soc/stm/stm32_sai_sub.c | 153 +++++++++++++++++---- 6 files changed, 202 insertions(+), 26 deletions(-) -- 1.9.1