Subversion Repositories Kolibri OS

Rev

Rev 4321 | Rev 4555 | 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.      ;Asper+: try to use another codec if possible [
  516.   if DEBUG
  517.      push    esi
  518.      mov     esi, msgNoAFGFound
  519.      call    SysMsgBoardStr
  520.      pop     esi
  521.   end  if
  522.      push    ecx
  523.      inc     eax
  524.      mov     ecx, [codec.addr]
  525.      shl     eax, cl
  526.      pop     ecx
  527.      cmp     eax, [ctrl.codec_mask]
  528.      jl      .skip_codec
  529.      ;Asper+]
  530.  
  531.      mov     eax, [codec.mfg]
  532.      test    eax, eax
  533.      jnz     @f
  534.   if DEBUG
  535.      push    esi
  536.      mov     esi, emsgNoAFGorMFGFound
  537.      call    SysMsgBoardStr
  538.      pop     esi
  539.   end  if
  540.   .skip_codec:
  541.      mov     eax, -1
  542.      ret
  543.   @@:
  544.  
  545.      mov     ebx, eax
  546.      push    ebx
  547.      stdcall read_widget_caps, eax
  548.  
  549.      cmp     eax, 0
  550.      jge     @f
  551.   if DEBUG
  552.      push    esi
  553.      mov     esi, emsgNoMem
  554.      call    SysMsgBoardStr
  555.      pop     esi
  556.   end  if
  557.      pop     ebx
  558.      mov     eax, -1
  559.      ret
  560.   @@:
  561.  
  562.      call read_pin_defaults
  563.  
  564.      cmp     eax, 0
  565.      jge     @f
  566.      pop     ebx
  567.      mov     eax, -1
  568.      ret
  569.   @@:
  570.      mov     eax, [codec.subsystem_id]
  571.      test    eax, eax
  572.      jnz     @f
  573.      stdcall snd_hda_codec_read, ebx, 0, AC_VERB_GET_SUBSYSTEM_ID, 0
  574.  
  575.   @@:
  576.  
  577.      ; power up all before initialization
  578.      stdcall snd_hda_set_power_state, ebx, AC_PWRST_D0
  579.  
  580.      xor     eax, eax
  581.      pop     ebx
  582.      ret
  583. endp
  584.  
  585.  
  586. ;;
  587. ;; snd_hda_codec_configure - (Re-)configure the HD-audio codec
  588. ;;
  589. ;; Start parsing of the given codec tree and (re-)initialize the whole
  590. ;; patch instance.
  591. ;;
  592. ;; Returns 0 if successful or a negative error code.
  593. ;;
  594. proc  snd_hda_codec_configure
  595.      call    get_codec_name
  596.   @@:
  597.      ; call the default parser
  598.      stdcall snd_hda_parse_generic_codec  ;entry point to generic tree parser!!!
  599.  
  600.      test    eax, eax
  601.      jz      @f
  602.   if DEBUG
  603.      push    esi
  604.      mov     esi, emsgNoParserAvailable
  605.      call    SysMsgBoardStr
  606.      pop     esi
  607.   end if
  608.   @@:
  609.   .out:
  610.      ret
  611. endp
  612.  
  613.  
  614. ; get_codec_name - store the codec name
  615. proc  get_codec_name
  616.      push    eax  ebx  edi  esi
  617.      mov     eax, [codec.ac_vendor_ids]
  618.      test    eax, eax
  619.      jnz     .get_chip_name
  620.      mov     ax, [codec.vendor_id]
  621.      mov     edi, hda_vendor_ids
  622.  
  623.   @@:
  624.      mov     ebx, [edi]
  625.      test    ebx, ebx
  626.      jz      .unknown
  627.  
  628.      cmp     ax, bx
  629.      jne     .next
  630.      mov     eax, [edi+4]
  631.      mov     [codec.ac_vendor_ids], eax
  632.      mov     esi, eax
  633.      call    SysMsgBoardStr
  634.   .get_chip_name:
  635.      stdcall detect_chip, [edi+8]
  636.      pop     esi  edi  ebx  eax
  637.      ret
  638.   .next:
  639.      add     edi, 12
  640.      jmp     @b
  641.   .unknown:
  642.      mov     [codec.ac_vendor_ids], ac_unknown
  643.      mov     [codec.chip_ids], chip_unknown
  644.  
  645.      mov     esi, chip_unknown
  646.      call    SysMsgBoardStr
  647.      movzx   eax, [codec.chip_id]
  648.      stdcall fdword2str, 2
  649.      call    SysMsgBoardStr
  650.      pop     esi  edi  ebx  eax
  651.      ret
  652. endp
  653.  
  654.  
  655. align 4
  656. proc detect_chip stdcall, chip_tab:dword
  657.  
  658.      push    eax  ebx  edi  esi
  659.      mov     ax, [codec.chip_id]
  660.  
  661.      mov     edi, [chip_tab]
  662. @@:
  663.      mov     ebx, [edi]
  664.      cmp     ebx, 0xFF
  665.      je      .unknown
  666.  
  667.      cmp     ax, bx
  668.      jne     .next
  669.      mov     eax, [edi+4]
  670.      mov     [codec.chip_ids], eax
  671.      mov     esi, eax
  672.      call    SysMsgBoardStr
  673.      pop     esi  edi  ebx  eax
  674.      ret
  675. .next:
  676.      add     edi, 8
  677.      jmp     @b
  678. .unknown:
  679.      mov     [codec.chip_ids], chip_unknown
  680.      mov     esi, chip_unknown
  681.      call    SysMsgBoardStr
  682.      movzx   eax, [codec.chip_id]
  683.      stdcall fdword2str, 2
  684.      call    SysMsgBoardStr
  685.      pop     esi  edi  ebx  eax
  686.      ret
  687. endp
  688.  
  689.  
  690. ;; look for an AFG and MFG nodes
  691. proc setup_fg_nodes
  692.      push    eax  ebx  ecx
  693.      stdcall snd_hda_get_sub_nodes, AC_NODE_ROOT
  694.      mov     ecx, eax
  695.      and     ecx, 0x7FFF ; total_nodes
  696.      mov     ebx, eax
  697.      shr     ebx, 16
  698.      and     ebx, 0x7FFF ; nid
  699.  
  700. if DEBUG    ;YAHOO
  701.      push    eax esi
  702.      mov     esi, msgSETUP_FG_NODES
  703.      call    SysMsgBoardStr
  704.      mov     eax, ebx
  705.      stdcall fdword2str, 1
  706.      call    SysMsgBoardStr
  707.  
  708.      mov     esi, strSemicolon
  709.      call    SysMsgBoardStr
  710.      mov     eax, ecx
  711.      stdcall fdword2str, 3
  712.      call    SysMsgBoardStr
  713.      pop     esi eax
  714. end if
  715.  
  716.   .next:
  717.      test    ecx, ecx
  718.      jz      .l1
  719.      snd_hda_param_read  ebx, AC_PAR_FUNCTION_TYPE
  720.      and     eax, 0xFF
  721.  
  722. if DEBUG    ;YAHOO
  723.      push    eax esi
  724.      mov     esi, msgFG_TYPE
  725.      call    SysMsgBoardStr
  726.      stdcall fdword2str, 3
  727.      call    SysMsgBoardStr
  728.      pop     esi eax
  729. end if
  730.  
  731.      cmp     eax, AC_GRP_AUDIO_FUNCTION
  732.      jne     @f
  733.  
  734.      mov     [codec.afg], ebx
  735.      mov     [codec.function_id], eax
  736.      jmp     .continue
  737.   @@:
  738.      cmp     eax, AC_GRP_MODEM_FUNCTION
  739.      jne     @f
  740.  
  741.      mov     [codec.mfg], ebx
  742.      mov     [codec.function_id], eax
  743.      jmp     .continue
  744.   @@:
  745.   .continue:
  746.      inc     ebx
  747.      dec     ecx
  748.      jnz     .next
  749.   .l1:
  750.      pop     ecx  ebx  eax
  751.      ret
  752. endp
  753.  
  754.  
  755. ;======================================================================================
  756. ; read widget caps for each widget and store in cache
  757. proc  read_widget_caps stdcall, fg_node:dword
  758.      push    ebx ecx edx edi
  759.  
  760.      stdcall snd_hda_get_sub_nodes, [fg_node]
  761.      mov     ecx, eax
  762.      and     ecx, 0x7FFF ; total_nodes
  763.      mov     [codec.num_nodes], cx
  764.      mov     ebx, eax
  765.      shr     ebx, 16
  766.      and     ebx, 0x7FFF ; nid
  767.      mov     [codec.start_nid], bx
  768.  
  769. if DEBUG    ;YAHOO
  770.      push    eax esi
  771.      mov     esi, msgSETUP_FG_NODES
  772.      call    SysMsgBoardStr
  773.      mov     eax, ebx
  774.      stdcall fdword2str, 1
  775.      call    SysMsgBoardStr
  776.  
  777.      mov     esi, strSemicolon
  778.      call    SysMsgBoardStr
  779.      mov     eax, ecx
  780.      stdcall fdword2str, 3
  781.      call    SysMsgBoardStr
  782.      pop     esi eax
  783. end if
  784.  
  785. if FDEBUG    ;YAHOO
  786.      push    esi
  787.      mov     esi, msgWCaps
  788.      call    SysMsgBoardStr
  789.      pop     esi
  790. end if
  791.  
  792.      mov     eax, ecx
  793.      shl     eax, 2
  794.      push    ebx ecx
  795.      call    Kmalloc
  796.      pop     ecx ebx
  797.      test    eax, eax
  798.      jz      .err_out
  799.      mov     [codec.wcaps], eax
  800.  
  801.      mov     edi, eax
  802.   .next_node:
  803.  
  804.      snd_hda_param_read  ebx, AC_PAR_AUDIO_WIDGET_CAP
  805.      stosd
  806.      inc     ebx
  807.      dec     ecx
  808.      jnz     .next_node
  809.      pop     edi edx ecx ebx
  810.      xor     eax, eax
  811.      ret
  812.   .err_out:
  813.      pop     edi edx ecx ebx
  814.      xor     eax, eax
  815.      dec     eax
  816.      ret
  817. endp
  818.  
  819.  
  820. ; read all pin default configurations and save codec->init_pins
  821. proc  read_pin_defaults
  822.      push    ebx ecx edx edi
  823.  
  824.      movzx   ebx, [codec.start_nid]
  825.      movzx   ecx, [codec.num_nodes]
  826.  
  827.      ;Asper [
  828.      mov     eax, HDA_PINCFG.sizeof
  829.      mul     cl
  830.      push    ebx ecx
  831.      call    Kmalloc
  832.      pop     ecx ebx
  833.      test    eax, eax
  834.      jz      .err_out
  835.      mov     [codec.init_pins], eax
  836.      mov     edi, eax
  837.      ;Asper ]
  838.  
  839. if FDEBUG
  840.    push   eax esi
  841.    mov    esi, msgPinCfgs
  842.    call   SysMsgBoardStr
  843.    pop    esi eax
  844. end if
  845.  
  846.  
  847.   .next_node:
  848.      stdcall get_wcaps, ebx
  849.      and  eax, AC_WCAP_TYPE
  850.      shr  eax, AC_WCAP_TYPE_SHIFT
  851.  
  852.      cmp     eax, AC_WID_PIN
  853.      jne     .continue
  854.  
  855.      mov     [edi + HDA_PINCFG.nid], bx
  856.      stdcall snd_hda_codec_read, ebx, 0, AC_VERB_GET_CONFIG_DEFAULT, 0
  857.      mov     [edi + HDA_PINCFG.cfg], eax
  858.  
  859.   .continue:
  860.      add     edi, HDA_PINCFG.sizeof
  861.      inc     ebx
  862.      dec     ecx
  863.      jnz     .next_node
  864.  
  865. ;Asper [
  866.      and     ebx, 0xFFFF
  867.      sub     bx, [codec.start_nid]
  868.      mov     [codec.num_pins], ebx
  869. ;Asper ]
  870.  
  871.      pop     edi edx ecx ebx
  872.      xor     eax, eax
  873.      ret
  874.   .err_out:
  875.      pop     edi edx ecx ebx
  876.      xor     eax, eax
  877.      dec     eax
  878.      ret
  879. endp
  880.  
  881.  
  882.  
  883. ; look up the given pin config list and return the item matching with NID
  884. proc  look_up_pincfg stdcall, array:dword, nid:dword
  885.      push    ebx ecx edx
  886.      mov     ecx, [codec.num_pins]
  887.      mov     eax, [array]
  888.      mov     ebx, [nid]
  889.   .next_pin:
  890.      mov     dx,  [eax + HDA_PINCFG.nid]
  891.      cmp     dx,  bx
  892.      je      .out
  893.   .continue:
  894.      add     eax, HDA_PINCFG.sizeof
  895.      dec     ecx
  896.      jnz     .next_pin
  897.  
  898.      xor     eax, eax
  899.   .out:
  900.      pop     edx ecx ebx
  901.      ret
  902. endp
  903.  
  904. ; write a config value for the given NID
  905. proc  set_pincfg stdcall, nid:dword, cfg:dword
  906.      push    eax  ebx  ecx  edx
  907.      mov     eax, [cfg]
  908.      xor     ebx, ebx
  909.      mov     edx, AC_VERB_SET_CONFIG_DEFAULT_BYTES_0
  910.      mov     ecx, 4
  911.   @@:
  912.      mov     bl,  al
  913.      stdcall snd_hda_codec_write, [nid], 0, edx, ebx
  914.      shr     eax, 8
  915.      inc     edx
  916.      dec     ecx
  917.      jnz     @b
  918.   .l1:
  919.      pop     edx  ecx  ebx  eax
  920.      ret
  921. endp
  922.  
  923.  
  924. ;;
  925. ;; snd_hda_codec_get_pincfg - Obtain a pin-default configuration
  926. ;; @codec: the HDA codec
  927. ;; @nid: NID to get the pin config
  928. ;;
  929. ;; Get the current pin config value of the given pin NID.
  930. ;; If the pincfg value is cached or overridden via sysfs or driver,
  931. ;; returns the cached value.
  932. ;;
  933. proc  snd_hda_codec_get_pincfg stdcall, nid:dword
  934.      push    edi
  935.      stdcall look_up_pincfg, [codec.init_pins], [nid]
  936.      test    eax, eax
  937.      jz      @f
  938.      mov     edi, eax
  939.      mov     eax, [edi + HDA_PINCFG.cfg]
  940.   @@:
  941.      pop     edi
  942.      ret
  943. endp
  944.  
  945. ;======================================================================================
  946.  
  947. ;;
  948. ;; snd_hda_codec_setup_stream - set up the codec for streaming
  949. ;; @nid: the NID to set up
  950. ;; @stream_tag: stream tag to pass, it's between 0x1 and 0xf.
  951. ;; @channel_id: channel id to pass, zero based.
  952. ;; @format: stream format.
  953. ;;
  954. proc hda_codec_setup_stream stdcall, nid:dword, stream_tag:dword, channel_id:dword, format:dword
  955.      push    eax
  956.      mov     eax, [nid]
  957.      test    eax, eax
  958.      jnz     @f
  959.      pop     eax
  960.      ret
  961.   @@:
  962.   if DEBUG
  963.      push    esi
  964.      mov     esi, msgHDACodecSetupStream
  965.      call    SysMsgBoardStr
  966.      stdcall fdword2str, 3
  967.      call    SysMsgBoardStr
  968.  
  969.      mov     esi, msgStream
  970.      call    SysMsgBoardStr
  971.      mov     eax, [stream_tag]
  972.      stdcall fdword2str, 3
  973.      call    SysMsgBoardStr
  974.  
  975.      mov     esi, msgChannel
  976.      call    SysMsgBoardStr
  977.      mov     eax, [channel_id]
  978.      stdcall fdword2str, 3
  979.      call    SysMsgBoardStr
  980.  
  981.      mov     esi, msgFormat
  982.      call    SysMsgBoardStr
  983.      mov     eax, [format]
  984.      stdcall fdword2str, 3
  985.      call    SysMsgBoardStr
  986.      pop     esi
  987.   end if
  988.      mov     eax, [stream_tag]
  989.      shl     eax, 4
  990.      or      eax, [channel_id]
  991.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_CHANNEL_STREAMID, eax
  992.  
  993.      mov     eax, 1000  ; wait 1 ms
  994.      call    StallExec
  995.  
  996.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_STREAM_FORMAT, [format]
  997.      pop     eax
  998.      ret
  999. endp
  1000.  
  1001.  
  1002. proc snd_hda_codec_cleanup_stream stdcall, nid:dword
  1003.      push    eax
  1004.      mov     eax, [nid]
  1005.      test    eax, eax
  1006.      jz      @f
  1007.      pop     eax
  1008.      ret
  1009.   @@:
  1010.   if DEBUG
  1011.      push    esi
  1012.      mov     esi, msgHDACodecCleanupStream
  1013.      call    SysMsgBoardStr
  1014.      stdcall fdword2str, 3
  1015.      call    SysMsgBoardStr
  1016.      pop     esi
  1017.   end if
  1018.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_CHANNEL_STREAMID, 0
  1019.   if 0  ; keep the format
  1020.      mov     eax, 1000000  ; wait 100 ms
  1021.      call    StallExec
  1022.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_STREAM_FORMAT, 0
  1023.   end if
  1024.      pop     eax
  1025.      ret
  1026. endp
  1027.  
  1028.  
  1029. proc  read_pin_cap, nid:dword
  1030.      snd_hda_param_read  [nid], AC_PAR_PIN_CAP
  1031.      ret
  1032. endp
  1033.  
  1034.  
  1035. ;; read the current volume
  1036. proc get_volume_mute stdcall, nid:dword, ch:dword, direction:dword, index:dword
  1037.      push    ebx
  1038.      mov     ebx, AC_AMP_GET_LEFT
  1039.      mov     eax, [ch]
  1040.      test    eax, eax
  1041.      jz      @f
  1042.      mov     ebx, AC_AMP_GET_RIGHT
  1043.   @@:
  1044.      mov     eax, [direction]
  1045.      cmp     eax, HDA_OUTPUT
  1046.      jne     @f
  1047.      or      ebx, AC_AMP_GET_OUTPUT
  1048.      jmp     .l1
  1049.   @@:
  1050.      or      ebx, AC_AMP_GET_INPUT
  1051.   .l1:
  1052.      or      ebx, [index]
  1053.      stdcall snd_hda_codec_read, [nid], 0, AC_VERB_GET_AMP_GAIN_MUTE, ebx
  1054.      and     eax, 0xFF
  1055.      pop     ebx
  1056.      ret
  1057. endp
  1058.  
  1059.  
  1060. ;; write the current volume in info to the h/w
  1061. proc put_volume_mute stdcall, nid:dword, ch:dword, direction:dword, index:dword, val:dword
  1062.      push    eax  ebx
  1063.      mov     ebx, AC_AMP_SET_LEFT
  1064.      mov     eax, [ch]
  1065.      test    eax, eax
  1066.      jz      @f
  1067.      mov     ebx, AC_AMP_SET_RIGHT
  1068.   @@:
  1069.      mov     eax, [direction]
  1070.      cmp     eax, HDA_OUTPUT
  1071.      jne     @f
  1072.      or      ebx, AC_AMP_SET_OUTPUT
  1073.      jmp     .l1
  1074.   @@:
  1075.      or      ebx, AC_AMP_SET_INPUT
  1076.   .l1:
  1077.      mov     eax, [index]
  1078.      shl     eax, AC_AMP_SET_INDEX_SHIFT
  1079.      or      ebx, eax
  1080.      or      ebx, [val]
  1081.      stdcall snd_hda_codec_write, [nid], 0, AC_VERB_SET_AMP_GAIN_MUTE, ebx
  1082.      pop     ebx  eax
  1083.      ret
  1084. endp
  1085.  
  1086.  
  1087. ;;
  1088. ;; snd_hda_codec_amp_update - update the AMP value
  1089. ;; @nid: NID to read the AMP value
  1090. ;; @ch: channel (left=0 or right=1)
  1091. ;; @direction: #HDA_INPUT or #HDA_OUTPUT
  1092. ;; @idx: the index value (only for input direction)
  1093. ;; @mask: bit mask to set
  1094. ;; @val: the bits value to set
  1095. ;;
  1096. ;; Update the AMP value with a bit mask.
  1097. ;; Returns 0 if the value is unchanged, 1 if changed.
  1098. ;;
  1099. ;-proc snd_hda_codec_amp_update stdcall, nid:dword, ch:dword, direction:dword, idx:dword, mask:dword, val:dword
  1100. ;-     push    ebx  edx
  1101. ;-     mov     eax, [mask]
  1102. ;-     mov     ebx, [val]
  1103. ;-     and     ebx, eax
  1104. ;-     xor     eax, -1
  1105. ;-     mov     edx, eax
  1106. ;-     stdcall get_volume_mute, [nid], [ch], [direction], [idx]
  1107. ;-     and     eax, edx
  1108. ;-     or      ebx, eax
  1109. ;-
  1110. ;-     stdcall put_volume_mute, [nid], [ch], [direction], [idx], ebx
  1111. ;-     xor     eax, eax
  1112. ;-     inc     eax
  1113. ;-     pop     edx  ebx
  1114. ;-     ret
  1115. ;-endp
  1116.  
  1117.  
  1118. ;;
  1119. ;; snd_hda_codec_amp_stereo - update the AMP stereo values
  1120. ;; @nid: NID to read the AMP value
  1121. ;; @direction: #HDA_INPUT or #HDA_OUTPUT
  1122. ;; @idx: the index value (only for input direction)
  1123. ;; @mask: bit mask to set
  1124. ;; @val: the bits value to set
  1125. ;;
  1126. ;; Update the AMP values like snd_hda_codec_amp_update(), but for a
  1127. ;; stereo widget with the same mask and value.
  1128. ;;
  1129. proc snd_hda_codec_amp_stereo stdcall, nid:dword, direction:dword, idx:dword, mask:dword, val:dword
  1130.      push    ebx edx
  1131.      mov     ebx, [val]
  1132.      mov     edx, [mask]
  1133.      and     ebx, edx
  1134.      stdcall put_volume_mute, [nid], 0, [direction], [idx], ebx
  1135.      stdcall put_volume_mute, [nid], 1, [direction], [idx], ebx
  1136.      pop     edx  ebx
  1137.      ret
  1138. endp
  1139.  
  1140.  
  1141. ;; set power state of the codec
  1142. proc snd_hda_set_power_state stdcall, fg:dword, power_state:dword
  1143.      push    eax ebx ecx edx
  1144.      ; this delay seems necessary to avoid click noise at power down
  1145.      mov     ebx, [power_state]
  1146.      cmp     ebx, AC_PWRST_D3
  1147.      jne     @f
  1148.      mov     eax, 100000
  1149.      call    StallExec
  1150.   @@:
  1151.      stdcall snd_hda_codec_read, [fg], 0, AC_VERB_SET_POWER_STATE, ebx
  1152.      ;partial workaround for "azx_get_response timeout"
  1153.      cmp     ebx, AC_PWRST_D0
  1154.      jne     @f
  1155.  
  1156.      mov     dx, [codec.vendor_id]
  1157.      cmp     dx, 0x14F1
  1158.  
  1159.      jne     @f
  1160.      mov     eax, 10000
  1161.      call    StallExec
  1162.   @@:
  1163.      movzx   ecx, [codec.num_nodes]
  1164.      movzx   edx, [codec.start_nid]
  1165.   .next_nid:
  1166.      stdcall get_wcaps, edx
  1167.      test    eax, AC_WCAP_POWER
  1168.      jz      .skip_nid
  1169.  
  1170.      stdcall get_wcaps_type, eax
  1171.      cmp     ebx, AC_PWRST_D3
  1172.      jne     .l1
  1173.      cmp     eax, AC_WID_PIN
  1174.      jne     .l1
  1175.      ;don't power down the widget if it controls
  1176.      ;eapd and EAPD_BTLENABLE is set.
  1177.      stdcall  read_pin_cap, edx
  1178.      test    eax, AC_PINCAP_EAPD
  1179.      jz      .l2
  1180.  
  1181.      stdcall snd_hda_codec_read, edx, 0, AC_VERB_GET_EAPD_BTLENABLE, 0
  1182.      and     eax, 0x02
  1183.      test    eax, eax
  1184.      jnz     .skip_nid
  1185.   .l2:
  1186.   .l1:
  1187.      stdcall snd_hda_codec_write, edx, 0, AC_VERB_SET_POWER_STATE, ebx
  1188.   .skip_nid:
  1189.      inc     edx
  1190.      dec     ecx
  1191.      jnz     .next_nid
  1192.  
  1193.      cmp     ebx, AC_PWRST_D0
  1194.      jne     .out
  1195.      ;wait until codec reaches to D0
  1196.      mov     ecx, 500
  1197.   .wait_D0:
  1198.      stdcall snd_hda_codec_read, [fg], 0, AC_VERB_GET_POWER_STATE, 0
  1199.      cmp     eax, ebx
  1200.      je      .out
  1201.      mov     eax, 1000  ; msleep(1);
  1202.      call    StallExec
  1203.      dec     ecx
  1204.      jnz     .wait_D0
  1205.   .out:
  1206.      pop     edx ecx ebx eax
  1207.      ret
  1208. endp
  1209.  
  1210.  
  1211. ;data
  1212.  
  1213. ; codec vendors
  1214. align 16
  1215. msg_Cirrus       db 'Cirrus Logic ',0
  1216. msg_Motorola       db 'Motorola ',0
  1217. msg_SiliconImage     db 'Silicon Image ',0
  1218. msg_Realtek       db 'Realtek ',0
  1219. msg_Creative       db 'Creative ',0
  1220. msg_IDT        db 'IDT ',0
  1221. msg_LSI        db 'LSI ',0
  1222. msg_AnalogDevices    db 'Analog Devices ',0
  1223. msg_CMedia       db 'C-Media ',0
  1224. msg_Conexant       db 'Conexant ',0
  1225. msg_Chrontel       db 'Chrontel ',0
  1226. msg_LG         db 'LG ',0
  1227. msg_Wolfson       db 'Wolfson Microelectronics ',0
  1228. msg_Qumranet       db 'Qumranet ',0
  1229. msg_SigmaTel       db 'SigmaTel ',0
  1230. ac_unknown     db 'unknown manufacturer ',0
  1231.  
  1232. chip_unknown   db 'unknown codec id ', 0
  1233.  
  1234.  
  1235. ; codec vendor labels
  1236. align 4
  1237. hda_vendor_ids:
  1238.      dd    0x1002, msg_ATI, chips_ATI
  1239.      dd    0x1013, msg_Cirrus, chips_Cirrus
  1240.      dd    0x1057, msg_Motorola, chips_Motorola
  1241.      dd    0x1095, msg_SiliconImage, chips_SiliconImage
  1242.      dd    0x10de, msg_NVidia, chips_NVidia
  1243.      dd    0x10ec, msg_Realtek, chips_Realtek
  1244.      dd    0x1102, msg_Creative, chips_Creative
  1245.      dd    0x1106, msg_VIA, chips_VIA
  1246.      dd    0x111d, msg_IDT, chips_IDT
  1247.      dd    0x11c1, msg_LSI, chips_LSI
  1248.      dd    0x11d4, msg_AnalogDevices, chips_Analog
  1249.      dd    0x13f6, msg_CMedia, chips_CMedia
  1250.      dd    0x14f1, msg_Conexant, chips_Conexant
  1251.      dd    0x17e8, msg_Chrontel, chips_Chrontel
  1252.      dd    0x1854, msg_LG, chips_LG
  1253.      dd    0x1aec, msg_Wolfson, chips_Wolfson
  1254.      dd    0x1af4, msg_Qumranet, chips_Qumranet   ; Qemu 0.14
  1255.      dd    0x434d, msg_CMedia, chips_CMedia
  1256.      dd    0x8086, msg_Intel, chips_Intel
  1257.      dd    0x8384, msg_SigmaTel, chips_SigmaTel
  1258.      dd    0 ; terminator
  1259.  
  1260. align 16             ;known codecs
  1261. chips_ATI            dd 0xAA01, chip_ATIR6XX
  1262.                      dd 0xFF
  1263.  
  1264. chips_Cirrus         dd 0xFF
  1265. chips_Motorola       dd 0xFF
  1266.  
  1267. chips_SiliconImage   dd 0x1392, chip_SI1392
  1268.                      dd 0xFF
  1269.  
  1270. chips_NVidia         dd 0x0002, chip_MCP78
  1271.                      dd 0xFF
  1272.  
  1273. chips_Realtek        dd 0x0262, chip_ALC262
  1274.                      dd 0x0268, chip_ALC268
  1275.                      dd 0x0269, chip_ALC269
  1276.                      dd 0x0272, chip_ALC272
  1277.                      dd 0x0662, chip_ALC662
  1278.                      dd 0x0663, chip_ALC663
  1279.                      dd 0x0883, chip_ALC883
  1280.                      dd 0x0887, chip_ALC887
  1281.                      dd 0x0888, chip_ALC888
  1282.                      dd 0x0889, chip_ALC889
  1283.                      dd 0xFF
  1284.  
  1285. chips_Creative       dd 0xFF
  1286.  
  1287. chips_VIA            dd 0xE721, chip_VT1708B_1
  1288.                      dd 0x0397, chip_VT17085_0
  1289.                      dd 0xFF
  1290.  
  1291. chips_IDT            dd 0xFF
  1292.  
  1293. chips_LSI            dd 0x1039, chip_LSI1039
  1294.                      dd 0x1040, chip_LSI1040
  1295.                      dd 0x3026, chip_LSI3026
  1296.                      dd 0x3055, chip_LSI3055
  1297.                      dd 0xFF
  1298.  
  1299. chips_Analog         dd 0x1986, chip_AD1986A
  1300.                      dd 0x198B, chip_AD198B
  1301.                      dd 0xFF
  1302.  
  1303. chips_CMedia         dd 0xFF
  1304.  
  1305. chips_Conexant       dd 0x5045, chip_CX20549
  1306.                      dd 0x5051, chip_CX20561
  1307.                      dd 0xFF
  1308.  
  1309. chips_Chrontel       dd 0xFF
  1310. chips_LG             dd 0xFF
  1311. chips_Wolfson        dd 0xFF
  1312. chips_Intel          dd 0xFF
  1313.  
  1314. chips_Qumranet       dd 0x0010, chip_HDA_OUTPUT
  1315.                      dd 0x0020, chip_HDA_DUPLEX
  1316.                      dd 0xFF
  1317.  
  1318. chips_SigmaTel       dd 0x7680, chip_STAC9221
  1319.                      dd 0x7682, chip_STAC9221_A2
  1320.                      dd 0xFF
  1321.  
  1322. align 16
  1323. ;AnalogDevices
  1324. chip_AD1986A         db 'AD1986A',13,10,0
  1325. chip_AD198B          db 'AD198B',13,10,0
  1326.  
  1327. ;ATI
  1328. chip_ATIR6XX         db 'ATIR6XX',13,10,0
  1329.  
  1330. ;Silicon Image
  1331. chip_SI1392          db 'SI1392',13,10,0
  1332.  
  1333. ;NVidia
  1334. chip_MCP78           db 'MCP78',13,10,0
  1335.  
  1336. ;Realtek
  1337. chip_ALC262          db 'ALC262',13,10,0
  1338. chip_ALC268          db 'ALC268',13,10,0
  1339. chip_ALC269          db 'ALC269',13,10,0
  1340. chip_ALC272          db 'ALC272',13,10,0
  1341. chip_ALC662          db 'ALC662',13,10,0
  1342. chip_ALC663          db 'ALC663',13,10,0
  1343. chip_ALC883          db 'ALC883',13,10,0
  1344. chip_ALC887          db 'ALC887',13,10,0
  1345. chip_ALC888          db 'ALC888',13,10,0
  1346. chip_ALC889          db 'ALC889',13,10,0
  1347.  
  1348. ;Sigmatel
  1349. chip_STAC9221        db 'STAC9221',13,10,0
  1350. chip_STAC9221_A2     db 'STAC9221_A2',13,10,0
  1351.  
  1352. ;VIA
  1353. chip_VT1708B_1       db 'VT1708B_1',13,10,0
  1354. chip_VT17085_0       db 'VT17085_0',13,10,0
  1355.  
  1356. ;Conexant
  1357. chip_CX20549         db 'CX20549',13,10,0
  1358. chip_CX20561         db 'CX20561',13,10,0
  1359.  
  1360. ;Qumranet
  1361. chip_HDA_OUTPUT      db 'HDA-OUTPUT',13,10,0
  1362. chip_HDA_DUPLEX      db 'HDA-DUPLEX',13,10,0
  1363.  
  1364. ;LSI
  1365. chip_LSI1039         db '1039 (Agere Systems HDA Modem)',13,10,0
  1366. chip_LSI1040         db '1040 (Agere Systems HDA Modem)',13,10,0
  1367. chip_LSI3026         db '3026 (Agere Systems HDA Modem)',13,10,0
  1368. chip_LSI3055         db '3055 (Agere Systems HDA Modem)',13,10,0
  1369.