Subversion Repositories Kolibri OS

Rev

Rev 6299 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6299 Rev 6943
Line 13... Line 13...
13
DEBUG_IRQ	equ 0
13
DEBUG_IRQ	equ 0
Line 14... Line 14...
14
 
14
 
15
USE_SINGLE_MODE equ  0	 ; 1 = Single mode; 0 = Normal mode.
15
USE_SINGLE_MODE equ  0	 ; 1 = Single mode; 0 = Normal mode.
Line 16... Line 16...
16
USE_UNSOL_EV	equ  1	 ; 1 = Use unsolicited events; 0 = Do not use unsolicited events.
16
USE_UNSOL_EV	equ  1	 ; 1 = Use unsolicited events; 0 = Do not use unsolicited events.
Line 17... Line 17...
17
 
17
 
18
TEST_VERSION_NUMBER  equ '019'
18
TEST_VERSION_NUMBER  equ '019a'
19
 
19
 
20
;Asper+ [
20
;Asper+ [
Line 650... Line 650...
650
	stdcall hda_codec_setup_stream, ebx, SDO_TAG, 0, 0x11	; Left & Right channels (Front panel)
650
	stdcall hda_codec_setup_stream, ebx, SDO_TAG, 0, 0x11	; Left & Right channels (Front panel)
651
@@:
651
@@:
652
	stdcall hda_codec_setup_stream, eax, SDO_TAG, 0, 0x11	; Left & Right channels (Back panel)
652
	stdcall hda_codec_setup_stream, eax, SDO_TAG, 0, 0x11	; Left & Right channels (Back panel)
653
;Asper+ ]
653
;Asper+ ]
Line -... Line 654...
-
 
654
 
654
 
655
	invoke	TimerHS, 1, 0, snd_hda_automute, 0
655
if USE_SINGLE_MODE
656
if USE_SINGLE_MODE
656
	mov	esi, msgSingleMode
657
	mov	esi, msgSingleMode
657
	invoke	SysMsgBoardStr
658
	invoke	SysMsgBoardStr
658
else
659
else
Line 826... Line 827...
826
	spin_lock
827
	spin_lock
827
if DEBUG_IRQ
828
if DEBUG_IRQ
828
	push	eax esi
829
	push	eax esi
829
	;mov     esi, msgIRQ
830
	;mov     esi, msgIRQ
830
	;invoke  SysMsgBoardStr
831
	;invoke  SysMsgBoardStr
831
	call	GetTimerTicks
832
	invoke	GetTimerTicks
832
	stdcall fdword2str, 2
833
	stdcall fdword2str, 2
833
	invoke	SysMsgBoardStr
834
	invoke	SysMsgBoardStr
834
	pop	esi eax
835
	pop	esi eax
835
end if
836
end if
836
	mov	edx, ICH6_REG_INTSTS
837
	mov	edx, ICH6_REG_INTSTS
Line 2298... Line 2299...
2298
 
2299
 
2299
 
2300
 
2300
proc  azx_bus_reset
2301
proc  azx_bus_reset
-
 
2302
	call	azx_stop_chip
2301
	call	azx_stop_chip
2303
	call	azx_init_chip
Line 2302... Line 2304...
2302
	call	azx_init_chip
2304
	ret
2303
endp
2305
endp
Line 2612... Line 2614...
2612
	ret
2614
	ret
2613
endp
2615
endp
Line 2614... Line 2616...
2614
 
2616
 
Line -... Line 2617...
-
 
2617
;_______
-
 
2618
 
-
 
2619
proc  snd_hda_automute stdcall, data:dword
-
 
2620
	push	eax ebx ecx edx esi
-
 
2621
	mov	esi, [spec.out_pin_node+4]
-
 
2622
	mov	ecx, [spec.out_pin_node]
-
 
2623
	test	esi, esi
-
 
2624
	jnz	@f
-
 
2625
	xchg	ecx, esi
-
 
2626
	test	esi, esi
-
 
2627
	jz	.out
-
 
2628
@@:
-
 
2629
	movzx	edx, word [esi + HDA_GNODE.nid]
-
 
2630
	stdcall is_jack_detectable, edx
-
 
2631
	test	eax, eax
-
 
2632
	jz	.out
-
 
2633
 
-
 
2634
	stdcall snd_hda_read_pin_sense, edx, 1
-
 
2635
	test	eax, AC_PINSENSE_PRESENCE
-
 
2636
	jnz	@f
