View | Details | Raw Unified | Return to bug 156494
Collapse All | Expand All

(-)linux/sound/pci/hda/patch_sigmatel.c (+90 lines)
Lines 1148-1153 Link Here
1148
}
1148
}
1149
1149
1150
/*
1150
/*
1151
 * STAC7661
1152
 */
1153
1154
static hda_nid_t vaio_dacs[4] = { 0x2, 0x3, 0x4, 0x5 };
1155
static hda_nid_t vaio_adcs[2] = { 0x8, 0x6 };
1156
1157
static struct hda_verb vaio_init[] = {
1158
	{0x0a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP }, /* HP <- 0x2 */
1159
	{0x0b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, /* N/A <- 0x4 */
1160
	{0x0c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, /* N/A <- 0x3 */
1161
	{0x0d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Mic? (<- 0x2) */
1162
	{0x0e, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN }, /* CD */
1163
	{0x0f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, /* Speaker <- 0x5 */
1164
	{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 }, /* Mic? */
1165
	{0x15, AC_VERB_SET_CONNECT_SEL, 0x2}, /* 0a,0d,14,02 */
1166
	{0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1167
	{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1168
	{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1169
	{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1170
	{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
1171
	{}
1172
};
1173
1174
static struct snd_kcontrol_new vaio_mixer[] = {
1175
	HDA_CODEC_VOLUME("Headphone Playback Volume", 0x02, 0, HDA_OUTPUT),
1176
	HDA_CODEC_MUTE("Headphone Playback Switch", 0x02, 0, HDA_OUTPUT),
1177
	HDA_CODEC_VOLUME("Speaker Playback Volume", 0x05, 0, HDA_OUTPUT),
1178
	HDA_CODEC_MUTE("Speaker Playback Switch", 0x05, 0, HDA_OUTPUT),
1179
	HDA_CODEC_VOLUME("CD-In Capture Volume", 0x07, 0, HDA_INPUT),
1180
	HDA_CODEC_MUTE("CD-In Capture Switch", 0x07, 0, HDA_INPUT),
1181
	HDA_CODEC_VOLUME("Capture Volume", 0x09, 0, HDA_INPUT),
1182
	HDA_CODEC_MUTE("Capture Switch", 0x09, 0, HDA_INPUT),
1183
	HDA_CODEC_VOLUME("Mic-In Capture Volume", 0x15, 0, HDA_OUTPUT),
1184
	HDA_CODEC_MUTE("Mic-In Capture Switch", 0x15, 0, HDA_OUTPUT),
1185
	{}
1186
};
1187
1188
static struct hda_codec_ops stac7661_patch_ops = {
1189
	.build_controls = stac92xx_build_controls,
1190
	.build_pcms = stac92xx_build_pcms,
1191
	.init = stac92xx_init,
1192
	.free = stac92xx_free,
1193
	// .unsol_event = stac92xx_unsol_event,
1194
#ifdef CONFIG_PM
1195
	.resume = stac92xx_resume,
1196
#endif
1197
};
1198
1199
enum { STAC7661_VAIO };
1200
1201
static struct hda_board_config stac7661_cfg_tbl[] = {
1202
	{ .modelname = "vaio", .config = STAC7661_VAIO },
1203
	{ .pci_subvendor = 0x104d, .pci_subdevice = 0x81ef,
1204
	  .config = STAC7661_VAIO },
1205
	{}
1206
};
1207
1208
static int patch_stac7661(struct hda_codec *codec)
1209
{
1210
	struct sigmatel_spec *spec;
1211
	int board_config;
1212
1213
	board_config = snd_hda_check_board_config(codec, stac7661_cfg_tbl);
1214
	if (board_config < 0)
1215
		return snd_hda_parse_generic_codec(codec);
1216
	
1217
	spec  = kzalloc(sizeof(*spec), GFP_KERNEL);
1218
	if (spec == NULL)
1219
		return -ENOMEM;
1220
1221
	codec->spec = spec;
1222
	switch (board_config) {
1223
	case STAC7661_VAIO:
1224
		spec->mixer = vaio_mixer;
1225
		spec->init = vaio_init;
1226
		spec->multiout.max_channels = 2;
1227
		spec->multiout.num_dacs = 4;
1228
		spec->multiout.dac_nids = vaio_dacs;
1229
		spec->num_adcs = 2;
1230
		spec->adc_nids = vaio_adcs;
1231
		break;
1232
	}
1233
1234
	codec->patch_ops = stac7661_patch_ops;
1235
	return 0;
1236
}
1237
1238
1239
/*
1151
 * patch entries
1240
 * patch entries
1152
 */
1241
 */
1153
struct hda_codec_preset snd_hda_preset_sigmatel[] = {
1242
struct hda_codec_preset snd_hda_preset_sigmatel[] = {
Lines 1168-1172 Link Here
1168
 	{ .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x },
1257
 	{ .id = 0x83847627, .name = "STAC9271D", .patch = patch_stac927x },
1169
 	{ .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x },
1258
 	{ .id = 0x83847628, .name = "STAC9274X5NH", .patch = patch_stac927x },
1170
 	{ .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x },
1259
 	{ .id = 0x83847629, .name = "STAC9274D5NH", .patch = patch_stac927x },
1260
 	{ .id = 0x83847661, .name = "STAC7661", .patch = patch_stac7661 },
1171
	{} /* terminator */
1261
	{} /* terminator */
1172
};
1262
};

Return to bug 156494