]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
soundwire: intel: fix channel number reported by hardware
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 6 Aug 2019 00:55:07 +0000 (19:55 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:26:22 +0000 (04:26 -0400)
BugLink: https://bugs.launchpad.net/bugs/1848047
[ 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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/soundwire/intel.c

index 317873bc0555deafbf4b2e26a44a1e67a59cfe9c..ec25a71d08873e46526f977f0e7775cb8467f921 100644 (file)
@@ -289,6 +289,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) >>