From patchwork Wed May 4 17:08:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 12838213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0574C4332F for ; Wed, 4 May 2022 17:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8+3BadbdBXTPOf933rZM4TeKth8EaudAKFuMyEeBasI=; b=K6OyXUu9BSF6Mc G7DB5k6RVWJ/wzNr6TB0WobwCH44Lg1zO8UaA+0UaZtPD8xm64PpSHh3bmzLjGfCyJGXH0x02G0OH 6CELRh3onuS+pT5YPWssduToW7+nslpxpJ2Pb2JWQMEQyHeiYIaHUWOEHyDK+ihg8zFcPCAXXVgnf sA0EpXUXlZ0HS1kuMYW0ZOUYubJ5es8r48W1MnNJjD8iWynVaIdKelrDPdIk50neEVpxFiB8WTuy5 XxSmb2USgjnm5ufO8e7gD89Yvmm/vhLDdAn5Iz/OLQZKdj+uYdCrzXovWlDglBQcB4f0ZHRsGigwR BbDh8l71aYwcZRZ6oACg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmIVy-00Bqd6-4A; Wed, 04 May 2022 17:10:14 +0000 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmIVt-00BqaO-UM for linux-mediatek@lists.infradead.org; Wed, 04 May 2022 17:10:11 +0000 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2446EsA5021058; Wed, 4 May 2022 12:09:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=2beTP+VHsh/r8Jl6uXGaBqsuGkWb7YUrylFfVtD6Gsg=; b=CCMTzY/V7jJpjIyoXbvnwOKxirh9bHl07d4K3TuBJe6hG5bW6ppzMODC6DmPbNkdYDvE IqZNsCZzKzNCL7clpyswkhPSKkG6apwJSbL2B9jxJzS5TPXbFaKNC9QX1SI1q5B3XNia 1WbAj70Y2OlbEutAADaAvwyeRBepo62/tctS6OF1zj5z8xEvtzct00AMiAhOck/sFDaQ WVgwTNEvngA0bGG1/9mMce13zoh27AiteP64Iq7f7NQXuYW6fE0+EYv05VYFcRxbPycu pqks87/5/nQjIGh8FIJ/eAnvvzr6dU6JtTgFv5ZWijdw47SfHP4E2alt1JUdfR8k9Ufy 1Q== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3fs1hpcxs0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 04 May 2022 12:09:08 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 4 May 2022 18:09:05 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Wed, 4 May 2022 18:09:05 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2B7F3459; Wed, 4 May 2022 17:09:05 +0000 (UTC) From: Charles Keepax To: CC: , , , , , , , , , , , , , , , , , Subject: [PATCH 00/38] Clean up usage of the endianness flag Date: Wed, 4 May 2022 18:08:27 +0100 Message-ID: <20220504170905.332415-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: GXNTo8I6X7-bi8nNsAYS80XtharKQek4 X-Proofpoint-GUID: GXNTo8I6X7-bi8nNsAYS80XtharKQek4 X-Proofpoint-Spam-Reason: safe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_101010_141526_15B98CE2 X-CRM114-Status: GOOD ( 24.04 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Before componentisation any part registered as a CODEC would have automatically supported both little and big endian, ie. the core would duplicate any supported LE or BE PCM format to support the other endian as well. As componentisation removed the distinction between CODEC drivers and platform drivers, a flag was added to specify if this behaviour is required for a particular component. However, as most systems tend to use little endian the absence of the flag is rarely noticed. Also the naming of the flag "endianness" is a little unobvious as to if it should be applied to a particular component. This series adds a comment to better explain the meaning of the flag and then tidys up the usage of the flag. A couple of uses of the flag are removed where is has been used inappropriately on the CPU side of the DAI link, this is clearly not valid in the cases it has been used, and I suspect never would be valid. Then some redundant formats are removed, since they would be covered by existing endianness flags. And finally a bunch of devices that are missing the flag have it added. It is worth noting that since componenisation there are now a couple of cases where it is not entire clear to me that the flag should be applied to all CODECs as it was before. In those cases I haven't updated the driver to add the flag and they are outlined here: 1) Build into the AP CODECs, these are actual silicon inside the main processor and they typically receive audio directly from an internal bus. It is not obvious to me that these can happily ignore endian. On the CODEC side these include: jz4725b.c, jz4760.c, jz4770.c, rk3328_codec.c, lpass-va-macro.c, lpass-rx-macro.c, lpass-tx-macro.c, lpass-wsa-macro.c. There are also some examples of this scattered around the various platform support directories in sound/soc. 2) Devices behind non-audio buses, SPI just moves bits and doesn't really define an endian for audio data on the bus. Thus it seems the CODEC probably can care about the endian. The only devices that fall into this group (mostly for AoV) are: rt5514-spi.c, rt5677-spi.c, cros_ec_codec.c (only the AoV). 3) CODECs with no DAIs, these could specify the flag and plenty of them do; CODECs from the initial conversion to componentisation. But the flag makes no difference here since there is nothing for it to apply to. This includes purely analogue CODECs: aw8738.c, ssm2305.c, tpa6130a2.c, tda7419.c, max9759.c, max9768.c, max9877.c, lm4857.c, simple-mux.c, simple-amplifier.c. And devices that only do jack detection: ts3a227e.c, mt6359-accdet.c. If there are any opinions on adding the flag to any of those three groups they would be greatfully received. But I am leaning towards leaving 1,2 without endianness flags since it feels inappropriate, and removing the endian flag from devices in catagory 3 that already have it. Assuming no one objects to that I will do a follow up series for that. Thanks, Charles Charles Keepax (38): ASoC: soc-component: Add comment for the endianness flag ASoC: atmel-pdmic: Remove endianness flag on pdmic component ASoC: atmel-classd: Remove endianness flag on class d component ASoC: cs4270: Remove redundant big endian formats ASoC: cs42l51: Remove redundant big endian formats ASoC: cs4349: Remove redundant big endian formats ASoC: hdmi-codec: Remove redundant big endian formats ASoC: sta32x: Remove redundant big endian formats ASoC: sta350: Remove redundant big endian formats ASoC: hdac_hda: Add endianness flag in snd_soc_component_driver ASoC: max98504: Add endianness flag in snd_soc_component_driver ASoC: adau1372: Add endianness flag in snd_soc_component_driver ASoC: cs4234: Add endianness flag in snd_soc_component_driver ASoC: cs35l41: Add endianness flag in snd_soc_component_driver ASoC: cx2072x: Add endianness flag in snd_soc_component_driver ASoC: lochnagar: Add endianness flag in snd_soc_component_driver ASoC: mt6351: Add endianness flag in snd_soc_component_driver ASoC: mt6358: Add endianness flag in snd_soc_component_driver ASoC: mt6359: Add endianness flag in snd_soc_component_driver ASoC: mt6660: Add endianness flag in snd_soc_component_driver ASoC: pcm3060: Add endianness flag in snd_soc_component_driver ASoC: rt1019: Add endianness flag in snd_soc_component_driver ASoC: rt9120: Add endianness flag in snd_soc_component_driver ASoC: tlv320adc3xxx: Add endianness flag in snd_soc_component_driver ASoC: tscs454: Add endianness flag in snd_soc_component_driver ASoC: cros_ec_codec: Add endianness flag in i2s_rx_component_driver ASoC: wcd934x: Add endianness flag in snd_soc_component_driver ASoC: wcd9335: Add endianness flag in snd_soc_component_driver ASoC: rt700: Add endianness flag in snd_soc_component_driver ASoC: rt711: Add endianness flag in snd_soc_component_driver ASoC: rt711-sdca: Add endianness flag in snd_soc_component_driver ASoC: rt715: Add endianness flag in snd_soc_component_driver ASoC: rt715-sdca: Add endianness flag in snd_soc_component_driver ASoC: rt1308-sdw: Add endianness flag in snd_soc_component_driver ASoC: rt1316-sdw: Add endianness flag in snd_soc_component_driver ASoC: wcd938x: Add endianness flag in snd_soc_component_driver ASoC: wsa881x: Add endianness flag in snd_soc_component_driver ASoC: sdw-mockup: Add endianness flag in snd_soc_component_driver include/sound/soc-component.h | 9 +++++++++ sound/soc/atmel/atmel-classd.c | 1 - sound/soc/atmel/atmel-pdmic.c | 1 - sound/soc/codecs/adau1372.c | 1 + sound/soc/codecs/cros_ec_codec.c | 7 ++++--- sound/soc/codecs/cs35l41.c | 2 ++ sound/soc/codecs/cs4234.c | 1 + sound/soc/codecs/cs4270.c | 15 +++------------ sound/soc/codecs/cs42l51.c | 7 ++----- sound/soc/codecs/cs4349.c | 9 +++------ sound/soc/codecs/cx2072x.c | 1 + sound/soc/codecs/hdac_hda.c | 15 ++++++++------- sound/soc/codecs/hdmi-codec.c | 15 +++++---------- sound/soc/codecs/lochnagar-sc.c | 5 +++-- sound/soc/codecs/max98504.c | 1 + sound/soc/codecs/mt6351.c | 10 ++++------ sound/soc/codecs/mt6358.c | 10 ++++------ sound/soc/codecs/mt6359.c | 10 ++++------ sound/soc/codecs/mt6660.c | 1 + sound/soc/codecs/pcm3060.c | 1 + sound/soc/codecs/rt1019.c | 3 ++- sound/soc/codecs/rt1308-sdw.c | 1 + sound/soc/codecs/rt1316-sdw.c | 1 + sound/soc/codecs/rt700.c | 1 + sound/soc/codecs/rt711-sdca.c | 1 + sound/soc/codecs/rt711.c | 1 + sound/soc/codecs/rt715-sdca.c | 1 + sound/soc/codecs/rt715.c | 1 + sound/soc/codecs/rt9120.c | 1 + sound/soc/codecs/sdw-mockup.c | 1 + sound/soc/codecs/sta32x.c | 9 +++------ sound/soc/codecs/sta350.c | 9 +++------ sound/soc/codecs/tlv320adc3xxx.c | 11 ++++++----- sound/soc/codecs/tscs454.c | 12 ++++++------ sound/soc/codecs/wcd9335.c | 1 + sound/soc/codecs/wcd934x.c | 1 + sound/soc/codecs/wcd938x.c | 1 + sound/soc/codecs/wsa881x.c | 1 + 38 files changed, 90 insertions(+), 89 deletions(-)