Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp980921rwd; Thu, 25 May 2023 06:41:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4LDF/8+q10nL4L3Aoao49iZ5424iypQ9xyfBLqoxKvbourXV9rHBf/YPjFPL9MiJYfEAm9 X-Received: by 2002:a17:90a:6e49:b0:255:3f41:82b6 with SMTP id s9-20020a17090a6e4900b002553f4182b6mr2215302pjm.4.1685022078559; Thu, 25 May 2023 06:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685022078; cv=none; d=google.com; s=arc-20160816; b=BuPqW46S2SJJ7OgA6ux+EZLBsiJ1je5/vkFVG4+N+98afDLfnCJXnT33BaNk98FOdM GodV5XTRqd/lqNlde74GRTNmt3OtjFLlcjcys7iD6hgB5J/jYSIJOHyNZQ9wVdv02qRW PC8cj+eV1wUOH9gNulbsA6Sr/X4Xc5wpyzNkUDLcDj/iVHfoGxvbbzhC26Yiuo4GpNFA e69fD1I2ux55kalHKBpHfd+KmmwZBc3yizhjv4Lmc/sMwnymc9fpVIxYShyRprLbhsCM RpL8JC7VlnkgfBW9KI9sE2nbhd7uSEkPRXHMk0bBSKHTYRKD8GiKmszdE034zFQlroJT KFPw== 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=zYY0GKMhXttuAw6paI9M2TLIWSmFkEjM7aIwjpOH6i4=; b=i9fsyzPU+BQCoKXxJbcjpz1XVU8P/blmP0JKQvgrXRR37VoLki2YTF/jLYOUbzo8Xc kssmr4D7WepiQ00B1Pwr/SUNOkr2RxUx8lYNbEvzCWetSPCiJptUBODEt+FUjG6GReaV WWNN2lJSYMZ6l4wvoY1iWfuW9cvAjBQqihIDvAvmdXndcM1j7AOKUbzmU9Fz8nfU09GP 7E3OMgsop9T6Z4OaIj+3VWiEn/5Xfeu3Dp0EwM8WNJ2KyTIqAad2fpgEVDwNOQqx7lNz 3i3VztJBiflf7X/+cXDSw479MpF+eSxvxmfwPMwXidOz6BPx8W15hpJ+GjrThJ8x0BUx diRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lSI8NUoR; 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 e4-20020a17090ab38400b0025014cb905esi1543496pjr.126.2023.05.25.06.41.06; Thu, 25 May 2023 06:41:18 -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=lSI8NUoR; 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 S240923AbjEYNjJ (ORCPT + 99 others); Thu, 25 May 2023 09:39:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241339AbjEYNi6 (ORCPT ); Thu, 25 May 2023 09:38:58 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B93818C for ; Thu, 25 May 2023 06:38:53 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3093a7b71fbso2072925f8f.2 for ; Thu, 25 May 2023 06:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685021931; x=1687613931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zYY0GKMhXttuAw6paI9M2TLIWSmFkEjM7aIwjpOH6i4=; b=lSI8NUoRqt6sKOtFjbYKQ1EpPdFGZy/OFcz/WK8bRYRwVMgzWirE6Opr2uEfXhx144 tqynAAgPY3KXxJglbouzD+2ETgPUOolPGFy7rYQVgXsAX3g4IoMNW7kCrUvpoKDenmQn QNH/1oQlrMFBLSBbyZU9xc/+P3tYQ7ZwO3aIQFJxThanQdjePsdrNAA8iXIJ36IW8038 BTquGyNO+19LB46JVbRVD6ZMAJOvZ8bIb4pYs+93nDqvKXOJybmuAB+0oGIHwUS989Th OeYicGaffL5atnDCrex6ZH21zZbXd/NtwfoJBsd0U6S8ay21wXlgOLhZKNJWMLV10B25 sqGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685021931; x=1687613931; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zYY0GKMhXttuAw6paI9M2TLIWSmFkEjM7aIwjpOH6i4=; b=Ao02cecf5qYUnRdBouAmfP+aNASk142fT7rRoaZaGk293g3idML3Y16IDe5/PI7qpM ga2itwcMou8jBG8ynBBt2OXuGfHkZOmvf17l22vAm4/xFb2HDPIAbFUycRXMcNgmRFLR EXSxUDr/8f48qjTIAjS1a6LhUtsUYmmXQqSsmTVnkZcvD/W/EIrElXzN5h3u6UzsySev h1mmaJ5btKHyHRwcZrr3fEJ6YS9+6YnKExP8LM0LXfY8uXf+O4vxTgcI6P5Czb1FqnBN 6eqabboYoWc4RX3BWt5d9H11y4nO6yAXeVXpXZcf1BPZvyDh3Jtgwso08BDBIzxGmJ6r LOqQ== X-Gm-Message-State: AC+VfDzb5TXdIU6O7TRCbjx9MsIX4k64QDNAw1maGxdppSk88rsaSYK8 Dr6DqwhSdB00EQScUsoHe9T5Ig== X-Received: by 2002:a5d:574d:0:b0:309:54b6:33b0 with SMTP id q13-20020a5d574d000000b0030954b633b0mr2621683wrw.44.1685021931808; Thu, 25 May 2023 06:38:51 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id z17-20020a5d6551000000b00301a351a8d6sm1803641wrv.84.2023.05.25.06.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 06:38:51 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org Cc: andersson@kernel.org, yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2 4/4] soundwire: qcom: set clk stop need reset flag at runtime Date: Thu, 25 May 2023 14:38:12 +0100 Message-Id: <20230525133812.30841-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20230525133812.30841-1-srinivas.kandagatla@linaro.org> References: <20230525133812.30841-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 WSA Soundwire controller needs an full reset if clock stop support is not available in slave devices. WSA881x does not support clock stop however WSA883x supports clock stop. Make setting this flag at runtime to address above issue. Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 1d2a105cb77f..b6c3fadc9090 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -617,10 +617,14 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus) sdw_extract_slave_id(bus, addr, &id); found = false; + ctrl->clock_stop_not_supported = false; /* Now compare with entries */ list_for_each_entry_safe(slave, _s, &bus->slaves, node) { if (sdw_compare_devid(slave, id) == 0) { qcom_swrm_set_slave_dev_num(bus, slave, i); + if (slave->prop.clk_stop_mode1) + ctrl->clock_stop_not_supported = true; + found = true; break; } @@ -1623,15 +1627,6 @@ static int qcom_swrm_probe(struct platform_device *pdev) pm_runtime_set_active(dev); pm_runtime_enable(dev); - /* Clk stop is not supported on WSA Soundwire masters */ - if (ctrl->version <= SWRM_VERSION_1_3_0) { - ctrl->clock_stop_not_supported = true; - } else { - ctrl->reg_read(ctrl, SWRM_COMP_MASTER_ID, &val); - if (val == MASTER_ID_WSA) - ctrl->clock_stop_not_supported = true; - } - #ifdef CONFIG_DEBUG_FS ctrl->debugfs = debugfs_create_dir("qualcomm-sdw", ctrl->bus.debugfs); debugfs_create_file("qualcomm-registers", 0400, ctrl->debugfs, ctrl, -- 2.21.0