Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3139440pxa; Tue, 18 Aug 2020 07:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIjcQrwGluaEg0eIYmmqDGvz2vHarbPfNDor3husrwQxG5qVhsbD3dEBYX+2LiY7aGyod9 X-Received: by 2002:a17:907:10d9:: with SMTP id rv25mr19305402ejb.264.1597761407414; Tue, 18 Aug 2020 07:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597761407; cv=none; d=google.com; s=arc-20160816; b=OqFvi/dguXNehqY75adqeByK0hwtxbH3WXwWwvGAT+n+kp1pPyhdD+NPtIYez0Pq7S uSR2rBZHZ+g4JSR4XOLIAkHuJoxcrnOFonVUzne1ZbayFnQgX7SOt2CI2W+/YJVoOHBb izl9+SaBJCm/ULF3nCNkLkuzX/uYdPtDMHPH9LoTfDBeVGquaf9TTYXT0ssyFc2lr2Ur qyv9y/wyiF8ubhpPtXKwspYJgR69gsVYgLwEDH5IDiTWKeSQy7WPzsko+jTU1GDEGQTe lU3A11ifdVV/WU5loPF6OkuzddGaBTVCGq2WreGFBOXEEHzct+lhqoveLVS3glp2Hp/b jsew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=+r0ZbQaBiqAhPkpsCIgTz1hQk1OdNngOrU6Dw5OeaL4=; b=FjKWvDnTwLSuUynwFUYM4z07A8MwXFA6RDjx56/KSWlp8iUiFsWIpNySK3/MrcV5qC U0Nw56e5IELk0Bse7AXo1CtiT7926ikIe9tBtEBtJ0zPDujbqmoqK2wbDYajdke4Re3r Qz6WJ2yVJcFQ7Yx75q3u6lRrzT1uMf3lWN4wDxb09iKBQxiHZ9LWOdLCsxfRWdBoQcGR bbDRi7EFP7cpxAg88Uxijqf7OrvXZyTrWlP/6Std5mJf7TElcK4uhxj2HoDVJcuCFqlf iSPwK+wcS74D7n5/iYxnl3nIs6+K72b0Bz37SSwi61N4xtoTD1BcDRCCznp/3WOMFDfe 5e2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id o10si13429018edv.301.2020.08.18.07.36.23; Tue, 18 Aug 2020 07:36:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726969AbgHROfi (ORCPT + 99 others); Tue, 18 Aug 2020 10:35:38 -0400 Received: from mga14.intel.com ([192.55.52.115]:33372 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727063AbgHROff (ORCPT ); Tue, 18 Aug 2020 10:35:35 -0400 IronPort-SDR: byEFxi18z4JZ4qw1omOPlP/mf+dgP4/Eb0kd4eAM9aZhtFiN0LnQKXrOI4u9QiXjZfLyltwHk5 IHp7c0iwriJA== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="154170498" X-IronPort-AV: E=Sophos;i="5.76,327,1592895600"; d="scan'208";a="154170498" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2020 07:35:35 -0700 IronPort-SDR: bVvdkknJA7bew7unweNqBq/BQ40Wtel/+Vm/lilbQhrFnelOxHyOfDvOHewpfnWcvaerzbrdZj IOZP6Q6YFEpg== X-IronPort-AV: E=Sophos;i="5.76,327,1592895600"; d="scan'208";a="471830550" Received: from bard-ubuntu.sh.intel.com ([10.239.13.33]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2020 07:35:30 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, rander.wang@linux.intel.com, ranjani.sridharan@linux.intel.com, hui.wang@canonical.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, mengdong.lin@intel.com, bard.liao@intel.com Subject: [PATCH 05/11] soundwire: bus: update multi-link definition with hw sync details Date: Tue, 18 Aug 2020 10:41:14 +0800 Message-Id: <20200818024120.20721-6-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200818024120.20721-1-yung-chuan.liao@linux.intel.com> References: <20200818024120.20721-1-yung-chuan.liao@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart Hardware-based synchronization is typically required when the bus->multi_link flag is set. On Intel platforms, when the Cadence IP is configured in 'Multi Master Mode', the hardware synchronization is required even when a stream only uses a single segment. The existing code only deal with hardware synchronization when a stream uses more than one segment so to remain backwards compatible we add a configuration threshold. For Intel cases this threshold will be set to one, other platforms may be able to use the SSP-based sync in those cases. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- include/linux/soundwire/sdw.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 76052f12c9f7..9adbe4fd7980 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -827,6 +827,11 @@ struct sdw_master_ops { * @multi_link: Store bus property that indicates if multi links * are supported. This flag is populated by drivers after reading * appropriate firmware (ACPI/DT). + * @hw_sync_min_links: Number of links used by a stream above which + * hardware-based synchronization is required. This value is only + * meaningful if multi_link is set. If set to 1, hardware-based + * synchronization will be used even if a stream only uses a single + * SoundWire segment. */ struct sdw_bus { struct device *dev; @@ -850,6 +855,7 @@ struct sdw_bus { unsigned int clk_stop_timeout; u32 bank_switch_timeout; bool multi_link; + int hw_sync_min_links; }; int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent, -- 2.17.1