From patchwork Sat Sep 30 23:43:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13405250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55736E748F0 for ; Sat, 30 Sep 2023 23:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234071AbjI3XoD (ORCPT ); Sat, 30 Sep 2023 19:44:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233997AbjI3XoD (ORCPT ); Sat, 30 Sep 2023 19:44:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94F07BC; Sat, 30 Sep 2023 16:44:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4ABD1C433C9; Sat, 30 Sep 2023 23:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696117441; bh=olNQkj8edqE39Hnx3Oj7nNyzlOiwbJE3qR/nV/hU2lU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=t9+0HeM8h0NMZd6L6BXOILF3oRLLelLqQKbHHtcpRexMa2pwibfuXvVMkz10D9l9g zbi/cFZghVEhwQYSEwtYcvfsDs+l9W1sId6iqzVRafxdSvLgnwDfb6FsQA4A4ZZN4D CzM9FR3w18Jd5MCQbr/ixGYJJJsYH1LROEhbXR/s8XkhUK53Mcx1/NmmWYMR8NIkcs +JyQaD6RPJ/1EjJrvytF3lD5T2OqJRmr8QRn8HvZffwfsHu2EJPAKWIFwmUPxVAcR6 asRA1uOOAK/JWd4czR0bR2TW09ciZsfvjYDknDFFy0NnmqfeLRUIdiNIGebGmhLNXU AB5LqdShpk0Mw== From: Mark Brown Date: Sun, 01 Oct 2023 01:43:38 +0200 Subject: [PATCH 1/3] Input: cap11xx - Cache hardware ID registers MIME-Version: 1.0 Message-Id: <20231001-input-maple-v1-1-ed3716051431@kernel.org> References: <20231001-input-maple-v1-0-ed3716051431@kernel.org> In-Reply-To: <20231001-input-maple-v1-0-ed3716051431@kernel.org> To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=1113; i=broonie@kernel.org; h=from:subject:message-id; bh=olNQkj8edqE39Hnx3Oj7nNyzlOiwbJE3qR/nV/hU2lU=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlGLK7yToUWh2XoyPoMn9R5B56M56wpY2OnXgw+ uBZKOGIeFCJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZRiyuwAKCRAk1otyXVSH 0D2QB/9GAhS5JfxpCk95gMbZGldAqZxfTAvpSdQoEzf9WjBmnX1dK12RB7ZhFt6eW1p+51vcO/o 8JwRaAYUsa87GdQ/+Xj02p6bDrU9RCwgykpIC5H2EddPswMHXm9NmJ/NRn0kttH1HaiU6p+Up9R oMrprnwBHfvCIeCBH9IUgQNymctk3Eq//BcbnCgS6QdzJPzRey9jUGr7byJdrjL7QwrTQzVnS7a C6gLXW3V3wXntawN6nkD4gBc2SIuDNA+cWl9jfmxz7vRjWyzTDrPYim5sA5namnQpuKkm2bDzql Q2DILJK67X2ZP7TXeOfRbKfddKaMvBVSpj1xT4jV+sIg7AXT X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- 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; } From patchwork Sat Sep 30 23:43:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13405252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93F6BE748E6 for ; Sat, 30 Sep 2023 23:44:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234162AbjI3XoG (ORCPT ); Sat, 30 Sep 2023 19:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233997AbjI3XoE (ORCPT ); Sat, 30 Sep 2023 19:44:04 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00B79BC; Sat, 30 Sep 2023 16:44:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B32DBC433C7; Sat, 30 Sep 2023 23:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696117442; bh=gWdnyYXttxIjh88wfA/QmRjMof3T9So3DMxuvdVdIUQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VJtuRrycxQGWoNSXUGTCkRhEeCg5lX5JvxdNj8wVaN/6ubtt2Rt9m+QvUYrOcqhhl kDchcEJ6ScCH7X4NYvhjLP13UMcUujADKfV2mBS10pgfGepFDOG+vW/gAvrq/1Pj2i QckII3LthanX+9sFXcBm1tMPGpv0uSizTkbQx2/R+Dz7Nn+NmCMkin58Ov/+v2UGrE NNk5l2StLvs50NwwwuD/Bm5KewJLZmQaCziKAryOqLZpkjv8DWaiXCfc/vFv5wvoLA K8Ypr+1fBE/NopMO//WKG8DmP82Cf4WHPXcWRbTEVkS8tWHLS6tj0pIvtMN1jGGf8Y 9MD6qOESx2r4g== From: Mark Brown Date: Sun, 01 Oct 2023 01:43:39 +0200 Subject: [PATCH 2/3] Input: cap11xx - Convert to use maple tree register cache MIME-Version: 1.0 Message-Id: <20231001-input-maple-v1-2-ed3716051431@kernel.org> References: <20231001-input-maple-v1-0-ed3716051431@kernel.org> In-Reply-To: <20231001-input-maple-v1-0-ed3716051431@kernel.org> To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=887; i=broonie@kernel.org; h=from:subject:message-id; bh=gWdnyYXttxIjh88wfA/QmRjMof3T9So3DMxuvdVdIUQ=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlGLK8phUcg9KoLSH9kT34IAkPQCetOyoMtXxGV fMmWLgzFLWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZRiyvAAKCRAk1otyXVSH 0OT7B/9Jgtz/re02rBFTuuXqFAw5agg5zLC7OM9Ge1yr6WEFqwfbqsh42MxBo/S2dsQGqnlSgCj q8Q3Ve7Gmiv9zSWQDvB9Hcao7IY1DI3ZOgetJdZeODUoJHmLQxwBA0FZCwwCA3dFTvhIoZSeCU7 p5jcICAnRAvLA6VQTXfFgPpbEvIN3KT18QevJfjPipWwerUEFhxqMXXqOVUHmGFBQ2dFP2F3DoD 5GJL5m63EHUxAFyzgZQcgIcQ2LCrq4+tFMJLazvMYmXkeQDsXxK7Pp9XF3NhfQnfDfeZs2QSQB/ Jz3+N+naNRdAFVuYCKNuBa1jivzbTpkv/Imj27GJlTK4A2Be X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- 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, }; From patchwork Sat Sep 30 23:43:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13405253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB513E748F0 for ; Sat, 30 Sep 2023 23:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234199AbjI3XoL (ORCPT ); Sat, 30 Sep 2023 19:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234164AbjI3XoG (ORCPT ); Sat, 30 Sep 2023 19:44:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64B1FAC; Sat, 30 Sep 2023 16:44:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FBB5C433C8; Sat, 30 Sep 2023 23:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696117444; bh=BEks8HaDvSubS8uxPTW2QSiBpwY7OijnnKFGqECTObg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KcDxKg5kNamfks/Id5aFchU30jWVqLW7FkC9wjYU5sZmr7XNqLQDSqgrOBxJwxVg+ 9+HYvS4RoAZG4299WqKpp/NhNfbn42wxeM01bR+kaPKQvimovSV1qE1Huc4goTPo5f uAAse1tZSUpDJrjeow1mnDqw36eoelabuZ0qXuZ/XjQhNjkGZ++EfLLA5oUhSEsVME sepFI+VW0OCV/wk2luxOmuXxyhyp8xyfyFf2QNYBv+c4hF11kCkxhIye/MA731H2my cHHQQnn8/Rw6ao5YrYjghk9m37ZRHuL4fMA3HI5wh/rejJHrJlDWDJlgwBbaSgx74Q A79EuIzmRkIaQ== From: Mark Brown Date: Sun, 01 Oct 2023 01:43:40 +0200 Subject: [PATCH 3/3] Input: qt1050 - Convert to use maple tree register cache MIME-Version: 1.0 Message-Id: <20231001-input-maple-v1-3-ed3716051431@kernel.org> References: <20231001-input-maple-v1-0-ed3716051431@kernel.org> In-Reply-To: <20231001-input-maple-v1-0-ed3716051431@kernel.org> To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=863; i=broonie@kernel.org; h=from:subject:message-id; bh=BEks8HaDvSubS8uxPTW2QSiBpwY7OijnnKFGqECTObg=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlGLK9iJCL4tJTga+xDHMZqbKIe1TesSPnVwMtX ptSnTMjBc+JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZRiyvQAKCRAk1otyXVSH 0LycB/9hXFah9KqbRqYjjcBLcSuJ2H9YxGyTHq4/1MfbwNz4ffTCn7OpFXofQtFcl8WxzAnUZdl Qa2jVj1X9wC7lHQZoV0Pcl4S6NzwFulxef1ve4kC3pzD6psefwVY7qOXadL2/Qr7FObf0EgW0RU aGIkif5JQRGi8OnKiuZgfbIDsUJ+Fj2BaECXy1/rtMKUZyow+pzaK5w4smbE1/pt7a0Lzqc80t5 GYKMu9njbrc+nDW0627itxBTK79CSxKBMLv80M9bBBD8caQJhYO7PkQYBzKeKUgME8VFqaqmAci IFJp2M2iY6ne6k6NFGzqv6VUhadbSMhhoZ/TXKxA2j53fFWL X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- 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,