[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <03d4131f-7204-4cc5-811b-ef541f904e17@wanadoo.fr>
Date: Sat, 16 Nov 2024 09:05:23 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Baojun Xu <baojun.xu@...com>, tiwai@...e.de
Cc: robh+dt@...nel.org, andriy.shevchenko@...ux.intel.com,
lgirdwood@...il.com, perex@...ex.cz, pierre-louis.bossart@...ux.intel.com,
shenghao-ding@...com, navada@...com, 13916275206@....com,
v-hampiholi@...com, v-po@...com, linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org, liam.r.girdwood@...el.com,
yung-chuan.liao@...ux.intel.com, broonie@...nel.org, antheas.dk@...il.com,
philm@...jaro.org
Subject: Re: [PATCH v5] ALSA: hda/tas2781: Add speaker id check for ASUS
projects
Le 16/11/2024 à 08:50, Baojun Xu a écrit :
> Add speaker id check by gpio in ACPI for ASUS projects.
> In other vendors, speaker id was checked by BIOS, and was applied in
> last bit of subsys id, so we can load corresponding firmware binary file
> for its speaker by subsys id.
> But in ASUS project, the firmware binary name will be appended an extra
> number to tell the speakers from different vendors. And this single digit
> come from gpio level of speaker id in BIOS.
>
> Signed-off-by: Baojun Xu <baojun.xu@...com>
...
> + sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
> + if (IS_ERR(sub)) {
> + dev_err(p->dev, "Failed to get SUBSYS ID.\n");
> + goto err;
> + }
> + // Speaker id was needed for ASUS projects.
Comments in this file are all /* */.
Why introduce // in many places?
CJ
> + if (!strncmp(sub, TAS2781_ASUS_ID, strlen(TAS2781_ASUS_ID))) {
> + ret = devm_acpi_dev_add_driver_gpios(p->dev,
> + tas2781_speaker_id_gpios);
> + if (ret < 0)
> + dev_err(p->dev, "Failed to add driver gpio %d.\n",
> + ret);
ret should be indented below the ( to ease reading.
> + p->speaker_id = devm_gpiod_get(p->dev, "speakerid", GPIOD_IN);
> + if (IS_ERR(p->speaker_id)) {
> + dev_err(p->dev, "Failed to get Speaker id.\n");
> + ret = PTR_ERR(p->speaker_id);
> + goto err;
> + }
> + } else {
> + p->speaker_id = NULL;
> + }
...
Powered by blists - more mailing lists