From patchwork Wed Nov 3 13:52:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600843 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E784C433EF for ; Wed, 3 Nov 2021 13:55:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27A56610FD for ; Wed, 3 Nov 2021 13:55:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 27A56610FD Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 657F416AA; Wed, 3 Nov 2021 14:54:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 657F416AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947709; bh=F1bGNf+j2sI+p9sZOyMctur/VhqOxrDqXZVOZeIclPU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kIKdOUNXQ4ue8sKmdhCLBWgwlqUts9NR6Mk1c1QC0psv4AMJPIniHTVtVdP7sbgty 2IhEqSPzZa3Ciie5GulCAHLv1B68Mffi3B8YQKhc03JhrRRZencAI2iZSZHArYfN1s fw1K7oOFgSg1/HNRpfMA9BLY3s/929ZxAOhjaDZ0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 44564F804F1; Wed, 3 Nov 2021 14:53:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 173DAF80269; Wed, 3 Nov 2021 14:53:00 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2061.outbound.protection.outlook.com [40.107.212.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E5AEBF80269 for ; Wed, 3 Nov 2021 14:52:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E5AEBF80269 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jUEj3ppG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LOMfd82PVCeRqE004UfmOAO8sMscZYhPHpMfs9mxsReuak1Vy8C5IZsT8s0+Yz97rPnsajBx/hMcxdeiawu2bAlNrhz+b1s3GSZ8EFXTQLZpc7KxhDJYaboGA23zyuEXaZCYIiA30Zbs8K1vzRLBi80c+An/EcFltliIFELEIH97kotex7bE+dirSq01rO0YbyNXhOboIz2tie6HdKJHbN7iuUspg1h7s2r89r3Zl8W2MecASiS1Y9sTt0Z6TmVcHqtgV//coOxTVl4i/xVoRo1r0TbWi9j6XUEaF52S+5AQKLgn+93qZxr34cQ3EXcerj7LPcLKPtV0k7IcxhfMtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IXqLwbKo7AloZe9GpCoOeG1wpo91/LMKM1UlGi1eBJA=; b=Hyxkkh568SOKQKAT7F5hQelYvDi0lqbPmzmySwEvZK/qUnvDOw1FyN+BUYYAc7shV255qfcs1aZtE4T34nGmnAsaqql2ZeFEAnJ7H5RKJx2GZY6sRuFjOLg8WnDjB+K8ViMStVrnIdUkHRqH9p1Lh0P8531KaISMOPsCJFbKLI8A9o1G9P4MeSA7CMNVMH0JAn1NP/2lkEwCE+mocFlYExbINIc6fkD3SmvFR1Rf891A3/r4mwA4RN6sFa9pwi8e59f+u15lzuAMrWMWMLSVBzJvN6ocRuO3AOC2VBKetCe4nbfvuZsISDLzaXPaPP7xGZv0vzrXyOM0TgIdI9hNYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IXqLwbKo7AloZe9GpCoOeG1wpo91/LMKM1UlGi1eBJA=; b=jUEj3ppGTg4e3U5c/JRQv1jXjuEHVk0YPsy5C72jzKqr65Qs10XAyiCslukTM8uOAMt32SST0Dms7CDYpy2D776NbstRzx7V69E3HSaxYZyiBqCIpogNrckxDMaUM+E079LnN4jIeOUgK7k+M265j9XMO+44Ue+Uk44rqoyPJier6TCsOhV3cZP6wzUpxpKHuh2cvpg1czPAeVn+dKyXPJS156YSTbfQyHUxK7XXGgSbSLgEtDT8GuJVC+R5rXDVQpFcgV3S5NWn7VhBj4IP+4v1xQJB9OR4NhDwbeYJgk4F1de++IXVPqad98KJPGzTIsZvM6sihhpH5K8iLFzYBg== Received: from BN9PR03CA0698.namprd03.prod.outlook.com (2603:10b6:408:ef::13) by BN6PR12MB1729.namprd12.prod.outlook.com (2603:10b6:404:108::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Wed, 3 Nov 2021 13:52:49 +0000 Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::8d) by BN9PR03CA0698.outlook.office365.com (2603:10b6:408:ef::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 3 Nov 2021 13:52:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:52:48 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:52:43 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:52:40 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 01/10] ASoC: tegra: Fix kcontrol put callback in ADMAIF Date: Wed, 3 Nov 2021 19:22:17 +0530 Message-ID: <1635947547-24391-2-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a904a2b-a4dc-4c9d-6891-08d99ed13876 X-MS-TrafficTypeDiagnostic: BN6PR12MB1729: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /CFR+4fEHl+nIiV/UNct8FlZp7wTF049NlfzGADPOQCxPxCUgx1nTeZsVLcGLkfVKMgB2wDWELQHZLTy+E3DKZrrT5RvlE30fVbBpGBTfZYL4Fc+jXyAF7+vdihiZ7B/pAUQC7dE6JJMyDHq+4KbDVKwOCxMwPI2Wegdzi/FxkPzt5X9wrmRyWaOhUdfJ4Knb7mDQVHsN5iqiZrqmgXyrFawypGZK6Zk8107biVo7cE4e+gvS0Hvoh/E4JKEZag1MgNH05+RhTTLP1vEz+eehtdpbiKfEzeq34RSnFKynA2KHwNpIT3BPpeNADJJX0PRWbx5SFl9i/IXxW/qdkMelMY4Rq7GfJQ2g7zetzZVxWKdv283vtusotafYVFn1sghg3g/Q4JfXUkTcJ5Xvq7GbbqfRfw1364LTsAb4wLpd6fZdpBU0OvCtNu2Z5y57yU0QzgSWlPCCkndQHMOd9fZ3HscDrHTGOL0UhQ3BXnMaz2eTVhkrmYqQA/fvneDU4w48WT2YMUY3QMKFamVpPL/ECYxKe5PYAPWiSgX1FYNe0WXXJM2/WlWtWotMyHMdiBJ6j3UCnqxxupUOhxPtachPV1vPJwGOJJdHw9KsY7aaDcEdeYbeiBYS2VeqPP4733gs0IdUb0vvjGT+f17i7cezM4K2os3U6ZSOipdar0iUjDKiUkLbsvmk1X7hdfEHsdzX4M2XzGaSvwioLnF8io0KQ== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid04.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(36860700001)(8936002)(86362001)(508600001)(8676002)(70586007)(70206006)(107886003)(2906002)(36756003)(356005)(7636003)(82310400003)(83380400001)(4326008)(5660300002)(6666004)(426003)(7696005)(336012)(47076005)(186003)(26005)(36906005)(316002)(54906003)(110136005)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:52:48.0574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a904a2b-a4dc-4c9d-6891-08d99ed13876 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.35]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1729 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the ADMAIF driver accordingly Fixes: f74028e159bb ("ASoC: tegra: Add Tegra210 based ADMAIF driver") Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown Signed-off-by: Sameer Pujar --- sound/soc/tegra/tegra210_admaif.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/sound/soc/tegra/tegra210_admaif.c b/sound/soc/tegra/tegra210_admaif.c index bcccdf3..dc71075 100644 --- a/sound/soc/tegra/tegra210_admaif.c +++ b/sound/soc/tegra/tegra210_admaif.c @@ -452,16 +452,29 @@ static int tegra_admaif_put_control(struct snd_kcontrol *kcontrol, struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); int value = ucontrol->value.integer.value[0]; - if (strstr(kcontrol->id.name, "Playback Mono To Stereo")) + if (strstr(kcontrol->id.name, "Playback Mono To Stereo")) { + if (admaif->mono_to_stereo[ADMAIF_TX_PATH][ec->reg] == value) + return 0; + admaif->mono_to_stereo[ADMAIF_TX_PATH][ec->reg] = value; - else if (strstr(kcontrol->id.name, "Capture Mono To Stereo")) + } else if (strstr(kcontrol->id.name, "Capture Mono To Stereo")) { + if (admaif->mono_to_stereo[ADMAIF_RX_PATH][ec->reg] == value) + return 0; + admaif->mono_to_stereo[ADMAIF_RX_PATH][ec->reg] = value; - else if (strstr(kcontrol->id.name, "Playback Stereo To Mono")) + } else if (strstr(kcontrol->id.name, "Playback Stereo To Mono")) { + if (admaif->stereo_to_mono[ADMAIF_TX_PATH][ec->reg] == value) + return 0; + admaif->stereo_to_mono[ADMAIF_TX_PATH][ec->reg] = value; - else if (strstr(kcontrol->id.name, "Capture Stereo To Mono")) + } else if (strstr(kcontrol->id.name, "Capture Stereo To Mono")) { + if (admaif->stereo_to_mono[ADMAIF_RX_PATH][ec->reg] == value) + return 0; + admaif->stereo_to_mono[ADMAIF_RX_PATH][ec->reg] = value; + } - return 0; + return 1; } static int tegra_admaif_dai_probe(struct snd_soc_dai *dai) From patchwork Wed Nov 3 13:52:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600839 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77542C433EF for ; Wed, 3 Nov 2021 13:54:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CAE2D61108 for ; Wed, 3 Nov 2021 13:54:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CAE2D61108 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D4D4D166D; Wed, 3 Nov 2021 14:53:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D4D4D166D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947674; bh=C2h5Vi5QcbonDICJtnhGSTphXE+1isRJaFsPMOfrBBY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EHhDXT0G1GBOpA5SRvZnX+UqoUrsOXFZqic2K8JNhAs2ouamDo7yriyq/R/0lIix3 xvrZoS79XxszLeiixqOYmwRIGVddOtaPQ2LbTgXhVnXOMKzdUnBGL9FbuwHnnuOTdS zL159AduK9gWAHs+GITSm44RH4O8GHx/9LNPJlcQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7CD29F8049E; Wed, 3 Nov 2021 14:53:04 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D806F804CA; Wed, 3 Nov 2021 14:53:03 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2050.outbound.protection.outlook.com [40.107.236.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 230E6F80224 for ; Wed, 3 Nov 2021 14:52:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 230E6F80224 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="q2QE6mJL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IQagZ4GC4JG9mjYGENnzQpqDA/uYcoGTh4aZRpQdnxsTrFDF7MfgmvoFD9aWxbMZA2JtTAq1P/14NvuEyOwhbk235CJgSdLW/39YNVn26jC4+3XRDSsM6OT3Ge2Q6eWduqKvhqcEnsFEEEbJ4zKs+Xo3dJLvcm1WKXH5CKJMUzRC4xq3ZlJ3erDVwAMIx82sbdgBgYIpL8vPNHm6e1DG3ELNRYMKRIP4A6BD4voLIghKnfRL3hlIKTxYtc9bVP02/RYXY7AIpOFoR/Awvo/wtb9gPn4zVeFr5svlUPyc4PdWOL6R+I14d7LZOKP/6KOftG9SPIuBPLOk8acbvnZA9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=i2FX+tsXhbe1qqBKVL0Y4eOGaBZ/381SU8qOGjtKF0I=; b=VKqKQxAm+2Dbl9FOSHDP5wDH80p3f4UyKsmDtPuXSjjkWrK/jHigP3pJu+DuMuC1sJAsx1/zGyqh0AvE5ISYnRVljwQgGKr5SObmnGW4uG2skY4Ne2806gM+NDkrpGPawxf2wIsUBivyfOiCj9k3KNY3i1rUnRbHW9OdZdbvOWeNgYSfAcr5jqtVz7h0C/p7jM/FWEka/WbkI/2nzud57bpyccC9XBqt78PHPQ2HIhYz7yovfTOKISccg1PTFPnIvzyiosys0FGWnn/jj0rWF3/Ei1q5+bsiLQL6CnOgs7YjJKEr8bBNcCxXes1oq2X4SKIwoMNoNV/vtwNj7wcfdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i2FX+tsXhbe1qqBKVL0Y4eOGaBZ/381SU8qOGjtKF0I=; b=q2QE6mJLbU//3OKtyE2Hns9cMUt3Om8vPN1ff1nhLLLvNYB3QB94g2LqOJxbrQrPuTcwr38kKuNresU+PJILvjfLU9Lal/WoVf/6Uy+A5fk3cxW4i9g4a/pvJOA/xf7GwjBLisqg3sCq0aoPPjqLriTQaiPmfj3fG3imYxpuOwF6F7UNwZADUYB7Rpil8ttCwuZ2UOzBa7CHKFBVATSB66sLI9+BR92yShxBFv3n8Hpxa8nj5S2xBpSB66gkTnCMsNacpS/vR9+W5dd5royCU4wGdzD1p6YquP6vCLpO7N5Pgv9DOS6v5Lm5mDTGvsABLBLG/jA4gR1ThnTJsVHgng== Received: from BN6PR16CA0020.namprd16.prod.outlook.com (2603:10b6:404:f5::30) by DM6PR12MB3674.namprd12.prod.outlook.com (2603:10b6:5:1c4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.17; Wed, 3 Nov 2021 13:52:51 +0000 Received: from BN8NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:404:f5:cafe::99) by BN6PR16CA0020.outlook.office365.com (2603:10b6:404:f5::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Wed, 3 Nov 2021 13:52:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by BN8NAM11FT016.mail.protection.outlook.com (10.13.176.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:52:49 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 06:52:46 -0700 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:52:43 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 02/10] ASoC: tegra: Fix kcontrol put callback in I2S Date: Wed, 3 Nov 2021 19:22:18 +0530 Message-ID: <1635947547-24391-3-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf371f62-3325-41d7-cb39-08d99ed1398c X-MS-TrafficTypeDiagnostic: DM6PR12MB3674: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a5kqbEX+umr5U+/4yHJKX9nuDNlBWlHdwu6VIpzDomucWvJhbXerPRoN2E1rQkjTj6P8aQGax/wJM5TRyirZpGsF+bGiJb9pQEPAPANkfNi34XOvKxfyTfIh4s5Cn0qGovMG4lXF5WW+aBlqHX+EglnPOMTj8S+SIctk5Y0NY2R5CM54jRqyzbHtGaeqeKF5fEOZRZtAbDkXXJ1+yVDHwjWA0lGCqv3fOq4lIxwz1KB3p6Ek1j4TLHv7+XYnSUk6wU260a3OC/QhqtdvuUcrbpe6AZUuFi+sMy+hhyEqO47ZyvLRlW+Tks+PoPGvcFdzy2293A4/8YCg49IJuepAKNgq/hkn05oO9Jm2jyA+Dlra+k8QDZPOXBViJS/jbuPuzBETj56wXVM9VSU8eJtvCEtX9Z1asACICseux3wEo6eKTMx+Rp+4vspEETH5jJCzZKUhIjB8Efg1JujULxKFLWlqFlWhbzfHQp5t0YTZOCRVuVTheRhpqjRKtI2SFhu+M5cfaPDnjm46UjIdi5s2jOnMwyix/f7ElbMCoXPQzlHb9l/ubZZc/Igx4OlbIItJwTdrkRP4v7w5Vk+7y3SYXVZnCTkdbpSKGLd9SP6WSeRx418i3g+NgP3d/2ND4/i400mgNXPio8wF9Fts3av71H+3TF4m4b4P7ekoPsZf8iR1CjqaJrrc75zN5D0CvYLXAFU5k3DjhBl6lxzS1sPAnw== X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(26005)(2906002)(336012)(186003)(107886003)(47076005)(70206006)(508600001)(70586007)(356005)(83380400001)(7636003)(2616005)(426003)(7696005)(82310400003)(4326008)(5660300002)(36860700001)(8676002)(36756003)(316002)(54906003)(110136005)(6666004)(8936002)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:52:49.8149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf371f62-3325-41d7-cb39-08d99ed1398c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3674 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the I2S driver accordingly. Fixes: c0bfa98349d1 ("ASoC: tegra: Add Tegra210 based I2S driver") Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown Signed-off-by: Sameer Pujar --- sound/soc/tegra/tegra210_i2s.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sound/soc/tegra/tegra210_i2s.c b/sound/soc/tegra/tegra210_i2s.c index 45f31cc..70505b5 100644 --- a/sound/soc/tegra/tegra210_i2s.c +++ b/sound/soc/tegra/tegra210_i2s.c @@ -347,6 +347,9 @@ static int tegra210_i2s_put_control(struct snd_kcontrol *kcontrol, int value = ucontrol->value.integer.value[0]; if (strstr(kcontrol->id.name, "Loopback")) { + if (i2s->loopback == value) + return 0; + i2s->loopback = value; regmap_update_bits(i2s->regmap, TEGRA210_I2S_CTRL, @@ -362,6 +365,9 @@ static int tegra210_i2s_put_control(struct snd_kcontrol *kcontrol, * cases mixer control is used to update custom values. A value * of "N" here means, width is "N + 1" bit clock wide. */ + if (i2s->fsync_width == value) + return 0; + i2s->fsync_width = value; regmap_update_bits(i2s->regmap, TEGRA210_I2S_CTRL, @@ -369,20 +375,38 @@ static int tegra210_i2s_put_control(struct snd_kcontrol *kcontrol, i2s->fsync_width << I2S_FSYNC_WIDTH_SHIFT); } else if (strstr(kcontrol->id.name, "Capture Stereo To Mono")) { + if (i2s->stereo_to_mono[I2S_TX_PATH] == value) + return 0; + i2s->stereo_to_mono[I2S_TX_PATH] = value; } else if (strstr(kcontrol->id.name, "Capture Mono To Stereo")) { + if (i2s->mono_to_stereo[I2S_TX_PATH] == value) + return 0; + i2s->mono_to_stereo[I2S_TX_PATH] = value; } else if (strstr(kcontrol->id.name, "Playback Stereo To Mono")) { + if (i2s->stereo_to_mono[I2S_RX_PATH] == value) + return 0; + i2s->stereo_to_mono[I2S_RX_PATH] = value; } else if (strstr(kcontrol->id.name, "Playback Mono To Stereo")) { + if (i2s->mono_to_stereo[I2S_RX_PATH] == value) + return 0; + i2s->mono_to_stereo[I2S_RX_PATH] = value; } else if (strstr(kcontrol->id.name, "Playback FIFO Threshold")) { + if (i2s->rx_fifo_th == value) + return 0; + i2s->rx_fifo_th = value; } else if (strstr(kcontrol->id.name, "BCLK Ratio")) { + if (i2s->bclk_ratio == value) + return 0; + i2s->bclk_ratio = value; } - return 0; + return 1; } static int tegra210_i2s_set_timing_params(struct device *dev, From patchwork Wed Nov 3 13:52:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600841 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC477C433EF for ; Wed, 3 Nov 2021 13:54:45 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B4DB610FD for ; Wed, 3 Nov 2021 13:54:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4B4DB610FD Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7D192169F; Wed, 3 Nov 2021 14:53:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7D192169F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947683; bh=g6jX0Dpaar/tC3ykvnD3jfLPP/bL5eePtV93+Vlqzss=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Bn0TA+wcdQOzVHpcaeIaV85OkERpyoWigBO2xZtl6jtFatSuWCBkyN8ObuLV04MCf RyENyaEMBIGy1t+Gk3w/N3gfuJ/AUAdO/S0gSkLxgW3Xys+J7y/Lq7HOu7Kh5dFrWB 9+NYI8rRTEVFR6LQHi21HKm4pWiGJSwjpOoGgrVs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 77D62F804E5; Wed, 3 Nov 2021 14:53:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A645EF8049E; Wed, 3 Nov 2021 14:53:03 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2069.outbound.protection.outlook.com [40.107.243.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C55EEF802BE for ; Wed, 3 Nov 2021 14:52:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C55EEF802BE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="CpaKPjqM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZHAe3Qr65A4Qjq3EH/zhGCNoBa95KGbjBAdWY4OMp+AknAEPpMrPzSBR+kZbsrg1ZS3eSWRP2ndUy2aeN5eHQW7j05ACEo4+kkmVQcG5f4pGmlPSboaXZI06ik8lzlIROL4Jnq+nWeqpX008E6kH5MghTXT2eBy+uRSR1FezrEDWjTBxWhQqmM/CGOiUWbvRVQBumMPjIer7UnalO1jxI8OAvlBj+OVFEF8vXCkWFuIhUjC8qfFhHrF7XMaF/Sej0Yd3ODCX98NS9WxysAzQgrOQw8Bg6zJPFQaRkzp7a38dMHamMVsxWEAK7c/V6T5EXNDNytecJ7z28n84dmJvFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=U0vMOIiPRrlYKpYg/ZguOoUpePuSqKZ90grpUKBnQNY=; b=oUnqAXQWozCI/ZY38PKd6wUxRJtzYlSKpCQ1JXx5wkEolckA4//hIjgjmuvxaHV3JrwMOBhDeaqGi2qYHGI7MCWC1dfqKgGSzI9kiFR6Wfag4+THrSzKEZof1uu4VhiA1E10A3avXHDB9Qzq7kw4pJpXjSYREEA0QSr6CIaoxB4XtOz++hbLZGEfANi2WEvUTnhK+Q3h33SYudqQkCNL92TO1Ie0OAM+co7W8iSbN6it4RMNyVOIMpSX2KMcnhXaG3ybZg2ap0WjmcL//EKO+JMpq7IKRvGoAE49t1qMUzdi74YKTflNklBAHVGkz/a5jL/LL0AGP3RalWarvKhyAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U0vMOIiPRrlYKpYg/ZguOoUpePuSqKZ90grpUKBnQNY=; b=CpaKPjqMrw3p4cS7jCBiEjaocMippabLRMIOX/29Zu/ewFhYbFL1VWa63maenvA+W7xAjZs+r4aW/l+vfN/iU+kWNu0CThQlIErB9Rsmz93ugDzkEzne9V4+CP4QpluMvS4vvWsvBZQ8No6lgKD1oP3Zgtz9DeqxwK53j8mOXDf7+zSzt0sFuVoLHwTyflz2S1PF1H7lfaEan5z+DjtH9wPTkoD2EYsRRHPsgBt6buOkY0Vl+uz115GyI6dUXh6wdUzol7zPPb6y2BEwlhQpKcwE8Ep/CNZGw3/K5WDmB+OfqtOaf2zgiqRVTOneWddlyRcmoEC7xVZCCIRkzG58Mg== Received: from MW4PR03CA0329.namprd03.prod.outlook.com (2603:10b6:303:dd::34) by BY5PR12MB4289.namprd12.prod.outlook.com (2603:10b6:a03:204::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Wed, 3 Nov 2021 13:52:55 +0000 Received: from CO1NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dd:cafe::da) by MW4PR03CA0329.outlook.office365.com (2603:10b6:303:dd::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 3 Nov 2021 13:52:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by CO1NAM11FT047.mail.protection.outlook.com (10.13.174.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:52:53 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:52:49 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:52:46 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 03/10] ASoC: tegra: Fix kcontrol put callback in DMIC Date: Wed, 3 Nov 2021 19:22:19 +0530 Message-ID: <1635947547-24391-4-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e894dedc-ff6d-415f-5075-08d99ed13baa X-MS-TrafficTypeDiagnostic: BY5PR12MB4289: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dHmFs0gyY8tJvZMzfMlKpV/zoSjngV8DgvM8BvuE/zSOb3cHOQneKkuo31a94ki8jBzwFGrZO9Yc8a9EEL5GLj0cj+yiixJeK3DeRlblINdEK16R0i1fqb6BkX+0HQF/0KJ032nPTBIxDx32LPEluF7AK6s+aRDxn0iNqimfamYbjjhNe3VYT75hsIrobVsv+jCOdan++Q7bpLnLbXnkR0iRtMy+K1ssAcqs0YwgVY4N3q9uSIwoSBDjxZMyaj17TYWoDtpN6AIyOeX1VfxUM2FirU1xSb4X8YagQrg15Vw5XChmOSDs7FdJQiu6SoFFwWUfXRzgs3+MelFcAQMS5z59az2VUhoDRINGSg9z0nLX5TSD+mHjOkj6Dbi17MN+aLIBmYDsU+yxJlEF9PBPD10GZ7FJgtIAvk+mBQpv597+QZHhEXy9ZZyyMSzhD+QOJlCcvTUmTqCye50jiuczRqzIFifC/wUngSar7227vOFwMwTJOsVPudUSfCOTpRK4/ZV3OjqpPwqfZCAFrmJ3JcAJ+RgzGaI5YHG1Mx5c3/AdDRBhLpoLMICzowgnAb9E4c5XFEolfdcJtmkqC8RdO29FBIO+NuiKGz9nxGEuZCZt6+xVGuwlsJ8quYPxa1g5jxrOkhJC7DmVE7AavPsC6KQviCSIJadfeLYtnkG/r/e5o292j++qXNxsMERTj8vSstPeGC/YfLUu6uBwdKjIXA== X-Forefront-Antispam-Report: CIP:216.228.112.36; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid05.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(82310400003)(2616005)(86362001)(47076005)(54906003)(316002)(110136005)(336012)(356005)(107886003)(426003)(508600001)(2906002)(6666004)(26005)(36860700001)(7636003)(186003)(4326008)(5660300002)(8676002)(8936002)(7696005)(83380400001)(70586007)(70206006)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:52:53.4887 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e894dedc-ff6d-415f-5075-08d99ed13baa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.36]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4289 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the DMIC driver accordingly. Fixes: 8c8ff982e9e2 ("ASoC: tegra: Add Tegra210 based DMIC driver") Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown Signed-off-by: Sameer Pujar --- sound/soc/tegra/tegra210_dmic.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/sound/soc/tegra/tegra210_dmic.c b/sound/soc/tegra/tegra210_dmic.c index b096478..39a63ed 100644 --- a/sound/soc/tegra/tegra210_dmic.c +++ b/sound/soc/tegra/tegra210_dmic.c @@ -185,20 +185,39 @@ static int tegra210_dmic_put_control(struct snd_kcontrol *kcontrol, struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); int value = ucontrol->value.integer.value[0]; - if (strstr(kcontrol->id.name, "Boost Gain Volume")) + if (strstr(kcontrol->id.name, "Boost Gain Volume")) { + if (dmic->boost_gain == value) + return 0; + dmic->boost_gain = value; - else if (strstr(kcontrol->id.name, "Channel Select")) - dmic->ch_select = ucontrol->value.integer.value[0]; - else if (strstr(kcontrol->id.name, "Mono To Stereo")) + } else if (strstr(kcontrol->id.name, "Channel Select")) { + if (dmic->ch_select == value) + return 0; + + dmic->ch_select = value; + } else if (strstr(kcontrol->id.name, "Mono To Stereo")) { + if (dmic->mono_to_stereo == value) + return 0; + dmic->mono_to_stereo = value; - else if (strstr(kcontrol->id.name, "Stereo To Mono")) + } else if (strstr(kcontrol->id.name, "Stereo To Mono")) { + if (dmic->stereo_to_mono == value) + return 0; + dmic->stereo_to_mono = value; - else if (strstr(kcontrol->id.name, "OSR Value")) + } else if (strstr(kcontrol->id.name, "OSR Value")) { + if (dmic->osr_val == value) + return 0; + dmic->osr_val = value; - else if (strstr(kcontrol->id.name, "LR Polarity Select")) + } else if (strstr(kcontrol->id.name, "LR Polarity Select")) { + if (dmic->lrsel == value) + return 0; + dmic->lrsel = value; + } - return 0; + return 1; } static const struct snd_soc_dai_ops tegra210_dmic_dai_ops = { From patchwork Wed Nov 3 13:52:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600845 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94F4DC433F5 for ; Wed, 3 Nov 2021 13:55:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EDB661166 for ; Wed, 3 Nov 2021 13:55:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7EDB661166 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 54B7816B4; Wed, 3 Nov 2021 14:54:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 54B7816B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947735; bh=gvmQ6QStlfDuamUV9ZOddKFYfhbXrtb5HOEAx4V17wU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=jlywCF6xF+zcDSCX1kQZ5fCL0beQOa2Zr6heqwl66SsueRNdndPpNPvcmMaAfbD8a R5RJT5RXvrh5W5ETbENQeagRExc1f6SKaJ9oXi64nHBvlPyUtAXc0LnXbQqambTmrQ 8r0m3dbxIMQpYh2iZom/kJ8nnsM7WtMC5nR0Uqdg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E86A9F80507; Wed, 3 Nov 2021 14:53:16 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 24526F804EC; Wed, 3 Nov 2021 14:53:08 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2067.outbound.protection.outlook.com [40.107.243.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5AC58F804E5 for ; Wed, 3 Nov 2021 14:52:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5AC58F804E5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="NHeM6BZ9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nFPE02EmobO1X3KEucBFk4V0OztIfU6HO3wnXVymUI30TGtNEgZJ3ggdxxy1mf78S2KxDnKS2i3u8gFPPVyXmbZKuFty8Ei9FXt//2zU2WudQ2QjqZE7v+xOX4dfFYHJ1mXyclm2nBxV2GdR6xR5MJgGfTloRxvoKXsPnJ7vqgUDiyRW3g8dKd/FQPvSkykmz83TWGfjSZhsA53YQj5FFJ8KpBkmD3mDLHRXrhhoAPJFLb/C7oW48Oaqf8ltwHl/gUg3tji1GF6g3+1Kf/YQiolA1Zb8UETh635RiSZXRPyBYjZRkTDY6bcnhXNgpO7IUCPMmBCf1XX4D9M4xOzc+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z9ZOKYQmuNuZwc2ljgbVpmsRj+kKvpiSn/G+mClgeXU=; b=Iifjl5Mpb86ULepw9YAUryolB0aDdDWsQ/IXVAXuzOrNNVn9HEIbSL8+ZERJMNrcv66Di+Ep9SSRQV6t2uB6Q7ppbkF47UJSBW9DXREAZft9/442L69lvSk9/NV81cun80xuzh7dUYXmTVDk/m8nd3Tii3jlvSy872U+eU4V+9wb3rjIKfLLQrJrxj9aG/pQp2sd3zNOf41qyySsKYiYojcor1SmhTz8hkuE02fk6q4Lim2q6JCdRqJbl/u9MV/aRyDBEwpwg2hFqCgc9YOvmbL3/QBPpi9MeTTI1rqrCSXA2nRoKjHFwZ9da0JRKewj4IcD3jj/rCTBJ+gJ7+/RGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z9ZOKYQmuNuZwc2ljgbVpmsRj+kKvpiSn/G+mClgeXU=; b=NHeM6BZ9IrUsT0Cort8BbPsmEIdzpy4YkDtVsJ5RzDKN0sEPbMeu1GAk8XOaVX8mR8JEmVmybRByTP/kQgYws1aHKNaK/Cbv+kBznLgUiTuogfOXvxlq9rNF0k7g0wSyMla2rAgY1MUs6A+GruAZc/ivitwQrk6DlFT3XCbM4Ggrm7UhDh70ysPnuLwGoiEPcmN7UeZTrEPew2neUaS2I7tTUdGeIZ9CIGwLlfzZ/bj/QCT53QT7JBAX+E/2ZzU97dSy6ugkwFBQxgvkB0x/f/Ob9Ngtwxsso+JmY2u+SPZ5ewwk6xkrmHZ6ud5ELuuS7izj7tP5NCI1gaUwpHvnhw== Received: from BN9PR03CA0712.namprd03.prod.outlook.com (2603:10b6:408:ef::27) by BN6PR12MB1203.namprd12.prod.outlook.com (2603:10b6:404:19::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 3 Nov 2021 13:52:56 +0000 Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::58) by BN9PR03CA0712.outlook.office365.com (2603:10b6:408:ef::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Wed, 3 Nov 2021 13:52:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:52:53 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:52:52 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:52:49 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 04/10] ASoC: tegra: Fix kcontrol put callback in DSPK Date: Wed, 3 Nov 2021 19:22:20 +0530 Message-ID: <1635947547-24391-5-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ce0edf17-7e9e-4240-289b-08d99ed13b89 X-MS-TrafficTypeDiagnostic: BN6PR12MB1203: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /pCP5sY1Lrj0TiFhoL60FKOlblcQSCe/3NVPuWMkXA18tF0V5agRnGTpJG5KbrR0TqPHMETGFOM26jE4ONbT+57AubGToqsK1azHr1GztG+0e/LJ4UpQYf6SStRKk6tcRIXKxDxqa4CanL+DliCmb5JgEvH75XKFJC50xt6o/kZoK5wRox/zfHkzpnOGn9PubMaY2G2D+inH0/nkskcszSZvAOeSdfVdJgo1EPcDM1SlsxAISfr+TvcgaY+MRIPuB8/x0QdxlzPJJw+i9orx5H3B9Iv4DJWZlKTfz4P47/O+h/Fq6PFO4x0Y0jE3J7X1HVraCJQO0F9RdGcs/CoLOSO9CoqF+WOsxyu81Abi91JXHd2l7Cb2qd0xlszUPTqj2DXapEPBEcse3UUrTwlFObQUsAZ8k+Q6mOPG/rY0ExNWB/stl1yJchnxcTjaeMFHAq77fgGNlk7JeR5f2yCdztsvAup/UxESAWhU8F0taut9XpOX81WfH9yCXrAAFPjaaf2pEzXIAWYt3sBYCPoh6GBXnM5fv3UWh/MQxvSc/+8PZBJ4g895tSnZQMsi/52Str0eKjJ1x5OjwC6izqquWMokWZtxlFXUwi9Bif2jo7TJn0wj4D6wrfe+JsAB7JpXRqTmYQ2bTbKxFzz/d9hNp+i+zBauV2aAhzB6b5rgaRQr5mvAdxI2juFUT6099sEXDM8gESahzKs4ab01MhqF7w== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid04.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(6666004)(70586007)(82310400003)(54906003)(8676002)(2906002)(2616005)(356005)(86362001)(47076005)(7696005)(107886003)(316002)(186003)(5660300002)(110136005)(508600001)(26005)(7636003)(83380400001)(36860700001)(4326008)(426003)(70206006)(336012)(8936002)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:52:53.2184 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce0edf17-7e9e-4240-289b-08d99ed13b89 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.35]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1203 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the DSPK driver accordingly. Fixes: 327ef6470266 ("ASoC: tegra: Add Tegra186 based DSPK driver") Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown Signed-off-by: Sameer Pujar --- sound/soc/tegra/tegra186_dspk.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/sound/soc/tegra/tegra186_dspk.c b/sound/soc/tegra/tegra186_dspk.c index 8ee9a77..4cc06e9 100644 --- a/sound/soc/tegra/tegra186_dspk.c +++ b/sound/soc/tegra/tegra186_dspk.c @@ -55,20 +55,39 @@ static int tegra186_dspk_put_control(struct snd_kcontrol *kcontrol, struct tegra186_dspk *dspk = snd_soc_component_get_drvdata(codec); int val = ucontrol->value.integer.value[0]; - if (strstr(kcontrol->id.name, "FIFO Threshold")) + if (strstr(kcontrol->id.name, "FIFO Threshold")) { + if (dspk->rx_fifo_th == val) + return 0; + dspk->rx_fifo_th = val; - else if (strstr(kcontrol->id.name, "OSR Value")) + } else if (strstr(kcontrol->id.name, "OSR Value")) { + if (dspk->osr_val == val) + return 0; + dspk->osr_val = val; - else if (strstr(kcontrol->id.name, "LR Polarity Select")) + } else if (strstr(kcontrol->id.name, "LR Polarity Select")) { + if (dspk->lrsel == val) + return 0; + dspk->lrsel = val; - else if (strstr(kcontrol->id.name, "Channel Select")) + } else if (strstr(kcontrol->id.name, "Channel Select")) { + if (dspk->ch_sel == val) + return 0; + dspk->ch_sel = val; - else if (strstr(kcontrol->id.name, "Mono To Stereo")) + } else if (strstr(kcontrol->id.name, "Mono To Stereo")) { + if (dspk->mono_to_stereo == val) + return 0; + dspk->mono_to_stereo = val; - else if (strstr(kcontrol->id.name, "Stereo To Mono")) + } else if (strstr(kcontrol->id.name, "Stereo To Mono")) { + if (dspk->stereo_to_mono == val) + return 0; + dspk->stereo_to_mono = val; + } - return 0; + return 1; } static int __maybe_unused tegra186_dspk_runtime_suspend(struct device *dev) From patchwork Wed Nov 3 13:52:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600847 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8FE9C433F5 for ; Wed, 3 Nov 2021 13:55:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2598D61108 for ; Wed, 3 Nov 2021 13:55:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2598D61108 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8B0FC1688; Wed, 3 Nov 2021 14:55:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8B0FC1688 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947754; bh=29UH+agiG+X5gC5QwxL1+UQGBRi57ixVPttfE4rnrvE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gdJjItLV7dxifBzUwCSL4HkTNLaNYbyQ8t2Ue8S/Z6DO2NGjE6hLbNf7MSD2/jmPM tUHkBXvqar2cFC5OQWtWyPsXcBUvaLp0HvIRcT7IrPRBTcm7WWdPd8l7JveOneCfed un7E8RtezerTrSrRFarHC0X8cOiYNYM9KrL+zK2g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 76509F80515; Wed, 3 Nov 2021 14:53:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1B6BDF804EB; Wed, 3 Nov 2021 14:53:10 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2054.outbound.protection.outlook.com [40.107.236.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 69409F80224 for ; Wed, 3 Nov 2021 14:52:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 69409F80224 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="B+WOfCG+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gt9B00QpDeDmeOjhJWvVzI5Rj+KwKEx1b9U48Nd6LgqwXSY0KWRQbwIYrHRLVofd5fzWEX1U3rw7Zq9xL9RVMDQ0lYfVEJZNRFKqCnRndVWt7ObKVZNQXfv5SjBIdCZJyR2FXscITIrFdxvwabkhTBO9SnQV/b1yCqVpAWGUKps7weD7HzSsZCogXl1NP5Yr/HYcf63atWl5bb2Psk5pmUILhYRHMZNme9nzmCVbYgC+XVmk/j8KGqHM4M9CCTrd4MhWMu3h9JuEJ/wztOiBKhhgAba0pj23nhOsYYRAU5Uut6lw1W8cWmGwmQDZ6ojl63Eappb0kkz7shmOdNEUug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=seKJXWAwKPt0HlTyQtw9cWNRWo8z3o3zV5fHVffk/V0=; b=RpvjCGrRLAEeXzJYvtTUOqLL3h2MsgMQVRWjXvc+zHX/ZZds93KkL/lkgoThfPJJi2VKhf5mFuRaUma5iymOBo6f/4Uek+4GDhvGF5MMGp2NfqFArmZ6huqe0QXBhO2vVRr6bU72xeJnXV718TBlQVK3Xz1cpx4lS+cZVUzg7xAxRrJ4VFwuagOTdKE6QB1BIMInjU2JmXFsGCWp3rlLWipdYYuiH0z5oZ/p5ALdNOP5TP+xK73bxHPmBv3tFSuQaomuIsmQ20B/bi9c9njuhVP0N18I9lqyjRzCRggWOtn5/uCrRUosUXrLFcMqx6WIfgGLr2TMC4wcu4wqFLeMQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=seKJXWAwKPt0HlTyQtw9cWNRWo8z3o3zV5fHVffk/V0=; b=B+WOfCG+i9qJJMjIcl3RPUsQAkdvxCqMJ/71TQS51cC/wb2ZCKtkhcHpTnpJd8jWzlWwqSF7LwQ2phURt7mDuV38Lid0WLZ5D/rxDYUSqFLcDeLuMc61q3N/fJV/AdgyCgSs693fXpfZUZ3pCjkQ4ODyJJufDZH7J4sHqA+Ash1JDReZRw0/JtHJzuFECtueSGHUlLYTRy6mXdxNWLLM5IC7clhzr3ouhB236yWvSD+dL8+oLd6KzazO2fCAGW9xHNHFaBHEhDwREOHmx1RU7zKJybQGjZA1QX5HtXCER/oNUeUB5YQQTE0hW4RZ3QB0f/OlkNOj/POMwOF/SxxV5w== Received: from BN9PR03CA0711.namprd03.prod.outlook.com (2603:10b6:408:ef::26) by BL0PR12MB5538.namprd12.prod.outlook.com (2603:10b6:208:1c9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 3 Nov 2021 13:52:56 +0000 Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::61) by BN9PR03CA0711.outlook.office365.com (2603:10b6:408:ef::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 3 Nov 2021 13:52:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:52:56 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:52:55 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:52:52 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 05/10] ASoC: tegra: Fix kcontrol put callback in AHUB Date: Wed, 3 Nov 2021 19:22:21 +0530 Message-ID: <1635947547-24391-6-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 146634ce-22d5-4c99-7ba4-08d99ed13d6f X-MS-TrafficTypeDiagnostic: BL0PR12MB5538: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 77myj5ntfHvOY7PJVPHLgxyB5sXjltjZswKprh3JsoCXxLgmNweg0UhAt0j7afilKZ6XEtEFDB6wtPo6kHhI8yk25zOhwZQ/K0ZuSoPiOXvdA+zB6MlM8Oe0S+KEYlTHg5zx4pn+bqb0Dwuqvj83A90EIu80rnsRrE5+72d2j70Riy6JBv48JLrGoyGNQ2Z6MgTrEOCpBYBPiIzgx/71NJ18b8Xmyphy/Gjsjs8ate5m/fIpGpxUnYSG3A8E9Iv9Ko0REtzEdJGA8hi2lQEbtXlIZNZ6jOOPxrC/28DIlBJ4+L6/b05tOgOCZdTwZ7YLPqkTCmLQd5Qn/yutFpU9YtK2e72x/i3KXgwqp+dic6+nA8UtHkTGi/XSQTBzAfI1zLOGAhelP2wo6fKtb3w6R3S4ruPeGpH7Ip5CFCWgpKbTXMyqjhYZrLxQNPkAP+JBPfrdloVdZNcI7ESD4/8eg4SYyKd4S6pimKqglpn5tdM393Jmj6oHsSB4shkLtLF6ebrwCoxIykqGlSkFlKSCT+I8lExlqZKV/NLmMqyV23xI4l99VHWPGePESrR7hSnfzFAJMMqYuKlUUEngFcdCg/H3hxrKvvQn9KeQESUi1piXZjpqgqVioHRkoRmOpfAdpKKRFKYo9+YkDOLVZBUaoKi5pxa2Mk5aj3T6n0h+EQAF+bCFC9W1aHUMglYLDU9/muKNK7Ol5+xme5GwOep6fA== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid04.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(7636003)(4326008)(5660300002)(70206006)(508600001)(356005)(316002)(54906003)(110136005)(70586007)(2906002)(426003)(2616005)(336012)(36906005)(82310400003)(26005)(186003)(8936002)(8676002)(6666004)(36860700001)(47076005)(83380400001)(107886003)(7696005)(36756003)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:52:56.4206 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 146634ce-22d5-4c99-7ba4-08d99ed13d6f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.35]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB5538 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Update the AHUB driver accordingly. Fixes: 16e1bcc2caf4 ("ASoC: tegra: Add Tegra210 based AHUB driver") Signed-off-by: Sameer Pujar Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown --- sound/soc/tegra/tegra210_ahub.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sound/soc/tegra/tegra210_ahub.c b/sound/soc/tegra/tegra210_ahub.c index a1989ea..388b815 100644 --- a/sound/soc/tegra/tegra210_ahub.c +++ b/sound/soc/tegra/tegra210_ahub.c @@ -62,6 +62,7 @@ static int tegra_ahub_put_value_enum(struct snd_kcontrol *kctl, unsigned int *item = uctl->value.enumerated.item; unsigned int value = e->values[item[0]]; unsigned int i, bit_pos, reg_idx = 0, reg_val = 0; + int change = 0; if (item[0] >= e->items) return -EINVAL; @@ -86,12 +87,14 @@ static int tegra_ahub_put_value_enum(struct snd_kcontrol *kctl, /* Update widget power if state has changed */ if (snd_soc_component_test_bits(cmpnt, update[i].reg, - update[i].mask, update[i].val)) - snd_soc_dapm_mux_update_power(dapm, kctl, item[0], e, - &update[i]); + update[i].mask, + update[i].val)) + change |= snd_soc_dapm_mux_update_power(dapm, kctl, + item[0], e, + &update[i]); } - return 0; + return change; } static struct snd_soc_dai_driver tegra210_ahub_dais[] = { From patchwork Wed Nov 3 13:52:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600849 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D67E9C433EF for ; Wed, 3 Nov 2021 13:56:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D7AF61108 for ; Wed, 3 Nov 2021 13:56:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5D7AF61108 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C9273166D; Wed, 3 Nov 2021 14:55:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C9273166D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947768; bh=EY+BfICY1xULbz89Q+hekTqX4s8rOuZBFiExtHgmm6I=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=n0zi+QQAbF/F+2r6JsOsD6hoiiJWB0hhBDXJ+zRdQGV0zE1IWqsjzjjkrz/71NL/x x/yUBXOGeYzu/XXsTsHV7fPTDDxxTOn7vBWL8tJ4tdbMzaBpuAemO07cSvvQwfAq87 CwKB9NDZhenBTuFWMdlOmSaLQYErRkOGLjCeIlVo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 992DEF80519; Wed, 3 Nov 2021 14:53:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E8017F804F2; Wed, 3 Nov 2021 14:53:11 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D7608F804E7 for ; Wed, 3 Nov 2021 14:53:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D7608F804E7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="SEW9Vc25" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FzNAnq5tJYpW+GabYnIJdre+Di39kWGAUI/Aemb+ZwhndtAc1zj4m5JB9hm5gOzzsiXqcyGM6rOGtvZFc45WKqACG8aNdJlODwkDOKlm7l1mGE4AGTisCAebDWvEbwjVsFpDUT2LeaoK8XrJa/wluNl0hJylWPULB3mXaC484FxotqtWLZ4XUXj/NyK43DPZx0MJoC9zYQLWNMLepgz2cJ95flJLKTz6RDqTDfqqmef/02fk9VH5FU5QMHbQ1DXgg/URDmiGJVXTUuuybiKPUrSjdQspuhsgw54/WJ0a0YlL0Lvfl4qm7Pcy7+ruxi/GyO6xUQUlASqk3kogLlCP/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Da/l8PVvKRGSZfJXUHeP98sIkpbFJjyuoTqRvSa0D1E=; b=XjwNTttILjET1+LppJ6jrMYjI8r2Tuy1fCffhcVsdjGFghorWDV02nHelFeyakvEAl6YP6fIkI9snuyGn7QtPFWaG7xDMTpf7/Md7QZ6vafkwSBRFwDxcRbdhTKR9mVHh4miRi4iPLHP2EFJnI666+Mgik0Vv3eAgUTBy4F3GuqdUbRo41/49Fhcl6OD6T17/sb5Oya+DvnHsqXxM4jqxEQX+OH0E5bEAZunjIu7Mw/BtjgjmpqQp2gxGDo2yk3GA3mBViZQxi7/msUS6Fa9o2RwmnXnQS9/SaegflayT57X6WTlpAIf4h/mYAOBHgidIQKCiHr2xZu5QD26a+mIyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Da/l8PVvKRGSZfJXUHeP98sIkpbFJjyuoTqRvSa0D1E=; b=SEW9Vc2522BUqsvuYSAXR01dudYATO1Wcx70KKWdNvygIQtFk7DmBG2Bfeb1lR7m7JS+8kBWAt4aNbHsEFyC80y5AcFDTbME7ueN06Go7lwOR7KwJ/PQvxPAJWP9AgWCnlf1szVi6aq9+G4Yu0r0tCNgKCOStGhirLHRUcyDh3WlrqO+xGwzcHbCpfDc3bHS1EEV3SEPq5vh1XVGmjflNPEinaYbr9iWrEdM/7weS2hwJBkOdWdkp6UMa1SrIV8C5X5LIvaGkrFzAp4eBGXTXQjT/nRQVw+ID4s4VsdgAaZjhxHwvbJKDm7Qa7ByEWBBQ0NUTsBV8nQdEZou7DXqbA== Received: from BN9PR03CA0168.namprd03.prod.outlook.com (2603:10b6:408:f4::23) by DM6PR12MB2844.namprd12.prod.outlook.com (2603:10b6:5:45::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Wed, 3 Nov 2021 13:53:00 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f4:cafe::b3) by BN9PR03CA0168.outlook.office365.com (2603:10b6:408:f4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:53:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:52:58 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:52:57 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:52:55 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 06/10] ASoC: tegra: Fix kcontrol put callback in MVC Date: Wed, 3 Nov 2021 19:22:22 +0530 Message-ID: <1635947547-24391-7-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a811b01-e71a-4a51-6d02-08d99ed13f13 X-MS-TrafficTypeDiagnostic: DM6PR12MB2844: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IJyOw7zHA2nMn33OtUVfZnXMenuUDcscnP6y1Jo7THC5awv95rQMmroJbST4UPhuqS9c5xlTjf96lpnUrHWY7z93kQePU90k0rlPV2f/dLOxLKIDjjIt0Ig9mW/qGUJT6tU3pUy6FPfKHQTyflSEdIJzi9p/I7hXxKp5WFfYAb562NZ33qlhUCcp9iDKvh/DypWfNJ8GFRoLPFS12GaRZpwMhzXBtp5StB1VuonR2rVvqmwEQrH7fmjCxB+xUfNwo4gje3mU4lzQdumTbo9cRvcXO4bJ/WrTZfKBJpvWAp1p/iP84AGbC0fxshlrEACDgKNpywC1zL43wPr5QNszviWr0zDtBTjCNKz880tCzlxbgBLDk7C1GuSmYGNctdqHRlsLKfoHQZLqsPxMna40xCZc6YL01tHAybGmxaRsgbRFDymyOEL8hZpjxWLiswQMcj26qeBMOQYnqNsAHmvIA1bulSWClfVzmhmTc8nQpPE1I1XLr966koX6HjAQUYF8gGzSw4ro2Fo/NvA5u/9yuaQF7zcLrvZk6VtoRAmbE5VKcI3NksVcHAqo37zkBjkDxMwfJD6M5ECBSuhoZ80bq8pgy4Uw2Wh1nKIK0ZOj88oVUshgOyujYDGkZ0ymexr3JPyi/gQuXgsb8oJR56VxVYYWWJLFJmFHGOaHBrIaHO7O/riDCU1Dh1lyfkACQquUypE+A8AiUBi2QGrWWDXMOA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(426003)(356005)(7696005)(2616005)(8936002)(4326008)(508600001)(54906003)(86362001)(36756003)(47076005)(336012)(26005)(7636003)(70206006)(316002)(6666004)(70586007)(107886003)(5660300002)(110136005)(186003)(82310400003)(8676002)(2906002)(83380400001)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:52:58.8559 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a811b01-e71a-4a51-6d02-08d99ed13f13 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2844 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Filter out duplicate updates in MVC driver. Fixes: e539891f9687 ("ASoC: tegra: Add Tegra210 based MVC driver") Signed-off-by: Sameer Pujar Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown --- sound/soc/tegra/tegra210_mvc.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sound/soc/tegra/tegra210_mvc.c b/sound/soc/tegra/tegra210_mvc.c index 7b9c700..380686c 100644 --- a/sound/soc/tegra/tegra210_mvc.c +++ b/sound/soc/tegra/tegra210_mvc.c @@ -136,7 +136,7 @@ static int tegra210_mvc_put_mute(struct snd_kcontrol *kcontrol, struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); struct tegra210_mvc *mvc = snd_soc_component_get_drvdata(cmpnt); unsigned int value; - u8 mute_mask; + u8 mute_mask, old_mask; int err; pm_runtime_get_sync(cmpnt->dev); @@ -148,8 +148,16 @@ static int tegra210_mvc_put_mute(struct snd_kcontrol *kcontrol, if (err < 0) goto end; + regmap_read(mvc->regmap, TEGRA210_MVC_CTRL, &value); + + old_mask = (value >> TEGRA210_MVC_MUTE_SHIFT) & TEGRA210_MUTE_MASK_EN; mute_mask = ucontrol->value.integer.value[0]; + if (mute_mask == old_mask) { + err = 0; + goto end; + } + err = regmap_update_bits(mvc->regmap, mc->reg, TEGRA210_MVC_MUTE_MASK, mute_mask << TEGRA210_MVC_MUTE_SHIFT); @@ -195,7 +203,7 @@ static int tegra210_mvc_put_vol(struct snd_kcontrol *kcontrol, unsigned int reg = mc->reg; unsigned int value; u8 chan; - int err; + int err, old_volume; pm_runtime_get_sync(cmpnt->dev); @@ -207,10 +215,16 @@ static int tegra210_mvc_put_vol(struct snd_kcontrol *kcontrol, goto end; chan = (reg - TEGRA210_MVC_TARGET_VOL) / REG_SIZE; + old_volume = mvc->volume[chan]; tegra210_mvc_conv_vol(mvc, chan, ucontrol->value.integer.value[0]); + if (mvc->volume[chan] == old_volume) { + err = 0; + goto end; + } + /* Configure init volume same as target volume */ regmap_write(mvc->regmap, TEGRA210_MVC_REG_OFFSET(TEGRA210_MVC_INIT_VOL, chan), From patchwork Wed Nov 3 13:52:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600853 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7FAEC433EF for ; Wed, 3 Nov 2021 13:56:59 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AA8561108 for ; Wed, 3 Nov 2021 13:56:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4AA8561108 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A90551687; Wed, 3 Nov 2021 14:56:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A90551687 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947817; bh=aJ4LwsBtr8lUS0oAOEQypQxKOdL34W5UWtWPdDYWa40=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IgsU2/jIZ8H9b1AV7AW7MdDXX0zaPf7zYcGZ/mmAiNQuqmuUaFnq0yAx+yS/MVQdJ igwaxunw1Di+nr4SkRteKR2IrbZD+hzm8Dc8T2rCi0MdDr/RNcNHVKVsPVcy9Llq5p Ome95ejlmioDAoA70SeFEzjZe325m1mcpZdOwocs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 967AAF80526; Wed, 3 Nov 2021 14:53:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 71881F80515; Wed, 3 Nov 2021 14:53:20 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2053.outbound.protection.outlook.com [40.107.220.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 75F4BF804FA for ; Wed, 3 Nov 2021 14:53:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 75F4BF804FA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="MSPIrtD3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AjVgtK87pvA5zNWYvS4n8rxRdP8RaQOh9IwXdT09TPbgl3br9CRx6goEsKqQoHdv+hAqkKYfXZKGWn3RlukF+dEbFXLnyfBQAI0PW8C/RltaO5h2uYKBqOl6+NF0Qz2JKzMCPPDQ/oby1ZNQDBYd+s+1w3JymcqUp2MgvA6rS8Vryx9brz2aHbt/InCEyQHFeOy80DhsQJVOOFmJRFIt2mntE2sopo0D8eNvpmx99fjwpTtlNFmLUIrwprAaNEUHdS+uaXe/UnM0acnvDknluRsKzBEg2bSwXvygg6ASl7+KlqU/JZG9rQgkFCAhIYA60xaglPKpGjizmI9sglhcyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WF2iEGB/T6jvZnq4ceN0v7xUZBWzt+ycRuQBNzdRPgU=; b=HAG7PmNFTNUFR6No6WIFnYSsZhpP5+MOButvJnwy8kQSy0jh/Ka1ao2cZszYNz3BseAO0eIbNidvO3bgzpPcrlxQfn7x3WVGnRZJPLjF4K19q5KwSIl2PMIyLZY+avFNOCE/d4Mdb9G4VrrDhYn40RbHCQ3qJ8F1Zgd+YBAdGlhLvy5HwN/8kHNwFdRXwLffZ9s+B+Kq1156Qt9xcbx/9XuYN87iHFZRfywj7xsojZDOOrlfasoGBdE3aOoN0Z4EgyW+TNZYWUjicU0spMzf0EiiJw9M/es2blPW5tS5wMekkPDLNkoeB6KXwEziAYNyR0z9nBW21Ik9cZJTYdnHFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=perex.cz smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WF2iEGB/T6jvZnq4ceN0v7xUZBWzt+ycRuQBNzdRPgU=; b=MSPIrtD3K+TdfdpWYyG7ZBcn/urjJlOnmo214SOSHUlced8y9jV1itvdT7FIYXSyDny7kBfuh4TNJmdFNT8uJ2Iq9oniE6EQQEtS8C2msQdprsWRnDtxihq9WZ9ILBTcTFvOQC7n/Bhz78cWD24dr08300LW9w/lVZokZdlfDNCA/Vek9JUGOgRVaD8JujBm5Zx30JhBE77RU68q6qfuwn35Ws/WloB843cqG2vkNvPaopkC+qd71+yfpPynMSlmdzcQKau6oAoxDHwFFk3NgBDoAjCbHTOZpNGyyFx3PlbPm6jdaDYLrcy22avUX20dhJ4+pVl6P5gqawATfgPydA== Received: from BN8PR03CA0013.namprd03.prod.outlook.com (2603:10b6:408:94::26) by BY5PR12MB3985.namprd12.prod.outlook.com (2603:10b6:a03:196::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Wed, 3 Nov 2021 13:53:03 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:408:94:cafe::68) by BN8PR03CA0013.outlook.office365.com (2603:10b6:408:94::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.18 via Frontend Transport; Wed, 3 Nov 2021 13:53:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; perex.cz; dkim=none (message not signed) header.d=none;perex.cz; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT010.mail.protection.outlook.com (10.13.177.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:53:02 +0000 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:53:01 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:53:00 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:52:58 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 07/10] ASoC: tegra: Fix kcontrol put callback in SFC Date: Wed, 3 Nov 2021 19:22:23 +0530 Message-ID: <1635947547-24391-8-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a180ea0-2d17-4216-c48c-08d99ed140f3 X-MS-TrafficTypeDiagnostic: BY5PR12MB3985: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oIqv5BeoPTZHvXwDYF66S+APP1tkfz4SuCjGloT3rg71+Aj5cco3uS5nEqwlhCB8n57UQEPILUoxwHgEBYTdejTCX+jvv1EdKIQ2H8KV1/pQVrb/Ye6FQgkSs8a7K+Pymduh8o9zoOHRCUgmpk0ey6IgCV4o4/8Pwr5sxmEwpXeaMwk/frxlzq5ukgV0jN32VS17UwbYj5gUkZ+M18xUDD/LuLQdTuaF0Cle0ey+3Gu96JYGiAVMl46BLSqxrG8E7CLMRI34wIYtdYYu9x8m9uynxPEWZBY1s4hDbN9LQ2BOxhKnMxbd8Ui507Wcx/LTkHbOM8e1/EFYFzzfv1AVmZjjcD372EowQt8aUuaJfKzSYo2TgJsfupvjCjCEJJBbFuS8KZOcR+C1UPVSv3xCYwQJj3ibIfn0aDHpxZZmxkhvBzNptgvuAK3J7eEluSfnoqYcw99IS9FNzW/Xlj8zr41lGxE3g+XI04cXwHqCLEq73abSQtRRgvZdLkn8ICsODDN+DmraGfRSg01eLVq1oaUTv/JxqTnfDpQE9C4KZ2Xkb7zh2FTxzgunhUAIclhXeaLfX7GjMtn6IxKxDA+LWsU6AqWtcXyuBiKNBluDslPXRSbKvI8uP8piD9nYQ+XtHfOSXRXtCnEALmxPtOgKKJ5ZxJqIkm/7qRFnIgpojLaF7A9YgBVw908ocouqp5btniyvAsz9nIc7EtYBPAnCKA== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid02.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(26005)(356005)(86362001)(47076005)(107886003)(2616005)(5660300002)(426003)(6666004)(186003)(83380400001)(4326008)(7636003)(2906002)(7696005)(8936002)(8676002)(336012)(36906005)(70586007)(82310400003)(36860700001)(70206006)(36756003)(508600001)(54906003)(110136005)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:53:02.2907 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a180ea0-2d17-4216-c48c-08d99ed140f3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.35]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3985 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Filter out duplicate updates in SFC driver. Fixes: b2f74ec53a6c ("ASoC: tegra: Add Tegra210 based SFC driver") Signed-off-by: Sameer Pujar Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown --- sound/soc/tegra/tegra210_sfc.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sound/soc/tegra/tegra210_sfc.c b/sound/soc/tegra/tegra210_sfc.c index dc477ee..ac24980 100644 --- a/sound/soc/tegra/tegra210_sfc.c +++ b/sound/soc/tegra/tegra210_sfc.c @@ -3273,16 +3273,27 @@ static int tegra210_sfc_put_control(struct snd_kcontrol *kcontrol, struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); int value = ucontrol->value.integer.value[0]; - if (strstr(kcontrol->id.name, "Input Stereo To Mono")) + if (strstr(kcontrol->id.name, "Input Stereo To Mono")) { + if (sfc->stereo_to_mono[SFC_RX_PATH] == value) + return 0; + sfc->stereo_to_mono[SFC_RX_PATH] = value; - else if (strstr(kcontrol->id.name, "Input Mono To Stereo")) + } else if (strstr(kcontrol->id.name, "Input Mono To Stereo")) { + if (sfc->mono_to_stereo[SFC_RX_PATH] == value) + return 0; + sfc->mono_to_stereo[SFC_RX_PATH] = value; - else if (strstr(kcontrol->id.name, "Output Stereo To Mono")) + } else if (strstr(kcontrol->id.name, "Output Stereo To Mono")) { + if (sfc->stereo_to_mono[SFC_TX_PATH] == value) + return 0; + sfc->stereo_to_mono[SFC_TX_PATH] = value; - else if (strstr(kcontrol->id.name, "Output Mono To Stereo")) + } else if (strstr(kcontrol->id.name, "Output Mono To Stereo")) { + if (sfc->mono_to_stereo[SFC_TX_PATH] == value) + return 0; + sfc->mono_to_stereo[SFC_TX_PATH] = value; - else - return 0; + } return 1; } From patchwork Wed Nov 3 13:52:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600851 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F460C433EF for ; Wed, 3 Nov 2021 13:56:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD2D561108 for ; Wed, 3 Nov 2021 13:56:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BD2D561108 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1771B16AE; Wed, 3 Nov 2021 14:55:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1771B16AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947801; bh=og/kH9vK5xWax+RDT4g1/B+KP4y5sTVyd9VoKd6VJ6A=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=q6KtgAmDhdkHu+ZIqxBbVP4jyi3GKo7/+YvvLnyJpF1f9rT3SWz0fGzYW+rWyND3p GvqNNbY3W6NvtnNXXA4b0Eqi3Dolnqgo3aQDLG+KPmte9/XRfKj5rWsp7CtIpKcPyd 15EUw6W/gUzG0j42j/C/a7+TTpXsd17UBPz+UVec= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CC41AF80524; Wed, 3 Nov 2021 14:53:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D4AEFF80506; Wed, 3 Nov 2021 14:53:14 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2057.outbound.protection.outlook.com [40.107.223.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2DC9FF80224 for ; Wed, 3 Nov 2021 14:53:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2DC9FF80224 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="oqCUKWRk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RrwdMpTK64XIcmL5VocW10co5jk45IcZBFlsAspByqHeMK1rLWLCJHR6DDyUx1OfUpOUDB5FLP4mBOFPE6BsX2JUrZcLeQ7B0uyCgnPLJQbfrpKjng6hJqIa09WXAY+Yb4wt5/HRDxVJwt/svKFjEiGQzUu6nkcpEpQhbtqI9adUK86wCmXuVUDg+yUWbWptpzygVDdktv4zfqLKk2YpyK4qTe8u3jE3+MNSZvSoWeCwP5KGN5WXdZywCz9gLCjrmWRhGEMSkt8CStETHbpKzFeUFTii910GPINGWlES1DibJOHtg3NzYwO+8VweDrkGhY0rTyiK0M9pmIRubs2mkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PktcI9cavefHccx9wJ7xoNYt427yPivaSQDVB9VDtMs=; b=K4YNB7w7eZtrc1uWceVuO882vfh1VvE6In5WOC8f51Ref8T7LJGxVf9Ob0A35npmzJuKZmAigoWinw+572NnJtnBH/Zt5GcCj5csAQiRzTIIoKv2dEbGAA9s833Gyi0ds4eXbTcHkiZ+6aRKPH7tYCJvJFt8464DO33XdKHrIu+NHN8UdMoSeQSF5KwFetx6uFlXnS9af7zAWfcEUqFhMHhbyUwnPaujyEyKhFsQ5Ym+vo5zYf3bss52qps/VPyZbayn1TzAjOBnS8tAAAUb3/53inz9/pmX2pr0y+sdur2kfbhdTZ+NuqKtyiSqZb9/Sn4mjaalGOdLN2tCn5sSYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PktcI9cavefHccx9wJ7xoNYt427yPivaSQDVB9VDtMs=; b=oqCUKWRky1Yj8uhsrTBw5fiI3NjEV5kWTkq4nLureN/UyFcgtNv3vrXZpsetCM0haWm7TUwPOimcsCb0G3OyJR5tiwdIQ1G1bAVUaQzpW3RNXRsU1lHJeyq9KjpeUNYqWuM99MdYoJPnsKSG2UT+ucgvS6SIZ2uttpFOz8it6n6r0YASbSLWbJ4VLybEQzFvuPsQ2Ev8HF8wfBO2D+vinvsMecS+owHfDpBAAViNndXBKUDZMYQRkIYyUK89iBmqZnyZNqcrftIeQMMH+jOZt+fYuaGSIIRjZeJzXSZoOjcfI+68FhBYzYg9fUFyq1moaXDauc4KvorBvlcV6Ok5tw== Received: from BN8PR03CA0035.namprd03.prod.outlook.com (2603:10b6:408:94::48) by CH2PR12MB4216.namprd12.prod.outlook.com (2603:10b6:610:a8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Wed, 3 Nov 2021 13:53:05 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:408:94:cafe::68) by BN8PR03CA0035.outlook.office365.com (2603:10b6:408:94::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:53:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT010.mail.protection.outlook.com (10.13.177.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:53:04 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:53:03 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:53:01 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 08/10] ASoC: tegra: Fix kcontrol put callback in AMX Date: Wed, 3 Nov 2021 19:22:24 +0530 Message-ID: <1635947547-24391-9-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 528882f1-4c88-44a9-ad7f-08d99ed14286 X-MS-TrafficTypeDiagnostic: CH2PR12MB4216: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PABPoNHmBXhqUcltldXH6SzjOftf4FS5G3ZoACXqp4LIFB0/eHIr3Amv9CmrxxEFNxFgA/1yTLf1urBsgHsiYfoPaZgOMIwMISjDyFabTgIn+Z8lL3ulzytkdsGEOfrw1A/jEfEYeUl+JukcxBAl9NzQkzD7Kj+EzrYUGqLah8ySy2dUzibUP0ZoBhgbCQzDY/fS8zvbedH4FJ0T8/6eKaBGCzQg4R+vPmKEE60d5M8bo11A0FkQHQqr1Q6iiymEoH2lG1e6zrYS7ml7CMtmthqgRlRSTC3dmPqBsvoWKP5sXb9MJ3BXByxzBc+nTrNPn0LmBGtLerTxFPrz6g7EgkWmYBZmR7nw+LyJcKalObTpPCBXZJIS5e8+HuVDScRA1B2OD7El1LjZrjHMCo74mnMpdaRofsZocPu4VarDElUFa0F0zg+8/3bzeKsIVgeJj0BG5ApmVC1UGpJDdRKbnbnE4np9vz+vonGy/z7KOS5WSDDlO1n1mIG1kQTQQeNq0ryAboztJLL8nt0l6sB9sO4UvOxCZ/TD6lx9KquMIJsSFzTN97Fomf2uogBhJsbjjFVQCaHiQyL70uGDm24IvTJNswLeHwjBDz7wNZtUY52bRZQhWLpg4LLjK+GkrbE7HOGeshbHzrzuhFrr8sZWnKTu8/c1BvupDuzyV1kKc7pkX86W6dpTG7TRCoU/PI+wlmvUpbE00pB/lcIHsxiziA== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid02.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(7636003)(36756003)(508600001)(356005)(6666004)(110136005)(54906003)(4326008)(36906005)(107886003)(316002)(2616005)(47076005)(426003)(336012)(2906002)(36860700001)(26005)(86362001)(70206006)(82310400003)(8676002)(5660300002)(8936002)(7696005)(70586007)(83380400001)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:53:04.9322 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 528882f1-4c88-44a9-ad7f-08d99ed14286 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.35]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4216 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Filter out duplicate updates in AMX driver. Fixes: 77f7df346c45 ("ASoC: tegra: Add Tegra210 based AMX driver") Signed-off-by: Sameer Pujar Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown --- sound/soc/tegra/tegra210_amx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/tegra/tegra210_amx.c b/sound/soc/tegra/tegra210_amx.c index af9bddf..6895763 100644 --- a/sound/soc/tegra/tegra210_amx.c +++ b/sound/soc/tegra/tegra210_amx.c @@ -222,6 +222,9 @@ static int tegra210_amx_put_byte_map(struct snd_kcontrol *kcontrol, int reg = mc->reg; int value = ucontrol->value.integer.value[0]; + if (value == bytes_map[reg]) + return 0; + if (value >= 0 && value <= 255) { /* Update byte map and enable slot */ bytes_map[reg] = value; From patchwork Wed Nov 3 13:52:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600855 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4CDEC433EF for ; Wed, 3 Nov 2021 13:57:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D41F610FC for ; Wed, 3 Nov 2021 13:57:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D41F610FC Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 832E116B3; Wed, 3 Nov 2021 14:56:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 832E116B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947836; bh=xRGdEPIqUQEvT3bTbr95CdZloeK+ukgEiI7qUaabQXs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=C6g3a/hgzx2u9T/lk2kQH8RFQkMycNjJPD2SmAzQiEd9GdmeiiU9fpcjlpP2pvwKF 194H9f9sGoHgaJOmBZb7Q5Arh0Jk0+BHWSwJUzLygwbh0DhNkSWjlKN7woC+8osNYS D47E1TeSmNdQIKeQvQEqAeaYpWPUEwvJtLKVdEls= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 446FDF80533; Wed, 3 Nov 2021 14:53:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BA854F80520; Wed, 3 Nov 2021 14:53:23 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2043.outbound.protection.outlook.com [40.107.236.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 22CCBF80224 for ; Wed, 3 Nov 2021 14:53:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 22CCBF80224 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="YOgPzSTw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LXtWUab2D/MAopXoWnHhtqMploUvyPfnyuwZv9W49sU2TwWz8/1Z2lx4UBmomkxA14Uh7M+QiOhQKamkGfFnDOi2ziSieECaMpMByQAfmbeqHJdLbeq8Dyja9RrVvgzANML2RxMdWU+mzd4XiK6yU8Lq1jIsa8YbJnismNccmwrHVmgLNEvlU+9akTSnH3ZEWX/XrPNHX6Ts975jFldSYUeCTdyYLei0eex1MfIHTYPDwn5p+SvEa+ChSAksOoy5PIp0jES2fdXaMTRwPAFDs64afSyZuxUukf7BBWnGK9xcuu3AxRw/Ie9zauuwehrrN2t6SZnOjAIEdaVB+YECWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ugxmlf/o55vAjvWrVe9GahbKf/lSIhQJpc3KN9DrvFo=; b=fJI8UmCOIylFLdyCJxaJUn18G3VFERksVtH8eYuLh/5hxmNiNhwJnZc42po+qt4GI7uC7MNyBHKRcCgUMvRiCEy3FVj90k2/p0izUytR4fHZ531+Mx4fIWMC8k4BSS1jILMqoRjawCIJuvSLSUAxRLavVbSwahri3vWa0Cc1jFhkzcKMCFeBzDNC00ZZ1jOIirrivzh8+TlbC3gWYv5YsV0hkWRkscG0VcyaQ1CHKF016q+pl22gC4bfQXw2nfAcp1G420yUYX0wAix0Q86JsAdXN0XIgpMaWHvaCoEhgAIG4EAUb3ZF/NZKBXCz03+3FNJ38ZAkGqbpnzQZN/xqPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ugxmlf/o55vAjvWrVe9GahbKf/lSIhQJpc3KN9DrvFo=; b=YOgPzSTwDQgQpwk0zzjfgGt0dNSKIPborMyW2cEeN+YALVn66nvXpMebwIJH8WigDnwl9R3b5Amar+ZjPl8QHzX/9Iv+IU8cZknSGdwy4cSp5qaJJxpCooea4/TFT28k9XtxShXuuTrxYZzbeWg3Vekv/pvFWWegE6MDiGkEjGbY5n/1JVnD4pSUZPtzXicWDd2yN5R5FUxaI/Rep6HOz+nuyzFAykfaaDv8tEUrhCwFU9VLioEogM/jfL6LJ3y8Ir/iz+c3oFIN72zebCi7g+185yD2JJhmyeX23SHXyEQ69Xpinm0PN2x4DZ6NyKvWW2bakIzMcTRMZGT9yDNP1A== Received: from BN0PR02CA0013.namprd02.prod.outlook.com (2603:10b6:408:e4::18) by BN6PR12MB1603.namprd12.prod.outlook.com (2603:10b6:405:b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 3 Nov 2021 13:53:09 +0000 Received: from BN8NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e4:cafe::98) by BN0PR02CA0013.outlook.office365.com (2603:10b6:408:e4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.17 via Frontend Transport; Wed, 3 Nov 2021 13:53:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT023.mail.protection.outlook.com (10.13.177.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:53:08 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:53:06 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:53:04 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 09/10] ASoC: tegra: Fix kcontrol put callback in ADX Date: Wed, 3 Nov 2021 19:22:25 +0530 Message-ID: <1635947547-24391-10-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6dd8037d-cc78-4400-bd1a-08d99ed144a0 X-MS-TrafficTypeDiagnostic: BN6PR12MB1603: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bb2iVKtwfTGLnB6apgKz7PARO9HDQpSWVug+Quq0CL/6e+s25kbYsvnuwkp8RKeGNkoY7fbTW2T3W5jTOznPIJlX1wfAYleVg5TvWGQxLmapdGABlS+kDCWgN0ctlJZ+x2hP8508HhTMORtoe94VukENvcF9+btrw2fw2UP4lyLRctLlJEdLlXokoQ94S+kkKwG1rH9pF6SWmIAb7Q+Nxx7P2/vdi5YCbrEvn9Wlve+D+/kck/NdPtpDrbN6GcJUZ17sfREJdlUK9iwMvymKy33kP0G8BqZ6gTrK8XJSJCC9Yuamn7Nyh2Rox8pxDcn5bYllDnSOpvnujSKc+WH51YJNbdxWiKtSLe6TCJO853EJqNJuOJLhWFmqwJtG6Y0gXnePX2p4DN197goJVOozLDsLNp51iaCI1LUcka/C4p+KVUSR74BJt7XD/E74wh6s8ihTaJogVHLpA8VUN6TGiFf2IkMERuL/my0tA9KrFWyfT8RRjVM8mQi6iYXTUJlCDQatJ7e3J0TQlTSBWu3JDoYbUmeQobkQIJT842wp8Kb8yusfH0bxMysNiBayAhhyhyBrS6D43B80Q7rkbvA94FdkaZe19Ufw/C/H6x/P9YMMGCExL05G21x0pReo3tFPw1tjYPi4kiBC1pRvCyFYxGMJ52oUR8dNWcWNr0egrz8URrFUVSbQdUcbzVhSA790Mc9Y7Cf213cKreu8ENbt/g== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(70586007)(26005)(36756003)(316002)(70206006)(107886003)(36906005)(6666004)(36860700001)(5660300002)(2906002)(356005)(7636003)(8676002)(82310400003)(7696005)(186003)(8936002)(508600001)(54906003)(110136005)(336012)(426003)(2616005)(47076005)(4326008)(86362001)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:53:08.4695 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6dd8037d-cc78-4400-bd1a-08d99ed144a0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1603 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Filter out duplicate updates in ADX driver. Fixes: a99ab6f395a9 ("ASoC: tegra: Add Tegra210 based ADX driver") Signed-off-by: Sameer Pujar Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown --- sound/soc/tegra/tegra210_adx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/tegra/tegra210_adx.c b/sound/soc/tegra/tegra210_adx.c index d7c7849..933c450 100644 --- a/sound/soc/tegra/tegra210_adx.c +++ b/sound/soc/tegra/tegra210_adx.c @@ -193,6 +193,9 @@ static int tegra210_adx_put_byte_map(struct snd_kcontrol *kcontrol, struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value;; + if (value == bytes_map[mc->reg]) + return 0; + if (value >= 0 && value <= 255) { /* update byte map and enable slot */ bytes_map[mc->reg] = value; From patchwork Wed Nov 3 13:52:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 12600857 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CED28C433EF for ; Wed, 3 Nov 2021 13:57:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D15C60EB8 for ; Wed, 3 Nov 2021 13:57:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D15C60EB8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 915AD167D; Wed, 3 Nov 2021 14:56:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 915AD167D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635947866; bh=U1qKSGKQ7T8MGOy8DjhdSkpwe/0UXhdTilYxhVCghzU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HXcKpKqjo9ziya2lQl98KyIhq8hYguwynORQRbxqQjg360TJyn9e4c0Faqc1laBXf J3kVp3wgZzBxPV4Z6EowykjOLhaAs6lGDjOngIHewAaCpTzW0/19Y2mzDZwt7WJllh f0xUo46gJIsXFhLwhp2y6N8lQS9G5wY0ukldtC/4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 93B04F8053D; Wed, 3 Nov 2021 14:53:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22E81F80524; Wed, 3 Nov 2021 14:53:27 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2056.outbound.protection.outlook.com [40.107.95.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2FD11F80510 for ; Wed, 3 Nov 2021 14:53:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2FD11F80510 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jfP7/dyK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HnYVPJoc9Y4BAdLUjaSQLa3IR2vuVJ9gt8995NIOt9jlMSRh71Oc7eabBuZO3f5EP4BUOmiPg7fMRdM7I6Y/nuCH848OhCISO7IwQHf79SJLhEjqHSBfZw9peOy6WWIPloEIDchn0y7gPkjaF9xs9v2Hzv1zl9QkRK6WBGEJ51Ca7lR6//WXkSxr7j/apq9JtdKA7Q7Em4K+UkMAfA4pdCANsqtgQ37/wfw+GuuVTXe1RAkxJ2r0b5IUu0lft5euGGuV1BPSAJ5nbMLuwTOliICD1cIbDW0g8KpF4nEnnK8cG3ZOgcY18dng7m6bo7/i0FoEIO2dqZLhbPaHU4IpWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WgUJ9s87Od92IhYOLI48pQMKrFUKSuJ7BIUwtBHCr7Y=; b=W6VSgp1pre/ZfOwYLmLNW7rYAfAUUnZgHj82ewRgc8DYM6lhUh9hy6SpJ3EZNKZuH5G+Y92YJu+aORrkwumzDYTNc7aQIOC+ukEMfxDuEpBI/hJZHizz2lAiW3M6CurDkgLdg92st5oySLVdDJ3Y7fLFbCJW9si9+3qJoqApSGVLSFkna7LAxf0VRWfN3xq+bbTLUibBqhakGsp5BG279RAS4FrtIqUic5O4j7Ivb47b0EH0VpHvB3oJfsVEu8lRsfKledjzHX9+eiXWLzSgBR7rGvZjwuAqnz69fGNKCnNEjSfjTDYZYYKgvhlaePskx1BaE5xVBJRMD3fd2szQFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=alsa-project.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WgUJ9s87Od92IhYOLI48pQMKrFUKSuJ7BIUwtBHCr7Y=; b=jfP7/dyK8diy6USb1+EhPcuvJ2uJi3GTG1Se1UXJz/AhU9muJZRlYXU++1siSsgqr6Uafcy+zMmsjS6p0Uo+waJ/wPtke0NrPJsQx10jkAVeY65DfmgQ4kzYh4LU8ReQ1iykkFsVxpVlZxING08ej/NMgtdhUXJIWCrfn7Dny+awHFaUxeF4MMesfGnWpNc3gxEUj8pPIz6VwTCugYVhBSg43NeRfMf9MfPe6IeiLnwzSWeib0VDo521XcowWvSTwfeMbMWuuLzmrH3WaoD9VqX4Skh03qN8Avy+CHuywApAnZ3uop67mENihgxJZFca9iD2vcjbyFsb5zBYX5e4VQ== Received: from BN9PR03CA0035.namprd03.prod.outlook.com (2603:10b6:408:fb::10) by CO6PR12MB5444.namprd12.prod.outlook.com (2603:10b6:5:35e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Wed, 3 Nov 2021 13:53:12 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fb:cafe::81) by BN9PR03CA0035.outlook.office365.com (2603:10b6:408:fb::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.18 via Frontend Transport; Wed, 3 Nov 2021 13:53:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; alsa-project.org; dkim=none (message not signed) header.d=none;alsa-project.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by BN8NAM11FT065.mail.protection.outlook.com (10.13.177.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 3 Nov 2021 13:53:10 +0000 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 3 Nov 2021 13:53:09 +0000 Received: from audio.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 3 Nov 2021 06:53:07 -0700 From: Sameer Pujar To: , , , Subject: [PATCH v2 10/10] ASoC: tegra: Fix kcontrol put callback in Mixer Date: Wed, 3 Nov 2021 19:22:26 +0530 Message-ID: <1635947547-24391-11-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635947547-24391-1-git-send-email-spujar@nvidia.com> References: <1635947547-24391-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7e3791f-d016-4562-52ef-08d99ed14628 X-MS-TrafficTypeDiagnostic: CO6PR12MB5444: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VX510ZvckgkQPCoaHluPCKub7Yf8HV+nT0bwS4QD2CY3183/JP/C8Xlplxlh37pvBlEErgdamHgTfbg9i3lacV+SyXawQiCSdITNmAkQ0c5q/ocOhOy3fJWCqLY34nMJEAfvUj99pIXMhej7X250/WGfTz21+D9+wQNwqCAPjAx5ouPXoO1FOorBdX0GXLNoFK23CNnEjHvSKOly4qp88e4dOdjAzgEt8dEprfaW6wjV0U+v5XGKuQkASbAizdhySfj6QTdd84LEZl5RrqK0gBvrWm3HlsVzNr1cEKcEfRp/MAOB0KjyHtIEn/R0dI1X34IdSWvb+z4LPP81YgAsDKgcE0cgXHfbIn765Co/FI4/uaL00GvsN85Qh+iJlAZzPBi8RFPEuNRbmm1OPztMHSOq4eyAV487zFP9OqIcWHwmtYVIpbf4rGrjba0Afx7gHPWFnguPKd4AVUn7PFhLorQNrFUVypS/SgBioy2bQZC1ARkQQKr0x4Oee8BC5ekjERJU8heZh7k0uY7Mrimo+sVmwUS5IEciOCfwKzKZ2x4QA53ea3IYKF3rv5Hi5sUQvrpZxmQkpsS3oZfP+snTAAdguVq2T9vocKAqfQXW9y9gcTQToqSzeL/AEK5M/qfM9LKPUCyvhvVicGcHE2YVknvRta0tv484pV9wq/PPurwzggQFvlBa7XmuMFZapqdYmyECizsoAYHC8l5QX3LLPw== X-Forefront-Antispam-Report: CIP:216.228.112.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid02.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(83380400001)(7696005)(2616005)(36906005)(2906002)(316002)(82310400003)(86362001)(6666004)(426003)(7636003)(36860700001)(4326008)(8936002)(54906003)(107886003)(26005)(8676002)(36756003)(110136005)(356005)(47076005)(336012)(70586007)(186003)(5660300002)(508600001)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:53:10.7669 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7e3791f-d016-4562-52ef-08d99ed14628 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.35]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5444 Cc: alsa-devel@alsa-project.org, Sameer Pujar , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The kcontrol put callback is expected to return 1 when there is change in HW or when the update is acknowledged by driver. This would ensure that change notifications are sent to subscribed applications. Filter out duplicate updates in Mixer driver. Fixes: 05bb3d5ec64a ("ASoC: tegra: Add Tegra210 based Mixer driver") Signed-off-by: Sameer Pujar Suggested-by: Jaroslav Kysela Suggested-by: Mark Brown --- sound/soc/tegra/tegra210_mixer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/tegra/tegra210_mixer.c b/sound/soc/tegra/tegra210_mixer.c index 55e6177..d2d1946 100644 --- a/sound/soc/tegra/tegra210_mixer.c +++ b/sound/soc/tegra/tegra210_mixer.c @@ -210,6 +210,9 @@ static int tegra210_mixer_put_gain(struct snd_kcontrol *kcontrol, id = (reg - TEGRA210_MIXER_GAIN_CFG_RAM_ADDR_0) / TEGRA210_MIXER_GAIN_CFG_RAM_ADDR_STRIDE; + if (mixer->gain_value[id] == ucontrol->value.integer.value[0]) + return 0; + mixer->gain_value[id] = ucontrol->value.integer.value[0]; err = tegra210_mixer_configure_gain(cmpnt, id, instant_gain);