Subversion Repositories Kolibri OS

Rev

Rev 4555 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4555 Rev 5048
Line 38... Line 38...
38
    pop    edx  ebx
38
	pop	edx  ebx
39
    mov    eax, -1
39
	mov	eax, -1
40
    ret
40
	ret
41
  @@:
41
@@:
42
  if  FDEBUG   ;YAHOO
42
if  FDEBUG
43
    push   eax esi
43
	push	eax esi
44
    mov    esi, msgVerbQuery
44
	mov	esi, msgVerbQuery
45
    call   SysMsgBoardStr
45
	invoke	SysMsgBoardStr
46
    mov    eax, ebx
46
	mov	eax, ebx
47
    stdcall fdword2str, 2
47
	stdcall fdword2str, 2
48
    call   SysMsgBoardStr
48
	invoke	SysMsgBoardStr
49
    pop    esi eax
49
	pop	esi eax
50
  end if
50
end if
51
 
51
 
Line 52... Line 52...
52
    mov    edx, -1
52
	mov	edx, -1
53
  .again:
53
.again:
Line 62... Line 62...
62
    test   edx, edx
62
	test	edx, edx
63
    jz     .end_debug
63
	jz	.end_debug
64
    push   eax esi
64
	push	eax esi
65
    mov    esi, msgVerbAnswer
65
	mov	esi, msgVerbAnswer
66
    call   SysMsgBoardStr
66
	invoke	SysMsgBoardStr
67
    mov    eax, edx
67
	mov	eax, edx
68
    stdcall fdword2str, 2
68
	stdcall fdword2str, 2
69
    call   SysMsgBoardStr
69
	invoke	SysMsgBoardStr
70
    pop    esi eax
70
	pop	esi eax
71
   .end_debug:
71
.end_debug:
72
  end if
72
end if
73
 
73
 
Line 74... Line 74...
74
  @@:
74
@@:
75
 
-
 
76
    ;call   snd_hda_power_down
75
	;call   snd_hda_power_down
77
    cmp    edx, -1
76
	cmp	edx, -1
78
    jne    .l1
77
	jne	.l1
Line 79... Line 78...
79
 
78
 
Line 86... Line 85...
86
 
85
 
Line 87... Line 86...
87
  if  DEBUG
86
if DEBUG
88
    push   esi
87
	push	esi
89
    mov    esi, emsgBusResetFatalComm
88
	mov	esi, emsgBusResetFatalComm
90
    call   SysMsgBoardStr
89
	invoke	SysMsgBoardStr
91
    pop    esi
90
	pop	esi
92
  end if
91
end if
93
    call   azx_bus_reset
92
	call	azx_bus_reset
94
  @@:
93
@@:
95
  .l1:
94
.l1:
Line 197... Line 196...
197
    jne      @f
196
	jne	@f
198
    inc      eax
197
	inc	eax
199
  @@:
198
@@:
200
    and      eax, 0x7FFF7FFF
199
	and	eax, 0x7FFF7FFF
201
 
200
	ret
202
    ret
-
 
203
endp
201
endp
204
 
202
 
Line 205... Line 203...
205
;;
203
;;
206
;; snd_hda_get_connections - get connection list
204
;; snd_hda_get_connections - get connection list
Line 244... Line 242...
244
    test     ebx, AC_WCAP_CONN_LIST
242
	test	ebx, AC_WCAP_CONN_LIST
245
    jnz      .conn_list_ok
243
	jnz	.conn_list_ok
246
  if DEBUG
244
if DEBUG
247
    mov      esi, emsgConnListNotAvailable
245
	mov	esi, emsgConnListNotAvailable
248
    call     SysMsgBoardStr
246
	invoke	SysMsgBoardStr
249
    mov      eax, [nid]
247
	mov	eax, [nid]
250
    stdcall fdword2str, 3
248
	stdcall fdword2str, 3
251
    call     SysMsgBoardStr
249
	invoke	SysMsgBoardStr
252
  end if
250
end if
253
    xor      eax, eax
251
	xor	eax, eax
254
    dec      eax
252
	dec	eax
255
    jmp      .out
253
	jmp	.out
256
  .conn_list_ok:
254
.conn_list_ok:
257
 
255
 
Line 331... Line 329...
331
    jnz      @f
