Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3397022ybp; Sun, 6 Oct 2019 11:02:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwK2IYQd7p6/9/GQKF1+E/Xnid0OjDDiGo8xVW8tanN8MPDwqJ6VLjT8xuZo5FetnycWb78 X-Received: by 2002:a05:6402:383:: with SMTP id o3mr11292764edv.205.1570384939110; Sun, 06 Oct 2019 11:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384939; cv=none; d=google.com; s=arc-20160816; b=w96KtldiQJZlYJ2CsAxw7pPjjQBRsG+Tv4r8tcNJiBFWO6C5eG0nuBEU5r0tNvZtM4 XKgL4BxzwcQolHa2xTPjMPci1DY/AFFGTs1/bIkHI9ZnVGCVcdL5c8EhwTyAHVzvKh47 vrU0zubryiHAkEVTh8Gb82qAwH4I/WR32gl7FGHaDdwXjHC2Ky2bAByHCahtRxAPXPDO rkU6T1SZLR6jSzWyVI2RdIztVaUkCqcxqeqcmlxTrheEcVpXGN+nqTckGP3iXpHaO/ia x6aC2Il5WuxsNEOTnhKMV3uesSL3EjjXJYFo/pZRqU51C+jGJvZG9ku8UvzY7bnAmXyV DO/g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Xb2gTIZHMXltaWI0m/LdEroyayFt8QKJ8KXauAaCCVw=; b=ANPS5RV8J2qw8ElKF2wgyAzb6CDRRD8NQ0rhiyTDtJDTvU4LNc7e1mIaObvNu2QEHy DtFjJN2La6v/s9t+CWSR1uXWQ4WLoBzzAMpRH6DwUjzmrsz85RhQMkcqyUZjCrU3dACS BkgFnEzHm+1PyWfozW9lpJfJo6R8Yy65IjFL2Tm2GL2Bh2y008jKj8rXapuQjvB1aRsC 4Qb6hyjG6TdSI0qsC7N1EvpQsWX1sCj3xHNc1CB3Hh8Xoa1gGaVbbpuwulF5fp8NlBPr nKse5CXLKc1q2UoURcPLvUrEkgvo3sv7N+cpKC8ONzPbIdqRqccuFvMXLD+IzzV5rNNa zdkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sXanqBHR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si7648005ede.380.2019.10.06.11.01.55; Sun, 06 Oct 2019 11:02:19 -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=sXanqBHR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbfJFRaX (ORCPT + 99 others); Sun, 6 Oct 2019 13:30:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:56234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727326AbfJFRaU (ORCPT ); Sun, 6 Oct 2019 13:30:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B6E152087E; Sun, 6 Oct 2019 17:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383019; bh=HG5hHxCXr/7SYGLS3y8yVDNosPel9kbxaaWVanjJFcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sXanqBHRSYfj9Q61Lmwv1IZeWGha8GE8jR5QKP2TY95sIuKcOQeCzMcFHqKlC+pKq MdPbDa2wdbc7OOaLCfxQCAqX+EBFiSmo1O+h/MgOxqMqQHZTO0t/m9aBzfstb+874o yqZxkqHE9Ls5y8H/P74XCRgZ2mJL+831OHv60reI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Vinod Koul , Sasha Levin Subject: [PATCH 4.19 056/106] soundwire: intel: fix channel number reported by hardware Date: Sun, 6 Oct 2019 19:21:02 +0200 Message-Id: <20191006171147.789863879@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171124.641144086@linuxfoundation.org> References: <20191006171124.641144086@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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