From patchwork Fri May 20 12:51:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 574710 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 B1D4AC433FE for ; Fri, 20 May 2022 12:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349577AbiETMvt (ORCPT ); Fri, 20 May 2022 08:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349572AbiETMvp (ORCPT ); Fri, 20 May 2022 08:51:45 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317A92EA1E; Fri, 20 May 2022 05:51:44 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 8FBD81F462B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653051103; bh=QOwsebbE+upK+gVJVhJOnLLBda4LVPYp2RLtMhPVfBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kvyz47qav2Xdemr7tAjD4VetXMYQoqNOwqLFnVEnrn6pbZ3gWfOKdt4ivXsFod/mL Src1tfD33PCWy4b/3iPGp/p7T+PgnzxyRCoUXFcgg0pjVpwSfyVOWIRehudhAjJ0xS 2UaBjW373IJJ48wH5VdcIEiuhkb6MI3E5eLJxBS4qldLh+hPBPDDT7DMDv7QXzGblg cEV4o0RTJRbsYyhOU47RP3xGex1eHSeRsrSMBRxs4LT5SY+k8hdQuDsMp4aM0mEOj7 7kSGzdI7bIg3JDsg8OBQxCfq8weuRp/r8fB88fXO7+94UdnCZF6yQ8jbYHj2vuYgnS p6XB6Bn5RxhCg== From: AngeloGioacchino Del Regno To: dmitry.torokhov@gmail.com Cc: matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, mkorpershoek@baylibre.com, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] Input: mtk-pmic-keys - Use regmap_{set, clear}_bits where possible Date: Fri, 20 May 2022 14:51:29 +0200 Message-Id: <20220520125132.229191-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220520125132.229191-1-angelogioacchino.delregno@collabora.com> References: <20220520125132.229191-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Instead of always using regmap_update_bits(), let's go for the shorter regmap_set_bits() and regmap_clear_bits() where possible. No functional change. Signed-off-by: AngeloGioacchino Del Regno --- drivers/input/keyboard/mtk-pmic-keys.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c index 8e4fa7cd16e6..83d0b90cc8cb 100644 --- a/drivers/input/keyboard/mtk-pmic-keys.c +++ b/drivers/input/keyboard/mtk-pmic-keys.c @@ -157,28 +157,16 @@ static void mtk_pmic_keys_lp_reset_setup(struct mtk_pmic_keys *keys, switch (long_press_mode) { case LP_ONEKEY: - regmap_update_bits(keys->regmap, pmic_rst_reg, - MTK_PMIC_PWRKEY_RST, - MTK_PMIC_PWRKEY_RST); - regmap_update_bits(keys->regmap, pmic_rst_reg, - MTK_PMIC_HOMEKEY_RST, - 0); + regmap_set_bits(keys->regmap, pmic_rst_reg, MTK_PMIC_PWRKEY_RST); + regmap_clear_bits(keys->regmap, pmic_rst_reg, MTK_PMIC_HOMEKEY_RST); break; case LP_TWOKEY: - regmap_update_bits(keys->regmap, pmic_rst_reg, - MTK_PMIC_PWRKEY_RST, - MTK_PMIC_PWRKEY_RST); - regmap_update_bits(keys->regmap, pmic_rst_reg, - MTK_PMIC_HOMEKEY_RST, - MTK_PMIC_HOMEKEY_RST); + regmap_set_bits(keys->regmap, pmic_rst_reg, MTK_PMIC_PWRKEY_RST); + regmap_set_bits(keys->regmap, pmic_rst_reg, MTK_PMIC_HOMEKEY_RST); break; case LP_DISABLE: - regmap_update_bits(keys->regmap, pmic_rst_reg, - MTK_PMIC_PWRKEY_RST, - 0); - regmap_update_bits(keys->regmap, pmic_rst_reg, - MTK_PMIC_HOMEKEY_RST, - 0); + regmap_clear_bits(keys->regmap, pmic_rst_reg, MTK_PMIC_PWRKEY_RST); + regmap_clear_bits(keys->regmap, pmic_rst_reg, MTK_PMIC_HOMEKEY_RST); break; default: break;