From patchwork Fri Dec 18 07:11:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 7880151 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9E0BF9F1AF for ; Fri, 18 Dec 2015 07:12:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0CA020480 for ; Fri, 18 Dec 2015 07:12:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0817F2047B for ; Fri, 18 Dec 2015 07:12:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9pDg-000125-K1; Fri, 18 Dec 2015 07:12:52 +0000 Received: from mail-pf0-x232.google.com ([2607:f8b0:400e:c00::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a9pDd-0000zl-UQ for linux-mediatek@lists.infradead.org; Fri, 18 Dec 2015 07:12:51 +0000 Received: by mail-pf0-x232.google.com with SMTP id n128so26675391pfn.0 for ; Thu, 17 Dec 2015 23:12:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=6JUSoLAHGuXqz6ru3qx8teTyZ5ZIdS9VP5xiINXrJew=; b=gG7xUBOz2AF6CAglr6sGLL15NZ8T4QVfPFM4RwRhZ6Mdg+UO1YtRIzed96fzpjjvpY SjML+F5teydMi45/CNoP683r5seGtJFQd7Y1Azop2ofpn0DRiqDQRb/1t045PpQRSZSI eJ/UAezDSS3luC1q3doCG1eKOj6xMIFnGD8qU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6JUSoLAHGuXqz6ru3qx8teTyZ5ZIdS9VP5xiINXrJew=; b=HfT+3yUwkXBHZ3FLNAyVk2oUJbBSjD70Fo1CkZok3opQ1QI48InXSI/P5OwoeH8nx7 I4n+JCO+3TOBfoejePmNugxNN5uZO/3WTzFX6kuZuQM9B9TjZ3MJJi0US1sGoO779ObF cwhPNLY9zacXq9RHazQPJkTVmdB16+hYg6CiGrLIPpRXMQ2TYHodWKzukAZmiLu6sSbn P8cN3oBAl2q+92D+fcISpAvi64cwNcZ0hgL+ZJoD+EB0tsaCE7jXLNH0IwUpRm2LpXio V1Z3JzvAehdzTz4PYDb7lUv6a/PuSLqXMseZNwZ70dXApk3KnwueBn2BKL1/b+q2uKdc qKlw== X-Gm-Message-State: ALoCoQkLdy5nyFbeXtmzkl8pVHf2glaIFifGqh7BOyjT1X3OZtBsTLp+VONjSb1laTV2LXFUkmtn8td75L/vbURFZAAeDkLIkQ== X-Received: by 10.98.8.212 with SMTP id 81mr2945437pfi.165.1450422749122; Thu, 17 Dec 2015 23:12:29 -0800 (PST) Received: from djkurtz1.tpe.corp.google.com ([172.30.210.4]) by smtp.gmail.com with ESMTPSA id e87sm15565297pfd.7.2015.12.17.23.12.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Dec 2015 23:12:28 -0800 (PST) From: Daniel Kurtz To: Henry Chen Subject: [RESEND PATCH] regulator: mt6311: Use REGCACHE_RBTREE Date: Fri, 18 Dec 2015 15:11:33 +0800 Message-Id: <1450422693-371-1-git-send-email-djkurtz@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151217_231250_025867_55346CA6 X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liam Girdwood , "open list:VOLTAGE AND CURRENT REGULATOR FRAMEWORK" , Mark Brown , linux-mediatek@lists.infradead.org, Matthias Brugger , eddie.huang@mediatek.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Henry Chen --- 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 */