Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp668659rdb; Thu, 22 Feb 2024 16:14:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV4mqBCcQqnfVXq3N++9mmt6jDmPRZT4acmeAZ6JwbHXpR1BlUILc+UcN8SeBnUUOzFh+SwfPqcpKSwov1wnLfLaFAi1lvNUk48XUecow== X-Google-Smtp-Source: AGHT+IHG6UAlbs+bO0M8wzTeNej7hWz4KsJJvcFz0QY38ecHh2WyXOS0Bhs5DK8vLe06s+olOTvr X-Received: by 2002:a05:6a00:3d0f:b0:6e4:c626:f905 with SMTP id lo15-20020a056a003d0f00b006e4c626f905mr551427pfb.16.1708647244297; Thu, 22 Feb 2024 16:14:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708647244; cv=pass; d=google.com; s=arc-20160816; b=IuGutWgzFR656W3dJB0bYqvEglwDOjiRm9gjvF6pBucvTmlw4iBacXmjKQN/0pXLoi qOBqeo0SkpOab1Paf7X+K5BaP6rHXxfRwq8/hA8RguEliEha47BS21/tGYeKTrtl3TCf phT9wrXludp9O1+vHDNNxGwm7j5No3Zsaw8j4LiqnUAjdZzdnmfJGp025wnD70dZaIwB BnHpgmg46WHw4sfeeBC281MCzU/Bgqqi2Ar/oYSMut4igmhy2utUwr85IgcLpIaAH0qh rEO7ezOQphtJnDqqrCU+LoyIVZjG9JXc8OEmK2cfCDzSCnIL6iEEmYZd+DmHHQiK7nwm 2VGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=lEayoV/QUYGxZp0YqKoosWLYzwBg4N1kgLXoerRBQLk=; fh=gGsbnxKjv0IBGEWpsreVKueJZpnQocUOof/ekvEY7s8=; b=L9vDxCx2abDeyfjLE9jXXnIASmqixcAjEH6zGzapD8w/Fgy3zTt6fNPp2MVBhfqcsx xk49+HPA6jcdGY3x2IQZo2GXwI1ghRWmkMk8cmvk55HRL5Ocevk+o65B4a2wG4fpY6eu HkW/exjZuFKS3FBNVNTxtwCF92/hRzQu4eD9px7jb0de4GYf3FMkNxgnGJ/88WLmKl8t 95aI3+MvYbuUfSPDFuOdNpD8Qf6xyMDL3VYQIiyeNfCYhHj2W7Y0W0A0oCeA/eIte/Uh uFmgLssbcrVjc0bW3iWzO+6GO50iAFE7JNdTi+7HbwBKx16WfL63Qx4a3kvWGRDgZHvf wtSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KAIzIKoZ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77559-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77559-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id by41-20020a056a0205a900b005dc893fcd81si11791937pgb.29.2024.02.22.16.14.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 16:14:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77559-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KAIzIKoZ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77559-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77559-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 061E12852CE for ; Fri, 23 Feb 2024 00:14:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD414621; Fri, 23 Feb 2024 00:14:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KAIzIKoZ" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 5386B7F for ; Fri, 23 Feb 2024 00:13:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708647240; cv=none; b=UAIIdRKVNj2Wg0kufMY9hVwA5LZ4IUyRTSCV5tKAleUdVsv8iYTUQM//F5jXO0XueJjuEB1e609WASnWpqJxAiPAQUrXV/vCyTSGnIFsJV4yTaUnQVbzPnePl2uw9rFXsUWK2JDcmDcA3b0j4fqjo67UCMsqeS8UgYpdcrM5qpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708647240; c=relaxed/simple; bh=4EONJpHLKVvplBQ1JdsOvXRqsXqzysjuQvWLs1B0/2M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YyISCFxL6aw6j8YfEvdQ1UTR4CUJ0il+EBL481oDOp2lEe8oZO1bsptGgttwRYwjr3hn1gvtVanVWOl2p+eU+gP6IhnXT4nhv5WtOngXLEk9w1P8JzetXVX9euy8uwb3K2zR86lUJWj1eUjDZKvTJ/m99wLmjNCizn7HudIz42o= 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=KAIzIKoZ; arc=none smtp.client-ip=198.175.65.11 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=1708647239; x=1740183239; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=4EONJpHLKVvplBQ1JdsOvXRqsXqzysjuQvWLs1B0/2M=; b=KAIzIKoZR8tpTXEPCbXnU+81SBdtzyvrIUHrIvNCm0ZW0q2gCzpl0BaT LjWXrCRBBq/46cHPR3l6Xqn0DVlJwcY4n0l7IX1O5Ti4LRXkB7k87nks9 i92w0wx2+0UWZBDtnetdP8uzA49cbE2zFuHSdz+cYvQn3OQ5+0FE76CRq ScMD17q8Ley8vkYyowbHN6i3m7jAFzfWBlxN0dMTPicy9aMIrw84U3/qY yp8UhBK2EtAtGiYNeyYQDVNIb7F9it7m2ZQbZxEBe5WQvR5uB/CrysabA LTRhL2N8nK8vVL+SWdsMXYZDUyiGxC5Alm7BFjQCXz42l0M7bwI0wFmMZ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="13497023" X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="13497023" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2024 16:13:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="10363862" Received: from smsalasl-mobl.amr.corp.intel.com (HELO [10.246.128.93]) ([10.246.128.93]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2024 16:13:55 -0800 Message-ID: <10f53a13-a0ff-40f9-b089-f5baacdb76b6@linux.intel.com> Date: Thu, 22 Feb 2024 19:13:51 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9] ASoc: tas2783: Add tas2783 codec driver To: Shenghao Ding , broonie@kernel.org Cc: andriy.shevchenko@linux.intel.com, lgirdwood@gmail.com, perex@perex.cz, 13916275206@139.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, liam.r.girdwood@intel.com, bard.liao@intel.com, mengdong.lin@intel.com, yung-chuan.liao@linux.intel.com, baojun.xu@ti.com, kevin-lu@ti.com, tiwai@suse.de, soyer@irl.hu References: <20240222074000.659-1-shenghao-ding@ti.com> Content-Language: en-US From: Pierre-Louis Bossart In-Reply-To: <20240222074000.659-1-shenghao-ding@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/22/24 2:40 AM, Shenghao Ding wrote: > The tas2783 is a smart audio amplifier with integrated MIPI SoundWire > interface (Version 1.2.1 compliant), I2C, and I2S/TDM interfaces designed > for portable applications. An on-chip DSP supports Texas Instruments > SmartAmp speaker protection algorithm. The integrated speaker voltage and > current sense provides for real-time monitoring of lodspeakers. loudspeakers. > +static void tas2783_apply_calib(struct tasdevice_priv *tas_dev, > + unsigned int *cali_data) > +{ > + struct regmap *map = tas_dev->regmap; > + u8 *cali_start; > + u16 offset; > + int ret; > + > + if (!tas_dev->sdw_peripheral) { > + dev_err(tas_dev->dev, "%s: peripheral doesn't exist.\n", > + __func__); > + return; > + } > + > + offset = tas_dev->sdw_peripheral->id.unique_id - > + TAS2783_UNIQUE_ID_BASE; > + if (offset >= TAS2783_MAX_DEV_NUM) { > + dev_err(tas_dev->dev, "%s: offset(%u) is out of range.\n", > + __func__, offset); > + return; > + } I think we are at the 4th iteration where I have to repeat myself... In the SoundWire spec, the unique_id is *LINK SPECIFIC*, and only used at the bus level within the context of a link to help avoid enumeration conflicts If you are using the unique_id as a SYSTEM-UNIQUE value to lookup EFI data, this is a TI-specific requirement that needs to be documented. That also means you need to double-check for errors so make sure there are no board configurations where the same unique_id is used in multiple links, or by devices other than tas2783.