-
 
2637
	xchg	ecx, esi
-
 
2638
@@:
-
 
2639
	; set PIN-Out enable
-
 
2640
	test	esi, esi
-
 
2641
	jz	.out
-
 
2642
	xor	edx, edx
-
 
2643
	test	[esi + HDA_GNODE.pin_caps], AC_PINCAP_HP_DRV
-
 
2644
	jz	@f
-
 
2645
	mov	edx, AC_PINCTL_HP_EN
-
 
2646
@@:
-
 
2647
	or	edx, AC_PINCTL_OUT_EN
-
 
2648
	movzx	eax, [esi + HDA_GNODE.nid]
-
 
2649
	stdcall snd_hda_codec_write, eax, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, edx
-
 
2650
 
-
 
2651
	; set PIN-Out disable
-
 
2652
	test	ecx, ecx
-
 
2653
	jz	.out
-
 
2654
	xor	edx, edx
-
 
2655
	movzx	eax, [ecx + HDA_GNODE.nid]
-
 
2656
	stdcall snd_hda_codec_write, eax, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, edx
-
 
2657
.out:
-
 
2658
	pop	esi edx ecx ebx eax
-
 
2659
	ret
Line 2615... Line 2660...
2615
;_______
2660
endp
2616
 
2661
 
2617
 
2662
 
2618
;Asper remember to add this functions:
2663
;Asper remember to add this functions:
Line 2625... Line 2670...
2625
end if
2670
end if
2626
if USE_UNSOL_EV = 0
2671
if USE_UNSOL_EV = 0
2627
	;Test. Do not make queue, process immediately!
2672
	;Test. Do not make queue, process immediately!
2628
	;stdcall here snd_hda_read_pin_sense stdcall, nid:dword, trigger_sense:dword
2673
	;stdcall here snd_hda_read_pin_sense stdcall, nid:dword, trigger_sense:dword
2629
	;and then mute/unmute pin based on the results
2674
	;and then mute/unmute pin based on the results
-
 
2675
	invoke	TimerHS, 1, 0, snd_hda_automute, 0
2630
end if
2676
end if
2631
	ret
2677
	ret
2632
endp
2678
endp
2633
;...
2679
;...
Line 2914... Line 2960...
2914
msgPciCmd    db 'PCI command     ',0
2960
msgPciCmd    db 'PCI command     ',0
2915
msgPciStat   db 'PCI status      ',0
2961
msgPciStat   db 'PCI status      ',0
2916
    msgHDALowMMIo db 'lower mmio base ',0
2962
    msgHDALowMMIo db 'lower mmio base ',0
2917
    msgHDAUpMMIo  db 'upper mmio base ',0
2963
    msgHDAUpMMIo  db 'upper mmio base ',0
2918
msgIrqMap    db 'HDA irq map as      ',0
2964
msgIrqMap    db 'HDA irq map as      ',0
-
 
2965
msgUnsolEvent db 'Unsolicited event!',13,10,0
Line 2919... Line 2966...
2919
 
2966
 
2920
;Asper [
2967
;Asper [
2921
if DEBUG
2968
if DEBUG
2922
    msgCodecMask	     db 'codec_mask = ',0
2969
    msgCodecMask	     db 'codec_mask = ',0
Line 2953... Line 3000...
2953
    msgFormat		     db 'format=',0
3000
    msgFormat		     db 'format=',0
Line 2954... Line 3001...
2954
 
3001
 
2955
    msgPollingCodecOnce      db 'polling the codec once',13,10,0 ;Asper~
3002
    msgPollingCodecOnce      db 'polling the codec once',13,10,0 ;Asper~
Line 2956... Line -...
2956
    msgSwitchToPollMode      db 'switching to polling mode',13,10,0 ;Asper~
-
 
2957
 
3003
    msgSwitchToPollMode      db 'switching to polling mode',13,10,0 ;Asper~
2958
    msgUnsolEvent	     db 'Unsolicited event!',13,10,0
3004
 
2959
    strSemicolon	     db ':',0
3005
    strSemicolon	     db ':',0
2960
    msgSETUP_FG_NODES	     db 'Setup FG nodes = start_nid:total_nodes = ',0
3006
    msgSETUP_FG_NODES	     db 'Setup FG nodes = start_nid:total_nodes = ',0
2961
    msgFG_TYPE		     db 'FG type = ',0
3007
    msgFG_TYPE		     db 'FG type = ',0