mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Baojun Xu <baojun.xu@ti.com>, tiwai@suse.de
Cc: robh+dt@kernel.org, andriy.shevchenko@linux.intel.com,
	lgirdwood@gmail.com, perex@perex.cz,
	pierre-louis.bossart@linux.intel.com, shenghao-ding@ti.com,
	navada@ti.com, 13916275206@139.com, v-hampiholi@ti.com,
	v-po@ti.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, liam.r.girdwood@intel.com,
	yung-chuan.liao@linux.intel.com, broonie@kernel.org,
	antheas.dk@gmail.com, philm@manjaro.org
Subject: Re: [PATCH v5] ALSA: hda/tas2781: Add speaker id check for ASUS projects
Date: Sat, 16 Nov 2024 09:05:23 +0100	[thread overview]
Message-ID: <03d4131f-7204-4cc5-811b-ef541f904e17@wanadoo.fr> (raw)
In-Reply-To: <20241116075006.11994-1-baojun.xu@ti.com>

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@ti.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;
> +	}

...

  reply	other threads:[~2024-11-16  8:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16  7:50 Baojun Xu
2024-11-16  8:05 ` Christophe JAILLET [this message]
2024-11-18  9:14 ` Andy Shevchenko
2024-11-18  9:14   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03d4131f-7204-4cc5-811b-ef541f904e17@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=13916275206@139.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=antheas.dk@gmail.com \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=navada@ti.com \
    --cc=perex@perex.cz \
    --cc=philm@manjaro.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=shenghao-ding@ti.com \
    --cc=tiwai@suse.de \
    --cc=v-hampiholi@ti.com \
    --cc=v-po@ti.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®