Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13341154ybl; Sun, 29 Dec 2019 09:40:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxEpieHIjUk4Gb/8evhStrzhsbJs8OJANlYnJ7YOUXvZKW2JXp8oSM5qSgrzISijCY0qIGl X-Received: by 2002:a05:6830:124b:: with SMTP id s11mr68333339otp.333.1577641231832; Sun, 29 Dec 2019 09:40:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641231; cv=none; d=google.com; s=arc-20160816; b=jmDnMyCb9XBIon7MrvEqQ5eWg7J8fsG0MlAUr4QLo0lvXdK8+LgiZhcN/9oDyhSDal P8yfvwYA0JsnW2t3lfiRFltvwJlLH9oP2sxPhlV37c6n5jjL9Tw8TE/f6THzB4LWvf7u zfUaZwIn/cazrB9NRzvYM4QFE5XMA25U8hGqps1fk59E6KB/i3Vw69P7gBQlyC6nCLLN Yq/n8Ai7/9z2XktOrdfpctDU3DhXYWblhUjy99sdUxV1Oa1KAE3tGcbOqLalrU8U89Od 4PilKSFBEnvSw2B/kyRQ0hlcWe5byGJZ2QUx6IoweCljEslDaRSTEzV+O89A1WXLSz8i o2YA== 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=EeO4V5Cu7ADmxBY+sTyN23g2U6wJyhBv0jxJn1usQ28=; b=gSw7/k2hTb4hJZbENwFAzVn40YzgQDpp92vhoDVBfp7Lgh4un4Hp0p+YzaQnJODGTy ZGHRBJjlI4wk81qNKqkp7r30gX15ad9anmsiF5D1plMzUlV1auU0JlofKQO85yFgW+nz LKpjviWoZxSvyG9qw6uF2FeOkXqQlg0mDgLs8InU+3sdb/PPHjZ/2vvckBRdmqOR+VKD UirNiNRynua33iy09c/SIIcKk9rbaAERbwkZW6xZza9n/QRy2QQtBSbF6mD7hS522CER jmS82ECqUsfQKmDeypJP0hY1ET8yQ7OODxeHurYTTp893KNEPAyVyLwZnAbEm76hdrBP Qh7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZNhpKiA1; 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 m25si21782353otn.208.2019.12.29.09.40.21; Sun, 29 Dec 2019 09:40:31 -0800 (PST) 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=ZNhpKiA1; 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 S1729452AbfL2Rdb (ORCPT + 99 others); Sun, 29 Dec 2019 12:33:31 -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