Skip to content

Commit c021ca7

Browse files
soyersoyertiwai
authored andcommitted
ALSA: hda/tas2781: add configurable global i2c address
Make the global i2c address configurable to support compatible amplifiers with different global i2c address. Signed-off-by: Gergo Koteles <soyer@irl.hu> Link: https://lore.kernel.org/r/a252f1efeed5049f027f01e699c9e10e1e05bf9e.1703891777.git.soyer@irl.hu Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 76f5f55 commit c021ca7

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

include/sound/tas2781.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ struct tasdevice_priv {
121121
bool force_fwload_status;
122122
bool playback_started;
123123
bool isacpi;
124+
unsigned int global_addr;
125+
124126
int (*fw_parse_variable_header)(struct tasdevice_priv *tas_priv,
125127
const struct firmware *fmw, int offset);
126128
int (*fw_parse_program_data)(struct tasdevice_priv *tas_priv,

sound/pci/hda/tas2781_hda_i2c.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data)
8181

8282
if (i2c_acpi_get_i2c_resource(ares, &sb)) {
8383
if (tas_priv->ndev < TASDEVICE_MAX_CHANNELS &&
84-
sb->slave_address != TAS2781_GLOBAL_ADDR) {
84+
sb->slave_address != tas_priv->global_addr) {
8585
tas_priv->tasdevice[tas_priv->ndev].dev_addr =
8686
(unsigned int)sb->slave_address;
8787
tas_priv->ndev++;
@@ -701,6 +701,7 @@ static int tas2781_hda_i2c_probe(struct i2c_client *clt)
701701
device_name = "TIAS2781";
702702
tas_hda->priv->save_calibration = tas2781_save_calibration;
703703
tas_hda->priv->apply_calibration = tas2781_apply_calib;
704+
tas_hda->priv->global_addr = TAS2781_GLOBAL_ADDR;
704705
} else
705706
return -ENODEV;
706707

0 commit comments

Comments
 (0)