summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/i2c/generic/generic.c5
-rw-r--r--src/drivers/i2c/hid/hid.c6
-rw-r--r--src/drivers/i2c/max98373/max98373.c6
-rw-r--r--src/drivers/i2c/max98927/max98927.c6
-rw-r--r--src/drivers/i2c/tpm/chip.c6
5 files changed, 29 insertions, 0 deletions
diff --git a/src/drivers/i2c/generic/generic.c b/src/drivers/i2c/generic/generic.c
index 46fff4ac6d..7f1ce16fea 100644
--- a/src/drivers/i2c/generic/generic.c
+++ b/src/drivers/i2c/generic/generic.c
@@ -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 = {
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 = {
diff --git a/src/drivers/i2c/max98373/max98373.c b/src/drivers/i2c/max98373/max98373.c
index 19dd7879e9..558be8a2ca 100644
--- a/src/drivers/i2c/max98373/max98373.c
+++ b/src/drivers/i2c/max98373/max98373.c
@@ -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 = {
diff --git a/src/drivers/i2c/max98927/max98927.c b/src/drivers/i2c/max98927/max98927.c
index 50b3e0c034..12599fed7c 100644
--- a/src/drivers/i2c/max98927/max98927.c
+++ b/src/drivers/i2c/max98927/max98927.c
@@ -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 = {
diff --git a/src/drivers/i2c/tpm/chip.c b/src/drivers/i2c/tpm/chip.c
index 2655b0da07..c2af071932 100644
--- a/src/drivers/i2c/tpm/chip.c
+++ b/src/drivers/i2c/tpm/chip.c
@@ -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 = {