From patchwork Fri Sep 16 13:53:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 606426 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 EBF33C54EE9 for ; Fri, 16 Sep 2022 13:54:57 +0000 (UTC) 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 250671A48; Fri, 16 Sep 2022 15:54:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 250671A48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663336495; bh=LcJoDOXfVKTXqw1pySO6ThoYivXbaJAXW1+AP8R0Gww=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=rrUFIuEHEuiuJXshc40tKFMnjDgT/jISxV8RjusAxTKpKahpkVOV/4lnh22FSEIVK 2XQ95oAKC3rq+MXRbWIfwcdR0H40SkSsVnsY5+77r2iG+RE9jwKUv1myT72CAOeN2I nudKyUVZDZsgOAXpeoPqjAIJbuU09uEskyhq7CJY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A2ECDF80254; Fri, 16 Sep 2022 15:54:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 14B3DF80496; Fri, 16 Sep 2022 15:54:03 +0200 (CEST) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BE93DF800E5 for ; Fri, 16 Sep 2022 15:53:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BE93DF800E5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JBQnB7TW" Received: by mail-wm1-x333.google.com with SMTP id r5-20020a1c4405000000b003b494ffc00bso1236964wma.0 for ; Fri, 16 Sep 2022 06:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=VyGv9vQBQ1xkHEaxOJIptX4tbCMnxfIpZYjINCvRYgM=; b=JBQnB7TWIBIwF9Lw0s2MP3HKz7duEZi8DDiZEqmm+5O2d1a/3PccKRGMefwnZK4hxA grI6/ptDhYWBbo/8uMXmoV2+CXV0EofMC8LM5thFf1r0ne0yr5Gxr0SK+8E02t7Yb/Zf zo0NSapqKJ/Ogy6YFSCpoVYXspbPulPf8bEWe+wpOCpmpbMCT6AuoEfECm3RNwTu/VFX pql62QumkOU8VuOlvi5H2U9d1MsP7tBOayQJSKcaHJETs81nzH3rDHyf8sER7DOMlHxR GiB4/M3s4fS6cGCKA5n4bpujXgaYrIlGPdjbD3yMTHuao0oxR+fTE8adsTEutK1uRZ9S 2BSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=VyGv9vQBQ1xkHEaxOJIptX4tbCMnxfIpZYjINCvRYgM=; b=yYWCUlKLtDZvb7dmb9znbtZs5WlC59OMgi7imtIl5kd4DYLj/57u2SUN+pH7KTcvTn 7R2gOH55cJTR5/xocWN/jmcmCmYmw804g84yl7swhU5If68iKXFiBhcD5OL8ojHZ1gp6 fbVNisO5zNIjLP3sI5CsoKK/HjJpNu5ePW8VpCRDoZvpJgEzbrIQpqAxYzX2CJncBBQS 8iNaWaBRAz0hJqHU0JExnUBFu4oAxObSIvZsKvRnghn0Yol4c997EApgXFIUVNLmvDBU pHkz4lhOSsMde4wA45DC3TxMkVUAOYYGZAp0FqzExDo0/vGNIHQzPEOu/NTc4ZLEMuK9 4BUA== X-Gm-Message-State: ACrzQf0YlHUba4F/Pvy+6yr3247w5TIUIk75YWTRQF+2hoXh6A+HKFMF 3AxM1HJPtgsue/kGuSslTyyBJQ== X-Google-Smtp-Source: AMsMyM5F1iDDMpOc25/B4rrtE9piDv1R7mtcHiPz7EsAWBn3EJ3+mS9oezISk77bPzq6/GOb+nAodA== X-Received: by 2002:a05:600c:114f:b0:3b4:9a0a:6204 with SMTP id z15-20020a05600c114f00b003b49a0a6204mr3490349wmz.132.1663336434900; Fri, 16 Sep 2022 06:53:54 -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 m2-20020a7bce02000000b003b483000583sm2084767wmc.48.2022.09.16.06.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 06:53:54 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org Subject: [PATCH v2 1/2] soundwire: qcom: update status from device id 1 Date: Fri, 16 Sep 2022 14:53:51 +0100 Message-Id: <20220916135352.19114-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, pierre-louis.bossart@linux.intel.com, linux-kernel@vger.kernel.org, Srinivas Kandagatla , sanyog.r.kale@intel.com, yung-chuan.liao@linux.intel.com, quic_srivasam@quicinc.com 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" By default autoenumeration is enabled on QCom SoundWire controller which means the core should not be dealing with device 0 w.r.t enumeration. During Enumeration if SoundWire core sees status[0] as SDW_SLAVE_ATTACHED and start programming the device id, however reading DEVID registers return zeros which does not match to any of the slaves in the list and the core attempts to park this device to Group 13. This results in adding SoundWire device with enumeration address 0:0:0:0 Fix this by not passing device 0 status to SoundWire core. Signed-off-by: Srinivas Kandagatla Reviewed-by: Pierre-Louis Bossart --- Changes since v1: - updated change log and split patch in to two as suggested by Pierre drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index e7f95c41eb70..d3ce580cdeaf 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -448,7 +448,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl) ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val); ctrl->slave_status = val; - for (i = 0; i <= SDW_MAX_DEVICES; i++) { + for (i = 1; i <= SDW_MAX_DEVICES; i++) { u32 s; s = (val >> (i * 2)); From patchwork Fri Sep 16 13:53:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 607179 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 2D5CFECAAD8 for ; Fri, 16 Sep 2022 13:55:24 +0000 (UTC) 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 2725A1AAE; Fri, 16 Sep 2022 15:54:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2725A1AAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663336522; bh=aZgMtGIFDgmRj641FdMcyIo0pbiDWgkyFSGaMkG+Vak=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mZLNp4xLMqpaX/GAXhPyD6ldvDTVl9KuYiDVviIrFNPB0ZF4n8uxZ2rgZyTA3iYZw qOoKjo2vWzfFSanYPn06TD4D2DVI78IpfAW5nRUbQwN2j1PuEre1gWvSVHlGhItbjt HExbVNYxWlge00/Ga9nbzDh9qdd5P3XvQQPUyEQk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 62FF5F80496; Fri, 16 Sep 2022 15:54:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3FBCFF802BE; Fri, 16 Sep 2022 15:54:04 +0200 (CEST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F190BF8024C for ; Fri, 16 Sep 2022 15:53:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F190BF8024C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="V4KuezOG" Received: by mail-wr1-x42e.google.com with SMTP id k9so36202846wri.0 for ; Fri, 16 Sep 2022 06:53:57 -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:subject:date; bh=F/++3j5vzbiWV6wQtfbpT+br4B/s5dtmbh359iA+BUU=; b=V4KuezOGi/JTNn5/6GMcwwzbP1cwJ2jYRWRJqXnawM1eJBg+CmGdlw+x/wMldl/++/ N55q6J+zmIVsAFrJBtOukfYyPJiCztuNyWmfSVyg3xOZdEINJUhviurCMeII9AD6hKgG l6Z6u8H6TZDX5tcZ0l5GKRI3F1ar0BoCQMfN2kslNgSV8Ym8h+0hcQWpSJ7ECL/H9myy jlLEjswffFwIK4QG5lFLZGkrrJRJlu5z7qqDkdgCzK6uns9MYg6j6xqgHj+/MJliqaLD KPSjgPUkO1l9tdt/zAKVoXiw/NCGHwlL75BH1hin0QqMHw9d2xXeKi8OMMs0usfbhyhO ds1w== 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; bh=F/++3j5vzbiWV6wQtfbpT+br4B/s5dtmbh359iA+BUU=; b=k0oz4mRkEmYHfYjstb1SXn0ME/lgXhDtg1eH6zqtpnvePngSOBWpDVlFvhuKSdcNVq 93K7C1HQHph74n0QsHxUe1gNlrxAbvcxoe7OFHTaCR78k8ikdwnj5Po9vyMvQqsOTsce h6L0scrcPh5AyFaaESuh6NoXX+w7WQ54326sXJLRISWE+w/+hYnZ65wIoC7NP3R68ujx R1o1/iFM90dZJr8yQ5zb3UnPl1PQ0dhWpw4QK9ckPnUZH7jwwfO9kttzeZGnRvedTPqS VB+KKC/RB6vMjj02JB5CG7776eQbaflCaVv1IfAOsNGze2tWd3oO7Y3yHhU8VX2Qrv6t aW0w== X-Gm-Message-State: ACrzQf1Ubc+t3NgKaB9Qo7zbPPlRbbLJgcNIMS4pQV77RchLJ19WNXQM KBGRtmoSwchSQ4QPsrCaUaea5A== X-Google-Smtp-Source: AMsMyM66mtWTrSH2i+OwN4eD0KuYmUQ7/S2/uesxpJ8irrIeofU4OyeQ3mLggy7e1a3yQyB+/AAIHQ== X-Received: by 2002:a05:6000:1ace:b0:22a:c9a6:e203 with SMTP id i14-20020a0560001ace00b0022ac9a6e203mr3048283wry.694.1663336435835; Fri, 16 Sep 2022 06:53:55 -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 m2-20020a7bce02000000b003b483000583sm2084767wmc.48.2022.09.16.06.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 06:53:55 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org Subject: [PATCH v2 2/2] soundwire: qcom: do not send status of device 0 during alert Date: Fri, 16 Sep 2022 14:53:52 +0100 Message-Id: <20220916135352.19114-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220916135352.19114-1-srinivas.kandagatla@linaro.org> References: <20220916135352.19114-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, pierre-louis.bossart@linux.intel.com, linux-kernel@vger.kernel.org, Srinivas Kandagatla , sanyog.r.kale@intel.com, yung-chuan.liao@linux.intel.com, quic_srivasam@quicinc.com 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" Device0 can not be in alter status. And for consistency reasons do not send status of device0 to core. Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index d3ce580cdeaf..a04a8863b228 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -428,7 +428,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl) ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val); - for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) { + for (dev_num = 1; dev_num <= SDW_MAX_DEVICES; dev_num++) { status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ)); if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {