summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_conexant.c
diff options
context:
space:
mode:
authorTakashi Iwai2015-03-03 10:07:24 +0100
committerTakashi Iwai2015-03-23 13:17:17 +0100
commit7639a06c23c7d4cda34c2546bd7290d8753849ca (patch)
treee3ede67363b832c068f3e5e9ca6d1654824146a8 /sound/pci/hda/patch_conexant.c
parentALSA: hda - Move some codes up to hdac_bus struct (diff)
downloadkernel-qcow2-linux-7639a06c23c7d4cda34c2546bd7290d8753849ca.tar.gz
kernel-qcow2-linux-7639a06c23c7d4cda34c2546bd7290d8753849ca.tar.xz
kernel-qcow2-linux-7639a06c23c7d4cda34c2546bd7290d8753849ca.zip
ALSA: hda - Move a part of hda_codec stuff into hdac_device
Now some codes and functionalities of hda_codec struct are moved to hdac_device struct. A few basic attributes like the codec address, vendor ID number, FG numbers, etc are moved to hdac_device, and they are accessed like codec->core.addr. The basic verb exec functions are moved, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r--sound/pci/hda/patch_conexant.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 142a6cf786da..1e21f9fbd54b 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -103,10 +103,9 @@ static int add_beep_ctls(struct hda_codec *codec)
static void cx_auto_parse_beep(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;
- hda_nid_t nid, end_nid;
+ hda_nid_t nid;
- end_nid = codec->start_nid + codec->num_nodes;
- for (nid = codec->start_nid; nid < end_nid; nid++)
+ for_each_hda_codec_node(nid, codec)
if (get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_BEEP) {
set_beep_amp(spec, nid, 0, HDA_OUTPUT);
break;
@@ -120,10 +119,9 @@ static void cx_auto_parse_beep(struct hda_codec *codec)
static void cx_auto_parse_eapd(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;
- hda_nid_t nid, end_nid;
+ hda_nid_t nid;
- end_nid = codec->start_nid + codec->num_nodes;
- for (nid = codec->start_nid; nid < end_nid; 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))
@@ -848,7 +846,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
struct conexant_spec *spec;
int err;
- codec_info(codec, "%s: BIOS auto-probing.\n", codec->chip_name);
+ codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name);
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec)
@@ -862,7 +860,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
if (spec->dynamic_eapd)
spec->gen.vmaster_mute.hook = cx_auto_vmaster_hook;
- switch (codec->vendor_id) {
+ switch (codec->core.vendor_id) {
case 0x14f15045:
codec->single_adc_amp = 1;
spec->gen.mixer_nid = 0x17;
@@ -896,7 +894,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
* others may use EAPD really as an amp switch, so it might be
* not good to expose it blindly.
*/
- switch (codec->subsystem_id >> 16) {
+ switch (codec->core.subsystem_id >> 16) {
case 0x103c:
spec->gen.vmaster_mute_enum = 1;
break;