From 69e9e715a644aef8db118a30dee3878c561b976a Mon Sep 17 00:00:00 2001 From: Naresh G Solanki Date: Mon, 4 Jun 2018 17:45:19 +0530 Subject: src/driver/i2c/{generic,hid,tpm,max}: Update device name based on devicetree.cb Name i2c device structure based on that in devicetree.cb Now log looks like: I2C: 01:0a (WCOM Touchscreen) I2C: 03:13 (Realtek RT5663) I2C: 03:39 (SSM4567 Right Speaker Amp) I2C: 03:3a (SSM4567 Left Speaker Amp) BUG=None BRANCH=None TEST=Build & boot Soraka Change-Id: I5dbb66ab705cd8601b8b1dc94bc6ee9f181b7be2 Signed-off-by: Naresh G Solanki Reviewed-on: https://review.coreboot.org/26830 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Furquan Shaikh --- src/drivers/i2c/hid/hid.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/drivers/i2c/hid') diff --git a/src/drivers/i2c/hid/hid.c b/src/drivers/i2c/hid/hid.c index 71d70d0cf6..bccce75a5d 100644 --- a/src/drivers/i2c/hid/hid.c +++ b/src/drivers/i2c/hid/hid.c @@ -58,7 +58,13 @@ static struct device_operations i2c_hid_ops = { static void i2c_hid_enable(struct device *dev) { + struct drivers_i2c_hid_config *config = dev->chip_info; + dev->ops = &i2c_hid_ops; + + if (config && config->generic.desc) { + dev->name = config->generic.desc; + } } struct chip_operations drivers_i2c_hid_ops = { -- cgit v1.2.3