};
EXPORT_SYMBOL_HDA(auto_pin_cfg_labels);
-static const char *input_labels[AUTO_PIN_LAST][4] = {
- { "Mic", "Mic 2", "Mic 3", "Mic 4" },
- { "Front Mic", "Front Mic 2", "Front Mic 3", "Front Mic 4" },
- { "Line", "Line 2", "Line 3", "Line 4" },
- { "Front Line", "Front Line 2", "Front Line 3", "Front Line 4" },
- { "CD", "CD 2", "CD 3", "CD 4" },
- { "Aux", "Aux 2", "Aux 3", "Aux 4" },
-};
-
-const char *snd_hda_get_input_pin_label(const struct auto_pin_cfg *cfg,
- int input)
+void snd_hda_get_input_pin_label(const struct auto_pin_cfg *cfg,
+ int input, char *str)
{
int type = cfg->inputs[input].type;
int idx;
if (type != cfg->inputs[input].type)
break;
}
- return input_labels[type][idx];
+ if (idx > 0)
+ sprintf(str, "%s %d", auto_pin_cfg_labels[type], idx);
+ else
+ strcpy(str, auto_pin_cfg_labels[type]);
}
EXPORT_SYMBOL_HDA(snd_hda_get_input_pin_label);
}
label = spec->cap_labels[spec->input_mux.num_items];
strcpy(label, type);
- spec->input_mux.items[spec->input_mux.num_items].label = label;
+ strcpy(spec->input_mux.items[spec->input_mux.num_items].label, label);
/* unmute the PIN external input */
unmute_input(codec, node, 0); /* index = 0? */
*/
#define HDA_MAX_NUM_INPUTS 16
struct hda_input_mux_item {
- const char *label;
+ char label[32];
unsigned int index;
};
struct hda_input_mux {
};
struct auto_pin_cfg;
-const char *snd_hda_get_input_pin_label(const struct auto_pin_cfg *cfg,
- int input);
+void snd_hda_get_input_pin_label(const struct auto_pin_cfg *cfg,
+ int input, char *label);
struct auto_pin_cfg {
int line_outs;
type <= AUTO_PIN_FRONT_MIC);
if (err < 0)
return err;
- imux->items[imux->num_items].label =
- snd_hda_get_input_pin_label(cfg, i);
+ snd_hda_get_input_pin_label(cfg, i,
+ imux->items[imux->num_items].label);
imux->items[imux->num_items].index =
ad1988_pin_to_adc_idx(cfg->inputs[i].pin);
imux->num_items++;
}
- imux->items[imux->num_items].label = "Mix";
+ strcpy(imux->items[imux->num_items].label, "Mix");
imux->items[imux->num_items].index = 9;
imux->num_items++;
if (idx < 0 && cap2)
idx = get_connection_index(codec, cap2, pin);
if (idx >= 0) {
- imux->items[imux->num_items].label =
- snd_hda_get_input_pin_label(cfg, i);
+ snd_hda_get_input_pin_label(cfg, i,
+ imux->items[imux->num_items].label);
imux->items[imux->num_items].index = idx;
imux->num_items++;
}
break;
nid = cfg->inputs[i].pin;
if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) {
- char label[32];
- snprintf(label, sizeof(label), "%s Boost",
- snd_hda_get_input_pin_label(cfg, i));
+ char pinname[32], label[32];
+ snd_hda_get_input_pin_label(cfg, i, pinname);
+ snprintf(label, sizeof(label), "%s Boost", pinname);
err = add_control(spec, ALC_CTL_WIDGET_VOL, label, 0,
HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT));
if (err < 0)
struct hda_input_mux *smux = &spec->private_smux;
/* check for mute support on SPDIF out */
if (wcaps & AC_WCAP_OUT_AMP) {
- smux->items[smux->num_items].label = "Off";
+ strcpy(smux->items[smux->num_items].label, "Off");
smux->items[smux->num_items].index = 0;
smux->num_items++;
spec->spdif_mute = 1;
return -EINVAL;
for (i = 0; i < num_cons; i++) {
- mono_mux->items[mono_mux->num_items].label =
- stac92xx_mono_labels[i];
+ strcpy(mono_mux->items[mono_mux->num_items].label,
+ stac92xx_mono_labels[i]);
mono_mux->items[mono_mux->num_items].index = i;
mono_mux->num_items++;
}
labels = stac92xx_spdif_labels;
for (i = 0; i < num_cons; i++) {
- spdif_mux->items[spdif_mux->num_items].label = labels[i];
+ strcpy(spdif_mux->items[spdif_mux->num_items].label, labels[i]);
spdif_mux->items[spdif_mux->num_items].index = i;
spdif_mux->num_items++;
}
int err, i;
unsigned int def_conf;
- dimux->items[dimux->num_items].label = stac92xx_dmic_labels[0];
+ strcpy(dimux->items[dimux->num_items].label, stac92xx_dmic_labels[0]);
dimux->items[dimux->num_items].index = 0;
dimux->num_items++;
return err;
}
- dimux->items[dimux->num_items].label = label;
+ strcpy(dimux->items[dimux->num_items].label, label);
dimux->items[dimux->num_items].index = index;
dimux->num_items++;
if (snd_hda_get_bool_hint(codec, "separate_dmux") != 1) {
- imux->items[imux->num_items].label = label;
+ strcpy(imux->items[imux->num_items].label, label);
imux->items[imux->num_items].index = index;
imux->num_items++;
}
if (err < 0)
return err;
- imux->items[imux->num_items].label = label;
+ strcpy(imux->items[imux->num_items].label, label);
imux->items[imux->num_items].index = index;
imux->num_items++;
}
/* for hp mode select */
i = 0;
while (texts[i] != NULL) {
- imux->items[imux->num_items].label = texts[i];
+ strcpy(imux->items[imux->num_items].label, texts[i]);
imux->items[imux->num_items].index = i;
imux->num_items++;
i++;
/* for internal loopback recording select */
for (idx = 0; idx < num_idxs; idx++) {
if (pin_idxs[idx] == 0xff) {
- imux->items[imux->num_items].label = "Stereo Mixer";
+ strcpy(imux->items[imux->num_items].label,
+ "Stereo Mixer");
imux->items[imux->num_items].index = idx;
imux->num_items++;
break;
type_idx, idx, cap_nid);
if (err < 0)
return err;
- imux->items[imux->num_items].label =
- snd_hda_get_input_pin_label(cfg, i);
+ snd_hda_get_input_pin_label(cfg, i,
+ imux->items[imux->num_items].label);
imux->items[imux->num_items].index = idx;
imux->num_items++;
}
/* for hp mode select */
i = 0;
while (texts[i] != NULL) {
- imux->items[imux->num_items].label = texts[i];
+ strcpy(imux->items[imux->num_items].label, texts[i]);
imux->items[imux->num_items].index = i;
imux->num_items++;
i++;
return err;
/* for digital mic select */
- imux->items[imux->num_items].label = "Digital Mic";
+ strcpy(imux->items[imux->num_items].label, "Digital Mic");
imux->items[imux->num_items].index = 4;
imux->num_items++;
return err;
/* for digital mic select */
- imux->items[imux->num_items].label = "Digital Mic";
+ strcpy(imux->items[imux->num_items].label, "Digital Mic");
imux->items[imux->num_items].index = 6;
imux->num_items++;