[alsa-devel] [PATCH] ASoC: rt286: Set cbj_en for ACPI devices

Lars-Peter Clausen lars at metafoo.de
Wed Sep 10 08:32:59 CEST 2014


On 09/10/2014 03:40 AM, bardliao at realtek.com wrote:
[...]
> +	/* enable jack combo mode on supported devices */
> +	acpiid = acpi_match_device(dev->driver->acpi_match_table, dev);
> +	if (acpiid) {
> +		for (mach = rt286_jack_combo; mach->acpi_id; mach++) {
> +			if (!strcmp(mach->acpi_id, acpiid->id))
> +				rt286->pdata.cbj_en =
> +					rt286_jack_combo->jack_combo;
> +
> +		}
> +	}

Don't invent your own mechanism for this. Use the driver_data field from the 
acpi_device_id table.

> +
>   	regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3);
>
>   	for (i = 0; i < RT286_POWER_REG_LEN; i++)
>



More information about the Alsa-devel mailing list