Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp677722ybh; Sat, 3 Aug 2019 07:32:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwckWnv0TJG+duz0adRnf0s6t35cW4ysve+IUA8UsBJ6+LzrkB74d5Ak3aKHeSh/ZYP4Ilw X-Received: by 2002:a17:902:a413:: with SMTP id p19mr137312831plq.134.1564842735145; Sat, 03 Aug 2019 07:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564842735; cv=none; d=google.com; s=arc-20160816; b=GCsU2+6nUD9VFD7sZbL7OXtYiTWlV52UDhhuKEFKNT6rG/ekugIXxRldAgnRSIlgNS K9LUnu/mtHoOyLTuN+Ya8nTGVhc6Ya9tEx3oreWlVwdxbPcOPNM70ButAD9Iuln4m6cZ GgldWTr93IPH8JL5Ub8Zlv2HWa+Merj7YkwIFQTqcljqCre7w1AhO3WHTwH3ZHvB1EDz ZWpft/eSoUzlCMf7LHA8AezKbObgNIDi0glh3362ttdel3qNK7BXsH6dDnEnm4hEIjHz 3Zdys7GVzNQ+AK3s5faDh++Xp6ZbH9URckPavebvPFitk43arwDxRy8l2vFuFmOmgnPc 5Tdg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MqA0/opw/DMFYuNVtwDktitTWNgLBPJwYEcl9RE+rBA=; b=EjIrXNM4kKBMTZgT1M5AU6me8Ok+pCiG9VcsF35+hIpU76mstvlepqKduMm+B22ohl p1zRCL2TJbs3LeoNQlx3En+lUZeERkVisGyNvYwpqHwCyCpLMf4PqHqfFMhbWSenLg1O 6Nd2MbH1Xu6JW4zMNP79Z/Ng+JLomedJrb6pRjOjrNn3Xy81ngOoM8/ECx4nC1hLZc0g a2K/eT3tnDQDd1iC72YadkXCoLUZB9UHV/m+w9tZZ7zdxDxy+Tsml7WnY0rPRyNYC/aF SKkxWPVQz7FenooUntu4ENYXSLWgjyrN4VULWr9hKQNsuAtZMC9uv+JLg3cMTOR7SGOq xWIg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n124si35495023pga.214.2019.08.03.07.31.59; Sat, 03 Aug 2019 07:32:15 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390642AbfHBPSE (ORCPT + 99 others); Fri, 2 Aug 2019 11:18:04 -0400 Received: from mga01.intel.com ([192.55.52.88]:16123 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729449AbfHBPSE (ORCPT ); Fri, 2 Aug 2019 11:18:04 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2019 08:18:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,338,1559545200"; d="scan'208";a="175610200" Received: from vivekcha-mobl1.amr.corp.intel.com (HELO [10.251.131.115]) ([10.251.131.115]) by orsmga003.jf.intel.com with ESMTP; 02 Aug 2019 08:18:02 -0700 Subject: Re: [RFC PATCH 07/40] soundwire: intel: fix channel number reported by hardware To: Vinod Koul Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, slawomir.blauciak@intel.com, Sanyog Kale References: <20190725234032.21152-1-pierre-louis.bossart@linux.intel.com> <20190725234032.21152-8-pierre-louis.bossart@linux.intel.com> <20190802115719.GJ12733@vkoul-mobl.Dlink> From: Pierre-Louis Bossart Message-ID: Date: Fri, 2 Aug 2019 10:18:02 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190802115719.GJ12733@vkoul-mobl.Dlink> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/19 6:57 AM, Vinod Koul wrote: > On 25-07-19, 18:39, Pierre-Louis Bossart wrote: >> PDI2 reports an invalid count, force the correct hardware-supported >> value >> >> Signed-off-by: Pierre-Louis Bossart >> --- >> drivers/soundwire/intel.c | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c >> index 497879dd9c0d..51990b192dc0 100644 >> --- a/drivers/soundwire/intel.c >> +++ b/drivers/soundwire/intel.c >> @@ -401,6 +401,15 @@ 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)); >> + >> + /* >> + * TODO: pdi number 2 reports channel count as 1 even though >> + * it supports 8 channel. Performing hardcoding for pdi >> + * number 2. >> + */ >> + if (pdi_num == 2) >> + count = 7; > > Is that true for all Intel controllers or some generations. Would it not > be better to put this under some flag which is set on platform basis? This is true of all controllers released so far. We will change this if the hardware changes. > >> + >> } else { >> count = intel_readw(shim, SDW_SHIM_PDMSCAP(link_id)); >> count = ((count & SDW_SHIM_PDMSCAP_CPSS) >> >> -- >> 2.20.1 >