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: 12978562 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F036DC54EE9 for ; Fri, 16 Sep 2022 13:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231908AbiIPNyk (ORCPT ); Fri, 16 Sep 2022 09:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231841AbiIPNyO (ORCPT ); Fri, 16 Sep 2022 09:54:14 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97B21AE9D6 for ; Fri, 16 Sep 2022 06:53:58 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id c2-20020a1c3502000000b003b2973dafb7so19919783wma.2 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: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=wRKmm+W+nHuIE6Kyi3MAQILQt4HUoG/d3vZ+ByIt/lblIRGYLpGqDlNST/bAqoRepu 3n8O43tXlBk59JBGAwHQgCxeCnoyADRPRJV0LeG6Ix8SQGasXOQ12P/x0B5pad8o35tR ckoK23lvPwPve1/1dfN9HeACGTgEdAr1gMp/vYBx6G00aXUa4ydl14SQYJQaY60bS+cQ pObjhHPLRTEjc9lQmpohtLG5cH9MLu34L3km9TO6uw37kfzM6OXOIpLAnhDP/j++XzHY 43tyxKrDJh9dPoS62ad3yyYo+HiBFR5S3mlS8Q4pFE/2u0ma5N1PViUyjOwRrIQHifWh KBHg== X-Gm-Message-State: ACrzQf1m10O9yutCpCOVUeaJwOCQ/ekzoQL/WBSydPyk99qfUec7HlEs AZ76HDDaqoUHtWe8oQD5n3IcLkG0raJQ1g== 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 Cc: 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, quic_srivasam@quicinc.com, Srinivas Kandagatla 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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: 12978561 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8B93ECAAD8 for ; Fri, 16 Sep 2022 13:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230302AbiIPNya (ORCPT ); Fri, 16 Sep 2022 09:54:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231348AbiIPNyI (ORCPT ); Fri, 16 Sep 2022 09:54:08 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E87FADCF1 for ; Fri, 16 Sep 2022 06:53:58 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id e16so36130289wrx.7 for ; Fri, 16 Sep 2022 06:53:58 -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=CQUvdfZri9UrBkpNWUdCZCpDZ6HJU0wf7CtNjUGuzk1RDK0lh4LhqfWAJNH+Gf6dut +qNTE8NWmR6jPGwhuhK2h2UsgnkrjUoq3n6yGVqt5WJOw0bUAwXC/pb3lLGk8evIB1N7 DDoCVvdh4xCBdx16hMtJsLEZYyM78YD+3tsTAdRzytwrwcfaDQPXmfM/MW/Ryx8j3enU 4qrAePL0MoBCY8GJYDQivfV+YJH4D6otV1N53+ZnhYIgaEjQOvqI4zSIDJRvkUnR4oy1 podZ7i7S0sRarA4+MKM6IrxPm/HM+1jOMNmULVE6sNWgl5pFywTuupdYAjngnAPrZOLQ q22g== X-Gm-Message-State: ACrzQf2of8qENutV8wbk8lu0jnlyTOkwtLrVFVCGt6+ELCEfDue7inzk Z+DO+5cPZp/0vhtbv8C1lfx4gg== 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 Cc: 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, quic_srivasam@quicinc.com, Srinivas Kandagatla 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Device0 can not be in alter status. And for consistency reasons do not send status of device0 to core. Signed-off-by: Srinivas Kandagatla Reviewed-by: Pierre-Louis Bossart --- 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) {