From patchwork Mon Apr 29 00:43:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13646170 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FE2038D; Mon, 29 Apr 2024 00:44:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714351444; cv=none; b=NwPJD+12zv3NSB7GYqi53cDq53Yl7Wp0IqDaLH8TU8zxM+gY+FhSbPHFeyUTyZBhwxz7I5kMdrIaAQbDMItXZ2wr6gwNHsRGOqwQnEZRRSGmZE7Kk8767uHKME+l8Rv4E6k048kKHrFcTk0HDiybQJEutPY8zgz7zsXYmpRqjRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714351444; c=relaxed/simple; bh=SOxXfekRZP6hwK5s/sf0CEq5o469FfcGNrWL6RZdNCw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MVGekdchYVCO/PaxqilWGORtpRsXGIM6yzQAn60N/oxUXrWnjyTD7ZIN8BRVA5zptUH0MhoOYbpZud6Lh32SS36pj0hIE11I6lo1hSW1pk1efonlECBIO/i+Fr9LvMGOXETANcDyBRbrTq7D3TxH/Q4FKRuaMih8rO0q48u2my8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=CS+7mB/k; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CS+7mB/k" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714351444; x=1745887444; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SOxXfekRZP6hwK5s/sf0CEq5o469FfcGNrWL6RZdNCw=; b=CS+7mB/kw2WGkRhMdcWId600WtSPjWxdhBfljjwg17D+Ez8Ro4xKYXa8 OU142Y0zwQUfZswVEez/Z4CAbbzRqh9gy/aelXU7ur00zgScAElZvZ8PN w4bPaSdUEZSisfSzRNtVmea21xWg8sduNGfVQ0ImdFSrjATICk+7vn3qb wYHvB0x0mIkS9kZ58TbhHEMpdmJchgKENY2Iu52u5IilHhfql+R+CY+bm V5diL4kQ4IU6Wp271b3PQyAnqTUpcIRF5WMUMgjjIE67T52j6wDB2DALa SBOrGUaLvArj/SF1y0FOhr/tm6xbBafpBhgsBtcMygeI1bhtKBcYQwgNA g==; X-CSE-ConnectionGUID: pdeNUMDXRHWmYpBG+ADkQQ== X-CSE-MsgGUID: sWY+fHGgQiOeZfmDN7hGHw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="21152936" X-IronPort-AV: E=Sophos;i="6.07,238,1708416000"; d="scan'208";a="21152936" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 17:44:01 -0700 X-CSE-ConnectionGUID: YT/Zsf/gQ06BxDX9ia6R/g== X-CSE-MsgGUID: qTsTCm5ASByWcblvW0vQeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,238,1708416000"; d="scan'208";a="30423054" Received: from yungchua-ws.ostc.intel.com (HELO yungchua-ws.intel.com) ([10.54.69.90]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 17:44:00 -0700 From: Bard Liao To: linux-sound@vger.kernel.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH 1/4] soundwire: intel_ace2x: cleanup DOAIS/DODS settings Date: Mon, 29 Apr 2024 00:43:18 +0000 Message-Id: <20240429004321.2399754-2-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240429004321.2399754-1-yung-chuan.liao@linux.intel.com> References: <20240429004321.2399754-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierre-Louis Bossart Use two variables to save the settings, in preparation of a follow-up change to read values from _DSD properties. Starting with this patch, the bitfields will be reordered and listed MSB-first, as shown in the hardware documentation. Also note that the default for DOAIS is changed from 0x1 (copy-pasted value?) to 0x3 (hardware default). Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel_ace2x.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index 75e629c938dc..32b538cd6d66 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -25,12 +25,17 @@ static void intel_shim_vs_init(struct sdw_intel *sdw) { void __iomem *shim_vs = sdw->link_res->shim_vs; + u16 doais; + u16 dods; u16 act; + doais = 0x3; + dods = 0x1; + act = intel_readw(shim_vs, SDW_SHIM2_INTEL_VS_ACTMCTL); - u16p_replace_bits(&act, 0x1, SDW_SHIM2_INTEL_VS_ACTMCTL_DOAIS); + u16p_replace_bits(&act, doais, SDW_SHIM2_INTEL_VS_ACTMCTL_DOAIS); + u16p_replace_bits(&act, dods, SDW_SHIM2_INTEL_VS_ACTMCTL_DODS); act |= SDW_SHIM2_INTEL_VS_ACTMCTL_DACTQE; - act |= SDW_SHIM2_INTEL_VS_ACTMCTL_DODS; intel_writew(shim_vs, SDW_SHIM2_INTEL_VS_ACTMCTL, act); usleep_range(10, 15); } From patchwork Mon Apr 29 00:43:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13646171 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AFBA624; Mon, 29 Apr 2024 00:44:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714351444; cv=none; b=HvLz1xAg4qMV9JpofWrqN+7PMeGOAklzyroGBHxYk7978ilz6/cZVpBSFRXJPg1XkyFDdi6dAu1esDeC9o9xTiehf7+yRB5hECCVx5naGQhubDT98b1L/tAdrqR6V1HN1T1Xezu47YUq0uJRnAPyJCd87A0YI0uQr5/A8nQw8m0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714351444; c=relaxed/simple; bh=Fs5Wd4bvoxAGg4B0xLOE1k0u+3+ahDP1iX1z3POoDfI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jW0Mg2VaLN5FjzMM1aJ9le7ivaCSQPWjYSSgPD0XW+NLrnWLT7UFcECKtqOOJjTJcT/iPld/ybKXAC/r1Dmra0x/SrlPJAL5wIQYHt6v8ajBI80PPPUas1npPLd17qAg0+akMH14zXJjDUkK2ODAzt3pCTsc/lBKrb51X9YD1O0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UQAhwiWI; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UQAhwiWI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714351444; x=1745887444; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Fs5Wd4bvoxAGg4B0xLOE1k0u+3+ahDP1iX1z3POoDfI=; b=UQAhwiWI4sakiiz1+Tia7O/qIS1O6GDT8lgkhrvi8i7AvgM93LvIN9iM d5RaKBEG4nMGkAo4vSPmzMrVjZ4biDzkNemSjRHhKAppGtkf7fgO78De0 D2MVsT5mCKRP75qAoO/ybuD10J8BIlNG+zu0xQ1g0EHUOZyg4i6LK0z9o apheVf6KL2yhfMdf1xfU365L993kzpkMQW2mnKEVnPbUTgiL2s/0Z+mxg jWF9xo8YbouSoZfPrOFNHVz22L/+lpu4lag2xKtl2b3yuISAda20D0+4h PqVwY1DsYOw66uvOoa85rIjyZtBfDn+Qmg9xgK7T0y2YzQAtl8VxEPLEO g==; X-CSE-ConnectionGUID: UY4N7wQqSg2Lfit5qJVoMw== X-CSE-MsgGUID: eWmmuPO5RLKkbv3Lk7XHHw== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="21152938" X-IronPort-AV: E=Sophos;i="6.07,238,1708416000"; d="scan'208";a="21152938" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 17:44:01 -0700 X-CSE-ConnectionGUID: cJkDek7jRwiKbmNpmtluSA== X-CSE-MsgGUID: p2ybH0ILTqCXRYTUysW/sA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,238,1708416000"; d="scan'208";a="30423057" Received: from yungchua-ws.ostc.intel.com (HELO yungchua-ws.intel.com) ([10.54.69.90]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 17:44:01 -0700 From: Bard Liao To: linux-sound@vger.kernel.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH 2/4] soundwire: intel_ace2x: use DOAIS and DODS settings from firmware Date: Mon, 29 Apr 2024 00:43:19 +0000 Message-Id: <20240429004321.2399754-3-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240429004321.2399754-1-yung-chuan.liao@linux.intel.com> References: <20240429004321.2399754-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierre-Louis Bossart Starting with LNL, the recommendation is to use settings read from DSD properties instead of hard-coding the values. The DOAIS and DODS values are completely-specific to Intel and are stored in a vendor-specific property structure. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.h | 5 +++++ drivers/soundwire/intel_ace2x.c | 7 +++++-- drivers/soundwire/intel_auxdevice.c | 21 +++++++++++++++++++++ include/linux/soundwire/sdw.h | 2 ++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/intel.h b/drivers/soundwire/intel.h index 511932c55216..b36d46319f0f 100644 --- a/drivers/soundwire/intel.h +++ b/drivers/soundwire/intel.h @@ -58,6 +58,11 @@ struct sdw_intel { #endif }; +struct sdw_intel_prop { + u16 doais; + u16 dods; +}; + enum intel_pdi_type { INTEL_PDI_IN = 0, INTEL_PDI_OUT = 1, diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index 32b538cd6d66..917cc79d4d85 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -25,12 +25,15 @@ static void intel_shim_vs_init(struct sdw_intel *sdw) { void __iomem *shim_vs = sdw->link_res->shim_vs; + struct sdw_bus *bus = &sdw->cdns.bus; + struct sdw_intel_prop *intel_prop; u16 doais; u16 dods; u16 act; - doais = 0x3; - dods = 0x1; + intel_prop = bus->vendor_specific_prop; + doais = intel_prop->doais; + dods = intel_prop->dods; act = intel_readw(shim_vs, SDW_SHIM2_INTEL_VS_ACTMCTL); u16p_replace_bits(&act, doais, SDW_SHIM2_INTEL_VS_ACTMCTL_DOAIS); diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c index 296a470ce1e0..697d64070794 100644 --- a/drivers/soundwire/intel_auxdevice.c +++ b/drivers/soundwire/intel_auxdevice.c @@ -122,6 +122,7 @@ static void generic_new_peripheral_assigned(struct sdw_bus *bus, static int sdw_master_read_intel_prop(struct sdw_bus *bus) { struct sdw_master_prop *prop = &bus->prop; + struct sdw_intel_prop *intel_prop; struct fwnode_handle *link; char name[32]; u32 quirk_mask; @@ -153,6 +154,26 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus) prop->quirks = SDW_MASTER_QUIRKS_CLEAR_INITIAL_CLASH | SDW_MASTER_QUIRKS_CLEAR_INITIAL_PARITY; + intel_prop = devm_kzalloc(bus->dev, sizeof(*intel_prop), GFP_KERNEL); + if (!intel_prop) + return -ENOMEM; + + /* initialize with hardware defaults, in case the properties are not found */ + intel_prop->doais = 0x3; + intel_prop->dods = 0x1; + + fwnode_property_read_u16(link, + "intel-sdw-doais", + &intel_prop->doais); + fwnode_property_read_u16(link, + "intel-sdw-dods", + &intel_prop->dods); + bus->vendor_specific_prop = intel_prop; + + dev_dbg(bus->dev, "doais %#x dods %#x\n", + intel_prop->doais, + intel_prop->dods); + return 0; } diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 7bb9119f3069..13e96d8b7423 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -886,6 +886,7 @@ struct sdw_master_ops { * @port_ops: Master port callback ops * @params: Current bus parameters * @prop: Master properties + * @vendor_specific_prop: pointer to non-standard properties * @m_rt_list: List of Master instance of all stream(s) running on Bus. This * is used to compute and program bus bandwidth, clock, frame shape, * transport and port parameters @@ -920,6 +921,7 @@ struct sdw_bus { const struct sdw_master_port_ops *port_ops; struct sdw_bus_params params; struct sdw_master_prop prop; + void *vendor_specific_prop; struct list_head m_rt_list; #ifdef CONFIG_DEBUG_FS struct dentry *debugfs; From patchwork Mon Apr 29 00:43:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13646172 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A613117F3; Mon, 29 Apr 2024 00:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714351446; cv=none; b=RVBJSp3gtvKmYQZxURpIqnpcJnE0bZc/oI4XEGBXZCyEGnPdLjl1KUIReVB8zC2+RM+Uo5LcjFD67cUy/CSkf1mrmZcxIgHmZNc+RxQTxjbb7PRyjleH+85qOMlMBEH3uNSolDgHxP+g+cUZkC/hs0kVBjE53dGP6uluNo/oW+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714351446; c=relaxed/simple; bh=XTpqSGb/WqBKDfIU+/PC7PAjWXtA2Wwy9iv70sB2u+o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PMwEm3U/GxxdDVR5ilDvjhw/+rjyJuMkR80fNTAl823U1ILG3AT9cKPwBugiLRnlsRGTTtrl7FN5/2yHN/Z17vwLqPwAnJAJPcVk4nm/Ti3A/N5OYJ6TOYwGDeXYflyFcNOWwood0TwqKJkB4BsSJ/pTdpxF9RXQtTTM+GlCj0Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nGCCSj84; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nGCCSj84" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714351445; x=1745887445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XTpqSGb/WqBKDfIU+/PC7PAjWXtA2Wwy9iv70sB2u+o=; b=nGCCSj84pVEZo/XNb9ogRb1zSyaEJIMoqfjdGdmxF2JKSnJ0yBNZCArM JtFSio4jG3qbqtHEiPPVJTMHZdGwX52G3C/crdJd8RjS+wGn7b1Gg4qG3 gTQKKpPv25VD2PmKPDp0UoQ6JG9A+tBlKcAh0JDbd/hre3qQ3MAIMYaBJ p2LDRF5iSQgXATEN0UTtVq5qWRqYYDHvXTtZtgUZw/5B8j6LtEWaO+MUx BuFv61yaiXfW3oPX5Nkxqf/bVoOWaOuz+009CqOJBjFufiayTORurA37p ip8GL27dop2+CnEwrMc5MAk4ZsgN8FLVuaxPmu7BvWrgG7tSJBr2AB8J/ w==; X-CSE-ConnectionGUID: sIwObsKmS6y2Z2b6xoYPEg== X-CSE-MsgGUID: zNmJzB+uTA+UvA5BRejXRA== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="21152941" X-IronPort-AV: E=Sophos;i="6.07,238,1708416000"; d="scan'208";a="21152941" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 17:44:02 -0700 X-CSE-ConnectionGUID: pNFB6MG7SmCgKMIOLxf/ew== X-CSE-MsgGUID: 75hynvahSnmqlOzlMvlYyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,238,1708416000"; d="scan'208";a="30423060" Received: from yungchua-ws.ostc.intel.com (HELO yungchua-ws.intel.com) ([10.54.69.90]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 17:44:01 -0700 From: Bard Liao To: linux-sound@vger.kernel.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH 3/4] soundwire: intel_ace2.x: add support for DODSE property Date: Mon, 29 Apr 2024 00:43:20 +0000 Message-Id: <20240429004321.2399754-4-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240429004321.2399754-1-yung-chuan.liao@linux.intel.com> References: <20240429004321.2399754-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierre-Louis Bossart Extend previous patches with the DODSE field and property. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.h | 1 + drivers/soundwire/intel_ace2x.c | 3 +++ drivers/soundwire/intel_auxdevice.c | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/intel.h b/drivers/soundwire/intel.h index b36d46319f0f..f58860f192f9 100644 --- a/drivers/soundwire/intel.h +++ b/drivers/soundwire/intel.h @@ -60,6 +60,7 @@ struct sdw_intel { struct sdw_intel_prop { u16 doais; + u16 dodse; u16 dods; }; diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index 917cc79d4d85..a07fd4a79f00 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -28,15 +28,18 @@ static void intel_shim_vs_init(struct sdw_intel *sdw) struct sdw_bus *bus = &sdw->cdns.bus; struct sdw_intel_prop *intel_prop; u16 doais; + u16 dodse; u16 dods; u16 act; intel_prop = bus->vendor_specific_prop; doais = intel_prop->doais; + dodse = intel_prop->dodse; dods = intel_prop->dods; act = intel_readw(shim_vs, SDW_SHIM2_INTEL_VS_ACTMCTL); u16p_replace_bits(&act, doais, SDW_SHIM2_INTEL_VS_ACTMCTL_DOAIS); + u16p_replace_bits(&act, dodse, SDW_SHIM2_INTEL_VS_ACTMCTL_DODSE); u16p_replace_bits(&act, dods, SDW_SHIM2_INTEL_VS_ACTMCTL_DODS); act |= SDW_SHIM2_INTEL_VS_ACTMCTL_DACTQE; intel_writew(shim_vs, SDW_SHIM2_INTEL_VS_ACTMCTL, act); diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c index 697d64070794..7310441050b1 100644 --- a/drivers/soundwire/intel_auxdevice.c +++ b/drivers/soundwire/intel_auxdevice.c @@ -160,18 +160,23 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus) /* initialize with hardware defaults, in case the properties are not found */ intel_prop->doais = 0x3; + intel_prop->dodse = 0x0; intel_prop->dods = 0x1; fwnode_property_read_u16(link, "intel-sdw-doais", &intel_prop->doais); + fwnode_property_read_u16(link, + "intel-sdw-dodse", + &intel_prop->dodse); fwnode_property_read_u16(link, "intel-sdw-dods", &intel_prop->dods); bus->vendor_specific_prop = intel_prop; - dev_dbg(bus->dev, "doais %#x dods %#x\n", + dev_dbg(bus->dev, "doais %#x dodse %#x dods %#x\n", intel_prop->doais, + intel_prop->dodse, intel_prop->dods); return 0; From patchwork Mon Apr 29 00:43:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13646173 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 065C528F3; Mon, 29 Apr 2024 00:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714351446; cv=none; b=Av/JsniAaKFgZcq+NmEKG/QACIeFKjNApDDyUVnanMHWGfYdVYj6c1qbelhxAiK2fVSWQP8LzxC88XvjvmwQmC8E6UkcWn0mdSyNRzJ8FKBaaWggGn7Dj73QWvaU6Jpwt24PAu8PGPx1DEwd8pjgM7lXmXBL2JSbj8WbMpm47UU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714351446; c=relaxed/simple; bh=CmBvxj4i2sYdd8JMUHor57gLmcthgmKvMp4PIMBm46U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Qyp2SujV+e34P8aGGyINlY5K4K3d//6w4Gi4sedeG18so3jJ0VMCSsQWOzdGQnZtU1lS3XFWms0mB6Ooh/vrdR0o879lJiDOI9gNGasi03fp2xLVSFCSEoOG6OEclgZzJowHso5dLOCOLZuijdiNpcSpao+nzq90/GQuFk2xkcc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=krpiXL16; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="krpiXL16" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714351445; x=1745887445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CmBvxj4i2sYdd8JMUHor57gLmcthgmKvMp4PIMBm46U=; b=krpiXL16zseV5H+jpMSL+FpqYp+RjhHJNE6jsuIK9NgD0c+UdzVaY2Kh 6wQlJykToy6qSaPHD2AtE7hxVWhyEovW7/1h1LP5qu+1I6RJJ5ZYg/jEF gINw6XC/ruElF9xV69SsGdleswNLYFxsETNQJk8AnMtcAepiZ1w8UNN/h Ih75X0X4vPfmJt30KOesVVhbQ37s0tek//xOptJB17U8O2XfA/cVwTTNd LO22gr4XCjDKHiQrdHqpPujt9UwCcgS+Z7tBxwkXlSGTYgDsK2nfjqgcy 6V8K+vA5Tjr1wQtxw7zn+Glzvajl7Cr44v5AGyHEN3N/eQCNFi4VpDWKc A==; X-CSE-ConnectionGUID: RD8iwX0BT6OhDIUqrfl3hg== X-CSE-MsgGUID: HT1xVyroTdC9zwQN7sTVGQ== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="21152944" X-IronPort-AV: E=Sophos;i="6.07,238,1708416000"; d="scan'208";a="21152944" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 17:44:02 -0700 X-CSE-ConnectionGUID: 4mw2mqMyTzCvsvvl4Ny59w== X-CSE-MsgGUID: 7j9KE2auRuigNavET/7gJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,238,1708416000"; d="scan'208";a="30423066" Received: from yungchua-ws.ostc.intel.com (HELO yungchua-ws.intel.com) ([10.54.69.90]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 17:44:01 -0700 From: Bard Liao To: linux-sound@vger.kernel.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH 4/4] soundwire: intel_ace2.x: add support for DOAISE property Date: Mon, 29 Apr 2024 00:43:21 +0000 Message-Id: <20240429004321.2399754-5-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240429004321.2399754-1-yung-chuan.liao@linux.intel.com> References: <20240429004321.2399754-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierre-Louis Bossart Extend previous patches with the DOAISE field and property. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.h | 1 + drivers/soundwire/intel_ace2x.c | 3 +++ drivers/soundwire/intel_auxdevice.c | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/intel.h b/drivers/soundwire/intel.h index f58860f192f9..b68e74c294e7 100644 --- a/drivers/soundwire/intel.h +++ b/drivers/soundwire/intel.h @@ -59,6 +59,7 @@ struct sdw_intel { }; struct sdw_intel_prop { + u16 doaise; u16 doais; u16 dodse; u16 dods; diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index a07fd4a79f00..8b1b6ad420cf 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -27,17 +27,20 @@ static void intel_shim_vs_init(struct sdw_intel *sdw) void __iomem *shim_vs = sdw->link_res->shim_vs; struct sdw_bus *bus = &sdw->cdns.bus; struct sdw_intel_prop *intel_prop; + u16 doaise; u16 doais; u16 dodse; u16 dods; u16 act; intel_prop = bus->vendor_specific_prop; + doaise = intel_prop->doaise; doais = intel_prop->doais; dodse = intel_prop->dodse; dods = intel_prop->dods; act = intel_readw(shim_vs, SDW_SHIM2_INTEL_VS_ACTMCTL); + u16p_replace_bits(&act, doaise, SDW_SHIM2_INTEL_VS_ACTMCTL_DOAISE); u16p_replace_bits(&act, doais, SDW_SHIM2_INTEL_VS_ACTMCTL_DOAIS); u16p_replace_bits(&act, dodse, SDW_SHIM2_INTEL_VS_ACTMCTL_DODSE); u16p_replace_bits(&act, dods, SDW_SHIM2_INTEL_VS_ACTMCTL_DODS); diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c index 7310441050b1..17cf27e6ea73 100644 --- a/drivers/soundwire/intel_auxdevice.c +++ b/drivers/soundwire/intel_auxdevice.c @@ -159,10 +159,14 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus) return -ENOMEM; /* initialize with hardware defaults, in case the properties are not found */ + intel_prop->doaise = 0x1; intel_prop->doais = 0x3; intel_prop->dodse = 0x0; intel_prop->dods = 0x1; + fwnode_property_read_u16(link, + "intel-sdw-doaise", + &intel_prop->doaise); fwnode_property_read_u16(link, "intel-sdw-doais", &intel_prop->doais); @@ -174,7 +178,8 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus) &intel_prop->dods); bus->vendor_specific_prop = intel_prop; - dev_dbg(bus->dev, "doais %#x dodse %#x dods %#x\n", + dev_dbg(bus->dev, "doaise %#x doais %#x dodse %#x dods %#x\n", + intel_prop->doaise, intel_prop->doais, intel_prop->dodse, intel_prop->dods);