From: Takashi Iwai <tiwai@suse.de>
To: bo liu <bo.liu@senarytech.com>
Cc: perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] ALSA: hda/senarytech: add senarytech codec support
Date: Thu, 13 Jun 2024 14:01:44 +0200 [thread overview]
Message-ID: <87ikydnj9z.wl-tiwai@suse.de> (raw)
In-Reply-To: <20240606015703.37118-1-bo.liu@senarytech.com>
On Thu, 06 Jun 2024 03:57:03 +0200,
bo liu wrote:
>
> Add initial Senarytech codec support for SN6186. Note that this hda
> patch relies on the configuration default registers to be set correctly
> (normally by BIOS/firmware) in order for it to set up pin widgets
> properly.
>
> Signed-off-by: bo liu <bo.liu@senarytech.com>
The code looks almost fine, just a few nitpicking:
> --- a/sound/pci/hda/Makefile
> +++ b/sound/pci/hda/Makefile
> @@ -24,6 +24,7 @@ snd-hda-codec-cs8409-y := patch_cs8409.o patch_cs8409-tables.o
> snd-hda-codec-ca0110-y := patch_ca0110.o
> snd-hda-codec-ca0132-y := patch_ca0132.o
> snd-hda-codec-conexant-y := patch_conexant.o
> +snd-hda-codec-senarytech-objs :=patch_senarytech.o
Use *-y instead of *-objs. The other entries have been corrected
recently.
> +/* parse EAPDs */
> +static void senary_auto_parse_eapd(struct hda_codec *codec)
> +{
> + struct senary_spec *spec = codec->spec;
> + hda_nid_t nid;
> +
> + for_each_hda_codec_node(nid, codec) {
> + if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
> + continue;
> + if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD))
> + continue;
> + spec->eapds[spec->num_eapds++] = nid;
> + if (spec->num_eapds >= ARRAY_SIZE(spec->eapds))
> + break;
> + }
> +
> + /* NOTE: below is a wild guess; if we have more than two EAPDs,
> + * it's a new chip, where EAPDs are supposed to be associated to
> + * pins, and we can control EAPD per pin.
> + * OTOH, if only one or two EAPDs are found, it's an old chip,
> + * thus it might control over all pins.
> + */
> + if (spec->num_eapds > 2)
> + spec->dynamic_eapd = 1;
Do you still need to verify this? This is copied from Conexant
driver, and they needed this workaround due to different handling per
chip model. Unless needed, better to drop (or assuming always true)
this condition for simplicity.
> +#ifdef CONFIG_PM
> +static int senary_auto_suspend(struct hda_codec *codec)
> +{
> + senary_auto_shutdown(codec);
> + return 0;
> +}
> +#endif
The latest code dropped the dependency on CONFIG_PM. Remove ifdef.
> +static const struct hda_codec_ops senary_auto_patch_ops = {
> + .build_controls = snd_hda_gen_build_controls,
> + .build_pcms = snd_hda_gen_build_pcms,
> + .init = senary_auto_init,
> + .free = senary_auto_free,
> + .unsol_event = snd_hda_jack_unsol_event,
> +#ifdef CONFIG_PM
> + .suspend = senary_auto_suspend,
> + .check_power_status = snd_hda_gen_check_power_status,
> +#endif
Ditto.
thanks,
Takashi
prev parent reply other threads:[~2024-06-13 12:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 1:57 [PATCH V2] ALSA: hda/senarytech: add senarytech codec support bo liu
2024-06-13 12:01 ` Takashi Iwai [this message]
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=87ikydnj9z.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=bo.liu@senarytech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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