Skip to contentSkip to conversation

hwmon: Update single register drivers to use maple tree register cache

PATCH In review Mark Brown 2 participants 9 messages Jun 10, 2023 Hardware monitoring

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

cover hwmon: Update single register drivers to use maple tree register cache

A number of hwmon drivers only support single register I/O and therefore gain no benefit from using the more modern maple tree register cache over the rbtree cache, convert them to maple tree.

---
Mark Brown (5):
hwmon: (lm75) Use maple tree register cache
hwmon: (lm95245) Use maple tree register cache
hwmon: (tmp102) Use maple tree register cache
hwmon: (tmp108) Use maple tree register cache
hwmon: (tmp464) Use maple tree register cache

 drivers/hwmon/lm75.c    | 2 +-
 drivers/hwmon/lm95245.c | 2 +-
 drivers/hwmon/tmp102.c  | 2 +-
 drivers/hwmon/tmp108.c  | 2 +-
 drivers/hwmon/tmp464.c  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

---
base-commit: 9561de3a55bed6bdd44a12820ba81ec416e705a7
change-id: 20230609-hwmon-maple-89029163bed2

Best regards,

Signature · 1 line
Mark Brown <[email protected]>
author
#1 lore raw

PATCH 1/5 hwmon: (lm75) Use maple tree register cache

The lm75 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient.

---
 drivers/hwmon/lm75.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/lm75.c +1 -1
index dbb99ea4a0ec..ab73b9af5c71 100644
@@ -548,7 +548,7 @@ static const struct regmap_config lm75_regmap_config = {
 	.writeable_reg = lm75_is_writeable_reg,
 	.volatile_reg = lm75_is_volatile_reg,
 	.val_format_endian = REGMAP_ENDIAN_BIG,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.use_single_read = true,
 	.use_single_write = true,
 };
Signature · 1 line
2.30.2
author
#2 lore raw

PATCH 2/5 hwmon: (lm95245) Use maple tree register cache

In reply to Mark Brown

The lm95245 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient.

---
 drivers/hwmon/lm95245.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/lm95245.c +1 -1
index 4236d1e0544d..a7dc84e997f1 100644
@@ -518,7 +518,7 @@ static const struct regmap_config lm95245_regmap_config = {
 	.val_bits = 8,
 	.writeable_reg = lm95245_is_writeable_reg,
 	.volatile_reg = lm95245_is_volatile_reg,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.use_single_read = true,
 	.use_single_write = true,
 };
Signature · 1 line
2.30.2
author
#3 lore raw

PATCH 3/5 hwmon: (tmp102) Use maple tree register cache

In reply to Mark Brown

The tmp102 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient.

---
 drivers/hwmon/tmp102.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/tmp102.c +1 -1
index e271556efe0b..9563e1328b74 100644
@@ -184,7 +184,7 @@ static const struct regmap_config tmp102_regmap_config = {
 	.writeable_reg = tmp102_is_writeable_reg,
 	.volatile_reg = tmp102_is_volatile_reg,
 	.val_format_endian = REGMAP_ENDIAN_BIG,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.use_single_read = true,
 	.use_single_write = true,
 };
Signature · 1 line
2.30.2
author
#4 lore raw

PATCH 4/5 hwmon: (tmp108) Use maple tree register cache

In reply to Mark Brown

The tmp108 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient.

---
 drivers/hwmon/tmp108.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/tmp108.c +1 -1
index 43784c289a9e..f5a80d133048 100644
@@ -318,7 +318,7 @@ static const struct regmap_config tmp108_regmap_config = {
 	.writeable_reg = tmp108_is_writeable_reg,
 	.volatile_reg = tmp108_is_volatile_reg,
 	.val_format_endian = REGMAP_ENDIAN_BIG,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.use_single_read = true,
 	.use_single_write = true,
 };
Signature · 1 line
2.30.2
author
#5 lore raw

PATCH 5/5 hwmon: (tmp464) Use maple tree register cache

In reply to Mark Brown

The tmp464 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient.

---
 drivers/hwmon/tmp464.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/tmp464.c +1 -1
index 9213a493a590..ef50f43d12e6 100644
@@ -644,7 +644,7 @@ static const struct regmap_config tmp464_regmap_config = {
 	.max_register = TMP464_DEVICE_ID_REG,
 	.volatile_reg = tmp464_is_volatile_reg,
 	.val_format_endian = REGMAP_ENDIAN_BIG,
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.use_single_read = true,
 	.use_single_write = true,
 };
Signature · 1 line
2.30.2
maintainer
#6 lore raw
In reply to Mark Brown
Quoted 4 lines · Mark Brown

A number of hwmon drivers only support single register I/O and therefore gain no benefit from using the more modern maple tree register cache over the rbtree cache, convert them to maple tree.

"gain no benefit from using the more modern maple tree register cache over the rbtree cache, convert them to maple tree."

Is that really what you wanted to say ?

Guenter

Quoted 20 lines

---
Mark Brown (5):
hwmon: (lm75) Use maple tree register cache
hwmon: (lm95245) Use maple tree register cache
hwmon: (tmp102) Use maple tree register cache
hwmon: (tmp108) Use maple tree register cache
hwmon: (tmp464) Use maple tree register cache

  drivers/hwmon/lm75.c    | 2 +-
  drivers/hwmon/lm95245.c | 2 +-
  drivers/hwmon/tmp102.c  | 2 +-
  drivers/hwmon/tmp108.c  | 2 +-
  drivers/hwmon/tmp464.c  | 2 +-
  5 files changed, 5 insertions(+), 5 deletions(-)

---
base-commit: 9561de3a55bed6bdd44a12820ba81ec416e705a7
change-id: 20230609-hwmon-maple-89029163bed2

Best regards,

author
#7 lore raw
Quoted 9 lines · Guenter Roeck
Quoted 3 lines · Mark Brown

A number of hwmon drivers only support single register I/O and therefore gain no benefit from using the more modern maple tree register cache over the rbtree cache, convert them to maple tree.

"gain no benefit from using the more modern maple tree register cache over the rbtree cache, convert them to maple tree."

Is that really what you wanted to say ?

Sorry, other way around - gain no benefit from using rbtree over maple tree.

maintainer
#8 lore raw
Quoted 6 lines · Mark Brown
Quoted 4 lines · Guenter Roeck
Quoted 3 lines · Mark Brown

A number of hwmon drivers only support single register I/O and therefore gain no benefit from using the more modern maple tree register cache over the rbtree cache, convert them to maple tree.

Quoted 7 lines
Quoted 4 lines

"gain no benefit from using the more modern maple tree register cache over the rbtree cache, convert them to maple tree."

Is that really what you wanted to say ?

Sorry, other way around - gain no benefit from using rbtree over maple tree.

That makes (much) more sense. I'll apply the series.

Thanks,
Guenter