Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2896935rdh; Mon, 30 Oct 2023 10:41:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3g6pyj3xYq6JlZ00sA2S1fMybNosGaaSuL37eXBp8yLlEuTgGacjLpO0O0iTUTwuUJxBy X-Received: by 2002:a17:90a:c698:b0:280:3772:5c2e with SMTP id n24-20020a17090ac69800b0028037725c2emr4766711pjt.25.1698687677538; Mon, 30 Oct 2023 10:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698687677; cv=none; d=google.com; s=arc-20160816; b=xiAWiUJSEB/gqg1oToSi6OKfxQOKXuYhdLO9E7SQKA9gFWyE8L5SC5WTC3Zeyukr3+ v1bmcqYw6Rr1Fp55EGeEbFuZNb16t4NWPLzHDmK2+lBFsh3Nadn/7g8xYNp666Jzf7dQ MNKtfKuULBBQrpn5sZLEyLpWrKmY25yIl2LkjRa9huWuB4pkypF6w2QVnTUSns1oP+om a062O6r+LcQan9UCScd0zsJicxu4tDxf6c533RoR+spovFSLOodcpJKyWslrtqsTnCbb VMtKnUQPhQ0d/IbEBLF4ZgUj46VDB6apI1rAbz29g5ckUCTQDQXWA/wylXZ4VtZWX7+z fQyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=m/QgsbUtGg0k+RtpNmxSX3Uay4bDl4t7BDgGpDK0K4c=; fh=+K7eN4hqa0wemsydoyMB8xqvnuemK9cmULV6R57ezqw=; b=v/v0Mm8DOrvBH9V2cNdpeSWsdfeO/NqAJHUa1UQcVIusxoX9L+eWv1ubfE6IeHnWN1 7h7Y9CD7TdLBJZkWQDC7t/XYf2w6MqeTXOTubFvwLQQJSB9jYXizqG8AqmcJjxRRnm6s /AfL7e1L3RDL+Baa3trQag8qMQsTaSJC4MukNcFW1O7DndFFFhnJhp4TYFlaD0PxSNEI EnN0NCv2hEA8TFrq5LRHTJu3O59hbSRo+uc3VGC6EvYJO0DeFUbwYlEkRD268u7w0mZl NSGztceh6a6FAVQcXJQ4XGqCW6YWZ6frav/kPFrQcgz7fDT8WPaYMIzlxc1l9sp0Hu8v zuLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EEgzAcN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z22-20020a17090ad79600b0027d032092d7si806307pju.184.2023.10.30.10.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 10:41:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EEgzAcN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 63ED2804916F; Mon, 30 Oct 2023 10:41:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233925AbjJ3RlE (ORCPT + 99 others); Mon, 30 Oct 2023 13:41:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233928AbjJ3RlD (ORCPT ); Mon, 30 Oct 2023 13:41:03 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20EAC9F for ; Mon, 30 Oct 2023 10:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698687661; x=1730223661; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=HQPbEJwDYJoTRJSOJp2zhcD6tw8Fd/fvwRJqyc7v2D0=; b=EEgzAcN+TOu32hw1muJudDFgQDtSmGh8USKat75h+DfRXv7IPbzLlR20 WzbFbrFGqsDiJCyFYJb+gpt1gm0hDRUbas21EgEqMR5JT/stgLMFZoHrb max3Q5z2UjEP6DwswnKWwGc5p6CTE7zO9Y8Yb0KXujN4mROhmb4m+VwW5 NdayBO8Cu4Z7dcTvMPHw5F1/JjrCPHs6jqikGaQ1EnQtNNfsb56laY7Gu rhP9ufVuYmuNeu+SfTeRlrku83aVWkc8THf2tJ0+G5WiQ1PIZfxn1AyoR C7ci4G1lvs7GYYzDM/rBYrzKpjrzd0oueqRWn0rYlSeGsYetskPu3zUY0 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="9652520" X-IronPort-AV: E=Sophos;i="6.03,263,1694761200"; d="scan'208";a="9652520" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2023 10:41:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="710163443" X-IronPort-AV: E=Sophos;i="6.03,263,1694761200"; d="scan'208";a="710163443" Received: from wezedi-mobl1.amr.corp.intel.com (HELO [10.212.223.192]) ([10.212.223.192]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2023 10:40:59 -0700 Message-ID: <9b94488e-206d-419b-92ed-e70aab11907b@linux.intel.com> Date: Mon, 30 Oct 2023 12:40:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] ASoC: tas2783: Add source files for tas2783 driver. Content-Language: en-US To: Mark Brown Cc: Baojun Xu , lgirdwood@gmail.com, perex@perex.cz, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kevin-lu@ti.com, shenghao-ding@ti.com, peeyush@ti.com, navada@ti.com, tiwai@suse.de References: <20231028092409.96813-1-baojun.xu@ti.com> <7f4465c1-5e8e-4c5f-bbff-d2c930326986@linux.intel.com> <9d922584-288a-4b73-83ef-477d1bc58521@sirena.org.uk> From: Pierre-Louis Bossart In-Reply-To: <9d922584-288a-4b73-83ef-477d1bc58521@sirena.org.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 30 Oct 2023 10:41:14 -0700 (PDT) On 10/30/23 12:20, Mark Brown wrote: > On Mon, Oct 30, 2023 at 11:05:39AM -0500, Pierre-Louis Bossart wrote: > >>> +static bool tas2783_readable_register(struct device *dev, unsigned int reg) >>> +{ >>> + switch (reg) { >>> + case 0x000 ... 0x080: /* Data port 0. */ > >> No, this is wrong. All the data port 'standard' registers are "owned" by >> the SoundWire core and handled during the port prepare/configure/bank >> switch routines. Do not use them for regmap. > >> In other words, you *shall* only define vendor-specific registers in >> this codec driver. > > This seems to come up a moderate amount and is an understandable thing > to do - could you (or someone else who knows SoundWire) perhaps send a > patch for the regmap SoundWire integration which does some validation > here during registration and at least prints a warning? Good suggestion, we could indeed check that the registers are NOT in the range [0,0xBF] for all ports - only the range [0xC0..FF] is allowed for implementation-defined values. I'll try to cook something up. > Also worth noting that the default is going to be that the registers are > readable if the driver doesn't configure anything at all so perhaps at > least for just readability this might be worth revisiting. Having the interrupt registers as readable could be problematic, there's a known race condition where the drivers need to do a read after a write, and I am a bit worried if we have two agents reading the same thing. It's the only case I am aware of where a read establishes a state. >>> +static const struct snd_soc_dapm_widget tasdevice_dapm_widgets[] = { >>> + SND_SOC_DAPM_AIF_IN("ASI", "ASI Playback", 0, SND_SOC_NOPM, 0, 0), >>> + SND_SOC_DAPM_AIF_OUT("ASI OUT", "ASI Capture", 0, SND_SOC_NOPM, >>> + 0, 0), >>> + SND_SOC_DAPM_SPK("SPK", NULL), >>> + SND_SOC_DAPM_OUTPUT("OUT"), >>> + SND_SOC_DAPM_INPUT("DMIC") >>> +}; > >> Can you clarify what "ASI" is? > > ASI seems to be a fairly commonly used name in TI devices... In general > naming that corresponds to the datasheet should be fine, especially for > internal only things like this sort of DAPM widget. I'd guess it's > something like Audio Serial Interface but not actually gone and looked. I was only asking was the acronym stood for to make it easier to look-up. Not asking for any technical details.