public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
* [RESEND PATCH] regulator: mt6311: Use REGCACHE_RBTREE
@ 2015-12-18  7:11 Daniel Kurtz
  2015-12-18  7:34 ` Henry Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Kurtz @ 2015-12-18  7:11 UTC (permalink / raw)
  To: Henry Chen
  Cc: linux-mediatek, eddie.huang, Matthias Brugger, Daniel Kurtz,
	Liam Girdwood, Mark Brown,
	open list:VOLTAGE AND CURRENT REGULATOR FRAMEWORK

This regulator is on a slow i2c bus.  Register accesses are very simple,
they all either enable/disable a regulator channel, or select a new
voltage level.  Thus, reading registers from the device will always
return what was last written.

Therefore we can save a lot of time when reading registers by using a
regmap_cache.  Since the register map is relatively large, but we only
ever access a few of them, we use an RBTREE cache.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
---
I used the wrong commit message subject in the first attempt.
Maybe this time someone will review it ;-).
---
 drivers/regulator/mt6311-regulator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/mt6311-regulator.c b/drivers/regulator/mt6311-regulator.c
index 02c4e5f..0495716 100644
--- a/drivers/regulator/mt6311-regulator.c
+++ b/drivers/regulator/mt6311-regulator.c
@@ -30,6 +30,7 @@ static const struct regmap_config mt6311_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.max_register = MT6311_FQMTR_CON4,
+	.cache_type = REGCACHE_RBTREE,
 };
 
 /* Default limits measured in millivolts and milliamps */
-- 
2.6.0.rc2.230.g3dd15c0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RESEND PATCH] regulator: mt6311: Use REGCACHE_RBTREE
  2015-12-18  7:11 [RESEND PATCH] regulator: mt6311: Use REGCACHE_RBTREE Daniel Kurtz
@ 2015-12-18  7:34 ` Henry Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Henry Chen @ 2015-12-18  7:34 UTC (permalink / raw)
  To: Daniel Kurtz
  Cc: linux-mediatek, eddie.huang, Matthias Brugger, Liam Girdwood,
	Mark Brown, open list:VOLTAGE AND CURRENT REGULATOR FRAMEWORK

Thanks to the patch.

On Fri, 2015-12-18 at 15:11 +0800, Daniel Kurtz wrote:
> This regulator is on a slow i2c bus.  Register accesses are very simple,
> they all either enable/disable a regulator channel, or select a new
> voltage level.  Thus, reading registers from the device will always
> return what was last written.
> 
> Therefore we can save a lot of time when reading registers by using a
> regmap_cache.  Since the register map is relatively large, but we only
> ever access a few of them, we use an RBTREE cache.
> 
> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

Acked-by: Henry Chen <henryc.chen@mediatek.com>

> ---
> I used the wrong commit message subject in the first attempt.
> Maybe this time someone will review it ;-).
> ---
>  drivers/regulator/mt6311-regulator.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/regulator/mt6311-regulator.c b/drivers/regulator/mt6311-regulator.c
> index 02c4e5f..0495716 100644
> --- a/drivers/regulator/mt6311-regulator.c
> +++ b/drivers/regulator/mt6311-regulator.c
> @@ -30,6 +30,7 @@ static const struct regmap_config mt6311_regmap_config = {
>  	.reg_bits = 8,
>  	.val_bits = 8,
>  	.max_register = MT6311_FQMTR_CON4,
> +	.cache_type = REGCACHE_RBTREE,
>  };
>  
>  /* Default limits measured in millivolts and milliamps */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-18  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-18  7:11 [RESEND PATCH] regulator: mt6311: Use REGCACHE_RBTREE Daniel Kurtz
2015-12-18  7:34 ` Henry Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox