[alsa-devel] [RfC][PATCH v2] ALSA: hda/realtek PCI quirk for Fujitsu U7x7

Takashi Iwai tiwai at suse.de
Tue Feb 13 18:19:21 CET 2018


On Tue, 13 Feb 2018 16:05:38 +0100,
Jan-Marek Glogowski wrote:
> 
> Am 13.02.2018 um 15:48 schrieb Takashi Iwai:
> > On Tue, 13 Feb 2018 15:21:48 +0100,
> > Jan-Marek Glogowski wrote:
> >>
> >> Am 13.02.2018 um 12:11 schrieb Takashi Iwai:
> >>> The driver doesn't check any difference of the position for
> >>> identifying the jack detection capability, so you can apply the same
> >>> quirk to both models.  Then I prefer putting with SND_PCI_QUIRK().
> >>
> >> So the patch is implemented in the spirit of what I actually did when analysing an fixing the bug via hdajackretask. Instead of fixed numbers, it takes the original headphone pin, changes the device to microphone and updates the mics' pin config.
> > 
> > The new patch looks better, but could you try to address warnings by
> > checkpatch.pl?  The 80-chars warning for SND_PCI_QUIRK() line can be
> > ignored.
> 
> Not sure if I should include the first hunk, but when I implemented my function I assumed the long function parameter list was ok, seeing alc269_fixup_pincfg_no_hp_to_lineout.

The change in the first hunk can be dropped.  It's an irrelevant
change.

> 
> @@ -3465,6 +3466,20 @@ static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
>  		spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
>  }
>  
> +static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
> +						 const struct hda_fixup *fix,
> +						 int action)
> +{
> +	unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
> +	unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
> +
> +	if (cfg_headphone && cfg_headset_mic == 0x411111f0)
> +		// same config, but a mic instead of a headphone

Avoid C++ style comment.

> +		snd_hda_codec_set_pincfg
> +			(codec, 0x19, (cfg_headphone & ~AC_DEFCFG_DEVICE)
> +			 + (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));

I'd put the parenthesis adjacent to the function name.
Also, better to use '|' instead of '+' for bit operations.

		snd_hda_codec_set_pincfg(codec, 0x19,
			(cfg_headphone & ~AC_DEFCFG_DEVICE) |
			(AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));


thanks,

Takashi


More information about the Alsa-devel mailing list