Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4845494rdb; Fri, 29 Dec 2023 16:11:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJn0qktbdnQDLsBU7s2xyz3zeVuxmtlF/VXGNi3396+59phg8EUU6PvmpaZeapKwXGRiow X-Received: by 2002:a05:6e02:178a:b0:35d:6caf:78c4 with SMTP id y10-20020a056e02178a00b0035d6caf78c4mr20686588ilu.80.1703895062679; Fri, 29 Dec 2023 16:11:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703895062; cv=none; d=google.com; s=arc-20160816; b=zgNgSNjkzsrOmXgHcrgsz6vXwtWAxuFLkqve3kXy9qQXyB7wM2MYHjYnV7F8WzF3kR TzuCEpuMXTn0wDMaOCVSs6q/gGV3nMUEcgcMShqNxn9+LOmX8+tSfZr2ukJBNbv9sdcd UV2WtSo+aUwjQchV6YsOCdRUujJRcsV9Gqh7rV8cJEUx3MHZul/DoJNV9ePo7dWznGve qPtHOcB486ooKZanbUbRoRY5Q1F+RStQt5nfmrVnxTVXp7JsPv4yPOdEAn+u5CbjuQEx tDo+/WMzt0T7cbKfx76IfVXhiXUTfwpRM8dy7T888m3MEIofeEl612vHBXbFaFh+dWHx usVw== ARC-Message-Signature: i=1; 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; bh=AFwEnPyESaAbw81Ldgu3Qf/H1lLkKtAnJueyv8a+cmY=; fh=JvSZ5/sqeBdpvbJYyH5kp4+fEWeDN16g8aW3jyvxq2M=; b=P2eR41njFOqtxmB6kvOqGJej74EekCzIQRdHeVS5SKxY7toRhmpLWRqUv3K/lxNyLV hAeH6CCLHSYNPl1hUOXEnAP2UdR3L1JCHBpwH5PxGZOG/qaRDnHeGAO+8tYiH3spzoAY O/xk6tD5ETfFKUcU/golTIsg0wFVJxYy123RqBH5lyWhsC93+HF7K9qQhn/v0PB0lguY AkByaObo8I4Mpe1S1ibwDqsgWKLOZMYKT99vBpxflXixXrMzKQu++j83Q7Ts/1cUeBBR a/9h+DILL6MX11hldyGm0P0ez7+qjQnODTgixdhb7NPax70pkq7spq3n3xNdI1G3RwEV UJ/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13296-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9-20020a170902654900b001bc162f3318si14796711pln.640.2023.12.29.16.11.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 16:11:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13296-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13296-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13296-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 61D48B2217E for ; Sat, 30 Dec 2023 00:10:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B9D12569; Sat, 30 Dec 2023 00:10:01 +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 8E08B7F0; Sat, 30 Dec 2023 00:09:59 +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 fedori.lan (51b6838a.dsl.pool.telekom.hu [::ffff:81.182.131.138]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 0000000000071EF2.00000000658F5FD0.0014D4A7; Sat, 30 Dec 2023 01:09:51 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles Subject: [PATCH v2 2/4] ALSA: hda/tas2781: add configurable global i2c address Date: Sat, 30 Dec 2023 01:09:43 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 Make the global i2c address configurable to support compatible amplifiers with different global i2c address. Signed-off-by: Gergo Koteles --- include/sound/tas2781.h | 2 ++ sound/pci/hda/tas2781_hda_i2c.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/sound/tas2781.h b/include/sound/tas2781.h index e17ceab4fead..dde9f8120d4c 100644 --- a/include/sound/tas2781.h +++ b/include/sound/tas2781.h @@ -121,6 +121,8 @@ struct tasdevice_priv { bool force_fwload_status; bool playback_started; bool isacpi; + unsigned int global_addr; + int (*fw_parse_variable_header)(struct tasdevice_priv *tas_priv, const struct firmware *fmw, int offset); int (*fw_parse_program_data)(struct tasdevice_priv *tas_priv, diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index 0f8d5f947f54..49477d17b07c 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -81,7 +81,7 @@ static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data) if (i2c_acpi_get_i2c_resource(ares, &sb)) { if (tas_priv->ndev < TASDEVICE_MAX_CHANNELS && - sb->slave_address != TAS2781_GLOBAL_ADDR) { + sb->slave_address != tas_priv->global_addr) { tas_priv->tasdevice[tas_priv->ndev].dev_addr = (unsigned int)sb->slave_address; tas_priv->ndev++; @@ -699,6 +699,7 @@ static int tas2781_hda_i2c_probe(struct i2c_client *clt) device_name = "TIAS2781"; tas_hda->priv->save_calibration = tas2781_save_calibration; tas_hda->priv->apply_calibration = tas2781_apply_calib; + tas_hda->priv->global_addr = TAS2781_GLOBAL_ADDR; } else return -ENODEV; -- 2.43.0