hda_automute.patch

ssgriffon, 02/13/2012 06:10 AM

Download (14.7 KB)

View differences:

sys/dev/sound/pci/hda/hdac.c
644 644
};
645 645
#define HDAC_CODECS_LEN	NELEM(hdac_codecs)
646 646

  
647
enum {
648
	HDAC_HP_SWITCH_CTL,
649
	HDAC_HP_SWITCH_CTRL,
650
	HDAC_HP_SWITCH_DEBUG
651
};
652

  
653
static const struct {
654
	uint32_t model;
655
	uint32_t id;
656
	int type;
657
	int inverted;
658
	int polling;
659
	int execsense;
660
	nid_t hpnid;
661
	nid_t spkrnid[8];
662
	nid_t eapdnid;
663
} hdac_hp_switch[] = {
664
	/* Specific OEM models */
665
	{ HP_V3000_SUBVENDOR, HDA_CODEC_CXVENICE, HDAC_HP_SWITCH_CTL,
666
	    0, 0, -1, 17, { 16, -1 }, 16 },
667
	/* { HP_XW4300_SUBVENDOR, HDA_CODEC_ALC260, HDAC_HP_SWITCH_CTL,
668
	    0, 0, -1, 21, { 16, 17, -1 }, -1 } */
669
	/* { HP_3010_SUBVENDOR,  HDA_CODEC_ALC260, HDAC_HP_SWITCH_DEBUG,
670
	    0, 1, 0, 16, { 15, 18, 19, 20, 21, -1 }, -1 }, */
671
	{ HP_NX7400_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
672
	    0, 0, -1, 6, { 5, -1 }, 5 },
673
	{ HP_NX6310_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
674
	    0, 0, -1, 6, { 5, -1 }, 5 },
675
	{ HP_NX6325_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
676
	    0, 0, -1, 6, { 5, -1 }, 5 },
677
	/* { HP_DC7700_SUBVENDOR, HDA_CODEC_ALC262, HDAC_HP_SWITCH_CTL,
678
	    0, 0, -1, 21, { 22, 27, -1 }, -1 }, */
679
	{ TOSHIBA_U200_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
680
	    0, 0, -1, 6, { 5, -1 }, -1 },
681
	{ TOSHIBA_A135_SUBVENDOR, HDA_CODEC_ALC861VD, HDAC_HP_SWITCH_CTL,
682
	    0, 0, -1, 27, { 20, -1 }, -1 },
683
	{ DELL_D820_SUBVENDOR, HDA_CODEC_STAC9220, HDAC_HP_SWITCH_CTRL,
684
	    0, 0, -1, 13, { 14, -1 }, -1 },
685
	{ DELL_I1300_SUBVENDOR, HDA_CODEC_STAC9220, HDAC_HP_SWITCH_CTRL,
686
	    0, 0, -1, 13, { 14, -1 }, -1 },
687
	{ DELL_OPLX745_SUBVENDOR, HDA_CODEC_AD1983, HDAC_HP_SWITCH_CTL,
688
	    0, 0, -1, 6, { 5, 7, -1 }, -1 },
689
	{ APPLE_MB3_SUBVENDOR, HDA_CODEC_ALC885, HDAC_HP_SWITCH_CTL,
690
	    0, 0, -1, 21, { 20, 22, -1 }, -1 },
691
	{ APPLE_INTEL_MAC, HDA_CODEC_STAC9221, HDAC_HP_SWITCH_CTRL,
692
	    0, 0, -1, 10, { 13, -1 }, -1 },
693
	{ LENOVO_3KN100_SUBVENDOR, HDA_CODEC_AD1986A, HDAC_HP_SWITCH_CTL,
694
	    1, 0, -1, 26, { 27, -1 }, -1 },
695
	/* { LENOVO_TCA55_SUBVENDOR, HDA_CODEC_AD1986A, HDAC_HP_SWITCH_CTL,
696
	    0, 0, -1, 26, { 27, 28, 29, 30, -1 }, -1 }, */
697
	{ LG_LW20_SUBVENDOR, HDA_CODEC_ALC880, HDAC_HP_SWITCH_CTL,
698
	    0, 0, -1, 27, { 20, -1 }, -1 },
699
	{ ACER_A5050_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
700
	    0, 0, -1, 20, { 21, -1 }, -1 },
701
	{ ACER_3681WXM_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
702
	    0, 0, -1, 20, { 21, -1 }, -1 },
703
	{ ACER_A4520_SUBVENDOR, HDA_CODEC_ALC268, HDAC_HP_SWITCH_CTL,
704
	    0, 0, -1, 20, { 21, -1 }, -1 },
705
	{ UNIWILL_9080_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
706
	    0, 0, -1, 20, { 21, -1 }, -1 },
707
	{ MSI_MS1034_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
708
	    0, 0, -1, 20, { 27, -1 }, -1 },
709
	{ MSI_MS034A_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
710
	    0, 0, -1, 20, { 27, -1 }, -1 },
711
	{ FS_SI1848_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
712
	    0, 0, -1, 20, { 21, -1 }, -1 },
713
	{ FL_S7020D_SUBVENDOR, HDA_CODEC_ALC260, HDAC_HP_SWITCH_CTL,
714
	    0, 0, -1, 20, { 16, -1 }, -1 },
715
	/*
716
	 * All models that at least come from the same vendor with
717
	 * simmilar codec.
718
	 */
719
	{ HP_ALL_SUBVENDOR, HDA_CODEC_CXVENICE, HDAC_HP_SWITCH_CTL,
720
	    0, 0, -1, 17, { 16, -1 }, 16 },
721
	{ HP_ALL_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
722
	    0, 0, -1, 6, { 5, -1 }, 5 },
723
	{ TOSHIBA_ALL_SUBVENDOR, HDA_CODEC_AD1981HD, HDAC_HP_SWITCH_CTL,
724
	    0, 0, -1, 6, { 5, -1 }, -1 },
725
	{ DELL_ALL_SUBVENDOR, HDA_CODEC_STAC9220, HDAC_HP_SWITCH_CTRL,
726
	    0, 0, -1, 13, { 14, -1 }, -1 },
727
#if 0
728
	{ LENOVO_ALL_SUBVENDOR, HDA_CODEC_AD1986A, HDAC_HP_SWITCH_CTL,
729
	    1, 0, -1, 26, { 27, -1 }, -1 },
730
	{ ACER_ALL_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL,
731
	    0, 0, -1, 20, { 21, -1 }, -1 },
732
#endif
733
};
734
#define HDAC_HP_SWITCH_LEN NELEM(hdac_hp_switch)
735

  
736 647
static const struct {
737 648
	uint32_t model;
738 649
	uint32_t id;
......
900 811
	struct hdac_widget *w;
901 812
	struct hdac_audio_ctl *ctl;
902 813
	uint32_t val, id, res;
903
	int i = 0, j, timeout, forcemute;
904
	nid_t cad;
814
	int i = 0, timeout, forcemute;
815
	nid_t cad, hp_nid;
905 816

  
906 817
	if (devinfo == NULL || devinfo->codec == NULL ||
907 818
	    devinfo->codec->sc == NULL)
......
910 821
	sc = devinfo->codec->sc;
911 822
	cad = devinfo->codec->cad;
912 823
	id = hdac_codec_id(devinfo);
913
	for (i = 0; i < HDAC_HP_SWITCH_LEN; i++) {
914
		if (HDA_DEV_MATCH(hdac_hp_switch[i].model,
915
		    sc->pci_subvendor) &&
916
		    hdac_hp_switch[i].id == id)
917
			break;
918
	}
919

  
920
	if (i >= HDAC_HP_SWITCH_LEN)
921
		return;
922 824

  
923 825
	forcemute = 0;
924
	if (hdac_hp_switch[i].eapdnid != -1) {
925
		w = hdac_widget_get(devinfo, hdac_hp_switch[i].eapdnid);
926
		if (w != NULL && w->param.eapdbtl != HDAC_INVALID)
927
			forcemute = (w->param.eapdbtl &
928
			    HDA_CMD_SET_EAPD_BTL_ENABLE_EAPD) ? 0 : 1;
929
	}
930 826

  
931
	if (hdac_hp_switch[i].execsense != -1)
932
		hdac_command(sc,
933
		    HDA_CMD_SET_PIN_SENSE(cad, hdac_hp_switch[i].hpnid,
934
		    hdac_hp_switch[i].execsense), cad);
827
	/*For now, only the first headphone jack supports automute. So find
828
	 * that jack*/
829
	hp_nid = devinfo->startnode;
830
	for (; hp_nid < devinfo->endnode; hp_nid++) {
831
		w = hdac_widget_get(devinfo, hp_nid);
832
		if((w != NULL) &&
833
		   (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) &&
834
		   (HDA_PARAM_PIN_CAP_HEADPHONE_CAP(w->wclass.pin.config))) {
835
			break;
836
		   }
837
	}
935 838

  
936 839
	timeout = 10000;
937 840
	do {
938 841
		res = hdac_command(sc,
939
		    HDA_CMD_GET_PIN_SENSE(cad, hdac_hp_switch[i].hpnid),
842
		    HDA_CMD_GET_PIN_SENSE(cad, hp_nid),
940 843
		    cad);
941
		if (hdac_hp_switch[i].execsense == -1 || res != 0x7fffffff)
844

  
845
		if (res != 0x7fffffff)
942 846
			break;
943 847
		DELAY(10);
944 848
	} while (--timeout != 0);
......
946 850
	HDA_BOOTVERBOSE(
947 851
		device_printf(sc->dev,
948 852
		    "HDA_DEBUG: Pin sense: nid=%d timeout=%d res=0x%08x\n",
949
		    hdac_hp_switch[i].hpnid, timeout, res);
853
		    hp_nid, timeout, res);
950 854
	);
951

  
952
	res = HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT(res);
953
	res ^= hdac_hp_switch[i].inverted;
954

  
955
	switch (hdac_hp_switch[i].type) {
956
	case HDAC_HP_SWITCH_CTL:
957
		ctl = hdac_audio_ctl_amp_get(devinfo,
958
		    hdac_hp_switch[i].hpnid, 0, 1);
959
		if (ctl != NULL) {
960
			val = (res != 0 && forcemute == 0) ?
961
			    HDA_AMP_MUTE_NONE : HDA_AMP_MUTE_ALL;
962
			if (val != ctl->muted) {
963
				ctl->muted = val;
964
				hdac_audio_ctl_amp_set(ctl,
965
				    HDA_AMP_MUTE_DEFAULT, ctl->left,
966
				    ctl->right);
967
			}
968
		}
969
		for (j = 0; hdac_hp_switch[i].spkrnid[j] != -1; j++) {
970
			ctl = hdac_audio_ctl_amp_get(devinfo,
971
			    hdac_hp_switch[i].spkrnid[j], 0, 1);
972
			if (ctl == NULL)
973
				continue;
974
			val = (res != 0 || forcemute == 1) ?
975
			    HDA_AMP_MUTE_ALL : HDA_AMP_MUTE_NONE;
976
			if (val == ctl->muted)
977
				continue;
855
	
856
	
857
	ctl = hdac_audio_ctl_amp_get(devinfo,
858
				     hp_nid, 0, 1);
859
	if (ctl != NULL) {
860
		val = (res != 0 && forcemute == 0) ?
861
			HDA_AMP_MUTE_NONE : HDA_AMP_MUTE_ALL;
862
		if (val != ctl->muted) {
978 863
			ctl->muted = val;
979
			hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_DEFAULT,
980
			    ctl->left, ctl->right);
864
			hdac_audio_ctl_amp_set(ctl,
865
					       HDA_AMP_MUTE_DEFAULT, ctl->left,
866
					       ctl->right);
981 867
		}
982
		break;
983
	case HDAC_HP_SWITCH_CTRL:
984
		if (res != 0) {
985
			/* HP in */
986
			w = hdac_widget_get(devinfo, hdac_hp_switch[i].hpnid);
987
			if (w != NULL && w->type ==
988
			    HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) {
989
				if (forcemute == 0)
990
					val = w->wclass.pin.ctrl |
991
					    HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE;
992
				else
993
					val = w->wclass.pin.ctrl &
994
					    ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE;
995
				if (val != w->wclass.pin.ctrl) {
996
					w->wclass.pin.ctrl = val;
997
					hdac_command(sc,
998
					    HDA_CMD_SET_PIN_WIDGET_CTRL(cad,
999
					    w->nid, w->wclass.pin.ctrl), cad);
1000
				}
1001
			}
1002
			for (j = 0; hdac_hp_switch[i].spkrnid[j] != -1; j++) {
1003
				w = hdac_widget_get(devinfo,
1004
				    hdac_hp_switch[i].spkrnid[j]);
1005
				if (w == NULL || w->type !=
1006
				    HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)
1007
					continue;
1008
				val = w->wclass.pin.ctrl &
1009
				    ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE;
1010
				if (val == w->wclass.pin.ctrl)
1011
					continue;
1012
				w->wclass.pin.ctrl = val;
1013
				hdac_command(sc, HDA_CMD_SET_PIN_WIDGET_CTRL(
1014
				    cad, w->nid, w->wclass.pin.ctrl), cad);
1015
			}
1016
		} else {
1017
			/* HP out */
1018
			w = hdac_widget_get(devinfo, hdac_hp_switch[i].hpnid);
1019
			if (w != NULL && w->type ==
1020
			    HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) {
1021
				val = w->wclass.pin.ctrl &
1022
				    ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE;
1023
				if (val != w->wclass.pin.ctrl) {
1024
					w->wclass.pin.ctrl = val;
1025
					hdac_command(sc,
1026
					    HDA_CMD_SET_PIN_WIDGET_CTRL(cad,
1027
					    w->nid, w->wclass.pin.ctrl), cad);
1028
				}
1029
			}
1030
			for (j = 0; hdac_hp_switch[i].spkrnid[j] != -1; j++) {
1031
				w = hdac_widget_get(devinfo,
1032
				    hdac_hp_switch[i].spkrnid[j]);
1033
				if (w == NULL || w->type !=
1034
				    HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)
1035
					continue;
1036
				if (forcemute == 0)
1037
					val = w->wclass.pin.ctrl |
1038
					    HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE;
1039
				else
1040
					val = w->wclass.pin.ctrl &
1041
					    ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE;
1042
				if (val == w->wclass.pin.ctrl)
1043
					continue;
1044
				w->wclass.pin.ctrl = val;
1045
				hdac_command(sc, HDA_CMD_SET_PIN_WIDGET_CTRL(
1046
				    cad, w->nid, w->wclass.pin.ctrl), cad);
1047
			}
868
	}
869

  
870
	
871
	for (i = devinfo->startnode; i < devinfo->endnode; i++) {
872
	    
873
		w = hdac_widget_get(devinfo, i);
874
		if(w == NULL || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) {
875
			continue;
1048 876
		}
1049
		break;
1050
	case HDAC_HP_SWITCH_DEBUG:
1051
		if (hdac_hp_switch[i].execsense != -1)
1052
			hdac_command(sc,
1053
			    HDA_CMD_SET_PIN_SENSE(cad, hdac_hp_switch[i].hpnid,
1054
			    hdac_hp_switch[i].execsense), cad);
1055
		res = hdac_command(sc,
1056
		    HDA_CMD_GET_PIN_SENSE(cad, hdac_hp_switch[i].hpnid), cad);
1057
		device_printf(sc->dev,
1058
		    "[ 0] HDA_DEBUG: Pin sense: nid=%d res=0x%08x\n",
1059
		    hdac_hp_switch[i].hpnid, res);
1060
		for (j = 0; hdac_hp_switch[i].spkrnid[j] != -1; j++) {
1061
			w = hdac_widget_get(devinfo,
1062
			    hdac_hp_switch[i].spkrnid[j]);
1063
			if (w == NULL || w->type !=
1064
			    HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)
1065
				continue;
1066
			if (hdac_hp_switch[i].execsense != -1)
1067
				hdac_command(sc,
1068
				    HDA_CMD_SET_PIN_SENSE(cad, w->nid,
1069
				    hdac_hp_switch[i].execsense), cad);
1070
			res = hdac_command(sc,
1071
			    HDA_CMD_GET_PIN_SENSE(cad, w->nid), cad);
1072
			device_printf(sc->dev,
1073
			    "[%2d] HDA_DEBUG: Pin sense: nid=%d res=0x%08x\n",
1074
			    j + 1, w->nid, res);
877
		
878
		if(((w->wclass.pin.config & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) != 
879
		    HDA_CONFIG_DEFAULTCONF_DEVICE_SPEAKER)) {
880
			continue;
1075 881
		}
1076
		break;
1077
	default:
1078
		break;
882
		
883
		ctl = hdac_audio_ctl_amp_get(devinfo,
884
					     i, 0, 1);
885
		if (ctl == NULL)
886
			continue;
887
		val = (res != 0 || forcemute == 1) ?
888
			HDA_AMP_MUTE_ALL : HDA_AMP_MUTE_NONE;
889
		if (val == ctl->muted)
890
			continue;
891
		ctl->muted = val;
892
		hdac_audio_ctl_amp_set(ctl, HDA_AMP_MUTE_DEFAULT,
893
				       ctl->left, ctl->right);
1079 894
	}
1080 895
}
1081 896

  
......
3337 3152
};
3338 3153
CHANNEL_DECLARE(hdac_channel);
3339 3154

  
3340
static void
3341
hdac_jack_poll_callback(void *arg)
3342
{
3343
	struct hdac_devinfo *devinfo = arg;
3344
	struct hdac_softc *sc;
3345

  
3346
	if (devinfo == NULL || devinfo->codec == NULL ||
3347
	    devinfo->codec->sc == NULL)
3348
		return;
3349
	sc = devinfo->codec->sc;
3350
	hdac_lock(sc);
3351
	if (sc->poll_ival == 0) {
3352
		hdac_unlock(sc);
3353
		return;
3354
	}
3355
	hdac_hp_switch_handler(devinfo);
3356
	callout_reset(&sc->poll_jack, sc->poll_ival,
3357
	    hdac_jack_poll_callback, devinfo);
3358
	hdac_unlock(sc);
3359
}
3360

  
3361 3155
static int
3362 3156
hdac_audio_ctl_ossmixer_init(struct snd_mixer *m)
3363 3157
{
......
3376 3170

  
3377 3171
	id = hdac_codec_id(devinfo);
3378 3172
	cad = devinfo->codec->cad;
3379
	for (i = 0; i < HDAC_HP_SWITCH_LEN; i++) {
3380
		if (!(HDA_DEV_MATCH(hdac_hp_switch[i].model,
3381
		    sc->pci_subvendor) && hdac_hp_switch[i].id == id))
3173
	
3174
	for (i = devinfo->startnode; i < devinfo->endnode; i++) {
3175
		w = hdac_widget_get(devinfo, i);
3176
		if(w == NULL || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) {
3382 3177
			continue;
3383
		w = hdac_widget_get(devinfo, hdac_hp_switch[i].hpnid);
3384
		if (w == NULL || w->enable == 0 || w->type !=
3385
		    HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)
3178
		}
3179

  
3180
		if(!HDA_PARAM_PIN_CAP_HEADPHONE_CAP(w->wclass.pin.config)) {
3386 3181
			continue;
3387
		if (hdac_hp_switch[i].polling != 0)
3388
			callout_reset(&sc->poll_jack, 1,
3389
			    hdac_jack_poll_callback, devinfo);
3390
		else if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap))
3391
			hdac_command(sc,
3182
		} 
3183

  
3184
		if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) {
3185
		  	device_printf(sc->dev, "Enabling unsolicited responses for nid %d.", w->nid);
3186
		  	hdac_command(sc,
3392 3187
			    HDA_CMD_SET_UNSOLICITED_RESPONSE(cad, w->nid,
3393 3188
			    HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE |
3394 3189
			    HDAC_UNSOLTAG_EVENT_HP), cad);
3395
		else
3190
		} else {
3396 3191
			continue;
3192
		}
3397 3193
		hdac_hp_switch_handler(devinfo);
3398 3194
		HDA_BOOTVERBOSE(
3399 3195
			device_printf(sc->dev,
......
3404 3200
			    "pci_subvendor=0x%08x "
3405 3201
			    "codec=0x%08x [%s]\n",
3406 3202
			    i, w->nid, sc->pci_subvendor, id,
3407
			    (hdac_hp_switch[i].polling != 0) ? "POLL" :
3408 3203
			    "UNSOL");
3409 3204
		);
3410
		break;
3411 3205
	}
3412 3206
	for (i = 0; i < HDAC_EAPD_SWITCH_LEN; i++) {
3413 3207
		if (!(HDA_DEV_MATCH(hdac_eapd_switch[i].model,
......
3742 3536

  
3743 3537
	callout_init(&sc->poll_hda);
3744 3538
	callout_init(&sc->poll_hdac);
3745
	callout_init(&sc->poll_jack);
3746 3539

  
3747 3540
	TASK_INIT(&sc->unsolq_task, 0, hdac_unsolq_task, sc);
3748 3541

  
......
5790 5583
	sc->poll_ival = 0;
5791 5584
	callout_stop(&sc->poll_hda);
5792 5585
	callout_stop(&sc->poll_hdac);
5793
	callout_stop(&sc->poll_jack);
5794 5586
	hdac_reset(sc);
5795 5587
	hdac_unlock(sc);
5796 5588

  
......
6167 5959
		device_printf(sc->dev,
6168 5960
		    "HDA_DEBUG: Enabling controller interrupt...\n");
6169 5961
	);
6170
	if (sc->polling == 0)
6171
		HDAC_WRITE_4(&sc->mem, HDAC_INTCTL,
6172
		    HDAC_INTCTL_CIE | HDAC_INTCTL_GIE);
5962

  
6173 5963
	HDAC_WRITE_4(&sc->mem, HDAC_GCTL, HDAC_READ_4(&sc->mem, HDAC_GCTL) |
6174 5964
	    HDAC_GCTL_UNSOL);
5965
	if (sc->polling == 0) {
5966
		HDAC_WRITE_4(&sc->mem, HDAC_INTCTL,
5967
		    HDAC_INTCTL_CIE | HDAC_INTCTL_GIE);
5968
	} else {
5969
	  	callout_reset(&sc->poll_hdac, 1, hdac_poll_callback, sc);
5970
	}
5971
	
5972

  
6175 5973

  
6176 5974
	DELAY(1000);
6177 5975

  
sys/dev/sound/pci/hda/hdac_private.h
333 333
	int			poll_ival;
334 334
	struct callout		poll_hda;
335 335
	struct callout		poll_hdac;
336
	struct callout		poll_jack;
337 336

  
338 337
	struct task		unsolq_task;
339 338