[alsa-devel] Intel HDA / ca0132: support for Alienware 15 Creative Sound Core3D-EX

Takashi Iwai tiwai at suse.de
Mon May 18 11:39:40 CEST 2015


At Mon, 11 May 2015 22:17:01 +0200,
Gabriele Martino wrote:
> 
> On 04/05/2015 14:30, Takashi Iwai wrote:
> > Hm, this can be changed via a proper pin config?
> >
> > In anyway, I'm traveling in this week and next week, so cannot debug
> > the things.  Will check it later once when I back from vacation.  Just
> > ping me.
> Hi, this should be the final version.
> There are some big changes:
> - all the pin configuration is now performed in ca0132_config(), no more
> static definitions
> - some initialization verbs depend on the pin configuration, so they are
> generated from the pin configuration
> - the quirks management code now is a simple "if" in the pin configuration
> 
> I can't split the patch because the quirks part requires the dynamic
> verbs generation.
> I'm using this since 5 May without any trouble, so it shouldn't blow up
> things.

The patch looks almost OK, but just a few things:

> +static int ca0132_prepare_verbs(struct hda_codec *codec)
> +{
> +	struct ca0132_spec *spec = codec->spec;
> +	static struct hda_verb empty_verb = {};
> +#define NUM_SPEC_VERBS 4
> +
> +	spec->chip_init_verbs = ca0132_init_verbs0;
> +	spec->spec_init_verbs = kzalloc(sizeof(struct hda_verb) * NUM_SPEC_VERBS, GFP_KERNEL);
> +	if (!spec->spec_init_verbs)
> +		return -ENOMEM;
> +
> +	/* HP jack autodetection */
> +	spec->spec_init_verbs[0].nid = spec->unsol_tag_hp;
> +	spec->spec_init_verbs[0].param = AC_VERB_SET_UNSOLICITED_ENABLE;
> +	spec->spec_init_verbs[0].verb = AC_USRSP_EN | spec->unsol_tag_hp;
> +
> +	/* MIC1 jack autodetection */
> +	spec->spec_init_verbs[1].nid = spec->unsol_tag_amic1;
> +	spec->spec_init_verbs[1].param = AC_VERB_SET_UNSOLICITED_ENABLE;
> +	spec->spec_init_verbs[1].verb = AC_USRSP_EN | spec->unsol_tag_amic1;
> +
> +	/* config EAPD */
> +	spec->spec_init_verbs[2].nid = 0x0b;
> +	spec->spec_init_verbs[2].param = 0x78D;
> +	spec->spec_init_verbs[2].verb = 0x00;
> +
> +	/* Previously commented configuration */
> +	/*
> +	spec->spec_init_verbs[3].nid = 0x0b;
> +	spec->spec_init_verbs[3].param = AC_VERB_SET_EAPD_BTLENABLE;
> +	spec->spec_init_verbs[3].verb = 0x02;
> +
> +	spec->spec_init_verbs[4].nid = 0x10;
> +	spec->spec_init_verbs[4].param = 0x78D;
> +	spec->spec_init_verbs[4].verb = 0x02;
> +
> +	spec->spec_init_verbs[5].nid = 0x10;
> +	spec->spec_init_verbs[5].param = AC_VERB_SET_EAPD_BTLENABLE;
> +	spec->spec_init_verbs[5].verb = 0x02;
> +	*/
> +
> +	/* Empty element */
> +	spec->spec_init_verbs[NUM_SPEC_VERBS-1] = empty_verb;

This line is superfluous when you allocated via kzalloc().

Could you fix it and give a proper patch changelog and your
signed-off-by tag?


thanks,

Takashi


More information about the Alsa-devel mailing list