Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp567346iog; Mon, 13 Jun 2022 08:16:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHYPA6nmaSa+smoQUJn0GB3S9IQIWE1nKn3zoTS+/b/KbBeE9MgM2DvtxakD7nMho7wVzy X-Received: by 2002:aa7:8883:0:b0:51c:41b6:6e1d with SMTP id z3-20020aa78883000000b0051c41b66e1dmr76859pfe.82.1655133410336; Mon, 13 Jun 2022 08:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655133410; cv=none; d=google.com; s=arc-20160816; b=JtQdm8elK9KPLh07S86wsvqTQ3oqlgiYUaNsAhjea5+7aIyrqezGwjQZgwH4fv3SQ0 gtrXoQZgZX2f/xTxyxAjLlRNRzS8qIiIYsEmQq/YV1uzpJh2pDUbOcW94RCjTLxbASE4 /tPwL6jBWM/Mbk1aALW55GYLDwyF4r7CEvqGCNfV0YYSM2PvAIeIEBs0BsGzi6bBxDcS 5ubTZWEpPXtBjpFLDRr4S+tl9ama17AAsllRBqEVZG1wJNKIgzVraYKxa9jYWwoT5991 ktGdxszzURBmHpLvLx7H3nT7Fo8TvkcBMfboUG5ihKMlBIQShAfiVYUF0clnx1m9iZB+ BwHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=amG3Jyi9N6/lsuPnpuAW9fBsxTalMyD68zPGubLJXnM=; b=ElIw8NiJ5bZXiBqmjuqV9D+F+MGO8lLREOJn4Fnwc/C/zmW0bZLluGM+hwYE5PvrKf rG1M7cQLLs40qEndC9BrAbOYhLw00nPOXglck0bxjK8s71FMh2CzLjDPVFauNCEA6zHN NItaCf9R1ZT3NziH2o8UXw5lbZqT/Dv/Ldc+PBqUQ04SI9zO+ENFQbZB3rqZ5ejE9mFP kzSK8w7HvpdfKzcoaLS1dfZH0fg5/b81NwlrPddChiMU1+DrxNsHwjurvjMQMdWMX6jD of48vQjzJGMXT/1ZxSEAd9XUTKtjBl0HzP3YrD5ba+42GBVFsxPWaXvu1IipztwIeY5a yjrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ba1/DL/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r8-20020a632b08000000b004085af5007bsi4498745pgr.428.2022.06.13.08.16.37; Mon, 13 Jun 2022 08:16:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ba1/DL/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351491AbiFMLEO (ORCPT + 99 others); Mon, 13 Jun 2022 07:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350183AbiFMKyo (ORCPT ); Mon, 13 Jun 2022 06:54:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D5EDDFEA; Mon, 13 Jun 2022 03:30:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5B363B80E59; Mon, 13 Jun 2022 10:30:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C200FC34114; Mon, 13 Jun 2022 10:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116201; bh=iDmtIbiCibEJV3q/3pm/u+kHThmsdq8O7eZM/tAXpic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ba1/DL/ZWv9+pioBz60nUn09vAsFA/f97SGEKLehDgcjuvqpblwDj7f2loeTZDDgU zKEPiD5Yvx9/yXu+iVIvTUae4/f+KzlbkoAw64GXx6waAqAPWlhlCCIJGv4JBNuz08 aBIdRhbX1Lv2l8BRiK6+o3QeKipdRcWmWHJMB15w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.4 042/411] ASoC: tscs454: Add endianness flag in snd_soc_component_driver Date: Mon, 13 Jun 2022 12:05:15 +0200 Message-Id: <20220613094929.771651698@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Charles Keepax [ Upstream commit ff69ec96b87dccb3a29edef8cec5d4fefbbc2055 ] The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. A fixup is also required to use the width directly rather than relying on the format in hw_params, now both little and big endian would be supported. It is worth noting this changes the behaviour of S24_LE to use a word length of 24 rather than 32. This would appear to be a correction since the fact S24_LE is stored as 32 bits should not be presented over the bus. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-26-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/tscs454.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/tscs454.c b/sound/soc/codecs/tscs454.c index c3587af9985c..3d981441b8d1 100644 --- a/sound/soc/codecs/tscs454.c +++ b/sound/soc/codecs/tscs454.c @@ -3128,18 +3128,17 @@ static int set_aif_sample_format(struct snd_soc_component *component, unsigned int width; int ret; - switch (format) { - case SNDRV_PCM_FORMAT_S16_LE: + switch (snd_pcm_format_width(format)) { + case 16: width = FV_WL_16; break; - case SNDRV_PCM_FORMAT_S20_3LE: + case 20: width = FV_WL_20; break; - case SNDRV_PCM_FORMAT_S24_3LE: + case 24: width = FV_WL_24; break; - case SNDRV_PCM_FORMAT_S24_LE: - case SNDRV_PCM_FORMAT_S32_LE: + case 32: width = FV_WL_32; break; default: @@ -3337,6 +3336,7 @@ static const struct snd_soc_component_driver soc_component_dev_tscs454 = { .num_dapm_routes = ARRAY_SIZE(tscs454_intercon), .controls = tscs454_snd_controls, .num_controls = ARRAY_SIZE(tscs454_snd_controls), + .endianness = 1, }; #define TSCS454_RATES SNDRV_PCM_RATE_8000_96000 -- 2.35.1