From patchwork Wed Oct 26 11:02:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11189 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp193348wru; Wed, 26 Oct 2022 04:04:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7l7YPxAciC7D2bGB4Aem4IqNM4ZoByL+vfvXhJMJ+5xmC0hgUNo+9CEgvMmXtU5cyCdUui X-Received: by 2002:a17:907:c25:b0:78e:1a4:132 with SMTP id ga37-20020a1709070c2500b0078e01a40132mr37390117ejc.521.1666782287066; Wed, 26 Oct 2022 04:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666782287; cv=none; d=google.com; s=arc-20160816; b=WPldsA8zoj1grQhS85FX0i0ZgW4Y9jA71YGfgOXhwLwSuoF76nVbCoJkWQhYnLv+XH x2Lteo4xeSzOHYG75N/BCQhak2F5bXybi0EQQSjXxlzUZ0ct6VWqX5cIaF5z2xWbsMPA jD/DuQ5Lug3h/AJjupQd6QLC5DsNXER9MIMa/DCu42Fr3iSRJSuLn9QXqSrh7uQ6pvmF /lkd+PnNsjiuaYl69/WYcVuEeVoWKpD42CzeO5NhixWs0AEW3Qmpft7kt3blcXOjmhm9 35diana6lyORKwVQaIwDA5P7rgppscjJGEDk5cigf2YjghDMS3dN5zypmduKhMszDeKg Xstw== 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=Iq+UTjOWMyquGHaqNGU9bVUM+RbHUdDoO13dPtnzSfU=; b=QI51EOZ20f4rmiNzI6Ttc4QE0wSG+vMeRlSA+nfcdY9L5LPH9YrZegs0s3wnekTrSb ZDQLgppVZzuOHYVN4nB6524BjDvXdCKx40tJkT0swE1zLYuBhbh+jjzEHMcJ7zxPrf2I fIUxZCYC5NOo7cCez49IWPfsMlzisuTg7vlE1vJmCMUSFa7mzrs6NYrOnZiPvr2Jc0Tt Z0lzd2foOwUkNIQcdr1D3ej7wN2/IGSbplYqIimUb63CngdBk3j8seY7S+DunISIdpwW 5MXYVgQi8sQuGQ0aoHXllK7NF/bdn0M4I7LEVnWWwdnusEchs5GFLBtLB0lmdcTWSeDo S5qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkr8je1+; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga11-20020a1709070c0b00b007309e8d567fsi5988006ejc.145.2022.10.26.04.04.22; Wed, 26 Oct 2022 04:04: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=kkr8je1+; 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 S233481AbiJZLCa (ORCPT + 99 others); Wed, 26 Oct 2022 07:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233265AbiJZLC0 (ORCPT ); Wed, 26 Oct 2022 07:02:26 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92E3EB515E for ; Wed, 26 Oct 2022 04:02:24 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id v130-20020a1cac88000000b003bcde03bd44so1186043wme.5 for ; Wed, 26 Oct 2022 04:02:24 -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 :message-id:reply-to; bh=Iq+UTjOWMyquGHaqNGU9bVUM+RbHUdDoO13dPtnzSfU=; b=kkr8je1+7h37yq2UCQzx7bziwp9BgRGHNSqBb7MHWFDsWbjGPduEr3Jl4E1yYfBt0Q 2rH15nIYWCvOOnIr8WyHRKxRHoqQFq1ctID5UQJJ27i0gf4/9mbP647SAxtQEEd70ciO xE+gccJPfzpgshvNKQIhRcfy0mF3ECaew3cgZz7OeL8zh2jlodY2AeFhDGYLNK4BCj7i LfgT8ODc6dk9tcQcKjJzUIq2h3A515ZhcAmRFDopXRHNoNPCnbKneJOUv34RYE1KLypw r3Ro1TF5ufrWemVsjdkN3Q9NoZsxph7y2TBCpZvSpDmSaREstiDlBhBjg5zlNyYtWRTZ zlkw== 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=Iq+UTjOWMyquGHaqNGU9bVUM+RbHUdDoO13dPtnzSfU=; b=rycNqXX98jZ7D7BMHraj3yAw7eE+QA1jFFoyapJaoPjFEtgUBVKKQRfOFBs4x7AssS AfkV8wsKkguSyMdRbZObohSRNhhIaRgDGeFq7jdmiltvi/RmhFFx2ftc099KWhIgPGvo 30WzwM+AbiizSSuijKjRS/a1DRQX8SMVSDpK1EcjB4DqxsJRfS6CTrapJubnPNTUmMP/ LmgXje5PywJkfanXG2DaxXpXS8acCy3cfZiYvHrCzjfouOTk8ptywfUBiQKm/EX2E3x4 ifRi/ypeRq3cwTID//gyn+OG+aHLRvaiUkzd7nbnziuLCmq+v5WJUfsrT7/zFyJPIt33 j5Hw== X-Gm-Message-State: ACrzQf1SJg0RlZEu2yOVk5ps5wbp3AGCDAHCLLtn6louzVIRuDs6Ukg3 d4j9U55x4FPkNdQhW9t/mCHVNa53uIYZPw== X-Received: by 2002:a05:600c:3585:b0:3c7:9f:5f87 with SMTP id p5-20020a05600c358500b003c7009f5f87mr2101249wmq.76.1666782143122; Wed, 26 Oct 2022 04:02:23 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id z7-20020a5d44c7000000b0023672104c24sm5237415wrr.74.2022.10.26.04.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 04:02:22 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org, yung-chuan.liao@linux.intel.com Cc: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 1/6] soundwire: qcom: reinit broadcast completion Date: Wed, 26 Oct 2022 12:02:05 +0100 Message-Id: <20221026110210.6575-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> References: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 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,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747747903670478284?= X-GMAIL-MSGID: =?utf-8?q?1747747903670478284?= For some reason we never reinit the broadcast completion, there is a danger that broadcast commands could be treated as completed by driver from previous complete status. Fix this by reinitializing the completion before sending a broadcast command. Fixes: ddea6cf7b619 ("soundwire: qcom: update register read/write routine") Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index b33d5db494a5..8f1a1eb017a2 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -344,6 +344,9 @@ static int qcom_swrm_cmd_fifo_wr_cmd(struct qcom_swrm_ctrl *swrm, u8 cmd_data, if (swrm_wait_for_wr_fifo_avail(swrm)) return SDW_CMD_FAIL_OTHER; + if (cmd_id == SWR_BROADCAST_CMD_ID) + reinit_completion(&swrm->broadcast); + /* Its assumed that write is okay as we do not get any status back */ swrm->reg_write(swrm, SWRM_CMD_FIFO_WR_CMD, val); From patchwork Wed Oct 26 11:02:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11190 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp193402wru; Wed, 26 Oct 2022 04:04:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CQ1iGft5LVBCPkVWAOfGEsEHIR+f0JNZAGEbR+5j4WX4On50HVa0AbXz14R8JU+4BYRbo X-Received: by 2002:a17:906:9b90:b0:78d:9704:752 with SMTP id dd16-20020a1709069b9000b0078d97040752mr35527400ejc.695.1666782293707; Wed, 26 Oct 2022 04:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666782293; cv=none; d=google.com; s=arc-20160816; b=bKniR0n/vJ6e6PMi3g3ZJn34uK0TfBfUa23rUcfUdsE9rHntD6KrUSakXvEhLFBGQ8 wcMGBBaVCb5r0ncbXwEahde0wBtSz6LDDOE/dvFpca8/VgTVDfbCAXB0bnPMZMka8+0s jfW9OMiVqKG2beiURtH+NKb3F1mcqtleHdeeJcAGyhmL7HQf0phCJRPAivDSHFmApNpX FJPAAljYNUee4FcbHYmj7YZJLyKj0CA8AE8+BgxxGtix94s3Kjn6ZWH6FGobRXZpXwwi oQOuZ19OGMfklsN0TbFeUJYJ+hvy7pjcTlDpUDvZwZCrNts/dTiAgc3VB5wLv9jprXQA C9cg== 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=y4sQJzVrHni1WLAuaAcAXcY4IxBG/K5oBIjFNgyTIGU=; b=PwthWV+4ouRYkEfg6EYNUXBXuVqpiLltrdDBp6pYxlsqUYlrHc9jN//qA6cPRjIBxN MmnxCWsbe4TUgyWkhbii3SSzjzGfllUjMM3uSqxaJ4MuHdTt5/NiTmN4fPZKE+63X/x/ XnLc+C4qzDXH2XQomT0l9Lb30r0Vj11+xnbMoqE7bfnuNkg9LerNMNpznsU0FO33AqPz 49U9Ffg9fSsMeN26qx0kh6euu2mka/nFyUWrL5pYnPdr7Th6+CTc7LGmPL0hiySVrKib MIEkQewXgoXxny5Q/G8GXTOcZw12AO3DXWmqx8Scma0qMCbpp/Vng+gX+w4Gt1BjKFPG i4cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TAx4tjE+; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a17090617cf00b0072a477a55e0si4614693eje.369.2022.10.26.04.04.29; Wed, 26 Oct 2022 04:04:53 -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=TAx4tjE+; 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 S233166AbiJZLCe (ORCPT + 99 others); Wed, 26 Oct 2022 07:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233397AbiJZLC1 (ORCPT ); Wed, 26 Oct 2022 07:02:27 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDC8FB56DB for ; Wed, 26 Oct 2022 04:02:25 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5so2149019wmo.1 for ; Wed, 26 Oct 2022 04:02:25 -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 :message-id:reply-to; bh=y4sQJzVrHni1WLAuaAcAXcY4IxBG/K5oBIjFNgyTIGU=; b=TAx4tjE+S9rXc/zlFGGPRl0uwIS/mtGtuJhj7IGSzfeIMVzaco9BF+sU98thou5Lgj C0JW8r0zxjpHDi8rzTS5doOZ8Gz3TnF3Ko47ZbObPbEtOiV/XczTTpCtT5Ba2yMs4k+B pVNYj0RW8tOCU53hk3rl0NmNgNTk52yI7qQ9ts6Ifjz2dS5epGUYe8Act0oylQB5oh8y wayfnhvtZhP+CWjdF+iHl2nGWhus+jPR+QftOAj4Kjkr93LT4qw8p5NssmqKSpWWYc9f 2xK+G3bYSycJwqnyByA0N5cIel8sF93aBKc2HqMaOr+na6uDjdvC/uMMj9ms4PKkYBBI zDPw== 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=y4sQJzVrHni1WLAuaAcAXcY4IxBG/K5oBIjFNgyTIGU=; b=lx0dLSQSHwIJgbTJJAO+/S+XWoxMq+zKrv7JwpmxHwf5cLukhTbP7ya7zH40pQ3CNh 0WCZVmkJ+HTRPkttG74aABOgy1/d5mrrUAkVaRg9cSdK5Xn5Q/d3nRisD7vrf9FOM4j1 8Kiyn2Q3emn8x6mpGzADi6Nks6isz9mx8IXB6tBTzHtug9/T23YCMGaJGxtrrRhVSngq sHhZv0R6qVKxutEjRvLkReKYoWxUyukXwAeOv/auslJY2B/a6hTZp8fcf/+Cd70Rrkwb SbxOK9IuaoUagA6tWzPLIqrsi7J/38/sqwj0gMnpaIodsq0t6+l/g6ZAsIHHEzgULxaQ A8dg== X-Gm-Message-State: ACrzQf0IblewDXZollMbeYpTAPv3p8kA5jLCFTQhb6tVkslGzZOhpDdx 2pQI5IATt0c/cBZ2irJUlfc2og== X-Received: by 2002:a05:600c:244:b0:3c6:bc2f:421b with SMTP id 4-20020a05600c024400b003c6bc2f421bmr2040804wmj.32.1666782144503; Wed, 26 Oct 2022 04:02:24 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id z7-20020a5d44c7000000b0023672104c24sm5237415wrr.74.2022.10.26.04.02.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 04:02:23 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org, yung-chuan.liao@linux.intel.com Cc: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 2/6] soundwire: qcom: check for outanding writes before doing a read Date: Wed, 26 Oct 2022 12:02:06 +0100 Message-Id: <20221026110210.6575-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> References: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 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,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747747910321184901?= X-GMAIL-MSGID: =?utf-8?q?1747747910321184901?= Reading will increase the fifo count, so check for outstanding cmd wrt. write fifo depth to avoid overflow as read will also increase write fifo cnt. Fixes: a661308c34de ("soundwire: qcom: wait for fifo space to be available before read/write") Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 8f1a1eb017a2..cee2b2223141 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -380,6 +380,12 @@ static int qcom_swrm_cmd_fifo_rd_cmd(struct qcom_swrm_ctrl *swrm, val = swrm_get_packed_reg_val(&swrm->rcmd_id, len, dev_addr, reg_addr); + /* + * Check for outstanding cmd wrt. write fifo depth to avoid + * overflow as read will also increase write fifo cnt. + */ + swrm_wait_for_wr_fifo_avail(swrm); + /* wait for FIFO RD to complete to avoid overflow */ usleep_range(100, 105); swrm->reg_write(swrm, SWRM_CMD_FIFO_RD_CMD, val); From patchwork Wed Oct 26 11:02:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11191 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp193682wru; Wed, 26 Oct 2022 04:05:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM531Cz5HGZ/bjvcmzxG0RswNrQHbnHqJkMOn9czIOpI74FQQ751nqfQ0ePfdqQwI4Tdr2sn X-Received: by 2002:a17:907:2c74:b0:7a1:d333:f214 with SMTP id ib20-20020a1709072c7400b007a1d333f214mr19162227ejc.14.1666782324146; Wed, 26 Oct 2022 04:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666782324; cv=none; d=google.com; s=arc-20160816; b=tpMlQ4qjNqDv3H1c0CdaoijsvppUlTmWpt1bzhmup6D9zVQr83s+NrP91arJCLuZoq RXQCHmHnwdDFVcd+mFrPkJID6bSDFOOwYUYXljcLzhM7Lmt8jqPXR7QkNOGVu3y9Hyhm dLuXGj9NtC+zmNa584E5UloaPkAlES6I4spvEgRkKcnNCFdfE3Ricma/6hqZ3bdB+dXS nnLnQP1feCP3YRDC9uyJWVAdSqPJvoC3Dy9+cobC0R3k6vB8LUlPEbOCzMfg2xoApj/H 2ZTNgQ3vrTQ10pjJUCVs1CJPhbU3IkxCMVAHi6H7Hpb683kArecftHnSvFK1oYa46YZ+ /t7w== 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=Icdth5bW06+FTiDoc6hzh4mTVqW0L169qAB+NpMSMiM=; b=mZFMCXiVDg5y99liBtDbX2I6f5noleMz+frocdtzaNmCbI45hqqCR5Y0OGKUKxRhY6 1buhiHEN/dCDLQhwTc5JGd0qB8Koi2u2mxBS7vAl0wahPokYI4KzY6qUHFD6PVwsfbEL uou9Sixaxo/U901zlz8u46TYpnXRg3hlGQLmG+vy3sda3ZnvjaKG8178VgSPC4O5+7Gs 1kTIFjpEF50pI39XmTiWOIodHRHKQRxXDimQnkbtyztNmHSmaddFxH9UySYG4ms8PvK3 v73yc+CUt5WJNtc2pn/qR10Eumw3WMKMLpcxvTJa33r1Vhy3sRlHVaeu9ancj+lmhLl5 AgEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VrUr1NCq; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a1709065d0a00b00797e151e584si5338032ejt.605.2022.10.26.04.04.59; Wed, 26 Oct 2022 04:05:24 -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=VrUr1NCq; 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 S233482AbiJZLCh (ORCPT + 99 others); Wed, 26 Oct 2022 07:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233453AbiJZLC2 (ORCPT ); Wed, 26 Oct 2022 07:02:28 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AE1EB5FCC for ; Wed, 26 Oct 2022 04:02:27 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id y10so9957848wma.0 for ; Wed, 26 Oct 2022 04:02:27 -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 :message-id:reply-to; bh=Icdth5bW06+FTiDoc6hzh4mTVqW0L169qAB+NpMSMiM=; b=VrUr1NCqQmWFyAAU8xzsnEdntA2wopK+LECDVycJpX4G8I9suVjN5U2pA/sRjdlQc2 AjUMKsTseDp1cTKb1O1il6+2kxcppqLOqrhR2Ekv8lQ6m4TiO991UyalYak5OxK99zxg vmDbHoZcft+3vVRz0QmX4tZ+OC4vGw0x8naTY/mvyBGMcamwAWU6wF34wlFy9Hq43MBU /CoIuijMweor3KlcVb3yXz+0rM8lBIjOcuoFhvfeeBlxtllk7oO4x9IYtwfM/P9Wsg2O YpmcQwBpz/U/JByaWi/jllXHminB/nirn90SXxjbZyaeacCUzDKP/Ui1sT5WIDh/3icv KJFQ== 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=Icdth5bW06+FTiDoc6hzh4mTVqW0L169qAB+NpMSMiM=; b=FNsU33i/zgen/fBZ2bi3RbsI3dAZF6FizXjj+raVf7J5Yz0quTazQAsvguAURP8ov+ dS5nwZYwtDP66L4hlV7E3KyWPEJvPIAN1HyHjPwVeEH2QccdaTwFtGQ+PnS0jFBQIQmz z3tAGlIm99Yi0yUMyAK+QATsHoTI0s30qwTbwJTjpk5Gcz9yxtHWp3UXSvJ6Be067Bzv XD8s8LONn68SV/jNv5lo6Kni0M9Wj6ufzQMEzKY8F+3Td8k0WpY/m95ema/tRTPrAo/Q tDs7Xk8vjecT0j5LN31gNYETp2h+t3kU+xo9C/j7VbwOnmmWNLlurB+1fPlNES0tpmPx Vy6w== X-Gm-Message-State: ACrzQf1+q595XqTeoEAv/zjp9uMczqeXc8jeS1EjxIb3ffYoC81E0C4V HktcaDRQqdquVN8Nde68uw+MiA== X-Received: by 2002:a05:600c:3d8a:b0:3c6:f241:cb36 with SMTP id bi10-20020a05600c3d8a00b003c6f241cb36mr1993088wmb.115.1666782145763; Wed, 26 Oct 2022 04:02:25 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id z7-20020a5d44c7000000b0023672104c24sm5237415wrr.74.2022.10.26.04.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 04:02:25 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org, yung-chuan.liao@linux.intel.com Cc: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 3/6] soundwire: qcom: remove unused SWRM_SPECIAL_CMD_ID Date: Wed, 26 Oct 2022 12:02:07 +0100 Message-Id: <20221026110210.6575-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> References: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 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,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747747942136406659?= X-GMAIL-MSGID: =?utf-8?q?1747747942136406659?= Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index cee2b2223141..7bc8cd0e906b 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -104,7 +104,6 @@ #define SWRM_REG_VAL_PACK(data, dev, id, reg) \ ((reg) | ((id) << 16) | ((dev) << 20) | ((data) << 24)) -#define SWRM_SPECIAL_CMD_ID 0xF #define MAX_FREQ_NUM 1 #define TIMEOUT_MS 100 #define QCOM_SWRM_MAX_RD_LEN 0x1 From patchwork Wed Oct 26 11:02:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp194346wru; Wed, 26 Oct 2022 04:06:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Q9E3OfRvu97LN6EPmIacMsNkdVner3NRRgyZcN+nHUX3MEgc4meOQprLjeDJZQnWsUMo1 X-Received: by 2002:a05:6402:35c9:b0:45c:de2e:ae1c with SMTP id z9-20020a05640235c900b0045cde2eae1cmr40271648edc.393.1666782406036; Wed, 26 Oct 2022 04:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666782406; cv=none; d=google.com; s=arc-20160816; b=cZD8SpWWLH1VdB4RGeOVxtekGfmHj5/dCqAv3nrGnN/A6WcfKm4j/9ybYOuNQpHdEL w0Mp5trU7PMm1sPqr8xibQtGVfGrFixuN7K9NlEn6ukhSokQR+aKgjSZBvIra2B0Ji0G Pn+QaAha8jaNR5R0qAYLRWXjshXaFEtK3/3fRoCqER6lgGL/ng8q9yopQrPO7DMxEhP4 zwXwLE/IaZuEhPd2ZnGkhMhFGwLZ9fCT9HxJCMojrL9Gxn7aDGeYryGKUt2ZncCh1gJs 1gYj61wULqHuHfeNghjcnauDcWASnoUxYlJethm4c0riHwemw0jPXZzfUyqoqPwdbEWR d6gQ== 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=9qO/JbNRzACWJ+/BPqzyo1ybZ7r6Vd9pEOf9FoOyjmc=; b=KMeJ69cJi4TUmQvUQlSuKvt11dN5tnP9+sQdcwJRzOrXNogQAXCR4saJXxBrTq6YNb KKKHCPIEelobcyL68uqoxPKyWO3Jtlkkzx0IjdTjP1KVSxok2mEAJkoSU7/W2XV0rO3W WYkKjy0vMykdOUUkmc1Or9hWzOzDoQYJqwSY5XuaymeEmDiBXuU/rfJeGjTVNUBVwv2G OvLx/sKF1YDdWBKs41z8o9f6eI4zlC08MUxkhJlEuc864LD/bEcWgOgAqU40joqpZGEq dDW44xSv2dlhw43MmdSySOZyi41meeiqu3sjOVBvyUwMjXi8Mrw3fKYtf1tzBGv7PHGq ca0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RWGT62z0; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020aa7df03000000b0045d4a88c735si4111929edy.220.2022.10.26.04.06.21; Wed, 26 Oct 2022 04:06:46 -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=RWGT62z0; 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 S233265AbiJZLCk (ORCPT + 99 others); Wed, 26 Oct 2022 07:02:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233471AbiJZLC3 (ORCPT ); Wed, 26 Oct 2022 07:02:29 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85688B5FED for ; Wed, 26 Oct 2022 04:02:28 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id r6-20020a1c4406000000b003cf4d389c41so232092wma.3 for ; Wed, 26 Oct 2022 04:02:28 -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 :message-id:reply-to; bh=9qO/JbNRzACWJ+/BPqzyo1ybZ7r6Vd9pEOf9FoOyjmc=; b=RWGT62z0OrUByMt9GrSpD27EAROj86fo8TCkjjtRrXYNZ6HPIPQ5r5t5vpxfZQi0hd QoBX2qHvro7m4+uOucRRcVawjJZD8M+NXwqHESqMKuVmPmFN0EEJpFUOxhi1Tv0NCQvq 5oSkrVszv1SKhJb5bc/UmpozOVeaCe01pKmr0hMCFKF5at8bs0Knx/L0vEg055RsahMi 5wgwPKOvh22s18cE2oZvGjSg0h3z1hhDKNPe22z3CxTt/ntFrf2/3Q0Ltzl2YLpErooj 3tdAEwQyKaSdYqfroQEnF+6gxG0O9YEFrAL35sjVpftNC6WinLATzAZHFZ5sNgad9J+r /Dcw== 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=9qO/JbNRzACWJ+/BPqzyo1ybZ7r6Vd9pEOf9FoOyjmc=; b=pkBpvZM3/u4ExeDZ1oxxthvuBtjIuLW7toyFjZgQkCg6kCBB0+E6/f3VA04z+URQeO bgOTR5FJvLIr0Y7ULq33dl/2IFVL9i2MZB+ywNSbZkyGIDLV8NHn+q8UeuUW/BfI8Nm3 n9j9uG4yDYxsHIYLsesRJVAvZl6Vlrvnvrj2kGo3QCUbSyzRUT4OQ3yMpY1498+KDQJC 0rnDboF4CbNx4sIJmbHq9sEBu+/sQ/FhjCvqXJdKxwLwxl+u3M5lZ18QCbqI/U/vR5sI exhGXcWVKvbTIcMOk7CH0okmdfYr/2um8qsVol4GHWmrB5VrJJorof2nWRrYRdyDJNP4 HzpQ== X-Gm-Message-State: ACrzQf2ivuZF0VxKdPXABSar/yKsMcYr4lBv1t5n4jTJpMODGDzu8wg9 I92IyWVq3pfHFEzs+Fadtd78SQ== X-Received: by 2002:a7b:cc15:0:b0:3b4:ca90:970d with SMTP id f21-20020a7bcc15000000b003b4ca90970dmr2043088wmh.198.1666782147100; Wed, 26 Oct 2022 04:02:27 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id z7-20020a5d44c7000000b0023672104c24sm5237415wrr.74.2022.10.26.04.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 04:02:26 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org, yung-chuan.liao@linux.intel.com Cc: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 4/6] soundwire: qcom: make reset optional for v1.6 controller Date: Wed, 26 Oct 2022 12:02:08 +0100 Message-Id: <20221026110210.6575-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> References: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 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,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747748027820839842?= X-GMAIL-MSGID: =?utf-8?q?1747748027820839842?= On Some Qualcomm SOCs like sc8280xp which uses v1.6 soundwire controller reset is not mandatory, so make this an optional one. Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 7bc8cd0e906b..54d370f4b291 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -1330,8 +1330,8 @@ static int qcom_swrm_probe(struct platform_device *pdev) } if (data->sw_clk_gate_required) { - ctrl->audio_cgcr = devm_reset_control_get_exclusive(dev, "swr_audio_cgcr"); - if (IS_ERR_OR_NULL(ctrl->audio_cgcr)) { + ctrl->audio_cgcr = devm_reset_control_get_optional_exclusive(dev, "swr_audio_cgcr"); + if (IS_ERR(ctrl->audio_cgcr)) { dev_err(dev, "Failed to get cgcr reset ctrl required for SW gating\n"); ret = PTR_ERR(ctrl->audio_cgcr); goto err_init; From patchwork Wed Oct 26 11:02:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp194676wru; Wed, 26 Oct 2022 04:07:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zWdM5YZHS60tqiF5vUELsuz+Gqmu55F4IT0aj1tyIGmXaDnPM6bJzjvbbgjWKw7ruDE6B X-Received: by 2002:a17:902:b092:b0:17b:833e:74f7 with SMTP id p18-20020a170902b09200b0017b833e74f7mr42838637plr.149.1666782434915; Wed, 26 Oct 2022 04:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666782434; cv=none; d=google.com; s=arc-20160816; b=taWD4HE9ZEIBegVs4CKVe6nkfC/UVARk2YFYtx+UwZkRHAG+hV9ORQThalGMHbbYQB mLztGwUmhkEuRFIH2CushEoge1ljbT6InMarmxpdOjryjfMttCW5jd+6EdPDlYB2uXNu zvaykTc1EaoSwIvYTNekTZzAXoCAjSPlpfcbYqc91UAFbo2/ySOtOjHmBWxm5nl+8r/J 8ww89FQS7i8TRw2aosFoh3bo0t4yZHMTJg7Po0q/ksMPxh6dYZikVYIAZoN6YZjPU6Oc zVa6JwxyKSqxXdTS0GaWy6C7teN8UM/8hDdqXnGOUuxTmkTqMRtkZOiB+/QRyJE+BBuX c2wA== 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=M5yIrMJGpCUVHY5GfvEg2i8ek5laLkQGA9zDhfgH9W8=; b=JSfgjXFCHEMCV812uOLcwL95z2u13iaW1uXMKHTjTs1UGkPC/r6rWHwK97glbemAck KTHrqGQo+bUwQXSQZcfTNXyTeso44LIweJ2NKEHux33ZDUfrP8JpJKSHBSRBo9iccxBV RV8Oh8eO0P3/RbZpncAC1/ljkLSGUt0xAth0Lpq6bmRq6zIJU/UGQKZ8LjetsWryP9hh 4k2ZD7ioj3Wj/RknqfVAdX8B8WErQYdbQGa4SeWiA3cBPNLh35sd1KZ5yTShPVvgdEeT a58hoARioIF+YwEPE1EPTHFDT5CzP7vnB6zhDqjk31iDm7X8LNgGVsDpzXpzIVrcPLEs 49bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O0WFoE7v; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a17090a8e8600b0020a774637a6si2128967pjo.67.2022.10.26.04.07.01; Wed, 26 Oct 2022 04:07:14 -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=O0WFoE7v; 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 S233512AbiJZLCp (ORCPT + 99 others); Wed, 26 Oct 2022 07:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233485AbiJZLCa (ORCPT ); Wed, 26 Oct 2022 07:02:30 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2CADB56D8 for ; Wed, 26 Oct 2022 04:02:29 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id z14so12179938wrn.7 for ; Wed, 26 Oct 2022 04:02:29 -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 :message-id:reply-to; bh=M5yIrMJGpCUVHY5GfvEg2i8ek5laLkQGA9zDhfgH9W8=; b=O0WFoE7vynG5KsDSLBTFaIikesyRanRpjq1Fbxh8BuIkEZPvwoh44dIJul80ph+gwD rZwgeujH8Jrqy5sdsHIof+RuuAV1KqKL3KvfAiG9wLOC8xAfKuEGIHPtn06ySffpqZeN aumbCJgl4ls0yXf6bpilHRmPTXLhy5a6pUOkhhqlLa+tzfaJYuttbymXSDmZojdGgdlt oloWKlyka5phBa9RRrNKMY1mQ2Uf65iVjz7uBeQzrvMXrP+GScvYRgOY+e9rSC36yBBz ed77qagUS1Rob8EEX/CWe50WoKf67T7rcO0R7hgkdOJFEpDEWF0MT5e7ysaxAynioCu8 9Sqw== 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=M5yIrMJGpCUVHY5GfvEg2i8ek5laLkQGA9zDhfgH9W8=; b=2CkFsZ4vlVBwP6ZFsz28M995HhA7t07dbeD+PuiYzWRI0mBn6EE5dWNQ4U97Lh3Kr7 TW1wfDUM1RVHi7sqBTGJTp2mh35nGlhITgNpx8JEk4nGifcvGwxcknCnazaZb+1MBExB DGeVRpL/znhihyy2W2h52d4kC4Vbkq2iU+p/5go/Et1f8+qM1BeXM1cfk5KDwiAB0v33 Fx8OlrhSdfUozMzSUnO0btUrW6IQFVV2vZHsfsmOAi9OvrNzphlNdiUYCViyIsbrP5TX 5IgccmUseddhXCOoVxag46cXCGkvvq09h2bpTY5Wz3EBS+fJQmIpPjWRdfxxGmCN0OvG CTUg== X-Gm-Message-State: ACrzQf3JT5OgBo6RlEodNVgRTPcMLKPIZsQtfhmWHg9y2r4DJY0+4jRj pbXxWu/SbAJ8cA3ifo9WdSMuiw== X-Received: by 2002:a05:6000:1f87:b0:236:7683:e5c0 with SMTP id bw7-20020a0560001f8700b002367683e5c0mr9178434wrb.193.1666782148331; Wed, 26 Oct 2022 04:02:28 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id z7-20020a5d44c7000000b0023672104c24sm5237415wrr.74.2022.10.26.04.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 04:02:27 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org, yung-chuan.liao@linux.intel.com Cc: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 5/6] dt-bindings: soundwire: qcom: add v1.7.0 support Date: Wed, 26 Oct 2022 12:02:09 +0100 Message-Id: <20221026110210.6575-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> References: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 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,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747748058399974008?= X-GMAIL-MSGID: =?utf-8?q?1747748058399974008?= Signed-off-by: Srinivas Kandagatla Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/soundwire/qcom,sdw.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/soundwire/qcom,sdw.txt b/Documentation/devicetree/bindings/soundwire/qcom,sdw.txt index c85c25779e3f..e0faed8dceac 100644 --- a/Documentation/devicetree/bindings/soundwire/qcom,sdw.txt +++ b/Documentation/devicetree/bindings/soundwire/qcom,sdw.txt @@ -13,6 +13,7 @@ board specific bus parameters. "qcom,soundwire-v1.5.0" "qcom,soundwire-v1.5.1" "qcom,soundwire-v1.6.0" + "qcom,soundwire-v1.7.0" - reg: Usage: required Value type: From patchwork Wed Oct 26 11:02:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 11194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp194583wru; Wed, 26 Oct 2022 04:07:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7oUz6snZeVZdvTb9LXWF2c5DCo56zKAF6IOp+jnUZaKO6Zwnpo5+qp8Hbi9VxDxvaqrRNj X-Received: by 2002:a17:90b:4f87:b0:212:effe:bdd7 with SMTP id qe7-20020a17090b4f8700b00212effebdd7mr3763330pjb.66.1666782435747; Wed, 26 Oct 2022 04:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666782435; cv=none; d=google.com; s=arc-20160816; b=IPVFBD7ZO5bbFZy9jBHGWRyPPWfYGGIOf0tZagjCF25MS1vwtfZtd9gI3UbPNXyDHY 3lqZypvP6kaiIjHEE/B2q8jm6ZDG0eXfUIcdz/YYdTQBcTpGc+gEm8IM6iNSftk6lAQ0 LeafN7+P5lF09fC0z9yNgJnHPGg0S+8bjckYfP9ALnT19pRXwIEkKc5f/EGUaFcM+dQZ Bkmy0/SKO+ZoOXd6lHbh7fLevUgEZi8IHajfE90/GIasQST3xFjiwHWIdwn7qN4vxQWi iVaFFxzoqfmEaQWxYZdmWJgcWgBC6AMGOat8pYNegooSUsrGFgpFEsqL/QHMWz+529yK DGug== 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=Wv+lK711vFeOkaa3Qp58DAbyPphjfDZDE3jaNs67Gvk=; b=vzg71/OOMIa0TjJIl60WixpnOTiS1kt4MnXNDzPZg1YieL08hL40clooBxfchmS6ww Gbct1H002ohEfNe/tJH9tRh2Lf9OXMY6Qa3diNxrjeDbIkS14Fna/LOJfWtnGVgOZtzB C6dkurPycsNPt5C2rS5MpnEiaRNLuaD7IrTQQu2GJrv9/zGDvXIoi2dR6yUFpoCJhnIy jxzTtR8HQJyE9cy+wgkzbUNCLpbwqQA4XPjzFXipZ3jEfNvb4z43TsvnwcHGL+lfrEXD UeJnp8yLKxXfbJ62dAmfyPnIB9RzaORiqCsNyxyFmpX8zxFNVGViklvbVaHfDaHi38gn P1DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nCFoVQj1; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j70-20020a638049000000b00434a2cf8d6asi6198172pgd.97.2022.10.26.04.07.01; Wed, 26 Oct 2022 04:07:15 -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=nCFoVQj1; 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 S233516AbiJZLCr (ORCPT + 99 others); Wed, 26 Oct 2022 07:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233111AbiJZLCd (ORCPT ); Wed, 26 Oct 2022 07:02:33 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35CC4B7EDB for ; Wed, 26 Oct 2022 04:02:31 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id bk15so25671531wrb.13 for ; Wed, 26 Oct 2022 04:02:31 -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 :message-id:reply-to; bh=Wv+lK711vFeOkaa3Qp58DAbyPphjfDZDE3jaNs67Gvk=; b=nCFoVQj1TzEu56BZ7+4z29jNcy1DdPyggeQccdQjjd4B46gWsDCDhN9iz/QOxic6lA k/nygJ4hASyHt5AZCV6JOveUNr3H2UNBSyveXcadxsD8gINgBi4FWkX1teanfP1nibIW SFQ4Vi+fbvTBB1Ge5AjaV9bQXRHqssoGl8Fyfov+2EIoRzOkdH/7jqCUuNRwddNgBtRT UUBM0Bx9ZsTkhhC/s36tCYQa3gIV0mADpFbUqQnPLVHOOfJ5FyreoLeiJT4YVriyLN0C LESJ1P062nzfBJzNRlOvZrh/cXTBDxzd0mKTaH3Ve9FmOsgcFLJNUDQhul+CIZEfV41U T38w== 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=Wv+lK711vFeOkaa3Qp58DAbyPphjfDZDE3jaNs67Gvk=; b=vJheMe0LsA0ZavE+VxnTrRYL0xhiKZ0qgnn3Tums+a/rWE82OjmipjwJZrcJvHnpr/ M5L21/utWUMNIj1InKIaqGHxNu0VAFnh5SvFIg/V1WO9gzZrmtc5a04C59YrS5zdq1vc kYZEPAUrlLYjUxKRPYcE4eeM+K/HL7iWqUgcFwkG8ipp/odRcT/HwHPuidIRsML7LDUR zsy1b7LG8lBjZva3IdFmganfiLIKTYBEczXwc+SkeI7rR9FRBsCrAvXy66xjA3GkuGbb iJB5IIFdMSu+D8w9YOwLONOdfG3dfIsx+IvYlp0mwcYVgb4GGPYlwlrW0rBIsvqB5bfB Qo5w== X-Gm-Message-State: ACrzQf3SIL4ewd+V1AnWYp3E3REbnivbmpTlLYW7LNVjhs4oN8nyLB6J Un7IxtRxXr3eSO4lFOSMT4/8R0x9uPu3Yw== X-Received: by 2002:a05:6000:1687:b0:231:95e6:e9ec with SMTP id y7-20020a056000168700b0023195e6e9ecmr30383929wrd.275.1666782149546; Wed, 26 Oct 2022 04:02:29 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id z7-20020a5d44c7000000b0023672104c24sm5237415wrr.74.2022.10.26.04.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 04:02:28 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org, yung-chuan.liao@linux.intel.com Cc: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 6/6] soundwire: qcom: add support for v1.7 Soundwire Controller Date: Wed, 26 Oct 2022 12:02:10 +0100 Message-Id: <20221026110210.6575-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> References: <20221026110210.6575-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 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,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747748059120921579?= X-GMAIL-MSGID: =?utf-8?q?1747748059120921579?= This patch add support for v1.7 SoundWire Controller which has support for Multi-EE (Execution Environment), resulting in a new register and extending field in BUS_CTRL register. With these updates v1.7.0 is fully supported. Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 54d370f4b291..335424870290 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -25,6 +25,8 @@ #define SWRM_COMP_SW_RESET 0x008 #define SWRM_COMP_STATUS 0x014 +#define SWRM_LINK_MANAGER_EE 0x018 +#define SWRM_EE_CPU 1 #define SWRM_FRM_GEN_ENABLED BIT(0) #define SWRM_COMP_HW_VERSION 0x00 #define SWRM_COMP_CFG_ADDR 0x04 @@ -693,7 +695,14 @@ static int qcom_swrm_init(struct qcom_swrm_ctrl *ctrl) u32p_replace_bits(&val, SWRM_DEF_CMD_NO_PINGS, SWRM_MCP_CFG_MAX_NUM_OF_CMD_NO_PINGS_BMSK); ctrl->reg_write(ctrl, SWRM_MCP_CFG_ADDR, val); - ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START); + if (ctrl->version >= 0x01070000) { + ctrl->reg_write(ctrl, SWRM_LINK_MANAGER_EE, SWRM_EE_CPU); + ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, + SWRM_MCP_BUS_CLK_START << SWRM_EE_CPU); + } else { + ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START); + } + /* Configure number of retries of a read/write cmd */ if (ctrl->version > 0x01050001) { /* Only for versions >= 1.5.1 */ @@ -1518,7 +1527,13 @@ static int __maybe_unused swrm_runtime_resume(struct device *dev) } else { reset_control_reset(ctrl->audio_cgcr); - ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START); + if (ctrl->version >= 0x01070000) { + ctrl->reg_write(ctrl, SWRM_LINK_MANAGER_EE, SWRM_EE_CPU); + ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, + SWRM_MCP_BUS_CLK_START << SWRM_EE_CPU); + } else { + ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START); + } ctrl->reg_write(ctrl, SWRM_INTERRUPT_CLEAR, SWRM_INTERRUPT_STATUS_MASTER_CLASH_DET); @@ -1582,6 +1597,7 @@ static const struct of_device_id qcom_swrm_of_match[] = { { .compatible = "qcom,soundwire-v1.3.0", .data = &swrm_v1_3_data }, { .compatible = "qcom,soundwire-v1.5.1", .data = &swrm_v1_5_data }, { .compatible = "qcom,soundwire-v1.6.0", .data = &swrm_v1_6_data }, + { .compatible = "qcom,soundwire-v1.7.0", .data = &swrm_v1_5_data }, {/* sentinel */}, };