Naresh Solanki has uploaded this change for review. ( https://review.coreboot.org/26830
Change subject: src/driver/i2c/{generic,hid,tpm,max}: Update device name based on devicetree.cb ......................................................................
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 naresh.solanki@intel.com --- M src/drivers/i2c/generic/generic.c M src/drivers/i2c/hid/hid.c M src/drivers/i2c/max98373/max98373.c M src/drivers/i2c/max98927/max98927.c M src/drivers/i2c/tpm/chip.c 5 files changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/26830/1
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c index 46fff4a..7f1ce16 100644 --- a/src/drivers/i2c/generic/generic.c +++ b/src/drivers/i2c/generic/generic.c @@ -217,6 +217,11 @@ }
dev->ops = &i2c_generic_ops; + + /* Name the device as per description provided in devicetree */ + if (config && config->desc) { + dev->name = config->desc; + } }
struct chip_operations drivers_i2c_generic_ops = { diff --git a/src/drivers/i2c/hid/hid.c b/src/drivers/i2c/hid/hid.c index 71d70d0..bccce75 100644 --- a/src/drivers/i2c/hid/hid.c +++ b/src/drivers/i2c/hid/hid.c @@ -58,7 +58,13 @@
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 = { diff --git a/src/drivers/i2c/max98373/max98373.c b/src/drivers/i2c/max98373/max98373.c index 19dd787..17c79af 100644 --- a/src/drivers/i2c/max98373/max98373.c +++ b/src/drivers/i2c/max98373/max98373.c @@ -97,7 +97,12 @@
static void max98373_enable(struct device *dev) { + struct drivers_i2c_max98373_config *config = dev->chip_info; dev->ops = &max98373_ops; + + if (config && config->desc) { + dev->name = config->desc; + } }
struct chip_operations drivers_i2c_max98373_ops = { diff --git a/src/drivers/i2c/max98927/max98927.c b/src/drivers/i2c/max98927/max98927.c index 50b3e0c..214121a 100644 --- a/src/drivers/i2c/max98927/max98927.c +++ b/src/drivers/i2c/max98927/max98927.c @@ -93,7 +93,12 @@
static void max98927_enable(struct device *dev) { + struct drivers_i2c_max98927_config *config = dev->chip_info; dev->ops = &max98927_ops; + + if (config && config->desc) { + dev->name = config->desc; + } }
struct chip_operations drivers_i2c_max98927_ops = { diff --git a/src/drivers/i2c/tpm/chip.c b/src/drivers/i2c/tpm/chip.c index 2655b0d..b5ed6cc 100644 --- a/src/drivers/i2c/tpm/chip.c +++ b/src/drivers/i2c/tpm/chip.c @@ -84,7 +84,12 @@
static void i2c_tpm_enable(struct device *dev) { + struct drivers_i2c_tpm_config *config = dev->chip_info; dev->ops = &i2c_tpm_ops; + + if (config && config->desc) { + dev->name = config->desc; + } }
struct chip_operations drivers_i2c_tpm_ops = {