Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170333
b: refs/heads/master
c: 9c96fa5
h: refs/heads/master
i:
  170331: 15a9e11
v: v3
  • Loading branch information
Takashi Iwai committed Nov 16, 2009
1 parent 37d3931 commit 68dfed6
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d02d1b638af580ae3d69367248539a8b3893064
refs/heads/master: 9c96fa599fe4f0ccc6e3e606df6652335afe28e8
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
int err;
struct hda_nid_item *item;

if (kctl->id.subdevice & (1<<31)) {
if (kctl->id.subdevice & HDA_SUBDEV_NID_FLAG) {
if (nid == 0)
nid = kctl->id.subdevice & 0xffff;
kctl->id.subdevice = 0;
Expand Down
15 changes: 12 additions & 3 deletions trunk/sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
#ifndef __SOUND_HDA_LOCAL_H
#define __SOUND_HDA_LOCAL_H

/* We abuse kcontrol_new.subdev field to pass the NID corresponding to
* the given new control. If id.subdev has a bit flag HDA_SUBDEV_NID_FLAG,
* snd_hda_ctl_add() takes the lower-bit subdev value as a valid NID.
*
* Note that the subdevice field is cleared again before the real registration
* in snd_hda_ctl_add(), so that this value won't appear in the outside.
*/
#define HDA_SUBDEV_NID_FLAG (1U << 31)

/*
* for mixer controls
*/
Expand All @@ -33,7 +42,7 @@
/* mono volume with index (index=0,1,...) (channel=1,2) */
#define HDA_CODEC_VOLUME_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \
.subdevice = (1<<31)|(nid), \
.subdevice = HDA_SUBDEV_NID_FLAG | (nid), \
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \
SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \
Expand All @@ -54,7 +63,7 @@
/* mono mute switch with index (index=0,1,...) (channel=1,2) */
#define HDA_CODEC_MUTE_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \
.subdevice = (1<<31)|(nid), \
.subdevice = HDA_SUBDEV_NID_FLAG | (nid), \
.info = snd_hda_mixer_amp_switch_info, \
.get = snd_hda_mixer_amp_switch_get, \
.put = snd_hda_mixer_amp_switch_put, \
Expand All @@ -71,7 +80,7 @@
/* special beep mono mute switch with index (index=0,1,...) (channel=1,2) */
#define HDA_CODEC_MUTE_BEEP_MONO_IDX(xname, xcidx, nid, channel, xindex, direction) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xcidx, \
.subdevice = (1<<31)|(nid), \
.subdevice = HDA_SUBDEV_NID_FLAG | (nid), \
.info = snd_hda_mixer_amp_switch_info, \
.get = snd_hda_mixer_amp_switch_get, \
.put = snd_hda_mixer_amp_switch_put_beep, \
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,7 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name,
if (! knew->name)
return -ENOMEM;
if (get_amp_nid_(val))
knew->subdevice = (1<<31)|get_amp_nid_(val);
knew->subdevice = HDA_SUBDEV_NID_FLAG | get_amp_nid_(val);
knew->private_value = val;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -4324,7 +4324,7 @@ static int add_control(struct alc_spec *spec, int type, const char *name,
if (!knew->name)
return -ENOMEM;
if (get_amp_nid_(val))
knew->subdevice = (1<<31)|get_amp_nid_(val);
knew->subdevice = HDA_SUBDEV_NID_FLAG | get_amp_nid_(val);
knew->private_value = val;
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2689,7 +2689,7 @@ stac_control_new(struct sigmatel_spec *spec,
return NULL;
}
if (nid)
knew->subdevice = (1<<31)|nid;
knew->subdevice = HDA_SUBDEV_NID_FLAG | nid;
return knew;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_via.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ static int via_add_control(struct via_spec *spec, int type, const char *name,
if (!knew->name)
return -ENOMEM;
if (get_amp_nid_(val))
knew->subdevice = (1<<31)|get_amp_nid_(val);
knew->subdevice = HDA_SUBDEV_NID_FLAG | get_amp_nid_(val);
knew->private_value = val;
return 0;
}
Expand Down

0 comments on commit 68dfed6

Please sign in to comment.