[alsa-devel] [PATCH] hda: Added new IDT codec family

Takashi Iwai tiwai at suse.de
Mon Nov 5 13:30:07 CET 2007


At Mon, 05 Nov 2007 10:06:57 -0500,
Matthew Ranostay wrote:
> 
> diff -r 3e1a17f8baca pci/hda/hda_codec.h
> --- a/pci/hda/hda_codec.h	Wed Oct 31 17:36:20 2007 +0100
> +++ b/pci/hda/hda_codec.h	Sat Nov 03 22:55:14 2007 -0500
> @@ -92,6 +92,8 @@ enum {
>   */
>  #define AC_VERB_SET_STREAM_FORMAT		0x200
>  #define AC_VERB_SET_AMP_GAIN_MUTE		0x300
> +#define AC_VERB_SET_RIGHT_AMP_IN_MUTE	0x350
> +#define AC_VERB_SET_LEFT_AMP_IN_MUTE	0x360

Usually we pass the values for left or right bits in the parameter
value (AC_AMP_SET_LEFT and AC_AMP_SET_RIGHT) instead of the verb
value.  So, no need to redefine them.

>  #define AC_VERB_SET_PROC_COEF			0x400
>  #define AC_VERB_SET_COEF_INDEX			0x500
>  #define AC_VERB_SET_CONNECT_SEL			0x701
> 
> diff -r 3e1a17f8baca pci/hda/patch_sigmatel.c
> --- a/pci/hda/patch_sigmatel.c	Wed Oct 31 17:36:20 2007 +0100
> +++ b/pci/hda/patch_sigmatel.c	Mon Nov 05 09:34:05 2007 -0500
> @@ -62,6 +62,11 @@ enum {
>  };
>  
>  enum {
> +	STAC_92HD71BXX_REF,
> +	STAC_92HD71BXX_MODELS
> +};
> +
> +enum {
>  	STAC_925x_REF,
>  	STAC_M2_2,
>  	STAC_MA6,
> @@ -172,6 +177,23 @@ static hda_nid_t stac9200_dac_nids[1] = 
>          0x02,
>  };
>  
> +static hda_nid_t stac92hd71bxx_adc_nids[2] = {
> +		0x12, 0x13,
> +};
> +
> +static hda_nid_t stac92hd71bxx_mux_nids[2] = {
> +		0x1a, 0x1b
> +};
> +
> +static hda_nid_t stac92hd71bxx_dac_nids[2] = {
> +		0x10, /*0x11, */
> +};
> +
> +#define STAC92HD71BXX_NUM_DMICS	2
> +static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = {
> +		0x18, 0x19, 0
> +};

Wrong indentations.
Try to run $linux_kernel/scripts/checkpatch.pl.  You'll find other
minor coding-style issues.

> +
>  static hda_nid_t stac925x_adc_nids[1] = {
>          0x03,
>  };
> @@ -236,6 +258,11 @@ static hda_nid_t stac922x_pin_nids[10] =
>  static hda_nid_t stac922x_pin_nids[10] = {
>  	0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
>  	0x0f, 0x10, 0x11, 0x15, 0x1b,
> +};
> +
> +static hda_nid_t stac92hd71bxx_pin_nids[10] = {
> +	0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
> +	0x0f, 0x14, 0x18, 0x19, 0x1e,
>  };
>  
>  static hda_nid_t stac927x_pin_nids[14] = {
> @@ -393,6 +420,25 @@ static struct hda_verb stac9200_eapd_ini
>  	/* set dac0mux for dac converter */
>  	{0x07, AC_VERB_SET_CONNECT_SEL, 0x00},
>  	{0x08, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
> +	{}
> +};
> +
> +static struct hda_verb stac92hd71bxx_core_init[] = {
> +	/* set master volume and direct control */
> +	{ 0x28, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
> +	/* unmute right and left channels for node 0x0a */
> +	{ 0x0a, AC_VERB_SET_LEFT_AMP_IN_MUTE, 0x0},
> +	{ 0x0a, AC_VERB_SET_RIGHT_AMP_IN_MUTE, 0x0},

The below would do the same job with a single line:
    { 0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) }


> +	/* connect headphone jack to dac1 */
> +	{ 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01},
> +	/* unmute right and left channels for node 0x0d */
> +	{ 0x0d, AC_VERB_SET_LEFT_AMP_IN_MUTE, 0x0},
> +	{ 0x0d, AC_VERB_SET_RIGHT_AMP_IN_MUTE, 0x0},
> +	/* unmute right and left channels for node 0x0f */
> +	{ 0x0f, AC_VERB_SET_LEFT_AMP_IN_MUTE, 0x0},
> +	{ 0x0f, AC_VERB_SET_RIGHT_AMP_IN_MUTE, 0x0},
> +	/* unmute mono out node */
> +	{ 0x14, AC_VERB_SET_LEFT_AMP_IN_MUTE, 0x0},
>  	{}
>  };

Ditto.


Thanks,

Takashi


More information about the Alsa-devel mailing list