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=-10.1 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_GIT autolearn=unavailable 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 364DFC43603 for ; Tue, 10 Dec 2019 21:12:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2C56246AA for ; Tue, 10 Dec 2019 21:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576012333; bh=UMpGuVvlVQ1bxIgcuXYUIwPC5nEb2CXC5Q+/LiSkbro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=V4RicHJo1/tA0hW0mzinml/yOQBTMkaB662+LfSkPl51zP2aS+cJjgnHH+pQ74O4o 2hZ/4A5WJ8t0QNL96f17dOVCd9/lWB3rN1zCxn4/RNycIR1YSIdBKCVCGVZesNzvNb fbyrO1YiygZpJdJDhmOZcSfQq8O5oDqBVpCW8Mvo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728915AbfLJVMM (ORCPT ); Tue, 10 Dec 2019 16:12:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:35296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728618AbfLJVMA (ORCPT ); Tue, 10 Dec 2019 16:12:00 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E848E246B5; Tue, 10 Dec 2019 21:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576012319; bh=UMpGuVvlVQ1bxIgcuXYUIwPC5nEb2CXC5Q+/LiSkbro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CxX7crp+LKl5/IqWMeJoJ7Colkkjh5uR1s2p58ms3fZd0jY0121DYCts40CoxSLgh w3O33Yhyu2swX7j8uuW475Dmk7lZg4fsKbr/nBCx5FO/nRgJqHnFVLI+lqCdBnA0LO KmIVSkywFuCKwVa1GdADG3Ahv3m4YNV2qyk13HVQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Vinod Koul , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.4 253/350] soundwire: intel: fix PDI/stream mapping for Bulk Date: Tue, 10 Dec 2019 16:05:58 -0500 Message-Id: <20191210210735.9077-214-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191210210735.9077-1-sashal@kernel.org> References: <20191210210735.9077-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 c134f914e9f55b7817e2bae625ec0e5f1379f7cd ] 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 Link: https://lore.kernel.org/r/20191022232948.17156-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- 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 13c54eac0cc3e..d1839707128a8 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -479,7 +479,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 @@ -508,7 +511,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; /* Program Stream config ALH register */ conf = intel_readl(alh, SDW_ALH_STRMZCFG(pdi->intel_alh_id)); -- 2.20.1