Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp474568rwb; Thu, 18 Aug 2022 07:06:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hFfmYzjAhAIhCYrdEoeLB6JvxIdBNUWVBygmZCAaGMVbyPyuwF6V0V1DZWKRgjWeMtU8e X-Received: by 2002:aa7:814d:0:b0:535:c875:dd4f with SMTP id d13-20020aa7814d000000b00535c875dd4fmr2963788pfn.4.1660831607094; Thu, 18 Aug 2022 07:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660831607; cv=none; d=google.com; s=arc-20160816; b=MLC2tv8nRFznACnfPsW2E+b6pHXD30Oc4K1wCjulopnSzcZFd+e1HEyse9UUCjOB0k fzjZJOKbqYBrut+aO/gszfKTlDJId+5ZsgHEwpjn2jMP2LlK5cQoew5pGmA+V86ca3SN zoKne3koIHg1JWQOCCfYscTEnzjJrrS2AqXWW/6ZczpBGomm3xkQsp6B6NgIEd7JKosG UobttsWqcJD0TSVtlFknXMCX1wjEZoHm2yImkRihcOtKZtG/OSJOZXh49JrL3LkQUdAJ XeNVhJt01T6K7vSmKH8a0tBSG4n6zcetzLe++X9Z27qxLr0Rzb5zv/nx7oYJm3iYZFZ1 jkuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6rZZaOHOvolmccYyL5qbkZM57p/vVPxvzfbkv6kGURE=; b=sqXhaT3t5juFKnUheA6h048ppnPQ4IBJoyDHnkqs43gB83SAdgQ636scIta98OxwAw Z9KOcfgg85sJ8Br+qHAcEAdeBj9gB5eogZANNZeiOFyho+dYLgd477t3wgkS1yxs6B6w uHa2tA7FGu5gxkCFBkncyJtKvUbZbMEn2Ra6bljZ2/w7U8Xv31hMpJBE5nBkWspotP7o jwEEktBtH69SYV5Ofx1QW1bHLB8nr5EfUGoEKbvId4aWFdWjHMBZF6xOq4Tx0OdOKq9R SPw7IpPTxbNs/VNu07iYwEWWBo6WGXSGQqbfjV8SE6TfirfZGIkZm0j/487PrGGy1eb3 ALWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=st0tuLfj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020a1709027e4300b001709c82ca08si1284929pln.297.2022.08.18.07.06.33; Thu, 18 Aug 2022 07:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=st0tuLfj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245213AbiHRNrC (ORCPT + 99 others); Thu, 18 Aug 2022 09:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245187AbiHRNqw (ORCPT ); Thu, 18 Aug 2022 09:46:52 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E81EB56EB for ; Thu, 18 Aug 2022 06:46:51 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id bs25so1812980wrb.2 for ; Thu, 18 Aug 2022 06:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=6rZZaOHOvolmccYyL5qbkZM57p/vVPxvzfbkv6kGURE=; b=st0tuLfjyZg4OwhWSH6GgD154EBVCs8begrdGXw66Y1wqcN6jG6vXa+K8NfbEtYg3I cHMjVPOLJKyvx+O0D/84ISQ2yukD3qKOuE74+kLVOC64t9RnIhNEoBMcpxMtwRX4JzGY RgNCqCYO8QYohBdJn2ZKNkg01259d9rfRkbKteUgMD+2F3lse3oF4uMV889ZVXG66QvZ QwxTyNwRxY/hcFqwZsQK0jKA9+aAX6U8g8Qt+s3G3j4d6LVBFHJZmakmXaNFyF2YQMlx WEnK9npc0xRahj/rWdMDKWHTw454VWiAvILMkxVkgmgjhJ7dGdAYFNjO+6wyr/uSCO/a zFzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=6rZZaOHOvolmccYyL5qbkZM57p/vVPxvzfbkv6kGURE=; b=qogl3dU+AceRgXe/6cmSDS+iH39Xte/RKUCZfojzkpeFss5H42vwSIkwqNs5QQXzPg kmQqLmnhbNuOThPC4UGz1ToaTvMn5vcLGhH1KJ44Z13AHIi+93dklLz5aZ60b9iTcHif VovlYKbR96fBQEL+dN8Zit3oI7X/6aZNzPFSx/P4B27Q6iOgSjLeRCAcGuum3fkVOyYw VWARPwYAKmIE4Me8mlW/XtGO4jgFDrS2/X6VrPB6FNMuAFKljEarW68ygLDx3GQVI/DF 5JiiY2u0/TJxZiYHTlzQJ+XKyYgpvCW2OxiBs1OA8Wd6p7SCZivLDwnqhaRzd2jgtO+i BFPg== X-Gm-Message-State: ACgBeo20S3Y4xzrVeDSG4bS+xpDZ099ZNYBjq/8W6w3V3B0qF3vlY2bg TcsZoFjH+BqPIOR38N7155hJzg== X-Received: by 2002:a5d:5a9a:0:b0:220:6309:5c87 with SMTP id bp26-20020a5d5a9a000000b0022063095c87mr1600521wrb.107.1660830410046; Thu, 18 Aug 2022 06:46:50 -0700 (PDT) Received: from srini-hackbox.lan (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.gmail.com with ESMTPSA id v5-20020a5d6785000000b0021e47fb24a2sm1454549wru.19.2022.08.18.06.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 06:46:49 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 5/6] ASoC: codecs: va-macro: clear the frame sync counter before enabling Date: Thu, 18 Aug 2022 14:46:18 +0100 Message-Id: <20220818134619.3432-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220818134619.3432-1-srinivas.kandagatla@linaro.org> References: <20220818134619.3432-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clear the frame sync counter before enabling it. Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/lpass-va-macro.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c index 1ea10dc70748..a35f684053d2 100644 --- a/sound/soc/codecs/lpass-va-macro.c +++ b/sound/soc/codecs/lpass-va-macro.c @@ -23,6 +23,7 @@ #define CDC_VA_MCLK_CONTROL_EN BIT(0) #define CDC_VA_CLK_RST_CTRL_FS_CNT_CONTROL (0x0004) #define CDC_VA_FS_CONTROL_EN BIT(0) +#define CDC_VA_FS_COUNTER_CLR BIT(1) #define CDC_VA_CLK_RST_CTRL_SWR_CONTROL (0x0008) #define CDC_VA_TOP_CSR_TOP_CFG0 (0x0080) #define CDC_VA_FS_BROADCAST_EN BIT(1) @@ -423,9 +424,12 @@ static int va_clk_rsc_fs_gen_request(struct va_macro *va, bool enable) regmap_update_bits(regmap, CDC_VA_CLK_RST_CTRL_MCLK_CONTROL, CDC_VA_MCLK_CONTROL_EN, CDC_VA_MCLK_CONTROL_EN); - + /* clear the fs counter */ + regmap_update_bits(regmap, CDC_VA_CLK_RST_CTRL_FS_CNT_CONTROL, + CDC_VA_FS_CONTROL_EN | CDC_VA_FS_COUNTER_CLR, + CDC_VA_FS_CONTROL_EN | CDC_VA_FS_COUNTER_CLR); regmap_update_bits(regmap, CDC_VA_CLK_RST_CTRL_FS_CNT_CONTROL, - CDC_VA_FS_CONTROL_EN, + CDC_VA_FS_CONTROL_EN | CDC_VA_FS_COUNTER_CLR, CDC_VA_FS_CONTROL_EN); regmap_update_bits(regmap, CDC_VA_TOP_CSR_TOP_CFG0, -- 2.21.0