Kernel/Graphics: Export DDC I2C address definition to global header file

This commit is contained in:
Liav A 2022-03-31 09:57:25 +03:00 committed by Andrew Kaster
parent 0c64abb5e3
commit cd3c51f29b
2 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
* Copyright (c) 2021-2022, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -31,5 +31,7 @@ struct Modesetting {
Timings horizontal;
Timings vertical;
};
// Note: Address 0x50 is expected to be the DDC2 (EDID) i2c address.
static constexpr u8 ddc2_i2c_address = 0x50;
}

View file

@ -351,8 +351,8 @@ void IntelNativeDisplayConnector::gmbus_read_edid()
Array<u8, 128> crt_edid_bytes {};
{
SpinlockLocker control_lock(m_control_lock);
MUST(m_gmbus_connector->write(DDC2_I2C_ADDRESS, 0));
MUST(m_gmbus_connector->read(DDC2_I2C_ADDRESS, crt_edid_bytes.data(), crt_edid_bytes.size()));
MUST(m_gmbus_connector->write(Graphics::ddc2_i2c_address, 0));
MUST(m_gmbus_connector->read(Graphics::ddc2_i2c_address, crt_edid_bytes.data(), crt_edid_bytes.size()));
}
set_edid_bytes(crt_edid_bytes);
}