329
	jnz	@f
332
 if DEBUG
330
if DEBUG
333
    push     eax esi
331
	push	eax esi
334
    mov      esi, emsgInvConnList
332
	mov	esi, emsgInvConnList
335
    call     SysMsgBoardStr
333
	invoke	SysMsgBoardStr
336
    mov      eax, [nid]
334
	mov	eax, [nid]
337
    stdcall  fdword2str, 1
335
	stdcall fdword2str, 1
338
    call     SysMsgBoardStr
336
	invoke	SysMsgBoardStr
339
 
337
 
Line 340... Line 338...
340
    mov      esi, strSemicolon
338
	mov	esi, strSemicolon
341
    call     SysMsgBoardStr
339
	invoke	SysMsgBoardStr
342
    mov      eax, ecx
340
	mov	eax, ecx
343
    stdcall  fdword2str, 0
341
	stdcall fdword2str, 0
344
    call     SysMsgBoardStr
342
	invoke	SysMsgBoardStr
Line 345... Line 343...
345
 
343
 
346
    mov      esi, strSemicolon
344
	mov	esi, strSemicolon
347
    call     SysMsgBoardStr
345
	invoke	SysMsgBoardStr
348
    mov      eax, [parm]
346
	mov	eax, [parm]
349
    stdcall  fdword2str, 2
347
	stdcall fdword2str, 2
350
    call     SysMsgBoardStr
348
	invoke	SysMsgBoardStr
351
    pop      esi eax
349
	pop	esi eax
352
 end if
350
end if
353
    xor      eax, eax
351
	xor	eax, eax
354
    jmp      .out
352
	jmp	.out
Line 370... Line 368...
370
 if DEBUG
368
if DEBUG
371
    push     eax esi
369
	push	eax esi
372
    push     esi
370
	push	esi
373
    mov      esi, emsgInvDepRangeVal
371
	mov	esi, emsgInvDepRangeVal
374
    call     SysMsgBoardStr
372
	invoke	SysMsgBoardStr
375
    pop      esi
373
	pop	esi
376
    push     eax
374
	push	eax
377
    mov      eax, esi
375
	mov	eax, esi
378
    stdcall  fdword2str, 0
376
	stdcall fdword2str, 0
379
    call     SysMsgBoardStr
377
	invoke	SysMsgBoardStr
380
 
378
 
Line 381... Line 379...
381
    mov      esi, strSemicolon
379
	mov	esi, strSemicolon
382
    call     SysMsgBoardStr
380
	invoke	SysMsgBoardStr
383
    pop      eax
381
	pop	eax
384
    stdcall  fdword2str, 2
382
	stdcall fdword2str, 2
385
    call     SysMsgBoardStr
383
	invoke	SysMsgBoardStr
386
    pop      esi eax
384
	pop	esi eax
387
 end if
385
end if
388
    jmp      .continue
386
	jmp	.continue
389
  @@:
387
@@:
390
    push     ecx
388
	push	ecx
Line 396... Line 394...
396
    jl       @f
394
	jl	@f
397
 if DEBUG
395
if DEBUG
398
    push     esi
396
	push	esi
399
    mov      esi, emsgTooManyConns
397
	mov	esi, emsgTooManyConns
400
    call     SysMsgBoardStr
398
	invoke	SysMsgBoardStr
401
    pop      esi
399
	pop	esi
402
 end if
400
end if
403
    pop      ecx
401
	pop	ecx
404
    jmp      .err_out
402
	jmp	.err_out
405
  @@:
403
@@:
406
    shl      ebx, 1
404
	shl	ebx, 1
Line 424... Line 422...
424
    jl       @f
422
	jl	@f
425
 if DEBUG
423
if DEBUG
426
    push     esi
424
	push	esi
427
    mov      esi, emsgTooManyConns
425
	mov	esi, emsgTooManyConns
428
    call     SysMsgBoardStr
426
	invoke	SysMsgBoardStr
429
    pop      esi
427
	pop	esi
430
 end if
428
end if
431
    jmp      .err_out
429
	jmp	.err_out
432
  @@:
430
@@:
433
    shl      ebx, 1
431
	shl	ebx, 1
434
    push     edi
432
	push	edi
Line 509... Line 507...
509
 
507
 
Line 510... Line 508...
510
     mov     eax, [codec.afg]
508
	mov	eax, [codec.afg]
511
     test    eax, eax
509
	test	eax, eax
512
     jnz     @f
510
	jnz	@f
513
 
-
 
514
     ;Asper+: try to use another codec if possible [
511
	;Asper+: try to use another codec if possible [
515
  if DEBUG
512
if DEBUG
516
     push    esi
513
	push	esi
517
     mov     esi, msgNoAFGFound
514
	mov	esi, msgNoAFGFound
518
     call    SysMsgBoardStr
515
	invoke	SysMsgBoardStr
519
     pop     esi
516
	pop	esi
520
  end  if
517
end  if
521
     push    ecx
518
	push	ecx
522
     inc     eax
519
	inc	eax
523
     mov     ecx, [codec.addr]
520
	mov	ecx, [codec.addr]
Line 532... Line 529...
532
     jnz     @f
529
	jnz	@f
533
  if DEBUG
530
if DEBUG
534
     push    esi
531
	push	esi
535
     mov     esi, emsgNoAFGorMFGFound
532
	mov	esi, emsgNoAFGorMFGFound
536
     call    SysMsgBoardStr
533
	invoke	SysMsgBoardStr
537
     pop     esi
534
	pop	esi
538
  end  if
535
end  if
539
  .skip_codec:
536
.skip_codec:
540
     mov     eax, -1
537
	mov	eax, -1
541
     ret
538
	ret
542
  @@:
539
@@:
Line 549... Line 546...
549
     jge     @f
546
	jge	@f
550
  if DEBUG
547
if DEBUG
551
     push    esi
548
	push	esi
552
     mov     esi, emsgNoMem
549
	mov	esi, emsgNoMem
553
     call    SysMsgBoardStr
550
	invoke	SysMsgBoardStr
554
     pop     esi
551
	pop	esi
555
  end  if
552
end  if
556
     pop     ebx
553
	pop	ebx
557
     mov     eax, -1
554
	mov	eax, -1
558
     ret
555
	ret
559
  @@:
556
@@:
Line 569... Line 566...
569
     mov     eax, [codec.subsystem_id]
566
	mov	eax, [codec.subsystem_id]
570
     test    eax, eax
567
	test	eax, eax
571
     jnz     @f
568
	jnz	@f
572
     stdcall snd_hda_codec_read, ebx, 0, AC_VERB_GET_SUBSYSTEM_ID, 0
569
	stdcall snd_hda_codec_read, ebx, 0, AC_VERB_GET_SUBSYSTEM_ID, 0
573
 
570
@@:
574
  @@:
-
 
575
 
571
	; power up all before initialization
576
     ; power up all before initialization
-
 
577
     stdcall snd_hda_set_power_state, ebx, AC_PWRST_D0
572
	stdcall snd_hda_set_power_state, ebx, AC_PWRST_D0
578
 
573
 
Line 579... Line 574...
579
     xor     eax, eax
574
	xor	eax, eax
580
     pop     ebx
575
	pop	ebx
Line 600... Line 595...
600
     jz      @f
595
	jz	@f
601
  if DEBUG
596
if DEBUG
602
     push    esi
597
	push	esi
603
     mov     esi, emsgNoParserAvailable
598
	mov	esi, emsgNoParserAvailable
604
     call    SysMsgBoardStr
599
	invoke	SysMsgBoardStr
605
     pop     esi
600
	pop	esi
606
  end if
601
end if
607
  @@:
602
@@:
608
  .out:
603
.out:
609
     ret
604
	ret
610
endp
605
endp
Line 628... Line 623...
628
     jne     .next
623
	jne	.next
629
     mov     eax, [edi+4]
624
	mov	eax, [edi+4]
630
     mov     [codec.ac_vendor_ids], eax
625
	mov	[codec.ac_vendor_ids], eax
631
     mov     esi, eax
626
	mov	esi, eax
632
     call    SysMsgBoardStr
627
	invoke	SysMsgBoardStr
633
  .get_chip_name:
628
.get_chip_name:
634
     stdcall detect_chip, [edi+8]
629
	stdcall detect_chip, [edi+8]
635
     pop     esi  edi  ebx  eax
630
	pop	esi  edi  ebx  eax
636
     ret
631
	ret
637
  .next:
632
.next:
638
     add     edi, 12
633
	add	edi, 12
Line 641... Line 636...
641
     mov     [codec.ac_vendor_ids], ac_unknown
636
	mov	[codec.ac_vendor_ids], ac_unknown
642
     mov     [codec.chip_ids], chip_unknown
637
	mov	[codec.chip_ids], chip_unknown
643
 
638
 
Line 644... Line 639...
644
     mov     esi, chip_unknown
639
	mov	esi, chip_unknown
645
     call    SysMsgBoardStr
640
	invoke	SysMsgBoardStr
646
     movzx   eax, [codec.chip_id]
641
	movzx	eax, [codec.chip_id]
647
     stdcall fdword2str, 2
642
	stdcall fdword2str, 2
648
     call    SysMsgBoardStr
643
	invoke	SysMsgBoardStr
649
     pop     esi  edi  ebx  eax
644
	pop	esi edi ebx eax
650
     ret
645
	ret
651
endp
646
endp
Line 652... Line 647...
652
 
647
 
653
 
648
 
654
align 4
-
 
655
proc detect_chip stdcall, chip_tab:dword
649
align 4
656
 
650
proc detect_chip stdcall, chip_tab:dword
Line 657... Line 651...
657
     push    eax  ebx  edi  esi
651
	push	eax ebx edi esi
658
     mov     ax, [codec.chip_id]
652
	mov	ax, [codec.chip_id]
Line 667... Line 661...
667
     jne     .next
661
	jne	.next
668
     mov     eax, [edi+4]
662
	mov	eax, [edi+4]
669
     mov     [codec.chip_ids], eax
663
	mov	[codec.chip_ids], eax
670
     mov     esi, eax
664
	mov	esi, eax
671
     call    SysMsgBoardStr
665
	invoke	SysMsgBoardStr
672
     pop     esi  edi  ebx  eax
666
	pop	esi  edi  ebx  eax
673
     ret
667
	ret
674
.next:
668
.next:
675
     add     edi, 8
669
	add	edi, 8
676
     jmp     @b
670
	jmp	@b
677
.unknown:
671
.unknown:
678
     mov     [codec.chip_ids], chip_unknown
672
	mov	[codec.chip_ids], chip_unknown
679
     mov     esi, chip_unknown
673
	mov	esi, chip_unknown
680
     call    SysMsgBoardStr
674
	invoke	SysMsgBoardStr
681
     movzx   eax, [codec.chip_id]
675
	movzx	eax, [codec.chip_id]
682
     stdcall fdword2str, 2
676
	stdcall fdword2str, 2
683
     call    SysMsgBoardStr
677
	invoke	SysMsgBoardStr
684
     pop     esi  edi  ebx  eax
678
	pop	esi edi ebx eax
685
     ret
679
	ret
686
endp
680
endp
687
 
681
 
Line 695... Line 689...
695
     mov     ebx, eax
689
	mov	ebx, eax
696
     shr     ebx, 16
690
	shr	ebx, 16
697
     and     ebx, 0x7FFF ; nid
691
	and	ebx, 0x7FFF ; nid
698
 
692
 
Line 699... Line 693...
699
if DEBUG    ;YAHOO
693
if DEBUG
700
     push    eax esi
694
	push	eax esi
701
     mov     esi, msgSETUP_FG_NODES
695
	mov	esi, msgSETUP_FG_NODES
702
     call    SysMsgBoardStr
696
	invoke	SysMsgBoardStr
703
     mov     eax, ebx
697
	mov	eax, ebx
704
     stdcall fdword2str, 1
698
	stdcall fdword2str, 1
705
     call    SysMsgBoardStr
699
	invoke	SysMsgBoardStr
Line 706... Line 700...
706
 
700
 
707
     mov     esi, strSemicolon
701
	mov	esi, strSemicolon
708
     call    SysMsgBoardStr
702
	invoke	SysMsgBoardStr
709
     mov     eax, ecx
703
	mov	eax, ecx
710
     stdcall fdword2str, 3
704
	stdcall fdword2str, 3
711
     call    SysMsgBoardStr
705
	invoke	SysMsgBoardStr
712
     pop     esi eax
706
	pop	esi eax
Line 713... Line 707...
713
end if
707
end if
714
 
708
 
715
  .next:
709
.next:
716
     test    ecx, ecx
710
	test	ecx, ecx
717
     jz      .l1
711
	jz	.l1
Line 718... Line 712...
718
     snd_hda_param_read  ebx, AC_PAR_FUNCTION_TYPE
712
	snd_hda_param_read  ebx, AC_PAR_FUNCTION_TYPE
719
     and     eax, 0xFF
713
	and	eax, 0xFF
720
 
714
 
721
if DEBUG    ;YAHOO
715
if DEBUG
722
     push    eax esi
716
	push	eax esi
723
     mov     esi, msgFG_TYPE
717
	mov	esi, msgFG_TYPE
724
     call    SysMsgBoardStr
718
	invoke	SysMsgBoardStr
725
     stdcall fdword2str, 3
719
	stdcall fdword2str, 3
Line 726... Line 720...
726
     call    SysMsgBoardStr
720
	invoke	SysMsgBoardStr
727
     pop     esi eax
721
	pop	esi eax
Line 764... Line 758...
764
     shr     ebx, 16
758
	shr	ebx, 16
765
     and     ebx, 0x7FFF ; nid
759
	and	ebx, 0x7FFF ; nid
766
     mov     [codec.start_nid], bx
760
	mov	[codec.start_nid], bx
767
 
761
 
Line 768... Line 762...
768
if DEBUG    ;YAHOO
762
if DEBUG
769
     push    eax esi
763
	push	eax esi
770
     mov     esi, msgSETUP_FG_NODES
764
	mov	esi, msgSETUP_FG_NODES
771
     call    SysMsgBoardStr
765
	invoke	SysMsgBoardStr
772
     mov     eax, ebx
766
	mov	eax, ebx
773
     stdcall fdword2str, 1
767
	stdcall fdword2str, 1
774
     call    SysMsgBoardStr
768
	invoke	SysMsgBoardStr
Line 775... Line 769...
775
 
769
 
776
     mov     esi, strSemicolon
770
	mov	esi, strSemicolon
777
     call    SysMsgBoardStr
771
	invoke	SysMsgBoardStr
778
     mov     eax, ecx
772
	mov	eax, ecx
779
     stdcall fdword2str, 3
773
	stdcall fdword2str, 3
780
     call    SysMsgBoardStr
774
	invoke	SysMsgBoardStr
781
     pop     esi eax
775
	pop	esi eax
Line 782... Line 776...
782
end if
776
end if
783
 
777
 
784
if FDEBUG    ;YAHOO
778
if FDEBUG
785
     push    esi
779
	push	esi
786
     mov     esi, msgWCaps
780
	mov	esi, msgWCaps
787
     call    SysMsgBoardStr
781
	invoke	SysMsgBoardStr
Line 788... Line 782...
788
     pop     esi
782
	pop	esi
789
end if
783
end if
790
 
784
 
791
     mov     eax, ecx
785
	mov	eax, ecx
792
     shl     eax, 2
786
	shl	eax, 2
793
     push    ebx ecx
787
	push	ebx ecx
794
     call    Kmalloc
788
	invoke	Kmalloc
795
     pop     ecx ebx
789
	pop	ecx ebx
Line 826... Line 820...
826
     ;Asper [
820
	;Asper [
827
     mov     eax, HDA_PINCFG.sizeof
821
	mov	eax, HDA_PINCFG.sizeof
828
     mul     cl
822
	mul	cl
829
     push    ebx ecx
823
	push	ebx ecx
830
     call    Kmalloc
824
	invoke	Kmalloc
831
     pop     ecx ebx
825
	pop	ecx ebx
832
     test    eax, eax
826
	test	eax, eax
833
     jz      .err_out
827
	jz	.err_out
834
     mov     [codec.init_pins], eax
828
	mov	[codec.init_pins], eax
835
     mov     [codec.num_pins], 0
829
	mov	[codec.num_pins], 0
Line 838... Line 832...
838
 
832
 
Line 839... Line 833...
839
if FDEBUG
833
if FDEBUG
840
   push   eax esi
834
	push	eax esi
841
   mov    esi, msgPinCfgs
835
	mov	esi, msgPinCfgs
842
   call   SysMsgBoardStr
836
	invoke	SysMsgBoardStr
843
   pop    esi eax
837
	pop	esi eax
844
end if
838
end if
Line 845... Line 839...
845
 
839
 
Line 956... Line 950...
956
  @@:
950
@@:
957
  if DEBUG
951
if DEBUG
958
     push    esi
952
	push	esi
959
     mov     esi, msgHDACodecSetupStream
953
	mov	esi, msgHDACodecSetupStream
960
     call    SysMsgBoardStr
954
	invoke	SysMsgBoardStr
961
     stdcall fdword2str, 3
955
	stdcall fdword2str, 3
962
     call    SysMsgBoardStr
956
	invoke	SysMsgBoardStr
963
 
957
 
Line 964... Line 958...
964
     mov     esi, msgStream
958
	mov	esi, msgStream
965
     call    SysMsgBoardStr
959
	invoke	SysMsgBoardStr
966
     mov     eax, [stream_tag]
960
	mov	eax, [stream_tag]
967
     stdcall fdword2str, 3
961
	stdcall fdword2str, 3
968
     call    SysMsgBoardStr
962
	invoke	SysMsgBoardStr
Line 969... Line 963...
969
 
963
 
970
     mov     esi, msgChannel
964
	mov	esi, msgChannel
971
     call    SysMsgBoardStr
965
	invoke	SysMsgBoardStr
972
     mov     eax, [channel_id]
966
	mov	eax, [channel_id]
973
     stdcall fdword2str, 3
967
	stdcall fdword2str, 3
Line 974... Line 968...
974
     call    SysMsgBoardStr
968
	invoke	SysMsgBoardStr
975
 
969
 
976
     mov     esi, msgFormat
970
	mov	esi, msgFormat
977
     call    SysMsgBoardStr
971
	invoke	SysMsgBoardStr
978
     mov     eax, [format]
972
	mov	eax, [format]
979
     stdcall fdword2str, 3
973
	stdcall fdword2str, 3
980
     call    SysMsgBoardStr
974
	invoke	SysMsgBoardStr
981
     pop     esi
975
	pop	esi
982
  end if
976
end if
983
     mov     eax, [stream_tag]
977
	mov	eax, [stream_tag]
Line 1004... Line 998...
1004
  @@:
998
@@:
1005
  if DEBUG
999
if DEBUG
1006
     push    esi
1000
	push	esi
1007
     mov     esi, msgHDACodecCleanupStream
1001
	mov	esi, msgHDACodecCleanupStream
1008
     call    SysMsgBoardStr
1002
	invoke	SysMsgBoardStr
1009
     stdcall fdword2str, 3
1003
	stdcall fdword2str, 3
1010
     call    SysMsgBoardStr
1004
	invoke	SysMsgBoardStr
1011
     pop     esi
1005
	pop	esi
1012
  end if
1006
end if
1013
     stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_CHANNEL_STREAMID, 0
1007
	stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_CHANNEL_STREAMID, 0
1014
  if 0  ; keep the format
1008
if 0  ; keep the format
1015
     mov     eax, 1000000  ; wait 100 ms
1009
	mov	eax, 1000000  ; wait 100 ms
1016
     call    StallExec
1010
	call	StallExec
Line 1131... Line 1125...
1131
     pop     edx  ebx
1125
	pop	edx  ebx
1132
     ret
1126
	ret
1133
endp
1127
endp
1134
 
1128
 
Line -... Line 1129...
-
 
1129
; execute pin sense measurement
-
 
1130
proc snd_hda_read_pin_sense stdcall, nid:dword, trigger_sense:dword
-
 
1131
	mov	eax, [trigger_sense]
-
 
1132
	test	eax, eax
-
 
1133
	jz	.no_trigger_sense
-
 
1134
 
-
 
1135
	stdcall read_pin_cap, [nid]
-
 
1136
	test	eax, AC_PINCAP_TRIG_REQ ;need trigger?
-
 
1137
	jz	.no_trigger_sense
-
 
1138
 
-
 
1139
	stdcall snd_hda_codec_read, [nid], 0, AC_VERB_SET_PIN_SENSE, 0
-
 
1140
.no_trigger_sense:
-
 
1141
	stdcall snd_hda_codec_read, [nid], 0, AC_VERB_GET_PIN_SENSE, 0
-
 
1142
	ret
-
 
1143
endp
-
 
1144
 
-
 
1145
proc is_jack_detectable stdcall, nid:dword
-
 
1146
	stdcall read_pin_cap, [nid]
-
 
1147
	test	eax, AC_PINCAP_PRES_DETECT
-
 
1148
	jz	.no
-
 
1149
 
-
 
1150
	stdcall get_wcaps, [nid]
-
 
1151
	test	eax, AC_WCAP_UNSOL_CAP
-
 
1152
	jz	.no
-
 
1153
.yes:
-
 
1154
	xor	eax, eax
-
 
1155
	inc	eax
-
 
1156
	ret
-
 
1157
.no:
-
 
1158
	xor	eax, eax
-
 
1159
	ret
-
 
1160
endp
-
 
1161
 
-
 
1162
proc snd_hda_enable_pin_sense stdcall nid:dword, jacktag:dword
-
 
1163
	push	eax
-
 
1164
	stdcall is_jack_detectable, [nid]
-
 
1165
	test	eax, eax
-
 
1166
	jz	@f
-
 
1167
	mov	eax, [jacktag]
-
 
1168
	or	eax, AC_USRSP_EN
-
 
1169
	stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_UNSOLICITED_ENABLE, eax
-
 
1170
@@:
-
 
1171
	pop	eax
-
 
1172
	ret
-
 
1173
endp
Line 1135... Line 1174...
1135
 
1174
 
1136
;; set power state of the codec
1175
;; set power state of the codec
1137
proc snd_hda_set_power_state stdcall, fg:dword, power_state:dword
1176
proc snd_hda_set_power_state stdcall, fg:dword, power_state:dword
1138
     push    eax ebx ecx edx
1177
	push	eax ebx ecx edx
Line 1149... Line 1188...
1149
     jne     @f
1188
	jne	@f
1150
 
1189
 
Line 1151... Line 1190...
1151
     mov     dx, [codec.vendor_id]
1190
	mov	dx, [codec.vendor_id]
1152
     cmp     dx, 0x14F1
1191
	cmp	dx, 0x14F1
1153
 
-
 
1154
     jne     @f
1192
	jne	@f
1155
     mov     eax, 10000
1193
	mov	eax, 10000
1156
     call    StallExec
1194
	call	StallExec
1157
  @@:
1195
@@:
1158
     movzx   ecx, [codec.num_nodes]
1196
	movzx	ecx, [codec.num_nodes]
Line 1283... Line 1321...
1283
                     dd 0x0397, chip_VT17085_0
1321
		     dd 0x0397, chip_VT17085_0
1284
                     dd 0xFF
1322
		     dd 0xFF
1285
 
1323
 
Line 1286... Line 1324...
1286
chips_IDT            dd 0xFF
1324
chips_IDT	     dd 0xFF
1287
 
-
 
1288
chips_LSI            dd 0x1039, chip_LSI1039
1325
chips_LSI	     dd 0x1039, chip_LSI1039
1289
                     dd 0x1040, chip_LSI1040
1326
		     dd 0x1040, chip_LSI1040
1290
                     dd 0x3026, chip_LSI3026
1327
		     dd 0x3026, chip_LSI3026
1291
                     dd 0x3055, chip_LSI3055
1328
		     dd 0x3055, chip_LSI3055
1292
                     dd 0xFF
1329
		     dd 0xFF
Line 1360... Line 1397...
1360
chip_LSI1039         db '1039 (Agere Systems HDA Modem)',13,10,0
1397
chip_LSI1039	     db '1039 (Agere Systems HDA Modem)',13,10,0
1361
chip_LSI1040         db '1040 (Agere Systems HDA Modem)',13,10,0
1398
chip_LSI1040	     db '1040 (Agere Systems HDA Modem)',13,10,0
1362
chip_LSI3026         db '3026 (Agere Systems HDA Modem)',13,10,0
1399
chip_LSI3026	     db '3026 (Agere Systems HDA Modem)',13,10,0
1363
chip_LSI3055         db '3055 (Agere Systems HDA Modem)',13,10,0
1400
chip_LSI3055	     db '3055 (Agere Systems HDA Modem)',13,10,0
1364
1401
-
 
1402