Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7591323rwi; Mon, 24 Oct 2022 17:18:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Dhu8MuPOTu8+GnRDZhawG9JVzQML7omzIfIIVJHew4slNkki+on/40j4AGXUOSgt4uAY0 X-Received: by 2002:a17:902:7684:b0:186:8bc6:172d with SMTP id m4-20020a170902768400b001868bc6172dmr13976801pll.77.1666657098727; Mon, 24 Oct 2022 17:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666657098; cv=none; d=google.com; s=arc-20160816; b=FpkN/F3pqU3Br454vE92cmiWaoYXfKGUK2y+XJyrYDna7OfCy8vYD7UUub24jbacDi 6YIjYPYK3nh3JjLUVdzgobGtd4s60oxGlO80esHtpdmSmRbvi6pgE0znplM9HFcYWK52 gPpNUpN0lhV4g5PoRJxick7uA96uzwdSrCoQ7YatP5Yb2dVlynKYo17LvQnFnarw3z5d U+wZGiWAGszeix+CD4u9AbSPEyair39Zz/z1jSXzWAPhvApvV00d+N01jk9PAndu+Wve kJgGLt6fqRyDlu4tUM4o/10eGzSuFdLEjbdjOrTW1ftqgqy+aOylUgTo59myoxUxh+Nk PeEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HPp+33aYNoQqAGKipSoPytGt3HFjbS0IYlzYnBXZnaU=; b=gepoVww7uZW+oOcW4AOh8GvM1WLCEhnZ9a+YdO5x81N/XBm4/tdSKfclXhM2JoLyv7 JZmETl5yBKxvzG4A9UBZoWuP/YPk76vHUgc7SWiS6XZ/pxEif7sO+kaUWpwKa1JGueGF Xe0q7CfBVxYsjv7n/HXr73ooRasQ45ezUyt2Dh0xy5huTEj0DW938EHS1thVf8iw/wpv q3NANjg9gz2iajep+ELQLrM6qNeNZhxpSjbg+rikeI4i960JtBilZyV+RW1WSnWOzuEo ULY9tdJsc0nSsBtHMvurIMRXuDYL+5rgOxwB7WrbmGXoKLyHkE7/1okkKXRZ3P117qS8 OFIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=jmCmEXMj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h22-20020a63df56000000b0044a82d20079si1068440pgj.526.2022.10.24.17.18.05; Mon, 24 Oct 2022 17:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=jmCmEXMj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231345AbiJXXcN (ORCPT + 99 others); Mon, 24 Oct 2022 19:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231297AbiJXXbq (ORCPT ); Mon, 24 Oct 2022 19:31:46 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 017771D4DFA; Mon, 24 Oct 2022 14:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666644743; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HPp+33aYNoQqAGKipSoPytGt3HFjbS0IYlzYnBXZnaU=; b=jmCmEXMjhFZ7z+eIBo9HtNqhmipvRftvCUfSkfxFDQLiBRNfB9VrBmbvT96g75zhyIZIce shnY8wpFnn7y/GovUG363mZ+WURakSFyv420pdTbBDBiPOx0yoe+99bQVAb/OULG5PUbgE R7g4gCSz49qRygDCKTsSTHba6xJ1CCw= From: Paul Cercueil To: Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: od@opendingux.net, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH 5/5] pwm: jz4740: Use regmap_{set,clear}_bits Date: Mon, 24 Oct 2022 21:52:13 +0100 Message-Id: <20221024205213.327001-6-paul@crapouillou.net> In-Reply-To: <20221024205213.327001-1-paul@crapouillou.net> References: <20221024205213.327001-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Simplify a bit the code by using regmap_set_bits() and regmap_clear_bits() instead of regmap_update_bits() when possible. Signed-off-by: Paul Cercueil --- drivers/pwm/pwm-jz4740.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c index c0afc0c316a8..22fcdca66081 100644 --- a/drivers/pwm/pwm-jz4740.c +++ b/drivers/pwm/pwm-jz4740.c @@ -88,8 +88,7 @@ static int jz4740_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) struct jz4740_pwm_chip *jz = to_jz4740(chip); /* Enable PWM output */ - regmap_update_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm), - TCU_TCSR_PWM_EN, TCU_TCSR_PWM_EN); + regmap_set_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm), TCU_TCSR_PWM_EN); /* Start counter */ regmap_write(jz->map, TCU_REG_TESR, BIT(pwm->hwpwm)); @@ -129,8 +128,7 @@ static void jz4740_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) * In TCU2 mode (channel 1/2 on JZ4750+), this must be done before the * counter is stopped, while in TCU1 mode the order does not matter. */ - regmap_update_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm), - TCU_TCSR_PWM_EN, 0); + regmap_clear_bits(jz->map, TCU_REG_TCSRc(pwm->hwpwm), TCU_TCSR_PWM_EN); /* Stop counter */ regmap_write(jz->map, TCU_REG_TECR, BIT(pwm->hwpwm)); @@ -204,8 +202,8 @@ static int jz4740_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, regmap_write(jz4740->map, TCU_REG_TDFRc(pwm->hwpwm), period); /* Set abrupt shutdown */ - regmap_update_bits(jz4740->map, TCU_REG_TCSRc(pwm->hwpwm), - TCU_TCSR_PWM_SD, TCU_TCSR_PWM_SD); + regmap_set_bits(jz4740->map, TCU_REG_TCSRc(pwm->hwpwm), + TCU_TCSR_PWM_SD); if (state->enabled) { /* -- 2.35.1