From patchwork Thu Feb 9 13:13:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 652117 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9F6C9C61DA4 for ; Thu, 9 Feb 2023 13:16:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 56E13E72; Thu, 9 Feb 2023 14:15:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 56E13E72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675948602; bh=QIzgqJo1PbgT8kMvAqhqZSCWFoTb7LfwfgQrbOyf8p8=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DOlJ3qw0vEniAhfuyPjfAs/PV7GEh1F5t2hIg47ZdM9f0NZKblWSNd9qJMu90g5FL 1jJt6rnz4wvE9RE7N3XcJ2Sr597sBHs3IkYIzje4694xuENSPQxUi2M876EUgPU0FS jHdPyHsiTr7Rr3rT1Xl7Hry3MUizU/CkF/NhLUiE= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 22E7AF8055A; Thu, 9 Feb 2023 14:14:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 76D41F80553; Thu, 9 Feb 2023 14:14:46 +0100 (CET) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1BC40F80086 for ; Thu, 9 Feb 2023 14:13:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1BC40F80086 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=P5/7vAmo Received: by mail-wm1-x336.google.com with SMTP id bg5-20020a05600c3c8500b003e00c739ce4so1472697wmb.5 for ; Thu, 09 Feb 2023 05:13:54 -0800 (PST) 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:subject:date :message-id:reply-to; bh=NPMNrqeZWO55o8AuAcgfBuwWh3I0TkN1wM5VoUAdYRc=; b=P5/7vAmoDhtyUlDOFPxWWFRqeYKHw8doDPEZBBNdtIVq/tXEgqP6HDXkgsDHQG75uj BuJV5vmjH4QrQCnfFzzcRmVT3ejoinm3y5GEBKxcEeeD05XKfjCBAClKGnST3B8MQWBn Oc9ahTVyT17Vg+/x06m23nWOiXJ4PHkiIM5dWbGETfG8UKXs8GnE9P+l+9vGNhAOPryv SB4acICvJP0dUJDt6xotz75JpNVjolbpfbeHUVPmCeXC2RzRWI3hzObNL8NU/+9JNPDt 2mOU8jfUcVHMFTisSeQ4GxV8m4O9Zrv8n5ZG1Pox+2DVnyTohSu+1Kuswuhi67g9tHme /3zQ== 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 :subject:date:message-id:reply-to; bh=NPMNrqeZWO55o8AuAcgfBuwWh3I0TkN1wM5VoUAdYRc=; b=XvUYrBT4DfQePUWQgC29jsC1KwUI+wPwRSqqrZpfWbuOzYZ1QJjApc2nrSk/tSC5lP oYpM1XuX72IrCDYK85rMiEKHAhzJoBT3qap5C9QvE75oo7rL1HB2R1O2+bAFVIVt6sXH lBMvnKa3aDJWHtVbne/b33tLpRbG/5Gd4M96oU/s0e4/wlmxqQiqy1a2SUH0T8gUXO4r v9vlmAM/jTUwJ0572JCYjh2jyF9xL2OGf0tezXFp+58NNxIJV1Ep8mld9iq5U4y1kw8i j/8ykD5oQfqd3p41PfduHZgCoMqFjRcxQqXWhkYmbPAaBcPqj/+5Qw7p9A84sNt69ONG 9sHA== X-Gm-Message-State: AO0yUKXL2waIYmlMjM9IuU2tOK5/dD3B5vN2I43XWihLmv4u+OT8atUr ZEjm2p/vTEyfvtorqoqEs/HWXg== X-Google-Smtp-Source: AK7set8+KF1qJ63RGYOjxvONT/0dXdAeON0gJzSIfKGxOdbH/Nq2pMAk1kkn/QWQI4j+NQDJQZfcUQ== X-Received: by 2002:a05:600c:4485:b0:3dc:51ad:9dc4 with SMTP id e5-20020a05600c448500b003dc51ad9dc4mr9701331wmo.18.1675948433322; Thu, 09 Feb 2023 05:13:53 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ja13-20020a05600c556d00b003dc4b4dea31sm1789394wmb.27.2023.02.09.05.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 05:13:52 -0800 (PST) From: Srinivas Kandagatla To: vkoul@kernel.org Subject: [PATCH 5/5] soundwire: qcom: set clk stop need reset flag at runtime Date: Thu, 9 Feb 2023 13:13:36 +0000 Message-Id: <20230209131336.18252-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20230209131336.18252-1-srinivas.kandagatla@linaro.org> References: <20230209131336.18252-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Message-ID-Hash: B5A5BFUYETU7XAADJZ4D4BSFNPHK4QGC X-Message-ID-Hash: B5A5BFUYETU7XAADJZ4D4BSFNPHK4QGC X-MailFrom: srinivas.kandagatla@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, steev@kali.org, johan+linaro@kernel.org, quic_bjorande@quicinc.com, Srinivas Kandagatla X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 74e38c0d651b..0224a5a866de 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -536,10 +536,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.simple_clk_stop_capable) + ctrl->clock_stop_not_supported = true; + found = true; break; } @@ -1500,15 +1504,6 @@ static int qcom_swrm_probe(struct platform_device *pdev) (ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff, ctrl->version & 0xffff); - /* Clk stop is not supported on WSA Soundwire masters */ - if (ctrl->version <= 0x01030000) { - 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,