drivers/graphics/ihdgd: Minor EDID reading improvements
* Enable unproven feature of embedded-hal. We depend on it. Currently it gets implicitly enabled by bitbang-hal. * Reduce nesting in probe_edid
This commit is contained in:
@@ -9,7 +9,7 @@ drm-sys = "0.8.0"
|
||||
#TODO: edid is abandoned, fork it an maintain?
|
||||
edid = "0.3.0"
|
||||
#TODO: waiting for bitbang-hal to update to embedded-hal 1.0
|
||||
embedded-hal = "0.2.7"
|
||||
embedded-hal = { version = "0.2.7", features = ["unproven"] }
|
||||
log.workspace = true
|
||||
nb = "1.0"
|
||||
# Patched to allow for exact range allocation
|
||||
|
||||
@@ -274,31 +274,26 @@ impl Ddi {
|
||||
|
||||
Ok(edid_data)
|
||||
};
|
||||
let (source, edid_data) = match aux_read_edid(self) {
|
||||
Ok(edid_data) => ("AUX", edid_data),
|
||||
match aux_read_edid(self) {
|
||||
Ok(edid_data) => return Ok(Some(("AUX", edid_data))),
|
||||
Err(err) => {
|
||||
log::debug!("DDI {} failed to read EDID from AUX: {}", self.name, err);
|
||||
match gmbus_read_edid(self) {
|
||||
Ok(edid_data) => ("GMBUS", edid_data),
|
||||
Err(err) => {
|
||||
log::debug!("DDI {} failed to read EDID from GMBUS: {}", self.name, err);
|
||||
match gpio_read_edid(self) {
|
||||
Ok(edid_data) => ("GPIO", edid_data),
|
||||
Err(err) => {
|
||||
log::debug!(
|
||||
"DDI {} failed to read EDID from GPIO: {}",
|
||||
self.name,
|
||||
err
|
||||
);
|
||||
// Will try again but not fail the driver
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Ok(Some((source, edid_data)))
|
||||
}
|
||||
match gmbus_read_edid(self) {
|
||||
Ok(edid_data) => return Ok(Some(("GMBUS", edid_data))),
|
||||
Err(err) => {
|
||||
log::debug!("DDI {} failed to read EDID from GMBUS: {}", self.name, err);
|
||||
}
|
||||
}
|
||||
match gpio_read_edid(self) {
|
||||
Ok(edid_data) => return Ok(Some(("GPIO", edid_data))),
|
||||
Err(err) => {
|
||||
log::debug!("DDI {} failed to read EDID from GPIO: {}", self.name, err);
|
||||
}
|
||||
}
|
||||
// Will try again but not fail the driver
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn voltage_swing_hdmi(
|
||||
|
||||
Reference in New Issue
Block a user