Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1069417lqa; Sun, 28 Apr 2024 17:44:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0yR8El3Dlymd//pE4sOgRpminM6VtI3gY6HtMPVg/f9go6jVewwn4EyWw6L8tu9xYKg66zXs94QLMkGbyWe+ch1m0bJMlxGq8VCmwdw== X-Google-Smtp-Source: AGHT+IG3gaz5G2OfBzKLaKVyYRPpEXpSiEZ8jOs8Il510do4vHzdOdnZdJq/VWIgBqiH9F9op3xA X-Received: by 2002:a05:6214:e45:b0:6a0:ae32:34c5 with SMTP id o5-20020a0562140e4500b006a0ae3234c5mr9052821qvc.14.1714351462797; Sun, 28 Apr 2024 17:44:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714351462; cv=pass; d=google.com; s=arc-20160816; b=SGpWc1m+ESmBiCN+IIqZhxXllZwnN2Ckf31COWzgqpQk2elvNbQw90dmd5lHD7zPR4 Qd1d0//z4WvGYGREvRLYhRK4rxq8FMKw2ibA+ON55k8cetWV+YlP3p/F9jIXN14Bc9/X 6SmrJhTxnzJN2v7fVX8VK2cKJwuOsPZ1myDzj21wbjs4IPVVYaAXTYmJbFa5dav9Zz+1 2jLM7Ec//9n4XyxoMr7Ui01lu6R0og6vK55/wd7p9dzUPYJoK5w5fIPPpjxhCqc6kkyk NVLLMbOwb352RRQHNES1u2szo0uaew7bp2H1oqdf41WvJbTm6torPlTBL3XHLBOvmNd5 NMBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mu5RiPoNP5mL3aCPAdASPWidoo8jdQuzewmO06hycQU=; fh=DQfWcJ7a6lABpgAjlslbt+lALChD4jPOSQFW0XC7h54=; b=pPUBpeCWG7b4qzpMJ/eOa+/co0lm0HDAZBCUGLLZ7hS6jjpzLQjkUNs8zm9KTQG/9H JdgCJuZJ/zzZlxWj05D6jBlNtrwE1bBukM6oYcIPikkdQ5mDIQctitIs21mxObhFS1oq emJX6Ph8fyf9WNqDXSFIiOfTsu+MsgyzXMRl52diyHL7ns2Yyk9EtcuffLYSRHRGIdjv OdypIPWWPOaQJIo6eDqS8oS//myZjvy8Uwm8HNy2bArCiNDp8UpulOShmOKYxe8Nc/Gf FpSG14xGrlSIDD9Eqqz16/JW8nTnLCuaPsTprJilgty2TrNWV05/6j5jVQ5rHAyDqcN/ 1vTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="CS+7mB/k"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-161649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gc12-20020a056214230c00b0069b55db0afdsi25402369qvb.442.2024.04.28.17.44.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 17:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="CS+7mB/k"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-161649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4CE751C20D0C for ; Mon, 29 Apr 2024 00:44:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 697345CBD; Mon, 29 Apr 2024 00:44:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CS+7mB/k" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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); } -- 2.34.1