From patchwork Mon Jan 15 23:16:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 861110 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zL8WT3cL3z9sNc for ; Tue, 16 Jan 2018 10:21:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CJNcOm4x"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zL8WT1ZrWzF0WY for ; Tue, 16 Jan 2018 10:21:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CJNcOm4x"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::234; helo=mail-pg0-x234.google.com; envelope-from=nicoleotsuka@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CJNcOm4x"; dkim-atps=neutral Received: from mail-pg0-x234.google.com (mail-pg0-x234.google.com [IPv6:2607:f8b0:400e:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zL8QC6mx1zF0WL for ; Tue, 16 Jan 2018 10:17:23 +1100 (AEDT) Received: by mail-pg0-x234.google.com with SMTP id c194so8578528pga.12 for ; Mon, 15 Jan 2018 15:17:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ie/WEjh60QUrI3JasmNcbB7OJkLDQmX448G+t1KPbj4=; b=CJNcOm4x2bujC3YQxZNTK2Rove7+eZFu/eCNiEKcNL9qYl+D37Q0OpQ8PLhaBG5WkX rq9OeZWIoCEE8owhK40sSr3YT9u2lqbW0pi9+u1Wi+yQNjJsbV0GjllO/SJJrq0Lp576 a6DFM/o/jVJ07xUSWsYH8zoUABWK2zcNvuDEkim5MRZ+r0esoadZBR1dMmcGcXpNp9nH Z2nBk5AD+euok9rGK9nOAQGT57Drj7Ym7EbtOKLpuTGjW86Hx5f/DanaFuqOCP6pGvWa ThMqgHYeL3Zeec3VtvyoULKpdLluXWOI1YFzO/ZL7oVHRgw6g0lFjd+GOfBJVLj3FcPM eZ5g== 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; bh=ie/WEjh60QUrI3JasmNcbB7OJkLDQmX448G+t1KPbj4=; b=rGuBK/jcRQA02DJhZoEhNd+tiv1gtE5ELfW5WtBDbcSGt/nls0JEP8h762UPJ8SnMk mmrx9JNpPPx6ytsspnnz4YAYjwIgQDXM+7t21qCFv8NOUNae2kjqLT0FwWmEZZlLlQQP qMZzsbshv4jOZPJKExCyCVz2DUz1N/dFJl1uXxWh3IWJqpG5Nrco6FJoMG01qwp05AkY NvsVA1yK+/ZNJB+LdlTlJfsvRLIzYzfqO4YlryYlm+IpWRgTb/gWJnAl3QHdrvbCVtxO sR85u084NwOLuBh0Q2VVDJSEwwM//buORyKnAwtWczFmB+UXwe+NPdROHyyTRY7FsKp7 eukg== X-Gm-Message-State: AKwxytdC+9VRSDLRuHkT7cF0AaGsYZv5wJZa2uceHBWOGSTsoQItao2j PRIw7+2GbVOyciQgHBJUf48= X-Google-Smtp-Source: ACJfBotfUqKAqmlWm+WTyI4m3CndTQqLM13RY88Itl7ZBCma0AHYm3Mb05DOx7s6MOCzOZ2MHQoTwA== X-Received: by 10.98.7.73 with SMTP id b70mr5202759pfd.39.1516058241173; Mon, 15 Jan 2018 15:17:21 -0800 (PST) Received: from Asurada-CZ80.localdomain (c-73-231-2-134.hsd1.ca.comcast.net. [73.231.2.134]) by smtp.gmail.com with ESMTPSA id b6sm776442pfe.85.2018.01.15.15.17.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jan 2018 15:17:20 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Subject: [PATCH v4 00/17] ASoC: fsl_ssi: Clean up - program flow level Date: Mon, 15 Jan 2018 15:16:15 -0800 Message-Id: <1516058192-65519-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org, caleb@crome.org, lgirdwood@gmail.com, arnaud.mouiche@invoxia.com, lukma@denx.de, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" ==Change log== v4 * Reworked the series by taking suggestions from Maciej + Added TXBIT0 bit back to play safe in PATCH-14 + Made bool synchronous exclusive with AC97 mode in PATCH-16 v3 * Reworked the series by taking suggestions from Maciej + Added PATCH-01 to make RX and TX more clearly defined + Replaced "bool dir" with "int dir" in PATCH-04 + Replaced "!dir" with "int adir" in PATCH-05 + Put CBM_CFS behind the baudclk check to keep the same program flow in PATCH-14 + Removed all cpu_dai_drv changes in PATCH-15 v2 * Reworked the series by taking suggestions from Maciej + Added PATCH-01 to keep all ssi->i2s_net updated + Replaced bool tx with bool dir in PATCH-03 and PATCH-06 + Moved all initial register configurations from dai probe() to platform probe() so as to let AC97 CODEC successfully probe. * Added Tested-by from Caleb for TDM test cases. ==Background== The fsl_ssi driver was designed for PPC originally and then it has been updated to support different modes for i.MX Series, including SDMA, I2S Master mode, AC97 and older i.MXs with FIQ, by different contributors for different use cases in different coding styles. Additionally, in order to fix/work-around hardware bugs and design flaws, the driver made a lot of compromise so now its program flow looks very complicated and it's getting hard to maintain or update. So I am going to clean up the driver on both coding style level and program flow level. ==Introduction== This series of patches is the second set to clean up fsl_ssi driver in the program flow level. Any patch here may impact a fundamental test case like playback or record. ==Verification== This series of patches require fully tested. I have done such tests on i.MX6SoloX with WM8962 using imx_v6_v7_defconfig as: - Playback via I2S Master and Slave mode - Record via I2S Master and Slave mode - Simultaneous playback and record via I2S Master and Slave mode - Background playback with foreground record (starting at different time) via I2S Master and Slave mode - Background record with foreground playback (starting at different time) via I2S Master and Slave mode * All tests above by hacking offline_config to true in imx51. Caleb has tested v1 with TDM lookback tests on i.MX6. Example of uncovered tests: AC97, PowerPC and FIQ. Nicolin Chen (17): ASoC: fsl_ssi: Redefine RX and TX macros ASoC: fsl_ssi: Keep ssi->i2s_net updated ASoC: fsl_ssi: Clean up set_dai_tdm_slot() ASoC: fsl_ssi: Maintain a mask of active streams ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro ASoC: fsl_ssi: Clear FIFO directly in fsl_ssi_config() ASoC: fsl_ssi: Clean up helper functions of trigger() ASoC: fsl_ssi: Add DAIFMT define for AC97 ASoC: fsl_ssi: Clean up fsl_ssi_setup_regvals() ASoC: fsl_ssi: Set xFEN0 and xFEN1 together ASoC: fsl_ssi: Use snd_soc_init_dma_data instead ASoC: fsl_ssi: Move one-time configurations to probe() ASoC: fsl_ssi: Setup AC97 in fsl_ssi_hw_init() ASoC: fsl_ssi: Clean up _fsl_ssi_set_dai_fmt() ASoC: fsl_ssi: Add bool synchronous to mark synchronous mode ASoC: fsl_ssi: Move DT related code to a separate probe() ASoC: fsl_ssi: Use ssi->streams instead of reading register sound/soc/fsl/fsl_ssi.c | 741 +++++++++++++++++++++++++----------------------- sound/soc/fsl/fsl_ssi.h | 3 - 2 files changed, 379 insertions(+), 365 deletions(-) Tested-by: Caleb Crome