* [PATCH 0/3] Input: Small regmap improvements
@ 2023-09-30 23:43 Mark Brown
2023-09-30 23:43 ` [PATCH 1/3] Input: cap11xx - Cache hardware ID registers Mark Brown
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Mark Brown @ 2023-09-30 23:43 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Mark Brown
This series has a few small improvements to the regmap usage in some of
the input drivers, there's nothing really important here but it's all
nice to have.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
Mark Brown (3):
Input: cap11xx - Cache hardware ID registers
Input: cap11xx - Convert to use maple tree register cache
Input: qt1050 - Convert to use maple tree register cache
drivers/input/keyboard/cap11xx.c | 5 +----
drivers/input/keyboard/qt1050.c | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
---
base-commit: 6465e260f48790807eef06b583b38ca9789b6072
change-id: 20230929-input-maple-55fb28d952ea
Best regards,
--
Mark Brown <broonie@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] Input: cap11xx - Cache hardware ID registers
2023-09-30 23:43 [PATCH 0/3] Input: Small regmap improvements Mark Brown
@ 2023-09-30 23:43 ` Mark Brown
2023-09-30 23:43 ` [PATCH 2/3] Input: cap11xx - Convert to use maple tree register cache Mark Brown
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2023-09-30 23:43 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Mark Brown
The cap11xx devices have three hardware identification registers which are
currently marked as volatile, preventing caching of those registers. This
is not ideal since the registers should never change at runtime, we should
be able to cache the value after the first read. Stop marking the registers
as volatile, we don't have register defaults specified in the driver so
this will result in reading from the hardware on first use.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/input/keyboard/cap11xx.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 1b4937dce672..39ed3b9ddc65 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -160,9 +160,6 @@ static bool cap11xx_volatile_reg(struct device *dev, unsigned int reg)
case CAP11XX_REG_SENOR_DELTA(3):
case CAP11XX_REG_SENOR_DELTA(4):
case CAP11XX_REG_SENOR_DELTA(5):
- case CAP11XX_REG_PRODUCT_ID:
- case CAP11XX_REG_MANUFACTURER_ID:
- case CAP11XX_REG_REVISION:
return true;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] Input: cap11xx - Convert to use maple tree register cache
2023-09-30 23:43 [PATCH 0/3] Input: Small regmap improvements Mark Brown
2023-09-30 23:43 ` [PATCH 1/3] Input: cap11xx - Cache hardware ID registers Mark Brown
@ 2023-09-30 23:43 ` Mark Brown
2023-10-03 6:16 ` Dmitry Torokhov
2023-09-30 23:43 ` [PATCH 3/3] Input: qt1050 " Mark Brown
2023-12-13 5:39 ` [PATCH 0/3] Input: Small regmap improvements Dmitry Torokhov
3 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2023-09-30 23:43 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Mark Brown
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/input/keyboard/cap11xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 39ed3b9ddc65..77843ad15d4c 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -174,7 +174,7 @@ static const struct regmap_config cap11xx_regmap_config = {
.reg_defaults = cap11xx_reg_defaults,
.num_reg_defaults = ARRAY_SIZE(cap11xx_reg_defaults),
- .cache_type = REGCACHE_RBTREE,
+ .cache_type = REGCACHE_MAPLE,
.volatile_reg = cap11xx_volatile_reg,
};
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] Input: qt1050 - Convert to use maple tree register cache
2023-09-30 23:43 [PATCH 0/3] Input: Small regmap improvements Mark Brown
2023-09-30 23:43 ` [PATCH 1/3] Input: cap11xx - Cache hardware ID registers Mark Brown
2023-09-30 23:43 ` [PATCH 2/3] Input: cap11xx - Convert to use maple tree register cache Mark Brown
@ 2023-09-30 23:43 ` Mark Brown
2023-12-13 5:39 ` [PATCH 0/3] Input: Small regmap improvements Dmitry Torokhov
3 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2023-09-30 23:43 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Mark Brown
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/input/keyboard/qt1050.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/qt1050.c b/drivers/input/keyboard/qt1050.c
index 6953097db445..b51dfcd76038 100644
--- a/drivers/input/keyboard/qt1050.c
+++ b/drivers/input/keyboard/qt1050.c
@@ -213,7 +213,7 @@ static struct regmap_config qt1050_regmap_config = {
.val_bits = 8,
.max_register = QT1050_RES_CAL,
- .cache_type = REGCACHE_RBTREE,
+ .cache_type = REGCACHE_MAPLE,
.wr_table = &qt1050_writeable_table,
.rd_table = &qt1050_readable_table,
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] Input: cap11xx - Convert to use maple tree register cache
2023-09-30 23:43 ` [PATCH 2/3] Input: cap11xx - Convert to use maple tree register cache Mark Brown
@ 2023-10-03 6:16 ` Dmitry Torokhov
2023-10-03 12:16 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2023-10-03 6:16 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-input, linux-kernel
Hi Mark,
On Sun, Oct 01, 2023 at 01:43:39AM +0200, Mark Brown wrote:
> The maple tree register cache is based on a much more modern data structure
> than the rbtree cache and makes optimisation choices which are probably
> more appropriate for modern systems than those made by the rbtree cache.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
> drivers/input/keyboard/cap11xx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
> index 39ed3b9ddc65..77843ad15d4c 100644
> --- a/drivers/input/keyboard/cap11xx.c
> +++ b/drivers/input/keyboard/cap11xx.c
> @@ -174,7 +174,7 @@ static const struct regmap_config cap11xx_regmap_config = {
> .reg_defaults = cap11xx_reg_defaults,
>
> .num_reg_defaults = ARRAY_SIZE(cap11xx_reg_defaults),
> - .cache_type = REGCACHE_RBTREE,
> + .cache_type = REGCACHE_MAPLE,
I do not think these driver care much about the cache type. Optimal one
might even depend on the architecture. I wonder if we could have
something like REGCACHE_DEFAULT to signal that whatever is the "best
default" implementation it should be used?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] Input: cap11xx - Convert to use maple tree register cache
2023-10-03 6:16 ` Dmitry Torokhov
@ 2023-10-03 12:16 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2023-10-03 12:16 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 770 bytes --]
On Mon, Oct 02, 2023 at 11:16:51PM -0700, Dmitry Torokhov wrote:
> On Sun, Oct 01, 2023 at 01:43:39AM +0200, Mark Brown wrote:
> > - .cache_type = REGCACHE_RBTREE,
> > + .cache_type = REGCACHE_MAPLE,
> I do not think these driver care much about the cache type. Optimal one
> might even depend on the architecture. I wonder if we could have
> something like REGCACHE_DEFAULT to signal that whatever is the "best
> default" implementation it should be used?
I do sometimes wonder about that but there's also been enough issues
with the earlier stage of the transition and shaking out bugs in the
new code that it makes me a bit nervous about using one. It has also
been a useful exercise to go through and actually look at the users, but
that could be done any time.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] Input: Small regmap improvements
2023-09-30 23:43 [PATCH 0/3] Input: Small regmap improvements Mark Brown
` (2 preceding siblings ...)
2023-09-30 23:43 ` [PATCH 3/3] Input: qt1050 " Mark Brown
@ 2023-12-13 5:39 ` Dmitry Torokhov
3 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2023-12-13 5:39 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-input, linux-kernel
On Sun, Oct 01, 2023 at 01:43:37AM +0200, Mark Brown wrote:
> This series has a few small improvements to the regmap usage in some of
> the input drivers, there's nothing really important here but it's all
> nice to have.
Applied the lot, sorry for the delay.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-12-13 5:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-30 23:43 [PATCH 0/3] Input: Small regmap improvements Mark Brown
2023-09-30 23:43 ` [PATCH 1/3] Input: cap11xx - Cache hardware ID registers Mark Brown
2023-09-30 23:43 ` [PATCH 2/3] Input: cap11xx - Convert to use maple tree register cache Mark Brown
2023-10-03 6:16 ` Dmitry Torokhov
2023-10-03 12:16 ` Mark Brown
2023-09-30 23:43 ` [PATCH 3/3] Input: qt1050 " Mark Brown
2023-12-13 5:39 ` [PATCH 0/3] Input: Small regmap improvements Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox