Subversion Repositories Kolibri OS

Rev

Rev 4320 | Rev 4324 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. ;; Compose a 32bit command word to be sent to the HD-audio controller
  3. proc make_codec_cmd stdcall, nid:dword, direct:dword, verb:dword, parm:dword
  4.     push   ebx
  5.  
  6.     and    dword [codec.addr], 0xF
  7.     and    dword [direct], 1
  8.     and    dword [nid], 0x7F
  9.     and    dword [verb], 0xFFF
  10.     and    dword [parm], 0xFFFF
  11.  
  12.     mov    eax, [codec.addr]
  13.     shl    eax, 28
  14.     mov    ebx, [direct]
  15.     shl    ebx, 27
  16.     or     eax, ebx
  17.     mov    ebx, [nid]
  18.     shl    ebx, 20
  19.     or     eax, ebx
  20.     mov    ebx, [verb]
  21.     shl    ebx, 8
  22.      or     eax, ebx
  23.     mov    ebx, [parm]
  24.     or     eax, ebx
  25.     pop    ebx
  26.     ret
  27.  .err:
  28.     pop    ebx
  29.     mov    eax, -1
  30.     ret
  31. endp
  32.  
  33. ;; Send and receive a verb
  34. proc  codec_exec_verb stdcall, cmd:dword;, res:dword <- returned in eax
  35.     push   ebx  edx
  36.     mov    ebx, [cmd]
  37.     cmp    ebx, -1
  38.     jne    @f
  39.     pop    edx  ebx
  40.     mov    eax, -1
  41.     ret
  42.   @@:
  43.   if  FDEBUG   ;YAHOO
  44.     push   eax esi
  45.     mov    esi, msgVerbQuery
  46.     call   SysMsgBoardStr
  47.     mov    eax, ebx
  48.     stdcall fdword2str, 2
  49.     call   SysMsgBoardStr
  50.     pop    esi eax
  51.   end if
  52.  
  53.     mov    edx, -1
  54.   .again:
  55.     ; call   snd_hda_power_up
  56.     stdcall  azx_send_cmd, ebx
  57.     mov    ebx, eax
  58.     test   ebx, ebx
  59.     jnz    @f
  60.     call  azx_get_response
  61.     mov    edx, eax
  62.   if  FDEBUG
  63.     test   edx, edx
  64.     jz     .end_debug
  65.     push   eax esi
  66.     mov    esi, msgVerbAnswer
  67.     call   SysMsgBoardStr
  68.     mov    eax, edx
  69.     stdcall fdword2str, 2
  70.     call   SysMsgBoardStr
  71.     pop    esi eax
  72.    .end_debug:
  73.   end if
  74.  
  75.   @@:
  76.  
  77.     ;call   snd_hda_power_down
  78.     cmp    edx, -1
  79.     jne    .l1
  80.  
  81.     mov    eax, [ctrl.rirb_error]
  82.     test   eax, eax
  83.     jz     .l1
  84.  
  85.     mov    eax, [ctrl.response_reset]
  86.     jz     @f
  87.  
  88.   if  DEBUG
  89.     push   esi
  90.     mov    esi, emsgBusResetFatalComm
  91.     call   SysMsgBoardStr
  92.     pop    esi
  93.   end if
  94.     call   azx_bus_reset
  95.   @@:
  96.   .l1:
  97.     ;; clear reset-flag when the communication gets recovered
  98.     test   ebx, ebx
  99.     jnz    @f
  100.     mov    [ctrl.response_reset], 0
  101.   @@:
  102.     mov    eax, edx
  103.  
  104.     pop    edx  ebx
  105.     ret
  106. endp
  107.  
  108.  
  109. ;;
  110. ;; snd_hda_codec_read - send a command and get the response
  111. ;; @nid: NID to send the command
  112. ;; @direct: direct flag
  113. ;; @verb: the verb to send
  114. ;; @parm: the parameter for the verb
  115. ;;
  116. ;; Send a single command and read the corresponding response.
  117. ;;
  118. ;; Returns the obtained response value, or -1 for an error.
  119. ;;
  120. proc  snd_hda_codec_read stdcall, nid:dword, direct:dword, verb:dword, parm:dword
  121.     stdcall  make_codec_cmd, [nid], [direct], [verb], [parm]
  122.     stdcall  codec_exec_verb, eax
  123.     ret
  124. endp
  125.  
  126.  
  127. ;;
  128. ;; snd_hda_codec_write - send a single command without waiting for response
  129. ;; @nid: NID to send the command
  130. ;; @direct: direct flag
  131. ;; @verb: the verb to send
  132. ;; @parm: the parameter for the verb
  133. ;;
  134. ;; Send a single command without waiting for response.
  135. ;;
  136. ;; Returns 0 if successful, or a negative error code.
  137. ;;
  138. proc  snd_hda_codec_write stdcall, nid:dword, direct:dword, verb:dword, parm:dword
  139.     ; Do we need to support a sync write?
  140.     stdcall  make_codec_cmd, [nid], [direct], [verb], [parm]
  141.     stdcall  codec_exec_verb, eax
  142.     ret
  143. endp
  144.  
  145.  
  146. ;;
  147. ;; snd_hda_sequence_write - sequence writes
  148. ;; @seq: VERB array to send
  149. ;;
  150. ;; Send the commands sequentially from the given array.
  151. ;; The array must be terminated with NID=0.
  152. ;;
  153. proc  snd_hda_sequence_write stdcall, seq:dword
  154.     push     eax  ebx  ecx  esi
  155.     mov      esi, [seq]
  156.   @@:
  157.     ;mov      ecx, [esi + hda_verb.nid]
  158.     ;mov      ebx, [esi + hda_verb.verb]
  159.     ;mov      eax, [esi + hda_verb.param]
  160.     ;stdcall  snd_hda_codec_write, ecx, 0, ebx, eax
  161.     ;add      esi, hda_verb.sizeof
  162.     ;test     ecx, ecx
  163.     ;jnz      @b
  164.     ;______________________________________
  165.     cmp      dword [esi], 0
  166.     je       .out
  167.     movzx    ecx, word [esi] ; NID
  168.     movzx    ebx, word [esi+2] ; verb
  169.     and      bx, 0x0FFF
  170.     movzx    eax, word [esi + 4] ; sizeof(param) = 4 bytes
  171.     stdcall  snd_hda_codec_write, ecx, 0, ebx, eax
  172.     add      esi, 6
  173.     jmp      @b
  174.  .out:
  175.     pop      esi  ecx  ebx  eax
  176.     ret
  177. endp
  178.  
  179.  
  180. macro  snd_hda_param_read  nid, param
  181. {
  182.     stdcall  snd_hda_codec_read, nid, 0, AC_VERB_PARAMETERS, param
  183. }
  184.  
  185. ;;
  186. ;; snd_hda_get_sub_nodes - get the range of sub nodes
  187. ;; @codec: the HDA codec
  188. ;; @nid: NID to parse
  189. ;; @start_id: the pointer to store the start NID
  190. ;;
  191. ;; Parse the NID and store the start NID of its sub-nodes.
  192. ;; Returns the number of sub-nodes.
  193. ;;
  194. proc  snd_hda_get_sub_nodes stdcall, nid:dword;, start_id:dword  <- returned in upper word of eax
  195.     snd_hda_param_read  [nid], AC_PAR_NODE_COUNT
  196.  
  197.     cmp      eax, -1
  198.     jne      @f
  199.     inc      eax
  200.   @@:
  201.     and      eax, 0x7FFF7FFF
  202.  
  203.     ret
  204. endp
  205.  
  206. ;;
  207. ;; snd_hda_get_connections - get connection list
  208. ;; @codec: the HDA codec
  209. ;; @nid: NID to parse
  210. ;; @conn_list: connection list array
  211. ;; @max_conns: max. number of connections to store
  212. ;;
  213. ;; Parses the connection list of the given widget and stores the list
  214. ;; of NIDs.
  215. ;;
  216. ;; Returns the number of connections, or a negative error code.
  217. ;;
  218. proc  snd_hda_get_connections stdcall, nid:dword, conn_list:dword, max_conns:dword   ;Asper: Complete translation!
  219.     locals
  220.        parm          dd ?
  221.        conn_len      dd ?
  222.        conns         dd 0
  223.        shift         db 8
  224.        num_elements  dd 4
  225.        mask          dd 0x7F
  226.        wcaps         dd ?
  227.        prev_nid      dw 1 ;Asper: Hmm.. Probably ALSA bug that it isn't initialized. I suppose to init it with 1.
  228.     endl
  229.  
  230.     push     ebx ecx edx edi esi
  231.     mov      edi, [conn_list]
  232.     test     edi, edi
  233.     jz       .err_out
  234.     mov      ecx, [max_conns]
  235.     cmp      ecx, 0
  236.     jle      .err_out
  237.  
  238.  
  239.     stdcall  get_wcaps, [nid]
  240.     mov      ebx, eax
  241.     mov      [wcaps], eax
  242.     stdcall  get_wcaps_type, ebx
  243.     cmp      eax, AC_WID_VOL_KNB
  244.     je       .conn_list_ok
  245.     test     ebx, AC_WCAP_CONN_LIST
  246.     jnz      .conn_list_ok
  247.   if DEBUG
  248.     mov      esi, emsgConnListNotAvailable
  249.     call     SysMsgBoardStr
  250.     mov      eax, [nid]
  251.     stdcall fdword2str, 3
  252.     call     SysMsgBoardStr
  253.   end if
  254.     xor      eax, eax
  255.     dec      eax
  256.     jmp      .out
  257.   .conn_list_ok:
  258.  
  259.     snd_hda_param_read  [nid], AC_PAR_CONNLIST_LEN
  260.     mov      [parm], eax
  261.  
  262.     test     eax, AC_CLIST_LONG
  263.     jz       @f
  264.     ; long form
  265.     mov      [shift], 16
  266.     mov      [num_elements], 2
  267.     mov      [mask], 0x7FFF ;Asper+
  268.   @@:
  269.     and      eax, AC_CLIST_LENGTH
  270.     test     eax, eax
  271.     jz       .out ; no connection
  272.  
  273.     mov      [conn_len], eax
  274.     cmp      eax, 1
  275.     jne      .multi_conns
  276.     ; single connection
  277.     stdcall  snd_hda_codec_read, [nid], 0, AC_VERB_GET_CONNECT_LIST, 0
  278.     mov      [parm], eax
  279.     cmp      [parm], -1
  280.     jne      @f
  281.     cmp      [ctrl.rirb_error], 0
  282.     jne      @f
  283.     xor      eax, eax
  284.     dec      eax
  285.     jmp      .out
  286.   @@:
  287.  
  288.     mov      eax, [parm]
  289.     and      eax, [mask]
  290.     stosd
  291.     xor      eax, eax
  292.     inc      eax
  293.     jmp      .out
  294.   .multi_conns:
  295.  
  296.     ; multi connection
  297.     xor      ecx, ecx
  298.     mov      edx, [num_elements]
  299.   .next_conn:
  300.     mov      eax, ecx
  301.   .mod:
  302.     cmp      eax, edx
  303.     jl       .mod_counted
  304.     sub      eax, edx
  305.     jmp      .mod
  306.   .mod_counted:
  307.  
  308.     test     eax, eax
  309.     jnz      .l1
  310.     stdcall  snd_hda_codec_read, [nid], 0, AC_VERB_GET_CONNECT_LIST, ecx
  311.     mov      [parm], eax
  312.  
  313.     cmp      eax, -1
  314.     jne      .l1
  315.     cmp      [ctrl.rirb_error], 0
  316.     jne      .err_out
  317.   .l1:
  318.  
  319.     mov      eax, 1
  320.     push     ecx
  321.     mov      cl, [shift]
  322.     dec      cl
  323.     shl      eax, cl
  324.     and      eax, [parm]
  325.     pop      ecx
  326.     mov      ebx, eax  ;ranges
  327.  
  328.     mov      eax, [parm]
  329.     and      eax, [mask] ;val
  330.  
  331.     test     eax, eax
  332.     jnz      @f
  333.  if DEBUG
  334.     push     eax esi
  335.     mov      esi, emsgInvConnList
  336.     call     SysMsgBoardStr
  337.     mov      eax, [nid]
  338.     stdcall  fdword2str, 1
  339.     call     SysMsgBoardStr
  340.  
  341.     mov      esi, strSemicolon
  342.     call     SysMsgBoardStr
  343.     mov      eax, ecx
  344.     stdcall  fdword2str, 0
  345.     call     SysMsgBoardStr
  346.  
  347.     mov      esi, strSemicolon
  348.     call     SysMsgBoardStr
  349.     mov      eax, [parm]
  350.     stdcall  fdword2str, 2
  351.     call     SysMsgBoardStr
  352.     pop      esi eax
  353.  end if
  354.     xor      eax, eax
  355.     jmp      .out
  356.   @@:
  357.     push     ecx
  358.     mov      cl, [shift]
  359.     shr      [parm], cl
  360.     pop      ecx
  361.  
  362.     test     ebx, ebx
  363.     jz       .range_zero
  364.     ; ranges between the previous and this one
  365.     movzx    esi, word [prev_nid]
  366.     test     esi, esi
  367.     jz       .l2
  368.     cmp      esi, eax
  369.     jl       @f
  370.   .l2:
  371.  if DEBUG
  372.     push     eax esi
  373.     push     esi
  374.     mov      esi, emsgInvDepRangeVal
  375.     call     SysMsgBoardStr
  376.     pop      esi
  377.     push     eax
  378.     mov      eax, esi
  379.     stdcall  fdword2str, 0
  380.     call     SysMsgBoardStr
  381.  
  382.     mov      esi, strSemicolon
  383.     call     SysMsgBoardStr
  384.     pop      eax
  385.     stdcall  fdword2str, 2
  386.     call     SysMsgBoardStr
  387.     pop      esi eax
  388.  end if
  389.     jmp      .continue
  390.   @@:
  391.     push     ecx
  392.     mov      ecx, esi
  393.     inc      ecx
  394.     mov      ebx, [conns]
  395.   .next_conn2:
  396.     cmp      ebx, [max_conns]
  397.     jl       @f
  398.  if DEBUG
  399.     push     esi
  400.     mov      esi, emsgTooManyConns
  401.     call     SysMsgBoardStr
  402.     pop      esi
  403.  end if
  404.     pop      ecx
  405.     jmp      .err_out
  406.   @@:
  407.     shl      ebx, 1
  408.     push     edi
  409.     add      edi, ebx
  410.     mov      word [edi], cx
  411.     pop      edi
  412.     shr      ebx, 1
  413.     inc      ebx
  414.     inc      ecx
  415.     cmp      ecx, eax
  416.     jle      .next_conn2
  417.  
  418.     mov      [conns], ebx
  419.     pop      ecx
  420.     jmp      .end_range_test
  421.   .range_zero:
  422.  
  423.     mov      ebx, [conns]
  424.     cmp      ebx, [max_conns]
  425.     jl       @f
  426.  if DEBUG
  427.     push     esi
  428.     mov      esi, emsgTooManyConns
  429.     call     SysMsgBoardStr
  430.     pop      esi
  431.  end if
  432.     jmp      .err_out
  433.   @@:
  434.     shl      ebx, 1
  435.     push     edi
  436.     add      edi, ebx
  437.     mov      word [edi], ax
  438.     pop      edi
  439.     shr      ebx, 1
  440.     inc      ebx
  441.     mov      [conns], ebx
  442.   .end_range_test:
  443.     mov      [prev_nid], ax
  444.   .continue:
  445.     inc      ecx
  446.     cmp      ecx, [conn_len]
  447.     jl       .next_conn
  448.  
  449.      mov     eax, [conns]
  450.   .out:
  451.      pop     esi edi edx ecx ebx
  452.      ret
  453.   .err_out:
  454.      pop     esi edi edx ecx ebx
  455.      mov     eax, -1
  456.      ret
  457. endp
  458.  
  459.  
  460. ; Asper: Have to be realized later, when we will work with such events, but not NOW!
  461. ;proc  snd_hda_queue_unsol_events stdcall, res:dword, res_ex:dword
  462. ;    push     ebx  edi  esi
  463. ;    ...
  464. ;    pop      esi  edi  ebx
  465. ;    ret
  466. ;endp
  467.  
  468. ; This functions also will be later realized.
  469. ;proc  process_unsol_events stdcall, work:dword
  470. ;proc  init_usol_queue stdcall, bus:dword
  471.  
  472. ;;
  473. ;; snd_hda_bus_new - create a HDA bus
  474. ;; @card: the card entry
  475. ;; @temp: the template for hda_bus information
  476. ;; @busp: the pointer to store the created bus instance
  477. ;;
  478. ;; Returns 0 if successful, or a negative error code.
  479. ;;
  480. ;proc  snd_hda_bus_new
  481.     ; if we want to support unsolicited events, we have to solve this
  482.     ;    bus->workq = create_singlethread_workqueue(bus->workq_name);
  483.     ; (...)
  484. ;    xor   eax, eax
  485. ;    ret
  486. ;endp
  487.  
  488. ;;
  489. ;; snd_hda_codec_init - initialize a HDA codec
  490. ;;
  491. ;; Returns 0 if successful, or a negative error code.
  492. ;;
  493. proc  snd_hda_codec_init    ; We use just one codec (the first found)
  494.      snd_hda_param_read  AC_NODE_ROOT, AC_PAR_VENDOR_ID
  495.      cmp     eax, -1
  496.      jne     @f
  497.      snd_hda_param_read  AC_NODE_ROOT, AC_PAR_VENDOR_ID
  498.   @@:
  499.      mov     [codec.chip_id], ax
  500.      shr     eax, 16
  501.      mov     [codec.vendor_id], ax
  502.  
  503.      snd_hda_param_read  AC_NODE_ROOT, AC_PAR_SUBSYSTEM_ID
  504.      mov     [codec.subsystem_id], eax
  505.  
  506.      snd_hda_param_read  AC_NODE_ROOT, AC_PAR_REV_ID
  507.      mov     [codec.revision_id], eax
  508.  
  509.      stdcall setup_fg_nodes
  510.  
  511.      mov     eax, [codec.afg]
  512.      test    eax, eax
  513.      jnz     @f
  514.  
  515.      mov     eax, [codec.mfg]
  516.      test    eax, eax
  517.      jnz     @f
  518.   if DEBUG
  519.      push    esi
  520.      mov     esi, emsgNoAFGorMFGFound
  521.      call    SysMsgBoardStr
  522.      pop     esi
  523.   end  if
  524.      mov     eax, -1
  525.      ret
  526.   @@:
  527.  
  528.      mov     ebx, eax
  529.      push    ebx
  530.      stdcall read_widget_caps, eax
  531.  
  532.      cmp     eax, 0
  533.      jge     @f
  534.   if DEBUG
  535.      push    esi
  536.      mov     esi, emsgNoMem
  537.      call    SysMsgBoardStr
  538.      pop     esi
  539.   end  if
  540.      pop     ebx
  541.      mov     eax, -1
  542.      ret
  543.   @@:
  544.  
  545.      call read_pin_defaults
  546.  
  547.      cmp     eax, 0
  548.      jge     @f
  549.      pop     ebx
  550.      mov     eax, -1
  551.      ret
  552.   @@:
  553.      mov     eax, [codec.subsystem_id]
  554.      test    eax, eax
  555.      jnz     @f
  556.      stdcall snd_hda_codec_read, ebx, 0, AC_VERB_GET_SUBSYSTEM_ID, 0
  557.  
  558.   @@:
  559.  
  560.      ; power up all before initialization
  561.      stdcall snd_hda_set_power_state, ebx, AC_PWRST_D0
  562.  
  563.      pop     ebx
  564.      ret
  565. endp
  566.  
  567.  
  568. ;;
  569. ;; snd_hda_codec_configure - (Re-)configure the HD-audio codec
  570. ;;
  571. ;; Start parsing of the given codec tree and (re-)initialize the whole
  572. ;; patch instance.
  573. ;;
  574. ;; Returns 0 if successful or a negative error code.
  575. ;;
  576. proc  snd_hda_codec_configure
  577.      call    get_codec_name
  578.   @@:
  579.      ; call the default parser
  580.      stdcall snd_hda_parse_generic_codec  ;entry point to generic tree parser!!!
  581.  
  582.      test    eax, eax
  583.      jz      @f
  584.   if DEBUG
  585.      push    esi
  586.      mov     esi, emsgNoParserAvailable
  587.      call    SysMsgBoardStr
  588.      pop     esi
  589.   end if
  590.   @@:
  591.   .out:
  592.      ret
  593. endp
  594.  
  595.  
  596. ; get_codec_name - store the codec name
  597. proc  get_codec_name
  598.      push    eax  ebx  edi  esi
  599.      mov     eax, [codec.ac_vendor_ids]
  600.      test    eax, eax
  601.      jnz     .get_chip_name
  602.      mov     ax, [codec.vendor_id]
  603.      mov     edi, hda_vendor_ids
  604.  
  605.   @@:
  606.      mov     ebx, [edi]
  607.      test    ebx, ebx
  608.      jz      .unknown
  609.  
  610.      cmp     ax, bx
  611.      jne     .next
  612.      mov     eax, [edi+4]
  613.      mov     [codec.ac_vendor_ids], eax
  614.      mov     esi, eax
  615.      call    SysMsgBoardStr
  616.   .get_chip_name:
  617.      stdcall detect_chip, [edi+8]
  618.      pop     esi  edi  ebx  eax
  619.      ret
  620.   .next:
  621.      add     edi, 12
  622.      jmp     @b
  623.   .unknown:
  624.      mov     [codec.ac_vendor_ids], ac_unknown
  625.      mov     [codec.chip_ids], chip_unknown
  626.  
  627.      mov     esi, chip_unknown
  628.      call    SysMsgBoardStr
  629.      movzx   eax, [codec.chip_id]
  630.      stdcall fdword2str, 2
  631.      call    SysMsgBoardStr
  632.      pop     esi  edi  ebx  eax
  633.      ret
  634. endp
  635.  
  636.  
  637. align 4
  638. proc detect_chip stdcall, chip_tab:dword
  639.  
  640.      push    eax  ebx  edi  esi
  641.      mov     ax, [codec.chip_id]
  642.  
  643.      mov     edi, [chip_tab]
  644. @@:
  645.      mov     ebx, [edi]
  646.      cmp     ebx, 0xFF
  647.      je      .unknown
  648.  
  649.      cmp     ax, bx
  650.      jne     .next
  651.      mov     eax, [edi+4]
  652.      mov     [codec.chip_ids], eax
  653.      mov     esi, eax
  654.      call    SysMsgBoardStr
  655.      pop     esi  edi  ebx  eax
  656.      ret
  657. .next:
  658.      add     edi, 8
  659.      jmp     @b
  660. .unknown:
  661.      mov     [codec.chip_ids], chip_unknown
  662.      mov     esi, chip_unknown
  663.      call    SysMsgBoardStr
  664.      movzx   eax, [codec.chip_id]
  665.      stdcall fdword2str, 2
  666.      call    SysMsgBoardStr
  667.      pop     esi  edi  ebx  eax
  668.      ret
  669. endp
  670.  
  671.  
  672. ;; look for an AFG and MFG nodes
  673. proc setup_fg_nodes
  674.      push    eax  ebx  ecx
  675.      stdcall snd_hda_get_sub_nodes, AC_NODE_ROOT
  676.      mov     ecx, eax
  677.      and     ecx, 0x7FFF ; total_nodes
  678.      mov     ebx, eax
  679.      shr     ebx, 16
  680.      and     ebx, 0x7FFF ; nid
  681.  
  682. if DEBUG    ;YAHOO
  683.      push    eax esi
  684.      mov     esi, msgSETUP_FG_NODES
  685.      call    SysMsgBoardStr
  686.      mov     eax, ebx
  687.      stdcall fdword2str, 1
  688.      call    SysMsgBoardStr
  689.  
  690.      mov     esi, strSemicolon
  691.      call    SysMsgBoardStr
  692.      mov     eax, ecx
  693.      stdcall fdword2str, 3
  694.      call    SysMsgBoardStr
  695.      pop     esi eax
  696. end if
  697.  
  698.   .next:
  699.      test    ecx, ecx
  700.      jz      .l1
  701.      snd_hda_param_read  ebx, AC_PAR_FUNCTION_TYPE
  702.      and     eax, 0xFF
  703.  
  704. if DEBUG    ;YAHOO
  705.      push    eax esi
  706.      mov     esi, msgFG_TYPE
  707.      call    SysMsgBoardStr
  708.      stdcall fdword2str, 3
  709.      call    SysMsgBoardStr
  710.      pop     esi eax
  711. end if
  712.  
  713.      cmp     eax, AC_GRP_AUDIO_FUNCTION
  714.      jne     @f
  715.  
  716.      mov     [codec.afg], ebx
  717.      mov     [codec.function_id], eax
  718.      jmp     .continue
  719.   @@:
  720.      cmp     eax, AC_GRP_MODEM_FUNCTION
  721.      jne     @f
  722.  
  723.      mov     [codec.mfg], ebx
  724.      mov     [codec.function_id], eax
  725.      jmp     .continue
  726.   @@:
  727.   .continue:
  728.      inc     ebx
  729.      dec     ecx
  730.      jnz     .next
  731.   .l1:
  732.      pop     ecx  ebx  eax
  733.      ret
  734. endp
  735.  
  736.  
  737. ;======================================================================================
  738. ; read widget caps for each widget and store in cache
  739. proc  read_widget_caps stdcall, fg_node:dword
  740.      push    ebx ecx edx edi
  741.  
  742.      stdcall snd_hda_get_sub_nodes, [fg_node]
  743.      mov     ecx, eax
  744.      and     ecx, 0x7FFF ; total_nodes
  745.      mov     [codec.num_nodes], cx
  746.      mov     ebx, eax
  747.      shr     ebx, 16
  748.      and     ebx, 0x7FFF ; nid
  749.      mov     [codec.start_nid], bx
  750.  
  751. if DEBUG    ;YAHOO
  752.      push    eax esi
  753.      mov     esi, msgSETUP_FG_NODES
  754.      call    SysMsgBoardStr
  755.      mov     eax, ebx
  756.      stdcall fdword2str, 1
  757.      call    SysMsgBoardStr
  758.  
  759.      mov     esi, strSemicolon
  760.      call    SysMsgBoardStr
  761.      mov     eax, ecx
  762.      stdcall fdword2str, 3
  763.      call    SysMsgBoardStr
  764.      pop     esi eax
  765. end if
  766.  
  767. if FDEBUG    ;YAHOO
  768.      push    esi
  769.      mov     esi, msgWCaps
  770.      call    SysMsgBoardStr
  771.      pop     esi
  772. end if
  773.  
  774.      mov     eax, ecx
  775.      shl     eax, 2
  776.      push    ebx ecx
  777.      call    Kmalloc
  778.      pop     ecx ebx
  779.      test    eax, eax
  780.      jz      .err_out
  781.      mov     [codec.wcaps], eax
  782.  
  783.      mov     edi, eax
  784.   .next_node:
  785.  
  786.      snd_hda_param_read  ebx, AC_PAR_AUDIO_WIDGET_CAP
  787.      stosd
  788.      inc     ebx
  789.      dec     ecx
  790.      jnz     .next_node
  791.      pop     edi edx ecx ebx
  792.      xor     eax, eax
  793.      ret
  794.   .err_out:
  795.      pop     edi edx ecx ebx
  796.      xor     eax, eax
  797.      dec     eax
  798.      ret
  799. endp
  800.  
  801.  
  802. ; read all pin default configurations and save codec->init_pins
  803. proc  read_pin_defaults
  804.      push    ebx ecx edx edi
  805.  
  806.      movzx   ebx, [codec.start_nid]
  807.      movzx   ecx, [codec.num_nodes]
  808.  
  809.      ;Asper [
  810.      mov     eax, HDA_PINCFG.sizeof
  811.      mul     cl
  812.      push    ebx ecx
  813.      call    Kmalloc
  814.      pop     ecx ebx
  815.      test    eax, eax
  816.      jz      .err_out
  817.      mov     [codec.init_pins], eax
  818.      mov     edi, eax
  819.      ;Asper ]
  820.  
  821. if FDEBUG
  822.    push   eax esi
  823.    mov    esi, msgPinCfgs
  824.    call   SysMsgBoardStr
  825.    pop    esi eax
  826. end if
  827.  
  828.  
  829.   .next_node:
  830.      stdcall get_wcaps, ebx
  831.      and  eax, AC_WCAP_TYPE
  832.      shr  eax, AC_WCAP_TYPE_SHIFT
  833.  
  834.      cmp     eax, AC_WID_PIN
  835.      jne     .continue
  836.  
  837.      mov     [edi + HDA_PINCFG.nid], bx
  838.      stdcall snd_hda_codec_read, ebx, 0, AC_VERB_GET_CONFIG_DEFAULT, 0
  839.      mov     [edi + HDA_PINCFG.cfg], eax
  840.  
  841.   .continue:
  842.      add     edi, HDA_PINCFG.sizeof
  843.      inc     ebx
  844.      dec     ecx
  845.      jnz     .next_node
  846.  
  847. ;Asper [
  848.      and     ebx, 0xFFFF
  849.      sub     bx, [codec.start_nid]
  850.      mov     [codec.num_pins], ebx
  851. ;Asper ]
  852.  
  853.      pop     edi edx ecx ebx
  854.      xor     eax, eax
  855.      ret
  856.   .err_out:
  857.      pop     edi edx ecx ebx
  858.      xor     eax, eax
  859.      dec     eax
  860.      ret
  861. endp
  862.  
  863.  
  864.  
  865. ; look up the given pin config list and return the item matching with NID
  866. proc  look_up_pincfg stdcall, array:dword, nid:dword
  867.      push    ebx ecx edx
  868.      mov     ecx, [codec.num_pins]
  869.      mov     eax, [array]
  870.      mov     ebx, [nid]
  871.   .next_pin:
  872.      mov     dx,  [eax + HDA_PINCFG.nid]
  873.      cmp     dx,  bx
  874.      je      .out
  875.   .continue:
  876.      add     eax, HDA_PINCFG.sizeof
  877.      dec     ecx
  878.      jnz     .next_pin
  879.  
  880.      xor     eax, eax
  881.   .out:
  882.      pop     edx ecx ebx
  883.      ret
  884. endp
  885.  
  886. ; write a config value for the given NID
  887. proc  set_pincfg stdcall, nid:dword, cfg:dword
  888.      push    eax  ebx  ecx  edx
  889.      mov     eax, [cfg]
  890.      xor     ebx, ebx
  891.      mov     edx, AC_VERB_SET_CONFIG_DEFAULT_BYTES_0
  892.      mov     ecx, 4
  893.   @@:
  894.      mov     bl,  al
  895.      stdcall snd_hda_codec_write, [nid], 0, edx, ebx
  896.      shr     eax, 8
  897.      inc     edx
  898.      dec     ecx
  899.      jnz     @b
  900.   .l1:
  901.      pop     edx  ecx  ebx  eax
  902.      ret
  903. endp
  904.  
  905.  
  906. ;;
  907. ;; snd_hda_codec_get_pincfg - Obtain a pin-default configuration
  908. ;; @codec: the HDA codec
  909. ;; @nid: NID to get the pin config
  910. ;;
  911. ;; Get the current pin config value of the given pin NID.
  912. ;; If the pincfg value is cached or overridden via sysfs or driver,
  913. ;; returns the cached value.
  914. ;;
  915. proc  snd_hda_codec_get_pincfg stdcall, nid:dword
  916.      push    edi
  917.      stdcall look_up_pincfg, [codec.init_pins], [nid]
  918.      test    eax, eax
  919.      jz      @f
  920.      mov     edi, eax
  921.      mov     eax, [edi + HDA_PINCFG.cfg]
  922.   @@:
  923.      pop     edi
  924.      ret
  925. endp
  926.  
  927. ;======================================================================================
  928.  
  929. ;;
  930. ;; snd_hda_codec_setup_stream - set up the codec for streaming
  931. ;; @nid: the NID to set up
  932. ;; @stream_tag: stream tag to pass, it's between 0x1 and 0xf.
  933. ;; @channel_id: channel id to pass, zero based.
  934. ;; @format: stream format.
  935. ;;
  936. proc hda_codec_setup_stream stdcall, nid:dword, stream_tag:dword, channel_id:dword, format:dword
  937.      push    eax
  938.      mov     eax, [nid]
  939.      test    eax, eax
  940.      jnz     @f
  941.      pop     eax
  942.      ret
  943.   @@:
  944.   if DEBUG
  945.      push    esi
  946.      mov     esi, msgHDACodecSetupStream
  947.      call    SysMsgBoardStr
  948.      stdcall fdword2str, 3
  949.      call    SysMsgBoardStr
  950.  
  951.      mov     esi, msgStream
  952.      call    SysMsgBoardStr
  953.      mov     eax, [stream_tag]
  954.      stdcall fdword2str, 3
  955.      call    SysMsgBoardStr
  956.  
  957.      mov     esi, msgChannel
  958.      call    SysMsgBoardStr
  959.      mov     eax, [channel_id]
  960.      stdcall fdword2str, 3
  961.      call    SysMsgBoardStr
  962.  
  963.      mov     esi, msgFormat
  964.      call    SysMsgBoardStr
  965.      mov     eax, [format]
  966.      stdcall fdword2str, 3
  967.      call    SysMsgBoardStr
  968.      pop     esi
  969.   end if
  970.      mov     eax, [stream_tag]
  971.      shl     eax, 4
  972.      or      eax, [channel_id]
  973.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_CHANNEL_STREAMID, eax
  974.  
  975.      mov     eax, 1000  ; wait 1 ms
  976.      call    StallExec
  977.  
  978.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_STREAM_FORMAT, [format]
  979.      pop     eax
  980.      ret
  981. endp
  982.  
  983.  
  984. proc snd_hda_codec_cleanup_stream stdcall, nid:dword
  985.      push    eax
  986.      mov     eax, [nid]
  987.      test    eax, eax
  988.      jz      @f
  989.      pop     eax
  990.      ret
  991.   @@:
  992.   if DEBUG
  993.      push    esi
  994.      mov     esi, msgHDACodecCleanupStream
  995.      call    SysMsgBoardStr
  996.      stdcall fdword2str, 3
  997.      call    SysMsgBoardStr
  998.      pop     esi
  999.   end if
  1000.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_CHANNEL_STREAMID, 0
  1001.   if 0  ; keep the format
  1002.      mov     eax, 1000000  ; wait 100 ms
  1003.      call    StallExec
  1004.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_STREAM_FORMAT, 0
  1005.   end if
  1006.      pop     eax
  1007.      ret
  1008. endp
  1009.  
  1010.  
  1011. proc  read_pin_cap, nid:dword
  1012.      snd_hda_param_read  [nid], AC_PAR_PIN_CAP
  1013.      ret
  1014. endp
  1015.  
  1016.  
  1017. ;; read the current volume
  1018. proc get_volume_mute stdcall, nid:dword, ch:dword, direction:dword, index:dword
  1019.      push    ebx
  1020.      mov     ebx, AC_AMP_GET_LEFT
  1021.      mov     eax, [ch]
  1022.      test    eax, eax
  1023.      jz      @f
  1024.      mov     ebx, AC_AMP_GET_RIGHT
  1025.   @@:
  1026.      mov     eax, [direction]
  1027.      cmp     eax, HDA_OUTPUT
  1028.      jne     @f
  1029.      or      ebx, AC_AMP_GET_OUTPUT
  1030.      jmp     .l1
  1031.   @@:
  1032.      or      ebx, AC_AMP_GET_INPUT
  1033.   .l1:
  1034.      or      ebx, [index]
  1035.      stdcall snd_hda_codec_read, [nid], 0, AC_VERB_GET_AMP_GAIN_MUTE, ebx
  1036.      and     eax, 0xFF
  1037.      pop     ebx
  1038.      ret
  1039. endp
  1040.  
  1041.  
  1042. ;; write the current volume in info to the h/w
  1043. proc put_volume_mute stdcall, nid:dword, ch:dword, direction:dword, index:dword, val:dword
  1044.      push    eax  ebx
  1045.      mov     ebx, AC_AMP_SET_LEFT
  1046.      mov     eax, [ch]
  1047.      test    eax, eax
  1048.      jz      @f
  1049.      mov     ebx, AC_AMP_SET_RIGHT
  1050.   @@:
  1051.      mov     eax, [direction]
  1052.      cmp     eax, HDA_OUTPUT
  1053.      jne     @f
  1054.      or      ebx, AC_AMP_SET_OUTPUT
  1055.      jmp     .l1
  1056.   @@:
  1057.      or      ebx, AC_AMP_SET_INPUT
  1058.   .l1:
  1059.      mov     eax, [index]
  1060.      shl     eax, AC_AMP_SET_INDEX_SHIFT
  1061.      or      ebx, eax
  1062.      or      ebx, [val]
  1063.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_AMP_GAIN_MUTE, ebx
  1064.      pop     ebx  eax
  1065.      ret
  1066. endp
  1067.  
  1068.  
  1069. ;;
  1070. ;; snd_hda_codec_amp_update - update the AMP value
  1071. ;; @nid: NID to read the AMP value
  1072. ;; @ch: channel (left=0 or right=1)
  1073. ;; @direction: #HDA_INPUT or #HDA_OUTPUT
  1074. ;; @idx: the index value (only for input direction)
  1075. ;; @mask: bit mask to set
  1076. ;; @val: the bits value to set
  1077. ;;
  1078. ;; Update the AMP value with a bit mask.
  1079. ;; Returns 0 if the value is unchanged, 1 if changed.
  1080. ;;
  1081. ;-proc snd_hda_codec_amp_update stdcall, nid:dword, ch:dword, direction:dword, idx:dword, mask:dword, val:dword
  1082. ;-     push    ebx  edx
  1083. ;-     mov     eax, [mask]
  1084. ;-     mov     ebx, [val]
  1085. ;-     and     ebx, eax
  1086. ;-     xor     eax, -1
  1087. ;-     mov     edx, eax
  1088. ;-     stdcall get_volume_mute, [nid], [ch], [direction], [idx]
  1089. ;-     and     eax, edx
  1090. ;-     or      ebx, eax
  1091. ;-
  1092. ;-     stdcall put_volume_mute, [nid], [ch], [direction], [idx], ebx
  1093. ;-     xor     eax, eax
  1094. ;-     inc     eax
  1095. ;-     pop     edx  ebx
  1096. ;-     ret
  1097. ;-endp
  1098.  
  1099.  
  1100. ;;
  1101. ;; snd_hda_codec_amp_stereo - update the AMP stereo values
  1102. ;; @nid: NID to read the AMP value
  1103. ;; @direction: #HDA_INPUT or #HDA_OUTPUT
  1104. ;; @idx: the index value (only for input direction)
  1105. ;; @mask: bit mask to set
  1106. ;; @val: the bits value to set
  1107. ;;
  1108. ;; Update the AMP values like snd_hda_codec_amp_update(), but for a
  1109. ;; stereo widget with the same mask and value.
  1110. ;;
  1111. proc snd_hda_codec_amp_stereo stdcall, nid:dword, direction:dword, idx:dword, mask:dword, val:dword
  1112.      push    ebx edx
  1113.      mov     ebx, [val]
  1114.      mov     edx, [mask]
  1115.      and     ebx, edx
  1116.      stdcall put_volume_mute, [nid], 0, [direction], [idx], ebx
  1117.      stdcall put_volume_mute, [nid], 1, [direction], [idx], ebx
  1118.      pop     edx  ebx
  1119.      ret
  1120. endp
  1121.  
  1122.  
  1123. ;; set power state of the codec
  1124. proc snd_hda_set_power_state stdcall, fg:dword, power_state:dword
  1125.      push    eax ebx ecx edx
  1126.      ; this delay seems necessary to avoid click noise at power down
  1127.      mov     ebx, [power_state]
  1128.      cmp     ebx, AC_PWRST_D3
  1129.      jne     @f
  1130.      mov     eax, 100000
  1131.      call    StallExec
  1132.   @@:
  1133.      stdcall snd_hda_codec_read, [fg], 0, AC_VERB_SET_POWER_STATE, ebx
  1134.      ;partial workaround for "azx_get_response timeout"
  1135.      cmp     ebx, AC_PWRST_D0
  1136.      jne     @f
  1137.  
  1138.      mov     dx, [codec.vendor_id]
  1139.      cmp     dx, 0x14F1
  1140.  
  1141.      jne     @f
  1142.      mov     eax, 10000
  1143.      call    StallExec
  1144.   @@:
  1145.      movzx   ecx, [codec.num_nodes]
  1146.      movzx   edx, [codec.start_nid]
  1147.   .next_nid:
  1148.      stdcall get_wcaps, edx
  1149.      test    eax, AC_WCAP_POWER
  1150.      jz      .skip_nid
  1151.  
  1152.      stdcall get_wcaps_type, eax
  1153.      cmp     ebx, AC_PWRST_D3
  1154.      jne     .l1
  1155.      cmp     eax, AC_WID_PIN
  1156.      jne     .l1
  1157.      ;don't power down the widget if it controls
  1158.      ;eapd and EAPD_BTLENABLE is set.
  1159.      stdcall  read_pin_cap, edx
  1160.      test    eax, AC_PINCAP_EAPD
  1161.      jz      .l2
  1162.  
  1163.      stdcall snd_hda_codec_read, edx, 0, AC_VERB_GET_EAPD_BTLENABLE, 0
  1164.      and     eax, 0x02
  1165.      test    eax, eax
  1166.      jnz     .skip_nid
  1167.   .l2:
  1168.   .l1:
  1169.      stdcall snd_hda_codec_write, edx, 0, AC_VERB_SET_POWER_STATE, ebx
  1170.   .skip_nid:
  1171.      inc     edx
  1172.      dec     ecx
  1173.      jnz     .next_nid
  1174.  
  1175.      cmp     ebx, AC_PWRST_D0
  1176.      jne     .out
  1177.      ;wait until codec reaches to D0
  1178.      mov     ecx, 500
  1179.   .wait_D0:
  1180.      stdcall snd_hda_codec_read, [fg], 0, AC_VERB_GET_POWER_STATE, 0
  1181.      cmp     eax, ebx
  1182.      je      .out
  1183.      mov     eax, 1000  ; msleep(1);
  1184.      call    StallExec
  1185.      dec     ecx
  1186.      jnz     .wait_D0
  1187.   .out:
  1188.      pop     edx ecx ebx eax
  1189.      ret
  1190. endp
  1191.  
  1192.  
  1193. ;data
  1194.  
  1195. ; codec vendors
  1196. align 16
  1197. msg_Cirrus           db 'Cirrus Logic ',0
  1198. msg_Motorola         db 'Motorola ',0
  1199. msg_SiliconImage     db 'Silicon Image ',0
  1200. msg_Realtek          db 'Realtek ',0
  1201. msg_Creative         db 'Creative ',0
  1202. msg_IDT              db 'IDT ',0
  1203. msg_LSI              db 'LSI ',0
  1204. msg_AnalogDevices    db 'Analog Devices ',0
  1205. msg_CMedia           db 'C-Media ',0
  1206. msg_Conexant         db 'Conexant ',0
  1207. msg_Chrontel         db 'Chrontel ',0
  1208. msg_LG               db 'LG ',0
  1209. msg_Wolfson          db 'Wolfson Microelectronics ',0
  1210. msg_Qumranet         db 'Qumranet ',0
  1211. msg_SigmaTel         db 'SigmaTel ',0
  1212. ac_unknown     db 'unknown manufacturer ',0
  1213.  
  1214. chip_unknown   db 'unknown codec id ', 0
  1215.  
  1216.  
  1217. ; codec vendor labels
  1218. align 4
  1219. hda_vendor_ids:
  1220.      dd    0x1002, msg_ATI, chips_ATI
  1221.      dd    0x1013, msg_Cirrus, chips_Cirrus
  1222.      dd    0x1057, msg_Motorola, chips_Motorola
  1223.      dd    0x1095, msg_SiliconImage, chips_SiliconImage
  1224.      dd    0x10de, msg_NVidia, chips_NVidia
  1225.      dd    0x10ec, msg_Realtek, chips_Realtek
  1226.      dd    0x1102, msg_Creative, chips_Creative
  1227.      dd    0x1106, msg_VIA, chips_VIA
  1228.      dd    0x111d, msg_IDT, chips_IDT
  1229.      dd    0x11c1, msg_LSI, chips_LSI
  1230.      dd    0x11d4, msg_AnalogDevices, chips_Analog
  1231.      dd    0x13f6, msg_CMedia, chips_CMedia
  1232.      dd    0x14f1, msg_Conexant, chips_Conexant
  1233.      dd    0x17e8, msg_Chrontel, chips_Chrontel
  1234.      dd    0x1854, msg_LG, chips_LG
  1235.      dd    0x1aec, msg_Wolfson, chips_Wolfson
  1236.      dd    0x1af4, msg_Qumranet, chips_Qumranet   ; Qemu 0.14
  1237.      dd    0x434d, msg_CMedia, chips_CMedia
  1238.      dd    0x8086, msg_Intel, chips_Intel
  1239.      dd    0x8384, msg_SigmaTel, chips_SigmaTel
  1240.      dd    0 ; terminator
  1241.  
  1242. align 16             ;known codecs
  1243. chips_ATI            dd 0xAA01, chip_ATIR6XX
  1244.                      dd 0xFF
  1245.  
  1246. chips_Cirrus         dd 0xFF
  1247. chips_Motorola       dd 0xFF
  1248.  
  1249. chips_SiliconImage   dd 0x1392, chip_SI1392
  1250.                      dd 0xFF
  1251.  
  1252. chips_NVidia         dd 0x0002, chip_MCP78
  1253.                      dd 0xFF
  1254.  
  1255. chips_Realtek        dd 0x0262, chip_ALC262
  1256.                      dd 0x0268, chip_ALC268
  1257.                      dd 0x0269, chip_ALC269
  1258.                      dd 0x0272, chip_ALC272
  1259.                      dd 0x0662, chip_ALC662
  1260.                      dd 0x0663, chip_ALC663
  1261.                      dd 0x0883, chip_ALC883
  1262.                      dd 0x0887, chip_ALC887
  1263.                      dd 0x0888, chip_ALC888
  1264.                      dd 0x0889, chip_ALC889
  1265.                      dd 0xFF
  1266.  
  1267. chips_Creative       dd 0xFF
  1268.  
  1269. chips_VIA            dd 0xE721, chip_VT1708B_1
  1270.                      dd 0x0397, chip_VT17085_0
  1271.                      dd 0xFF
  1272.  
  1273. chips_IDT            dd 0xFF
  1274.  
  1275. chips_LSI            dd 0x1039, chip_LSI1039
  1276.                  dd 0x1040, chip_LSI1040
  1277.                  dd 0x3026, chip_LSI3026
  1278.                  dd 0x3055, chip_LSI3055
  1279.                  dd 0xFF
  1280.  
  1281. chips_Analog         dd 0x1986, chip_AD1986A
  1282.                      dd 0x198B, chip_AD198B
  1283.                      dd 0xFF
  1284.  
  1285. chips_CMedia         dd 0xFF
  1286.  
  1287. chips_Conexant       dd 0x5045, chip_CX20549
  1288.                      dd 0x5051, chip_CX20561
  1289.                      dd 0xFF
  1290.  
  1291. chips_Chrontel       dd 0xFF
  1292. chips_LG             dd 0xFF
  1293. chips_Wolfson        dd 0xFF
  1294. chips_Intel          dd 0xFF
  1295.  
  1296. chips_Qumranet       dd 0x0010, chip_HDA_OUTPUT
  1297.                      dd 0x0020, chip_HDA_DUPLEX
  1298.                      dd 0xFF
  1299.  
  1300. chips_SigmaTel       dd 0x7680, chip_STAC9221
  1301.                      dd 0x7682, chip_STAC9221_A2
  1302.                      dd 0xFF
  1303.  
  1304. align 16
  1305. ;AnalogDevices
  1306. chip_AD1986A         db 'AD1986A',13,10,0
  1307. chip_AD198B          db 'AD198B',13,10,0
  1308.  
  1309. ;ATI
  1310. chip_ATIR6XX         db 'ATIR6XX',13,10,0
  1311.  
  1312. ;Silicon Image
  1313. chip_SI1392          db 'SI1392',13,10,0
  1314.  
  1315. ;NVidia
  1316. chip_MCP78           db 'MCP78',13,10,0
  1317.  
  1318. ;Realtek
  1319. chip_ALC262          db 'ALC262',13,10,0
  1320. chip_ALC268          db 'ALC268',13,10,0
  1321. chip_ALC269          db 'ALC269',13,10,0
  1322. chip_ALC272          db 'ALC272',13,10,0
  1323. chip_ALC662          db 'ALC662',13,10,0
  1324. chip_ALC663          db 'ALC663',13,10,0
  1325. chip_ALC883          db 'ALC883',13,10,0
  1326. chip_ALC887          db 'ALC887',13,10,0
  1327. chip_ALC888          db 'ALC888',13,10,0
  1328. chip_ALC889          db 'ALC889',13,10,0
  1329.  
  1330. ;Sigmatel
  1331. chip_STAC9221        db 'STAC9221',13,10,0
  1332. chip_STAC9221_A2     db 'STAC9221_A2',13,10,0
  1333.  
  1334. ;VIA
  1335. chip_VT1708B_1       db 'VT1708B_1',13,10,0
  1336. chip_VT17085_0       db 'VT17085_0',13,10,0
  1337.  
  1338. ;Conexant
  1339. chip_CX20549         db 'CX20549',13,10,0
  1340. chip_CX20561         db 'CX20561',13,10,0
  1341.  
  1342. ;Qumranet
  1343. chip_HDA_OUTPUT      db 'HDA-OUTPUT',13,10,0
  1344. chip_HDA_DUPLEX      db 'HDA-DUPLEX',13,10,0
  1345.  
  1346. ;LSI
  1347. chip_LSI1039         db '1039 (Agere Systems HDA Modem)',13,10,0
  1348. chip_LSI1040         db '1040 (Agere Systems HDA Modem)',13,10,0
  1349. chip_LSI3026         db '3026 (Agere Systems HDA Modem)',13,10,0
  1350. chip_LSI3055         db '3055 (Agere Systems HDA Modem)',13,10,0