intel_extreme: Dump more info on ports found. Build fixes.

This commit is contained in:
Alexander von Gluck IV
2015-10-22 14:48:49 -05:00
parent 50f0b3fe76
commit 27134c6697
3 changed files with 33 additions and 9 deletions
@@ -83,7 +83,7 @@ Port::GetEDID(edid1_info* edid, bool forceRead)
return fEDIDState; return fEDIDState;
} }
TRACE("%s: using register %" B_PRIx32 "\n", PortName(), ddcRegister); TRACE("%s: using register %" B_PRIxADDR "\n", PortName(), ddcRegister);
i2c_bus bus; i2c_bus bus;
bus.cookie = (void*)ddcRegister; bus.cookie = (void*)ddcRegister;
@@ -184,7 +184,7 @@ AnalogPort::IsConnected()
} }
uint32 addr_t
AnalogPort::_DDCRegister() AnalogPort::_DDCRegister()
{ {
// always fixed // always fixed
@@ -218,7 +218,7 @@ LVDSPort::IsConnected()
} }
uint32 addr_t
LVDSPort::_DDCRegister() LVDSPort::_DDCRegister()
{ {
// always fixed // always fixed
@@ -245,7 +245,7 @@ DigitalPort::IsConnected()
} }
uint32 addr_t
DigitalPort::_DDCRegister() DigitalPort::_DDCRegister()
{ {
switch (PortIndex()) { switch (PortIndex()) {
@@ -64,7 +64,7 @@ static status_t _SetI2CSignals(void* cookie, int clock,
int data); int data);
private: private:
virtual uint32 _DDCRegister() = 0; virtual addr_t _DDCRegister() = 0;
port_index fPortIndex; port_index fPortIndex;
char* fPortName; char* fPortName;
@@ -84,7 +84,7 @@ virtual uint32 Type() const
virtual bool IsConnected(); virtual bool IsConnected();
protected: protected:
virtual uint32 _DDCRegister(); virtual addr_t _DDCRegister();
}; };
@@ -98,7 +98,7 @@ virtual uint32 Type() const
virtual bool IsConnected(); virtual bool IsConnected();
protected: protected:
virtual uint32 _DDCRegister(); virtual addr_t _DDCRegister();
}; };
@@ -114,7 +114,7 @@ virtual uint32 Type() const
virtual bool IsConnected(); virtual bool IsConnected();
protected: protected:
virtual uint32 _DDCRegister(); virtual addr_t _DDCRegister();
}; };
@@ -181,6 +181,29 @@ uninit_common(void)
} }
static void
dump_ports()
{
if (gInfo->port_count == 0) {
TRACE("%s: No ports connected\n", __func__);
return;
}
TRACE("%s: Connected ports: (port_count: %d)\n", __func__,
gInfo->port_count);
for (uint32 i = 0; i < gInfo->port_count; i++) {
Port* port = gInfo->ports[i];
if (!port) {
TRACE("port %d: INVALID ALLOC!\n", i);
continue;
}
TRACE("port %d: %s %s\n", i, port->PortName(),
port->IsConnected() ? "connected" : "disconnected");
}
}
static bool static bool
has_connected_port(port_index portIndex, uint32 type) has_connected_port(port_index portIndex, uint32 type)
{ {
@@ -302,7 +325,8 @@ intel_init_accelerant(int device)
} else } else
delete analogPort; delete analogPort;
TRACE("connected ports detected: %" B_PRIu32 "\n", gInfo->port_count); // On TRACE, dump ports and states
dump_ports();
status = create_mode_list(); status = create_mode_list();
if (status != B_OK) { if (status != B_OK) {