i2c: add device names

Change-Id: I1cb40223cdb43cc7069aee382657aac2b4cfd62b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2481
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
X512
2020-04-16 11:52:47 +00:00
committed by Jérôme Duval
parent e3b7218370
commit 898afd0a20
4 changed files with 5 additions and 2 deletions
@@ -57,6 +57,8 @@ I2CBus::RegisterDevice(i2c_addr slaveAddress, char* hid, char** cid,
CALLED();
device_attr attrs[] = {
{ B_DEVICE_PRETTY_NAME, B_STRING_TYPE, { string: "I2C device" }},
// connection
{ I2C_DEVICE_SLAVE_ADDR_ITEM, B_UINT16_TYPE, { ui16: slaveAddress }},
@@ -26,6 +26,7 @@ i2c_added_device(device_node *parent)
device_attr attributes[] = {
// info about device
{ B_DEVICE_PRETTY_NAME, B_STRING_TYPE, { string: "I2C bus" }},
{ B_DEVICE_BUS, B_STRING_TYPE, { string: "i2c" }},
{ I2C_BUS_PATH_ID_ITEM, B_UINT8_TYPE, { ui8: (uint8)pathID }},
{ NULL }
@@ -82,7 +82,7 @@ register_child_devices(void* cookie)
device_node* node = bus->info.driver_node;
char prettyName[25];
sprintf(prettyName, "PCH I2C Device");
sprintf(prettyName, "PCH I2C Controller");
device_attr attrs[] = {
// properties of this controller for i2c bus manager
@@ -84,7 +84,7 @@ register_child_devices(void* cookie)
device_node* node = bus->info.driver_node;
char prettyName[25];
sprintf(prettyName, "PCH I2C Device %" B_PRIu16, 0);
sprintf(prettyName, "PCH I2C Controller %" B_PRIu16, 0);
device_attr attrs[] = {
// properties of this controller for i2c bus manager