Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp623537pxb; Tue, 5 Apr 2022 16:18:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ3YnI05ICB8NT6Mr7Cqc7wpEEpLMgkgS7+7+pMLvZNiI4tJCYtJwqaOQaPdo84Eld5gDn X-Received: by 2002:a63:6a88:0:b0:398:7866:5ce4 with SMTP id f130-20020a636a88000000b0039878665ce4mr4666370pgc.240.1649200714128; Tue, 05 Apr 2022 16:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649200714; cv=none; d=google.com; s=arc-20160816; b=XQERBZD+4yJm8BmWyhkroNz5sPlzuGbEO0mAtvhXTtUp4x71ElBWLj/f17EclM/GrN Hw6D3LUU4nk8rWI2FFmM8fP46d7oxlO3cQNF5CKRi2Xz+WO8RIU9jNgmxSUWLB0PVISd kgmnE6SiFNIApkRDlCUOtvDauhkBV7PyLLXOda/H/1zm1O2DrLD7uXQupgGbxl5r7HLC JIpwuNSFtc+8YGbMWh0NS0AF9VRceBqbnTJLOX6uubVmhX8/q9iBbakDB5mMj7EyQ82l yEKLoHg+n4+QlQxRbY5IxLhFmqibffAlj7Asb2A9Iif5BdIaQSBWxIf54O0oj8tam19J iReQ== 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=i2n5I3GzIGNL4/BsSr4K+0RKPS+KARvhy9/koOM1w9M=; b=T9I4JP0AYVtI6fTzFpBlUroHZW2w16UBK7rtsIluJ3SA59ICE9ZROMcKh6I7Cnkj+K TO1cUzjaaFjLE6UdYj0/sJngpvtWcplPOiZN4exQHmzi7Jfgure6dUQJdeBDvhZJNQRN Ht4ge/Sm4sKRzFHhvyCFjNSHf3kyPfEzmBWfYcc9hrGJ1app2f1HkrqSWZEZn6UTpfvF UQkxj6DfymhJxNaOxsG1rfwsdDk9wRkSWgV3WG5wPbUkikNiZVmut+GVvUJmok+zzoXZ wNim3SPUt/PJL+J4AMHF2o46xReVZh2oldFUEvaRsVPqNVusF3Slu1FK1WHa8QdYPFNf 8tmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lxDTdFad; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k17-20020a63f011000000b003816043ef29si14486207pgh.286.2022.04.05.16.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:18:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lxDTdFad; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 24614228D1F; Tue, 5 Apr 2022 16:02:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244888AbiDEOAH (ORCPT + 99 others); Tue, 5 Apr 2022 10:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238275AbiDEJ3Q (ORCPT ); Tue, 5 Apr 2022 05:29:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E57C260FC; Tue, 5 Apr 2022 02:16:50 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1D95F615E5; Tue, 5 Apr 2022 09:16:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F3EDC385A2; Tue, 5 Apr 2022 09:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150209; bh=edHvhWt4iLm2OPP6xPUH7et3os8yqttfATwOvklfX6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lxDTdFadVwA/OG4xt5xOmSgAeh+5AmIsavmFkSdHVZOmHbrJAxhisZkHsEe07em1r YVjwFuUqZCvZNgr0HB6ZVfAyDmjhAs/5+NL5/F5o8IvX1tQVGdajm2ZzdN/tfBrEMA QdAt/35Z09id9jl20QD+yuxx92bSkoQ0IHAxVpsw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Cezary Rojewski , Pierre-Louis Bossart , Mark Brown Subject: [PATCH 5.16 0992/1017] ASoC: topology: Allow TLV control to be either read or write Date: Tue, 5 Apr 2022 09:31:45 +0200 Message-Id: <20220405070423.647026987@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Amadeusz Sławiński commit feb00b736af64875560f371fe7f58b0b7f239046 upstream. There is no reason to force readwrite access on TLV controls. It can be either read, write or both. This is further evidenced in code where it performs following checks: if ((k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ) && !sbe->get) return -EINVAL; if ((k->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) && !sbe->put) return -EINVAL; Fixes: 1a3232d2f61d ("ASoC: topology: Add support for TLV bytes controls") Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220112170030.569712-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-topology.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -512,7 +512,8 @@ static int soc_tplg_kcontrol_bind_io(str if (le32_to_cpu(hdr->ops.info) == SND_SOC_TPLG_CTL_BYTES && k->iface & SNDRV_CTL_ELEM_IFACE_MIXER - && k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE + && (k->access & SNDRV_CTL_ELEM_ACCESS_TLV_READ + || k->access & SNDRV_CTL_ELEM_ACCESS_TLV_WRITE) && k->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) { struct soc_bytes_ext *sbe; struct snd_soc_tplg_bytes_control *be;