Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6020505ybn; Sun, 29 Sep 2019 10:35:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqypSjXxbctt3l9cqrTb2lOjqL/nqrLf080yiFs0wsY2FmItEsIvKRzrxFfjeV8jqRT82hYw X-Received: by 2002:aa7:d816:: with SMTP id v22mr16036609edq.28.1569778539522; Sun, 29 Sep 2019 10:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569778539; cv=none; d=google.com; s=arc-20160816; b=ZqPy4370P+3wniNQBTloZg4uGFtBlCiuAbk0Hb2V/t6NFZhV/qXA3bMEjM8qD7Akck 1fe1/NPZhUgBrVPCrG+Aq94st2L3pCP0qgOfvIXtT2D1NkeYQ9YZiUeH1RumZB0XaNeh lwuh5WW2Nb2gyX0lwiwNln8KgQ3HqHn0HikmIHFjDI3Y6JeuMglzanJzwlXVlb5v/QHD hZwrxnsoixrXjLPWacBRO9Suas1IInx94Y6IlSlPzQMd9HTMlT7OQ06+ywpsGr0f7jSi 2bR475WB4zdCzVpQ++Sl6if7tuFlUhuWXcmmAT9lM/CsjlZncUf+Pe/pwc6272pXfTpD BYeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xb2gTIZHMXltaWI0m/LdEroyayFt8QKJ8KXauAaCCVw=; b=ipeVyPaaHyj2DNVv38H3TKps9TeBO/w35XkeBHCqh6Oh67UGhNPDIAGMSeLwrd7wSW hJUveTCvNHG3IJLB/IQvEmgSLIZHhVqRg6/cWq624cLe/t7YJ2Oiur5l/BxJ3+uIzSu7 o91KcfDIPm0l57dE0uGLdUnn3MIZSRquUKO/ZSPHtJl6a3WHxDez8B6/gzX5bLcLcsuV 7sXV6EXQghK1a+WM6oTIR4N9zQ2hd6OUQ9KzRAjmGA1ihZLugjqVT7TKuioltL34GNR+ rNG6D37dRAt6q4DEGZERJ45pdkn5qLaftmkUd6UI2wJwSROMH1/VXdl4j3T/45/vFBqa GBog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c07r9Q+b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si6021191edb.89.2019.09.29.10.35.15; Sun, 29 Sep 2019 10:35:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c07r9Q+b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729332AbfI2Rex (ORCPT + 99 others); Sun, 29 Sep 2019 13:34:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:46810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730422AbfI2Reo (ORCPT ); Sun, 29 Sep 2019 13:34:44 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98A0E2196E; Sun, 29 Sep 2019 17:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569778484; bh=HG5hHxCXr/7SYGLS3y8yVDNosPel9kbxaaWVanjJFcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c07r9Q+byHw1o6OKkY3pIY6c7YyE+EYaVZJT0OZi+KiAEP+EC2Z1j0mTS9JVFWNT5 Czt2iATAj2UHaKxTqA95s9mxYu/a36RG1MhWb7JJRFKSxoKJU8aiRJnZmbakyRKVNa l56gdmYgDzp4F8GV4szK7oC0vyRt7UMe/SN/MDFw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Vinod Koul , Sasha Levin Subject: [PATCH AUTOSEL 4.19 10/33] soundwire: intel: fix channel number reported by hardware Date: Sun, 29 Sep 2019 13:33:58 -0400 Message-Id: <20190929173424.9361-10-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190929173424.9361-1-sashal@kernel.org> References: <20190929173424.9361-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart [ Upstream commit 18046335643de6d21327f5ae034c8fb8463f6715 ] On all released Intel controllers (CNL/CML/ICL), PDI2 reports an invalid count, force the correct hardware-supported value This may have to be revisited with platform-specific values if the hardware changes, but for now this is good enough. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20190806005522.22642-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/soundwire/intel.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index a6e2581ada703..29bc99c4a7b66 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -282,6 +282,16 @@ intel_pdi_get_ch_cap(struct sdw_intel *sdw, unsigned int pdi_num, bool pcm) if (pcm) { count = intel_readw(shim, SDW_SHIM_PCMSYCHC(link_id, pdi_num)); + + /* + * WORKAROUND: on all existing Intel controllers, pdi + * number 2 reports channel count as 1 even though it + * supports 8 channels. Performing hardcoding for pdi + * number 2. + */ + if (pdi_num == 2) + count = 7; + } else { count = intel_readw(shim, SDW_SHIM_PDMSCAP(link_id)); count = ((count & SDW_SHIM_PDMSCAP_CPSS) >> -- 2.20.1