aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Paprocki <andrew@ishiboo.com>2007-12-19 06:13:44 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:42 -0500
commit3982d17e3d38850908ed3400cb5a68fdc623877d (patch)
treeedc3fa96f032fe767f0cbf5a83f85b853cf1b99a
parent1697055e6c82ee5e99f459c15619605782eb7fcc (diff)
[ALSA] hda-codec - Add missing #defines (and 1 rename) in hda_codec.h
Added AC_VERB_GET_DIGI_CONVERT_2 and renamed AC_VERB_GET_DIGI_CONVERT to AC_VERB_GET_DIGI_CONVERT_1 to stay consistent with the SET variants. Added AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK, AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, and AC_PINCAP_LR_SWAP. The missing fields were listed in the ALC883 datasheet rev 1.3. Signed-off-by: Andrew Paprocki <andrew@ishiboo.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--sound/pci/hda/hda_codec.c8
-rw-r--r--sound/pci/hda/hda_codec.h9
-rw-r--r--sound/pci/hda/patch_realtek.c4
3 files changed, 15 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 23d3befef57b..cd807194e5f1 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1435,7 +1435,8 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid)
1435 return err; 1435 return err;
1436 } 1436 }
1437 codec->spdif_ctls = 1437 codec->spdif_ctls =
1438 snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_DIGI_CONVERT, 0); 1438 snd_hda_codec_read(codec, nid, 0,
1439 AC_VERB_GET_DIGI_CONVERT_1, 0);
1439 codec->spdif_status = convert_to_spdif_status(codec->spdif_ctls); 1440 codec->spdif_status = convert_to_spdif_status(codec->spdif_ctls);
1440 return 0; 1441 return 0;
1441} 1442}
@@ -1482,7 +1483,7 @@ static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol,
1482 unsigned short val; 1483 unsigned short val;
1483 unsigned int sbits; 1484 unsigned int sbits;
1484 1485
1485 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_DIGI_CONVERT, 0); 1486 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_DIGI_CONVERT_1, 0);
1486 sbits = convert_to_spdif_status(val); 1487 sbits = convert_to_spdif_status(val);
1487 ucontrol->value.iec958.status[0] = sbits; 1488 ucontrol->value.iec958.status[0] = sbits;
1488 ucontrol->value.iec958.status[1] = sbits >> 8; 1489 ucontrol->value.iec958.status[1] = sbits >> 8;
@@ -1533,7 +1534,8 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid)
1533 return err; 1534 return err;
1534 } 1535 }
1535 codec->spdif_in_enable = 1536 codec->spdif_in_enable =
1536 snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_DIGI_CONVERT, 0) & 1537 snd_hda_codec_read(codec, nid, 0,
1538 AC_VERB_GET_DIGI_CONVERT_1, 0) &
1537 AC_DIG1_ENABLE; 1539 AC_DIG1_ENABLE;
1538 return 0; 1540 return 0;
1539} 1541}
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 2e242dbe0844..20be7761562d 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -77,12 +77,14 @@ enum {
77#define AC_VERB_GET_PIN_SENSE 0x0f09 77#define AC_VERB_GET_PIN_SENSE 0x0f09
78#define AC_VERB_GET_BEEP_CONTROL 0x0f0a 78#define AC_VERB_GET_BEEP_CONTROL 0x0f0a
79#define AC_VERB_GET_EAPD_BTLENABLE 0x0f0c 79#define AC_VERB_GET_EAPD_BTLENABLE 0x0f0c
80#define AC_VERB_GET_DIGI_CONVERT 0x0f0d 80#define AC_VERB_GET_DIGI_CONVERT_1 0x0f0d
81#define AC_VERB_GET_DIGI_CONVERT_2 0x0f0e
81#define AC_VERB_GET_VOLUME_KNOB_CONTROL 0x0f0f 82#define AC_VERB_GET_VOLUME_KNOB_CONTROL 0x0f0f
82/* f10-f1a: GPIO */ 83/* f10-f1a: GPIO */
83#define AC_VERB_GET_GPIO_DATA 0x0f15 84#define AC_VERB_GET_GPIO_DATA 0x0f15
84#define AC_VERB_GET_GPIO_MASK 0x0f16 85#define AC_VERB_GET_GPIO_MASK 0x0f16
85#define AC_VERB_GET_GPIO_DIRECTION 0x0f17 86#define AC_VERB_GET_GPIO_DIRECTION 0x0f17
87#define AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK 0x0f19
86#define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c 88#define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c
87/* f20: AFG/MFG */ 89/* f20: AFG/MFG */
88#define AC_VERB_GET_SUBSYSTEM_ID 0x0f20 90#define AC_VERB_GET_SUBSYSTEM_ID 0x0f20
@@ -110,6 +112,7 @@ enum {
110#define AC_VERB_SET_GPIO_DATA 0x715 112#define AC_VERB_SET_GPIO_DATA 0x715
111#define AC_VERB_SET_GPIO_MASK 0x716 113#define AC_VERB_SET_GPIO_MASK 0x716
112#define AC_VERB_SET_GPIO_DIRECTION 0x717 114#define AC_VERB_SET_GPIO_DIRECTION 0x717
115#define AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK 0x719
113#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 0x71c 116#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 0x71c
114#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_1 0x71d 117#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_1 0x71d
115#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_2 0x71e 118#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_2 0x71e
@@ -190,6 +193,10 @@ enum {
190#define AC_PINCAP_OUT (1<<4) /* output capable */ 193#define AC_PINCAP_OUT (1<<4) /* output capable */
191#define AC_PINCAP_IN (1<<5) /* input capable */ 194#define AC_PINCAP_IN (1<<5) /* input capable */
192#define AC_PINCAP_BALANCE (1<<6) /* balanced I/O capable */ 195#define AC_PINCAP_BALANCE (1<<6) /* balanced I/O capable */
196/* Note: This LR_SWAP pincap is defined in the Realtek ALC883 specification,
197 * but is marked reserved in the Intel HDA specification.
198 */
199#define AC_PINCAP_LR_SWAP (1<<7) /* L/R swap */
193#define AC_PINCAP_VREF (0x37<<8) 200#define AC_PINCAP_VREF (0x37<<8)
194#define AC_PINCAP_VREF_SHIFT 8 201#define AC_PINCAP_VREF_SHIFT 8
195#define AC_PINCAP_EAPD (1<<16) /* EAPD capable */ 202#define AC_PINCAP_EAPD (1<<16) /* EAPD capable */
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 2bbf89e26fa2..c251974fdcc7 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -572,7 +572,7 @@ static int alc_spdif_ctrl_get(struct snd_kcontrol *kcontrol,
572 unsigned char mask = (kcontrol->private_value >> 16) & 0xff; 572 unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
573 long *valp = ucontrol->value.integer.value; 573 long *valp = ucontrol->value.integer.value;
574 unsigned int val = snd_hda_codec_read(codec, nid, 0, 574 unsigned int val = snd_hda_codec_read(codec, nid, 0,
575 AC_VERB_GET_DIGI_CONVERT, 0x00); 575 AC_VERB_GET_DIGI_CONVERT_1, 0x00);
576 576
577 *valp = (val & mask) != 0; 577 *valp = (val & mask) != 0;
578 return 0; 578 return 0;
@@ -586,7 +586,7 @@ static int alc_spdif_ctrl_put(struct snd_kcontrol *kcontrol,
586 unsigned char mask = (kcontrol->private_value >> 16) & 0xff; 586 unsigned char mask = (kcontrol->private_value >> 16) & 0xff;
587 long val = *ucontrol->value.integer.value; 587 long val = *ucontrol->value.integer.value;
588 unsigned int ctrl_data = snd_hda_codec_read(codec, nid, 0, 588 unsigned int ctrl_data = snd_hda_codec_read(codec, nid, 0,
589 AC_VERB_GET_DIGI_CONVERT, 589 AC_VERB_GET_DIGI_CONVERT_1,
590 0x00); 590 0x00);
591 591
592 /* Set/unset the masked control bit(s) as needed */ 592 /* Set/unset the masked control bit(s) as needed */