Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6376034rdb; Thu, 14 Dec 2023 17:17:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHAPuKVKa2z34NcYtZ5TeOlCWlapMod5aCJn4+GTXQfWrdFtozcuUvTSTtP8ePUujN4k/6 X-Received: by 2002:a05:620a:2482:b0:77d:cbe1:6d1b with SMTP id i2-20020a05620a248200b0077dcbe16d1bmr15042878qkn.9.1702603033822; Thu, 14 Dec 2023 17:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702603033; cv=none; d=google.com; s=arc-20160816; b=Ph6niYRA4weTuL8AoHMwtcYYH9iPOhGuxqVJz44Xvu71S961uPrYbLFv5Z3dIaHVM1 jqK35qCBXh0O2QxXhyTNcQAQKYYX1b/LrMJkpMnomU0QnMti6KWUivz/z9/qyWQD3n/+ no8EZiUBbHgo2qbakJm3Oanz1i1MFVA7n7HwdX/j/ql4b9eu/c8aK530MpkboH/vT7Wt FHGAXxKDFww3Wi1RURS3RerHG3Ph9PVxMaXR6nAZo0cuN7NncRklViFQhDlhpI2pvtk5 g+iOoV840FrVOZGVVhohFsaUND5Dr4rtf3iX9s07e9Bzcz+qJ5MNt/2QPrVY4JqAoYsn xHNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=BNsHCh/6Pf6lrZuQ2SzFGmdglTBJAUmdFpxbhjLlbiw=; fh=ZR6V6D2WU0zyIjfQPX7YfmWZmlvbVzl0m0Qi5vpsgvY=; b=n7DgOhSrIIbOwDqCn8IhydoNaaXiHE+QlivRbivqrPkyRt7LnarSyPy7iihlircYhD 0SfsJxmqyg+EvbPNSviMX0d1hP0kRnztBCD3l0lbndYSINHxM0pBw9zhu2CfP/lXEBC3 JCLSoUpHrlppaCKZSH0OMxV3E5QxIZx3PLaS0jaFhfO3MU3pDNQ+lHKD67Ymq6XNyS0f JNiE68xf0LTGwLcfr+ylRI8jVz93ZYNktd6EWdwgNi/k05QhEmTqcMjgbxbwEoy9SSfD u9oQstJUyPecI/jfsAm56iywhMZ8+hPw6PzD0H0S5TOt36h0z1lqBodMnyJ1OvcXH/QD anGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ea24-20020a05620a489800b0077d75093ef3si17521168qkb.606.2023.12.14.17.17.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 17:17:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-308-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; spf=pass (google.com: domain of linux-kernel+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu 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 677391C22094 for ; Fri, 15 Dec 2023 01:17:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAEE9809; Fri, 15 Dec 2023 01:17:07 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from irl.hu (irl.hu [95.85.9.111]) (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 DBC037E4 for ; Fri, 15 Dec 2023 01:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=irl.hu Received: from [192.168.2.4] (51b687c3.dsl.pool.telekom.hu [::ffff:81.182.135.195]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 00000000000716A8.00000000657BA90E.0012D020; Fri, 15 Dec 2023 02:17:02 +0100 Message-ID: <9a2b85a8a19e002093e2471a97850d26e335900f.camel@irl.hu> Subject: Re: [PATCH 03/16] ASoC: tas2781: disable regmap regcache From: Gergo Koteles To: Mark Brown Cc: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Date: Fri, 15 Dec 2023 02:17:01 +0100 In-Reply-To: References: <21a183b5a08cb23b193af78d4b1114cc59419272.1701906455.git.soyer@irl.hu> <0b836c10-b21b-4275-8dd0-254dd5467497@sirena.org.uk> <47097f19398808b64f4cc87c2a3c7cc462fb2416.camel@irl.hu> <5f3f0306-799f-4f3b-9e05-fbd300c59d5d@sirena.org.uk> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.2 (3.50.2-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2023-12-07 at 22:39 +0000, Mark Brown wrote: > On Thu, Dec 07, 2023 at 10:12:13PM +0100, Gergo Koteles wrote: > > On Thu, 2023-12-07 at 20:36 +0000, Mark Brown wrote: >=20 > > > > And only one, because tasdevice_change_chn_book directly changes th= e > > > > address of i2c_client, so the unlucky one gets invalid values in it= s > > > > actual book from regcache_sync. >=20 > > > The code creates the impression that writing to one tas2781 writes to > > > all of them, is that not the case? >=20 > > Yes, the tasdevice_* functions, but the regcache_sync doesn't know > > this. >=20 > So this syncing is done in software not hardware? My understanding was > that this was a hardware thing. If you mean that the amplifier does not know that there are several programs or configurations or profiles, but only runs the current one, yes. >=20 > > > How would the devices get their configuration restored? >=20 > > tasdevice_tuning_switch calls tasdevice_select_tuningprm_cfg which > > checks whether the devices needs a new program or configuration. >=20 > > the runtime_suspend and system resume set the devices cur_prog, > > cur_conf to -1. >=20 > ... >=20 > > The tas2781_hda_playback_hook calls the tasdevice_tuning_switch >=20 > And there are no registers other than these programs? The tas2781-hda writes 4 things: 1. Profiles from RCA file eg. INT8866RCA2.bin has 4 profile: Music degree 0 calibration voice call earpiece spk2 bypass The profiles contain pre-power-up and pre-shutdown register+value sequences for each amplifier. 2. Programs from DSP firmware. eg. TAS2XXX3870.bin has 1 program: Tuning Mode 3. Configurations from the DSP firmware. eg. TAS2XXX3870.bin has 2 configurations: configuration_Normal_Tuning Mode_48 KHz_s2_0 calibration_Tuning Mode_48 KHz_s2_0 Programs and configurations contain blocks with addresses where they should be written. 4. Calibration data from EFI variables. R0, INV_R0, R0LOW, POWER, TLIM, Based on the chip, they should be written to 5 registers. The code restores all of these in playback_hook, runtime_resume, system_resume functions without regmap_cache_sync.