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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 D08F9C2D0CE for ; Sun, 29 Dec 2019 17:39:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD3DB207FD for ; Sun, 29 Dec 2019 17:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641150; bh=hErX01WQcNAc051sgKA5yrAyeSkxng0vTKBxomDpqHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hjGLq6//uhdOIYMeyeqoGAa5IF7cLInlbsuvjN78DC/0DN7jKy8azbgYlIGGajAA0 10P5jo6UYk/c3+hfao9k4RGVOjhTVcfT8oeisbUk+iv5LJTRjaT2BsT6KkV6x78HO2 U2p36npFxIuQFP/E5oEANqAtRBJu705wvXJXGiNw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729455AbfL2Rdc (ORCPT ); Sun, 29 Dec 2019 12:33:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:35018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728850AbfL2RdV (ORCPT ); Sun, 29 Dec 2019 12:33:21 -0500 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 A1F7420409; Sun, 29 Dec 2019 17:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640801; bh=hErX01WQcNAc051sgKA5yrAyeSkxng0vTKBxomDpqHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZNhpKiA1suwzIaI6hisaodxBbyfpGD41B+aaw/1JEt+jNr+IOehFQoIfR0rCh8tMW SFDVHQB02eTsgIqxfyADSPnr2sgi0Z11p04VgxzAlKdGlDFWIobqluOYHgLMWmKxOz wbJ1JgCx1nZ7xWeJCmq+gUdq1CAY7LyzNwJ3j+lM= 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 145/219] soundwire: intel: fix PDI/stream mapping for Bulk Date: Sun, 29 Dec 2019 18:19:07 +0100 Message-Id: <20191229162530.282595058@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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 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 29bc99c4a7b6..e49d3c810677 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -352,7 +352,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 @@ -381,7 +384,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