if (get_defcfg_connect(port_spdifi) != 1) 
if (get_defcfg_connect(port_spdifi) != AC_JACK_PORT_NONE) 
static int patch_cmi9880(struct hda_codec *codec){	struct cmi_spec *spec;	spec = kcalloc(1, sizeof(*spec), GFP_KERNEL);	if (spec == NULL)		return -ENOMEM;	codec->spec = spec;	spec->board_config = snd_hda_check_board_config(codec, cmi9880_cfg_tbl);	if (spec->board_config < 0) {		snd_printdd(KERN_INFO "hda_codec: Unknown model for CMI9880\n");		spec->board_config = CMI_AUTO; /* try everything */	}	/* copy default DAC NIDs */	memcpy(spec->dac_nids, cmi9880_dac_nids, sizeof(spec->dac_nids));	switch (spec->board_config) {	case CMI_MINIMAL:	case CMI_MIN_FP:		spec->surr_switch = 1;		if (spec->board_config == CMI_MINIMAL)			spec->num_ch_modes = 2;		else {			spec->front_panel = 1;			spec->num_ch_modes = 3;		}		spec->channel_modes = cmi9880_channel_modes;		spec->multiout.max_channels = cmi9880_channel_modes[0].channels;		spec->input_mux = &cmi9880_basic_mux;		break;	case CMI_FULL:	case CMI_FULL_DIG:		spec->front_panel = 1;		spec->multiout.max_channels = 8;		spec->input_mux = &cmi9880_basic_mux;		if (spec->board_config == CMI_FULL_DIG) {			spec->multiout.dig_out_nid = CMI_DIG_OUT_NID;			spec->dig_in_nid = CMI_DIG_IN_NID;		}		break;	case CMI_ALLOUT:		spec->front_panel = 1;		spec->multiout.max_channels = 8;		spec->no_line_in = 1;		spec->input_mux = &cmi9880_no_line_mux;		spec->multiout.dig_out_nid = CMI_DIG_OUT_NID;		break;	case CMI_AUTO:		{		unsigned int port_e, port_f, port_g, port_h;		unsigned int port_spdifi, port_spdifo;		/* collect pin default configuration */		cmi9880_get_pin_def_config(codec);		port_e = cmi9880_get_def_config(codec, 0x0f);		port_f = cmi9880_get_def_config(codec, 0x10);		port_g = cmi9880_get_def_config(codec, 0x1f);		port_h = cmi9880_get_def_config(codec, 0x20);		port_spdifi = cmi9880_get_def_config(codec, 0x13);		port_spdifo = cmi9880_get_def_config(codec, 0x12);		spec->front_panel = 1;		if ((get_defcfg_connect(port_e) == AC_JACK_PORT_NONE)		|| (get_defcfg_connect(port_f) == AC_JACK_PORT_NONE)) {			spec->surr_switch = 1;			/* no front panel */			if ((get_defcfg_connect(port_g) == AC_JACK_PORT_NONE)			|| (get_defcfg_connect(port_h) == AC_JACK_PORT_NONE)) {				/* no optional rear panel */				spec->board_config = CMI_MINIMAL;				spec->front_panel = 0;				spec->num_ch_modes = 2;			} else				spec->board_config = CMI_MIN_FP;				spec->num_ch_modes = 3;			spec->channel_modes = cmi9880_channel_modes;			spec->input_mux = &cmi9880_basic_mux;		} else {			spec->input_mux = &cmi9880_basic_mux;			if (get_defcfg_connect(port_spdifo) != 1)				spec->multiout.dig_out_nid = CMI_DIG_OUT_NID;			if (get_defcfg_connect(port_spdifi) != 1)				spec->dig_in_nid = CMI_DIG_IN_NID;		}		spec->multiout.max_channels = cmi9880_get_multich_pins(codec);		cmi9880_fill_multi_dac_nids(codec);		cmi9880_fill_multi_init(codec);		}		break;	}	spec->multiout.num_dacs = 4;	spec->multiout.dac_nids = spec->dac_nids;	spec->adc_nids = cmi9880_adc_nids;	codec->patch_ops = cmi9880_patch_ops;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d21b37ea134921f807ebdbd19ae3cd00bb8bf2fc/patch_cmedia.c/buggy/sound/pci/hda/patch_cmedia.c