From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47631CA9EAF for ; Thu, 24 Oct 2019 11:24:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18C9420856 for ; Thu, 24 Oct 2019 11:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571916244; bh=g+R7dOXwcKElWRvz7nfCK0CoS/QqY5FvmWjQtXYXq/A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=CF/1wcg+aHQ96L+csXMWqF5quF2VAw+ypsuaVtt9l/Zvz6D3qcvLUIrwFeN6tiZh2 wferxBn9kjZeR34a9lou51q01NJdqXaXC+W6gMz6Aecewq7yQ2hZ+M0sF5wu2B6QgT EMw1W+pD6pmsCo6M+EgSKM0ydyKcur8tXnUUL74w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438940AbfJXLYD (ORCPT ); Thu, 24 Oct 2019 07:24:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:59974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436501AbfJXLYC (ORCPT ); Thu, 24 Oct 2019 07:24:02 -0400 Received: from localhost (unknown [122.181.210.10]) (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 CE2152084C; Thu, 24 Oct 2019 11:24:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571916241; bh=g+R7dOXwcKElWRvz7nfCK0CoS/QqY5FvmWjQtXYXq/A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v/diBaZcHhDWIo+d+S3cwC1M/W56n2/OKrdFxsOE29WIddOrDJOiJE939fYB6f+wr ODZud7Q8KKyseuJi4mAQmDp58BR7ZJLemuOE7wiIq5XXXpa78RfGKwxczTO//LyzZ0 JJwSN3501O/+N/dCEA6sXvX2WxPHxRLcNGf5NhfM= Date: Thu, 24 Oct 2019 16:53:56 +0530 From: Vinod Koul To: Pierre-Louis Bossart 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, Bard liao , Rander Wang , Ranjani Sridharan , Sanyog Kale Subject: Re: [PATCH] soundwire: intel: fix PDI/stream mapping for Bulk Message-ID: <20191024112356.GA2620@vkoul-mobl> References: <20191022232948.17156-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191022232948.17156-1-pierre-louis.bossart@linux.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22-10-19, 18:29, Pierre-Louis Bossart wrote: > The previous formula is incorrect for PDI0/1, the mapping is not > linear but has a discontinuity between PDI1 and PDI2. > > This change has no effect on PCM PDIs (same mapping). > > Signed-off-by: Pierre-Louis Bossart > --- > drivers/soundwire/intel.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c > index b403ccc832b6..c984261fcc33 100644 > --- a/drivers/soundwire/intel.c > +++ b/drivers/soundwire/intel.c > @@ -480,7 +480,10 @@ intel_pdi_shim_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi) > unsigned int link_id = sdw->instance; > int pdi_conf = 0; > > - pdi->intel_alh_id = (link_id * 16) + pdi->num + 5; > + /* the Bulk and PCM streams are not contiguous */ > + pdi->intel_alh_id = (link_id * 16) + pdi->num + 3; > + if (pdi->num >= 2) > + pdi->intel_alh_id += 2; > > /* > * Program stream parameters to stream SHIM register > @@ -509,7 +512,10 @@ intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi) > unsigned int link_id = sdw->instance; > unsigned int conf; > > - pdi->intel_alh_id = (link_id * 16) + pdi->num + 5; > + /* the Bulk and PCM streams are not contiguous */ > + pdi->intel_alh_id = (link_id * 16) + pdi->num + 3; > + if (pdi->num >= 2) > + pdi->intel_alh_id += 2; The change is repeated so how about: intel_pdi_update_alh() or similar which does this rather than repeat the pattern > > /* Program Stream config ALH register */ > conf = intel_readl(alh, SDW_ALH_STRMZCFG(pdi->intel_alh_id)); > -- > 2.20.1 -- ~Vinod From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FADDCA9EAF for ; Thu, 24 Oct 2019 11:25:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 970D82084C for ; Thu, 24 Oct 2019 11:25:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="YVAJPNVS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="v/diBaZc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 970D82084C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D302E167F; Thu, 24 Oct 2019 13:24:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D302E167F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1571916298; bh=BUdNSVGYj/1Ok7jZdSiPk+/bIDEpSbUIjehfWDQo3u4=; h=Date:From:To:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YVAJPNVS359mjSalbpBLyFUpt3F5GxUG9eWkrRbqZMXKBuY5aOd3Hx1jf9vKrknb2 1Bcn5VBmmdPoGR7/IpmTIciODGAywsIu6Cmmjw5LssqEFijiLbRbpsgrc08+GpUOoU t5G2IhqWFGnfJOt47rkBL4HoMUucaVpXcUqk1BZo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 64321F80367; Thu, 24 Oct 2019 13:24:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1B94F8036B; Thu, 24 Oct 2019 13:24:06 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 00F56F80137 for ; Thu, 24 Oct 2019 13:24:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 00F56F80137 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="v/diBaZc" Received: from localhost (unknown [122.181.210.10]) (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 CE2152084C; Thu, 24 Oct 2019 11:24:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571916241; bh=g+R7dOXwcKElWRvz7nfCK0CoS/QqY5FvmWjQtXYXq/A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v/diBaZcHhDWIo+d+S3cwC1M/W56n2/OKrdFxsOE29WIddOrDJOiJE939fYB6f+wr ODZud7Q8KKyseuJi4mAQmDp58BR7ZJLemuOE7wiIq5XXXpa78RfGKwxczTO//LyzZ0 JJwSN3501O/+N/dCEA6sXvX2WxPHxRLcNGf5NhfM= Date: Thu, 24 Oct 2019 16:53:56 +0530 From: Vinod Koul To: Pierre-Louis Bossart Message-ID: <20191024112356.GA2620@vkoul-mobl> References: <20191022232948.17156-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191022232948.17156-1-pierre-louis.bossart@linux.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Cc: alsa-devel@alsa-project.org, tiwai@suse.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Ranjani Sridharan , broonie@kernel.org, srinivas.kandagatla@linaro.org, jank@cadence.com, slawomir.blauciak@intel.com, Sanyog Kale , Bard liao , Rander Wang Subject: Re: [alsa-devel] [PATCH] soundwire: intel: fix PDI/stream mapping for Bulk X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 22-10-19, 18:29, Pierre-Louis Bossart wrote: > The previous formula is incorrect for PDI0/1, the mapping is not > linear but has a discontinuity between PDI1 and PDI2. > > This change has no effect on PCM PDIs (same mapping). > > Signed-off-by: Pierre-Louis Bossart > --- > drivers/soundwire/intel.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c > index b403ccc832b6..c984261fcc33 100644 > --- a/drivers/soundwire/intel.c > +++ b/drivers/soundwire/intel.c > @@ -480,7 +480,10 @@ intel_pdi_shim_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi) > unsigned int link_id = sdw->instance; > int pdi_conf = 0; > > - pdi->intel_alh_id = (link_id * 16) + pdi->num + 5; > + /* the Bulk and PCM streams are not contiguous */ > + pdi->intel_alh_id = (link_id * 16) + pdi->num + 3; > + if (pdi->num >= 2) > + pdi->intel_alh_id += 2; > > /* > * Program stream parameters to stream SHIM register > @@ -509,7 +512,10 @@ intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi) > unsigned int link_id = sdw->instance; > unsigned int conf; > > - pdi->intel_alh_id = (link_id * 16) + pdi->num + 5; > + /* the Bulk and PCM streams are not contiguous */ > + pdi->intel_alh_id = (link_id * 16) + pdi->num + 3; > + if (pdi->num >= 2) > + pdi->intel_alh_id += 2; The change is repeated so how about: intel_pdi_update_alh() or similar which does this rather than repeat the pattern > > /* Program Stream config ALH register */ > conf = intel_readl(alh, SDW_ALH_STRMZCFG(pdi->intel_alh_id)); > -- > 2.20.1 -- ~Vinod _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel