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> Reviewed-on: https://review.coreboot.org/26830 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
parent
5c61fa851f
commit
69e9e715a6
|
@ -217,6 +217,11 @@ static void i2c_generic_enable(struct device *dev)
|
|||
}
|
||||
|
||||
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 = {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -97,7 +97,13 @@ static struct device_operations max98373_ops = {
|
|||
|
||||
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 = {
|
||||
|
|
|
@ -93,7 +93,13 @@ static struct device_operations max98927_ops = {
|
|||
|
||||
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 = {
|
||||
|
|
|
@ -84,7 +84,13 @@ static struct device_operations i2c_tpm_ops = {
|
|||
|
||||
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 = {
|
||||
|
|
Loading…
Reference in New Issue