Also fixed the assignment of multiout.dac_nids to satisfy const.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
static void set_dig_out(struct hda_codec *codec, hda_nid_t nid,
int verb, int val)
{
- hda_nid_t *d;
+ const hda_nid_t *d;
snd_hda_codec_write_cache(codec, nid, 0, verb, val);
d = codec->slave_dig_outs;
-1);
snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
if (codec->slave_dig_outs) {
- hda_nid_t *d;
+ const hda_nid_t *d;
for (d = codec->slave_dig_outs; *d; d++)
snd_hda_codec_setup_stream(codec, *d, stream_tag, 0,
format);
{
snd_hda_codec_cleanup_stream(codec, nid);
if (codec->slave_dig_outs) {
- hda_nid_t *d;
+ const hda_nid_t *d;
for (d = codec->slave_dig_outs; *d; d++)
snd_hda_codec_cleanup_stream(codec, *d);
}
unsigned int format,
struct snd_pcm_substream *substream)
{
- hda_nid_t *nids = mout->dac_nids;
+ const hda_nid_t *nids = mout->dac_nids;
int chs = substream->runtime->channels;
int i;
int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec,
struct hda_multi_out *mout)
{
- hda_nid_t *nids = mout->dac_nids;
+ const hda_nid_t *nids = mout->dac_nids;
int i;
for (i = 0; i < mout->num_dacs; i++)
* Helper for automatic pin configuration
*/
-static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list)
+static int is_in_nid_list(hda_nid_t nid, const hda_nid_t *list)
{
for (; *list; list++)
if (*list == nid)
*/
int snd_hda_parse_pin_def_config(struct hda_codec *codec,
struct auto_pin_cfg *cfg,
- hda_nid_t *ignore_nids)
+ const hda_nid_t *ignore_nids)
{
hda_nid_t nid, end_nid;
short seq, assoc_line_out, assoc_speaker;
unsigned int spdif_status; /* IEC958 status bits */
unsigned short spdif_ctls; /* SPDIF control bits */
unsigned int spdif_in_enable; /* SPDIF input enable? */
- hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
+ const hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
struct snd_array init_pins; /* initial (BIOS) pin configurations */
struct snd_array driver_pins; /* pin configs set by codec parser */
struct snd_array cvt_setups; /* audio convert setups */
struct hda_multi_out {
int num_dacs; /* # of DACs, must be more than 1 */
- hda_nid_t *dac_nids; /* DAC list */
+ const hda_nid_t *dac_nids; /* DAC list */
hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */
hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */
hda_nid_t dig_out_nid; /* digital out audio widget */
- hda_nid_t *slave_dig_outs;
+ const hda_nid_t *slave_dig_outs;
int max_channels; /* currently supported analog channels */
int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */
int no_share_stream; /* don't share a stream with multiple pins */
int snd_hda_parse_pin_def_config(struct hda_codec *codec,
struct auto_pin_cfg *cfg,
- hda_nid_t *ignore_nids);
+ const hda_nid_t *ignore_nids);
/* amp values */
#define AMP_IN_MUTE(idx) (0x7080 | ((idx)<<8))
/* check the pins hardwired to audio widget */
for (i = 0; i < cfg->line_outs; i++) {
idx = ad1988_pin_idx(cfg->line_out_pins[i]);
- spec->multiout.dac_nids[i] = ad1988_idx_to_dac(codec, idx);
+ spec->private_dac_nids[i] = ad1988_idx_to_dac(codec, idx);
}
spec->multiout.num_dacs = cfg->line_outs;
return 0;
nid = cfg->line_out_pins[i];
if (alc880_is_fixed_pin(nid)) {
int idx = alc880_fixed_pin_idx(nid);
- spec->multiout.dac_nids[i] = alc880_idx_to_dac(idx);
+ spec->private_dac_nids[i] = alc880_idx_to_dac(idx);
assigned[idx] = 1;
}
}
/* search for an empty channel */
for (j = 0; j < cfg->line_outs; j++) {
if (!assigned[j]) {
- spec->multiout.dac_nids[i] =
+ spec->private_dac_nids[i] =
alc880_idx_to_dac(j);
assigned[j] = 1;
break;
spec->multiout.num_dacs = 1;
spec->multiout.dac_nids = spec->private_dac_nids;
- spec->multiout.dac_nids[0] = 0x02;
+ spec->private_dac_nids[0] = 0x02;
nid = cfg->line_out_pins[0];
if (nid) {
spec->multiout.num_dacs = 1; /* only use one dac */
spec->multiout.dac_nids = spec->private_dac_nids;
- spec->multiout.dac_nids[0] = 2;
+ spec->private_dac_nids[0] = 2;
pfx = alc_get_line_out_pfx(spec, true);
if (!pfx)
HDA_OUTPUT));
if (err < 0)
return err;
- spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
+ spec->private_dac_nids[spec->multiout.num_dacs++] = dac;
}
if (nid != 0x16)
dac = alc861_look_for_dac(codec, nid);
if (!dac)
continue;
- spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
+ spec->private_dac_nids[spec->multiout.num_dacs++] = dac;
}
return 0;
}
dac = alc_auto_look_for_dac(codec, cfg->line_out_pins[i]);
if (!dac)
continue;
- spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
+ spec->private_dac_nids[spec->multiout.num_dacs++] = dac;
}
return 0;
}
spec->multi_io[num_pins].pin = nid;
spec->multi_io[num_pins].dac = dac;
num_pins++;
- spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
+ spec->private_dac_nids[spec->multiout.num_dacs++] = dac;
}
}
spec->multiout.num_dacs = 1;
if (err < 0)
return err;
- spec->multiout.dac_nids[spec->multiout.num_dacs++] = dac;
+ spec->private_dac_nids[spec->multiout.num_dacs++] = dac;
}
return 0;
printk(KERN_WARNING "stac92xx: No space for DAC 0x%x\n", nid);
return 1;
} else {
- spec->multiout.dac_nids[spec->multiout.num_dacs] = nid;
+ snd_BUG_ON(spec->multiout.dac_nids != spec->dac_nids);
+ spec->dac_nids[spec->multiout.num_dacs] = nid;
spec->multiout.num_dacs++;
}
return 0;
{
struct via_spec *spec = codec->spec;
struct hda_multi_out *mout = &spec->multiout;
- hda_nid_t *nids = mout->dac_nids;
+ const hda_nid_t *nids = mout->dac_nids;
int chs = substream->runtime->channels;
int i;
{
struct via_spec *spec = codec->spec;
struct hda_multi_out *mout = &spec->multiout;
- hda_nid_t *nids = mout->dac_nids;
+ const hda_nid_t *nids = mout->dac_nids;
if (substream->number == 0)
playback_multi_pcm_prep_0(codec, stream_tag, format,
{
struct via_spec *spec = codec->spec;
struct hda_multi_out *mout = &spec->multiout;
- hda_nid_t *nids = mout->dac_nids;
+ const hda_nid_t *nids = mout->dac_nids;
int i;
if (substream->number == 0) {
/* config dac list */
switch (i) {
case AUTO_SEQ_FRONT:
- spec->multiout.dac_nids[i] = 0x10;
+ spec->private_dac_nids[i] = 0x10;
break;
case AUTO_SEQ_CENLFE:
- spec->multiout.dac_nids[i] = 0x12;
+ spec->private_dac_nids[i] = 0x12;
break;
case AUTO_SEQ_SURROUND:
- spec->multiout.dac_nids[i] = 0x11;
+ spec->private_dac_nids[i] = 0x11;
break;
case AUTO_SEQ_SIDE:
- spec->multiout.dac_nids[i] = 0x13;
+ spec->private_dac_nids[i] = 0x13;
break;
}
}
switch (i) {
case AUTO_SEQ_FRONT:
/* AOW0 */
- spec->multiout.dac_nids[i] = 0x10;
+ spec->private_dac_nids[i] = 0x10;
break;
case AUTO_SEQ_CENLFE:
/* AOW2 */
- spec->multiout.dac_nids[i] = 0x12;
+ spec->private_dac_nids[i] = 0x12;
break;
case AUTO_SEQ_SURROUND:
/* AOW3 */
- spec->multiout.dac_nids[i] = 0x11;
+ spec->private_dac_nids[i] = 0x11;
break;
case AUTO_SEQ_SIDE:
/* AOW1 */
- spec->multiout.dac_nids[i] = 0x27;
+ spec->private_dac_nids[i] = 0x27;
break;
default:
break;
}
}
}
- spec->multiout.dac_nids[cfg->line_outs] = 0x28; /* AOW4 */
+ spec->private_dac_nids[cfg->line_outs] = 0x28; /* AOW4 */
} else if (cfg->line_outs == 3) { /* 6 channels */
for (i = 0; i < cfg->line_outs; i++) {
switch (i) {
case AUTO_SEQ_FRONT:
/* AOW0 */
- spec->multiout.dac_nids[i] = 0x10;
+ spec->private_dac_nids[i] = 0x10;
break;
case AUTO_SEQ_CENLFE:
/* AOW2 */
- spec->multiout.dac_nids[i] = 0x12;
+ spec->private_dac_nids[i] = 0x12;
break;
case AUTO_SEQ_SURROUND:
/* AOW1 */
- spec->multiout.dac_nids[i] = 0x11;
+ spec->private_dac_nids[i] = 0x11;
break;
default:
break;
/* config dac list */
switch (i) {
case AUTO_SEQ_FRONT:
- spec->multiout.dac_nids[i] = 0x10;
+ spec->private_dac_nids[i] = 0x10;
break;
case AUTO_SEQ_CENLFE:
- spec->multiout.dac_nids[i] = 0x24;
+ spec->private_dac_nids[i] = 0x24;
break;
case AUTO_SEQ_SURROUND:
- spec->multiout.dac_nids[i] = 0x11;
+ spec->private_dac_nids[i] = 0x11;
break;
case AUTO_SEQ_SIDE:
- spec->multiout.dac_nids[i] = 0x25;
+ spec->private_dac_nids[i] = 0x25;
break;
}
}
/* config dac list */
switch (i) {
case AUTO_SEQ_FRONT:
- spec->multiout.dac_nids[i] = 0x10;
+ spec->private_dac_nids[i] = 0x10;
break;
case AUTO_SEQ_CENLFE:
if (spec->codec->vendor_id == 0x11064397)
- spec->multiout.dac_nids[i] = 0x25;
+ spec->private_dac_nids[i] = 0x25;
else
- spec->multiout.dac_nids[i] = 0x24;
+ spec->private_dac_nids[i] = 0x24;
break;
case AUTO_SEQ_SURROUND:
- spec->multiout.dac_nids[i] = 0x11;
+ spec->private_dac_nids[i] = 0x11;
break;
case AUTO_SEQ_SIDE:
- spec->multiout.dac_nids[i] = 0x25;
+ spec->private_dac_nids[i] = 0x25;
break;
}
}
/* for Smart 5.1, line/mic inputs double as output pins */
if (cfg->line_outs == 1) {
spec->multiout.num_dacs = 3;
- spec->multiout.dac_nids[AUTO_SEQ_SURROUND] = 0x11;
+ spec->private_dac_nids[AUTO_SEQ_SURROUND] = 0x11;
if (spec->codec->vendor_id == 0x11064397)
- spec->multiout.dac_nids[AUTO_SEQ_CENLFE] = 0x25;
+ spec->private_dac_nids[AUTO_SEQ_CENLFE] = 0x25;
else
- spec->multiout.dac_nids[AUTO_SEQ_CENLFE] = 0x24;
+ spec->private_dac_nids[AUTO_SEQ_CENLFE] = 0x24;
}
return 0;
if (cfg->line_out_pins[0]) {
/* config dac list */
- spec->multiout.dac_nids[0] = 0x10;
+ spec->private_dac_nids[0] = 0x10;
}
return 0;
/* config dac list */
switch (i) {
case AUTO_SEQ_FRONT:
- spec->multiout.dac_nids[i] = 0x8;
+ spec->private_dac_nids[i] = 0x8;
break;
case AUTO_SEQ_CENLFE:
- spec->multiout.dac_nids[i] = 0xa;
+ spec->private_dac_nids[i] = 0xa;
break;
case AUTO_SEQ_SURROUND:
- spec->multiout.dac_nids[i] = 0x9;
+ spec->private_dac_nids[i] = 0x9;
break;
case AUTO_SEQ_SIDE:
- spec->multiout.dac_nids[i] = 0xb;
+ spec->private_dac_nids[i] = 0xb;
break;
}
}
/* config dac list */
switch (i) {
case AUTO_SEQ_FRONT:
- spec->multiout.dac_nids[i] = 0x10;
+ spec->private_dac_nids[i] = 0x10;
break;
case AUTO_SEQ_CENLFE:
- spec->multiout.dac_nids[i] = 0x25;
+ spec->private_dac_nids[i] = 0x25;
break;
case AUTO_SEQ_SURROUND:
- spec->multiout.dac_nids[i] = 0x11;
+ spec->private_dac_nids[i] = 0x11;
break;
}
}
spec->multiout.num_dacs = 1;
spec->multiout.dac_nids = spec->private_dac_nids;
if (cfg->line_out_pins[0])
- spec->multiout.dac_nids[0] = 0x8;
+ spec->private_dac_nids[0] = 0x8;
return 0;
}
spec->multiout.num_dacs = 1;
spec->multiout.dac_nids = spec->private_dac_nids;
if (cfg->line_out_pins[0])
- spec->multiout.dac_nids[0] = 0x8;
+ spec->private_dac_nids[0] = 0x8;
return 0;
}