Re: [PATCH v1] ALSA: hda/tas2781: Add compatible for hardware id TIAS2781 and TXNW2781

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 31, 2025 at 08:17:33PM +0800, Baojun Xu wrote:
> TIAS2781 is unofficial hardware id in acpi for tas2781 in HDA,

ACPI

> has been used for several projects. TXNW is the official hardware
> id for TI, will be used in new projects, including device on SPI bus.
> This patch will support both TIAS2781 and TXNW2781 in acpi

ACPI

> with tas2781 under HDA.

...

> +	hda_priv->save_calibration = tas2781_save_calibration;
> +	tas_hda->priv->global_addr = TAS2781_GLOBAL_ADDR;

No, just add these lines to a new branch.

>  	if (strstr(dev_name(&clt->dev), "TIAS2781")) {
>  		device_name = "TIAS2781";
> -		hda_priv->save_calibration = tas2781_save_calibration;
> -		tas_hda->priv->global_addr = TAS2781_GLOBAL_ADDR;
> +	} else if (strstr(dev_name(&clt->dev), "TXNW2781:00-tas2781-hda.0")) {

Why do you need to match the full device instance name?
Moreover, strstr() is incorrect. Should be strstarts() or str_has_prefix().

> +		device_name = "TXNW2781";
>  	} else if (strstr(dev_name(&clt->dev), "INT8866")) {
>  		device_name = "INT8866";
>  		hda_priv->save_calibration = tas2563_save_calibration;
>  		tas_hda->priv->global_addr = TAS2563_GLOBAL_ADDR;
> -	} else

> +	} else {
>  		return -ENODEV;
> +	}

Unrelated change.

...

>  static const struct acpi_device_id tas2781_acpi_hda_match[] = {
>  	{"TIAS2781", 0 },
> +	{"TXNW2781", 0 },
>  	{"INT8866", 0 },

Keep them sorted, please. Perhaps an additional patch?

>  	{}
>  };

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux