Comment 31 for bug 1284466

Revision history for this message
Raymond (superquad-vortex2) wrote :

it only test on those adi codecs ad198x which need 0.02 seconds for the measured impedance value become steady

according the specification

7.3.3.15 Pin Sense

The Pin Sense control returns the Presence Detect status, EDID-Like Data (ELD) Valid, and the impedance measurement of the device attached to the pin

Impedance returns the measured impedance of the widget. A returned value of 0x7FFF,FFFF (all 1‟s) indicates that a valid sense reading is not available, or the sense measurement is busy (refer to Section 7.3.1) if it has been recently triggered. This field is only valid if the widget has Sense capability as indicated by the “Impedance Sense Capable” bit of the Pin Capabilities parameter

for nid in codec.nodes:
    node = codec.get_node(nid)
    if WIDGET_TYPE_IDS[node.wtype] == 'PIN':
 pd = " "
        impedance = " "
 if ((node.pincaps & 4) == 4):
     if (node.pincaps & 2):
                codec.rw(nid, VERBS['SET_PIN_SENSE'], 0)
                time.sleep(0.02)
            sense = codec.rw(nid, VERBS['GET_PIN_SENSE'], 0)
            if (node.pincaps & 1):
  impedance = "Imp=%d" % (sense & 0x7fffffff)
            if (sense & 0x80000000):
  pd = "PD=1"
     else:
  pd = "PD=0"
        print "Pin 0x%.2x [%s] %s %s at %s (%s) %s : %s %s" % (nid, node.jack_conn_name, node.jack_type_name, node.jack_location_name, node.jack_location2_name, node.jack_color_name, node.defcfg_misc , pd, impedance)