Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2420347rdb; Tue, 12 Sep 2023 00:51:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhbB81HVGvYNatzZjsygackNUW2ym0X91uJkJ36GKiY2cmOj62ygvq/RLMPZtsPRxBNGW4 X-Received: by 2002:aca:1215:0:b0:3a7:4876:6044 with SMTP id 21-20020aca1215000000b003a748766044mr13049462ois.52.1694505112318; Tue, 12 Sep 2023 00:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694505112; cv=none; d=google.com; s=arc-20160816; b=WBQ7WwZJS0uRPafihSGjpg2wlw6CY39ONFCxZVuB687u3gcQiIfQMaPw9nDxafnm/A Okt/j8d5gPcvHdTVhF8VXFDYLdA2BIv0GAyYPZKRHMy+MmnwNYnJrWxwwW6rRMdFx1dp CVNnNXbfrJ+QuELbA2WByGfIWx72/26pR8WIWLnBph/MLTLsx83vSv4+89WOmR50Pw29 cVWMxdNj7i5v1Vxcm8LMNuyknO5i2/ufBP9a+cXzT0mPblrVRs5wQJWBYAjCa3lCKmc9 vZzEN2HCDTcUykpNzaaeSISZbPdw/37pB67TrVRxdyh8E+raFvzEyX5kK/UBroro7/hS hSpg== 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=0TiFKFK+XRL8Y2Qq5YanADGgX/99HgRFoLldxYf1nF8=; fh=7xbNZwTym+CKkW9darKiAIrlxwrHvdD9/+5rIv88u2Q=; b=fZT78gxt7LZkqcUVpqmG9vxPUBh3YveZICWKEZtwa5YgOYRc7IZ7kq5mOObnJI4ZKx KLg6kTUHHLc76pwvd/ZkRCJU1xh3VXSVNIJP3Th+BB67t02rhdxHT5mBCFcVtEisbNQz AsIAK2RsHyD5v8k5hEvJSJ9LESFLwDeuzm/eDxQKk2Mb60cg1+zjybJgH9yOQ4KmfTOh Djh8Vl4o1TaHwnxm5vygzJJEtI1Eo2q1rXejKk8gYWnr4G7DeQ9T6iRMIOgkTGUH3LSz /pDWCDW3ONfT6NhPaOsiaYc+AhhgUOpKWIcI6h1jhxcTIxAXTAXF9MeVcUuVCg0M7Ynn gtlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=YtZyX6fe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id z19-20020a63e113000000b0057744d09d09si5460249pgh.130.2023.09.12.00.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:51:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=YtZyX6fe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9C8EC80D542B; Mon, 11 Sep 2023 21:54:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbjILEyg (ORCPT + 99 others); Tue, 12 Sep 2023 00:54:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbjILExd (ORCPT ); Tue, 12 Sep 2023 00:53:33 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D76C61982 for ; Mon, 11 Sep 2023 21:52:44 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so13436552a12.1 for ; Mon, 11 Sep 2023 21:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1694494363; x=1695099163; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0TiFKFK+XRL8Y2Qq5YanADGgX/99HgRFoLldxYf1nF8=; b=YtZyX6fee1IO+aOnbTokMR4XX16aVgMWzCsyarqP2QKtOW1lWjQ2UdwETjELmUllF/ Y16oLHPajwBTC08nDH6U0tq1QTpsnt7DDQLImNt+acxjND+nm0Iv4gEVdMbtn3JRQaW+ JwaYk019jwzZYOD4Y7qulXIZrrOO5mGBxdvBCnkTGBO3U71mYQ5dvAh6GQeudwkKk/Ej DDa3dN2Amsbaql4s0iXjxVxtnvY4nt5LY9h9rh8674tIzzdti0NUkjzk/teZnabmZAXQ xq4oZadhmfNaMfIdEd5g1952N+HlUibOk9YL4vBa0CjCy1G0vLOs19uVhAD3JczMVpjE 7p/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694494363; x=1695099163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0TiFKFK+XRL8Y2Qq5YanADGgX/99HgRFoLldxYf1nF8=; b=DqJAjrofJejLVTQ4Fge4zrSykFVD5MPCKtT1roa4qeoUA6VWoMVRB4XuWoSazMncys xYxLh14ZiJUB5t+WwKAgvAWLb3ijly4Wh0NnVVQavFFVu1pJRQSAIgZbsi2Vb/WMFW3+ OMV9kqHDoCbESf0dlZYu9wQae3Ncobxs+tyMV0QSMhP3F691IWNm2+4tbDceN84xppdR O6LiK9Daq4KktyejLZnFH8zdMk0lI+eFNJMtqcDmhpMBD3JZDtSl2xG0IutSs9seDgI4 QGh8G1KwBmY76znH1AM4YGXazqwRtAQgSof63/Xy0yO2G/komCXFqOSs1c+9/oh3ET5o GVJw== X-Gm-Message-State: AOJu0YzpEA1kkC7dEf1shDjMS3rpaVNRv77GS3VKwgpz68xAEN2ehwhx JmjFQFY4NSEcb3dxoPMD8/TS2A== X-Received: by 2002:a05:6402:2899:b0:52a:586a:b19a with SMTP id eg25-20020a056402289900b0052a586ab19amr1381363edb.21.1694494363502; Mon, 11 Sep 2023 21:52:43 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.145]) by smtp.gmail.com with ESMTPSA id f21-20020a05640214d500b0051e22660835sm5422415edx.46.2023.09.11.21.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 21:52:43 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, magnus.damm@gmail.com, catalin.marinas@arm.com, will@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, biju.das.jz@bp.renesas.com, quic_bjorande@quicinc.com, arnd@arndb.de, konrad.dybcio@linaro.org, neil.armstrong@linaro.org, nfraprado@collabora.com, rafal@milecki.pl, wsa+renesas@sang-engineering.com Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Claudiu Beznea Subject: [PATCH 13/37] clk: renesas: rzg2l: use FIELD_GET() for PLL register fields Date: Tue, 12 Sep 2023 07:51:33 +0300 Message-Id: <20230912045157.177966-14-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912045157.177966-1-claudiu.beznea.uj@bp.renesas.com> References: <20230912045157.177966-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 11 Sep 2023 21:54:53 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email From: Claudiu Beznea Use FIELD_GET() for PLL register fields. This is its purpose. Signed-off-by: Claudiu Beznea --- drivers/clk/renesas/rzg2l-cpg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c index d8801f88df8e..50f69bbe1a6e 100644 --- a/drivers/clk/renesas/rzg2l-cpg.c +++ b/drivers/clk/renesas/rzg2l-cpg.c @@ -11,6 +11,7 @@ * Copyright (C) 2015 Renesas Electronics Corp. */ +#include #include #include #include @@ -38,14 +39,13 @@ #define WARN_DEBUG(x) do { } while (0) #endif -#define DIV_RSMASK(v, s, m) ((v >> s) & m) #define GET_SHIFT(val) ((val >> 12) & 0xff) #define GET_WIDTH(val) ((val >> 8) & 0xf) -#define KDIV(val) DIV_RSMASK(val, 16, 0xffff) -#define MDIV(val) DIV_RSMASK(val, 6, 0x3ff) -#define PDIV(val) DIV_RSMASK(val, 0, 0x3f) -#define SDIV(val) DIV_RSMASK(val, 0, 0x7) +#define KDIV(val) FIELD_GET(GENMASK(31, 16), val) +#define MDIV(val) FIELD_GET(GENMASK(15, 6), val) +#define PDIV(val) FIELD_GET(GENMASK(5, 0), val) +#define SDIV(val) FIELD_GET(GENMASK(2, 0), val) #define CLK_ON_R(reg) (reg) #define CLK_MON_R(reg) (0x180 + (reg)) -- 2.39.2