summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2019-08-05 19:55:07 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-07 18:59:29 +0200
commit5a58f0bf27ff1f6f401339e075c272a489bc9d24 (patch)
tree5b05e35f8ebef8ac64c5c187e4e5f2a624b14235
parent175f4efcb12ac85e5471cc0468e10a2d6db8a40f (diff)
downloadlinux-stable-5a58f0bf27ff1f6f401339e075c272a489bc9d24.tar.gz
linux-stable-5a58f0bf27ff1f6f401339e075c272a489bc9d24.tar.bz2
linux-stable-5a58f0bf27ff1f6f401339e075c272a489bc9d24.zip
soundwire: intel: fix channel number reported by hardware
[ 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 <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190806005522.22642-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/soundwire/intel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
index 60293a00a14e..8a670bc86c0c 100644
--- a/drivers/soundwire/intel.c
+++ b/drivers/soundwire/intel.c
@@ -283,6 +283,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) >>