From patchwork Sun Apr 2 09:42:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 78207 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1655083vqo; Sun, 2 Apr 2023 02:44:22 -0700 (PDT) X-Google-Smtp-Source: AKy350a5OGYo1LupXWSpPIv5ch9AbXxd/Gzm5UT/cq/MVdSR2OK3KcuX0iHXtY+cGT3/1wz5HG59 X-Received: by 2002:a17:906:250d:b0:8ae:e724:ea15 with SMTP id i13-20020a170906250d00b008aee724ea15mr31017050ejb.76.1680428662630; Sun, 02 Apr 2023 02:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680428662; cv=none; d=google.com; s=arc-20160816; b=HQ2o/f09dMcG+uPxbh3A2DyGamEz/4NPyKY1qVNAJLS1mJ6R/nsTXh8cr+A7nN3u8r xYMtwqlcJZNNskhgXjWf34QCwSQkFjf0trmp2pDMrOTqWhUgXXcgbzBuCrGEqkDme1Sx ZRC1oxgF6KKsRWer6Qu1B2RCFlZ57I/7xs6ZEpZwBaipZFWP4IxXbSsNs5g6FwwckZrY rAVpOYXYyRtl3zGAuwdqcU5vz2Pp+hPfhpP9WDprsa5Sh/IRThLaVvJu+f/FDf7W8Am7 iXGhcrD30CiWzH+oxUUJwrGAUZjqFRRDBomT78Ki7f+0xU9J2k9S1sgJJbTusFWzdmCH /HvA== 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; bh=QT5yFmgCNPj9GQvMRvz/D/b7eOq3lrYP2uQVDtDaTlE=; b=Lcp6sMZeKVPLdpUAo5RGV6katV6U7Lcrxrui1hRYC2iHrlAInQFw6zxkerdGwnMH3c sRCUjL2ieCuOIgGRU9ao71hzZSumwVuki8R084n+dwS3tznwD+AJ1fb73EShwKV7VxVF ijXov4p9RT1GXKgxc1gkmwlyz3/75b8Ko3XCmz8G7822mwKN/LzXodnFC6vkGgqdFOAR Pl2IeFKiaZGNuUgURc2AHs3uMJbkWStkHkPxhRdJm3/D0gzt/iBTRyuXb2tziiMnrBJQ xrJELZmj6XcVVlOuvtNUWMU38KDrCZxw8KWujs5pI4WD7HvtLnV+uo08nwke/+SiAWeK VzkA== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a1709066b8900b009217e23a19esi267726ejr.599.2023.04.02.02.43.59; Sun, 02 Apr 2023 02:44:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbjDBJm2 (ORCPT + 99 others); Sun, 2 Apr 2023 05:42:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230196AbjDBJm0 (ORCPT ); Sun, 2 Apr 2023 05:42:26 -0400 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FC3A1BF7B for ; Sun, 2 Apr 2023 02:42:24 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id iuDzpwm4hwFKBiuEApeDi6; Sun, 02 Apr 2023 11:42:23 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 02 Apr 2023 11:42:23 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: mturquette@baylibre.com, sboyd@kernel.org, abelvesa@kernel.org, peng.fan@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, heiko@sntech.de Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2 1/4] clk: Compute masks for fractional_divider clk when needed. Date: Sun, 2 Apr 2023 11:42:04 +0200 Message-Id: <0fd6357242c974259c9e034c6e28a0391c480bf0.1680423909.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762057165312079654?= X-GMAIL-MSGID: =?utf-8?q?1762057165312079654?= There is no real need to pre-compute mmask and nmask when handling fractional_divider clk. They can be computed when needed. Signed-off-by: Christophe JAILLET Reviewed-by: Heiko Stuebner Reviewed-by: Heiko Stuebner --- drivers/clk/clk-fractional-divider.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c index 6affe3565025..479297763e70 100644 --- a/drivers/clk/clk-fractional-divider.c +++ b/drivers/clk/clk-fractional-divider.c @@ -71,6 +71,7 @@ static void clk_fd_get_div(struct clk_hw *hw, struct u32_fract *fract) struct clk_fractional_divider *fd = to_clk_fd(hw); unsigned long flags = 0; unsigned long m, n; + u32 mmask, nmask; u32 val; if (fd->lock) @@ -85,8 +86,11 @@ static void clk_fd_get_div(struct clk_hw *hw, struct u32_fract *fract) else __release(fd->lock); - m = (val & fd->mmask) >> fd->mshift; - n = (val & fd->nmask) >> fd->nshift; + mmask = GENMASK(fd->mwidth - 1, 0) << fd->mshift; + nmask = GENMASK(fd->nwidth - 1, 0) << fd->nshift; + + m = (val & mmask) >> fd->mshift; + n = (val & nmask) >> fd->nshift; if (fd->flags & CLK_FRAC_DIVIDER_ZERO_BASED) { m++; @@ -166,6 +170,7 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate, struct clk_fractional_divider *fd = to_clk_fd(hw); unsigned long flags = 0; unsigned long m, n; + u32 mmask, nmask; u32 val; rational_best_approximation(rate, parent_rate, @@ -182,8 +187,11 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate, else __acquire(fd->lock); + mmask = GENMASK(fd->mwidth - 1, 0) << fd->mshift; + nmask = GENMASK(fd->nwidth - 1, 0) << fd->nshift; + val = clk_fd_readl(fd); - val &= ~(fd->mmask | fd->nmask); + val &= ~(mmask | nmask); val |= (m << fd->mshift) | (n << fd->nshift); clk_fd_writel(fd, val); @@ -260,10 +268,8 @@ struct clk_hw *clk_hw_register_fractional_divider(struct device *dev, fd->reg = reg; fd->mshift = mshift; fd->mwidth = mwidth; - fd->mmask = GENMASK(mwidth - 1, 0) << mshift; fd->nshift = nshift; fd->nwidth = nwidth; - fd->nmask = GENMASK(nwidth - 1, 0) << nshift; fd->flags = clk_divider_flags; fd->lock = lock; fd->hw.init = &init; From patchwork Sun Apr 2 09:42:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 78208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1655200vqo; Sun, 2 Apr 2023 02:44:48 -0700 (PDT) X-Google-Smtp-Source: AKy350bHuTarI1SVgHbP6/Xn005TTJrwvyRk8xq2TSyIA5oF62DJiVpwkRVv6OvJ7DmY1X2toO7K X-Received: by 2002:a17:907:6e1c:b0:947:bd54:cb8e with SMTP id sd28-20020a1709076e1c00b00947bd54cb8emr7887995ejc.10.1680428688262; Sun, 02 Apr 2023 02:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680428688; cv=none; d=google.com; s=arc-20160816; b=ltXNzfCybX5C6cxnV66Ntm1hm8yoLiGZZT938tJhDWVfFduAjBZZ+Xdh/QAPna4nZs DiAJn1JlQANV7TgGg+zARyYMYivsbio5rN6EJzuoGIaSzSFflWx7qr4KJiYsjldF55Sk USydVFHJHSg920hIvYp0OIgvWJMPv67IjN/w522GCSnvj1Zs7zsK2ng2E8aoM9n34y0e UhObu7pbl6pXLW8o0fo8Qhlxm0ryYVUpvSJzEHHRkKPDUMm41Fg3rvXnct4W99/og+mM dpVRmxDEzQBH8W5C9jTeMWPec2rSAz1rJ80vUU6l0lgHbzWt6qbLW/WTUTnvg9wtC9ym XFfQ== 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; bh=KEQFnAMSOELF+l+fh+rk1czw9PzBB3OxyXt+OHLU+JY=; b=ZUUw29jfQ/FP2S/kLNBR4wWPV2GQps8+fmfYnpMsJNqoRVhhvI6sHe7zN3Ht74qsj2 Gw6+apk7o4QSEmnuZ/iRrZb4l860wquYuub+my66sIqe/8e/IsIKxKCSSCiG3CKTQmyH Q85bcRu5n87OCFb3FoCvujQInI7qpZYEWoLuXSHLuTpfsOVDmVi6PGeCLGpF0I/9eqbb VmfU6r7XjjtX8QPv+4Egs+xExEZEhol33gJ8da3FdLVuiSz7eHSdTpozBh3XHBnr+gUf d0lw7oF/iSukSJttf0qS36tpcvLkfrciwzPE4Ci4Elu6qgyyxgCxfEbkwFbcwD/VpM0p 3foQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a1709067c9300b0092971a9d5e6si2634141ejo.966.2023.04.02.02.44.24; Sun, 02 Apr 2023 02:44:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230312AbjDBJme (ORCPT + 99 others); Sun, 2 Apr 2023 05:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbjDBJm3 (ORCPT ); Sun, 2 Apr 2023 05:42:29 -0400 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E741D1BF76 for ; Sun, 2 Apr 2023 02:42:26 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id iuDzpwm4hwFKBiuEDpeDiY; Sun, 02 Apr 2023 11:42:25 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 02 Apr 2023 11:42:25 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: mturquette@baylibre.com, sboyd@kernel.org, abelvesa@kernel.org, peng.fan@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, heiko@sntech.de Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2 2/4] clk: imx: Remove values for mmask and nmask in struct clk_fractional_divider Date: Sun, 2 Apr 2023 11:42:05 +0200 Message-Id: <187a2266c3a034a593a151d6e5e6b21118043b5d.1680423909.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762057192315501450?= X-GMAIL-MSGID: =?utf-8?q?1762057192315501450?= Now that fractional_divider clk computes mmask and nmask when needed, there is no more need to provide them explicitly anymore. Signed-off-by: Christophe JAILLET Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-composite-7ulp.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/clk/imx/clk-composite-7ulp.c b/drivers/clk/imx/clk-composite-7ulp.c index 4eedd45dbaa8..e208ddc51133 100644 --- a/drivers/clk/imx/clk-composite-7ulp.c +++ b/drivers/clk/imx/clk-composite-7ulp.c @@ -19,10 +19,8 @@ #define PCG_CGC_SHIFT 30 #define PCG_FRAC_SHIFT 3 #define PCG_FRAC_WIDTH 1 -#define PCG_FRAC_MASK BIT(3) #define PCG_PCD_SHIFT 0 #define PCG_PCD_WIDTH 3 -#define PCG_PCD_MASK 0x7 #define SW_RST BIT(28) @@ -102,10 +100,8 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, fd->reg = reg; fd->mshift = PCG_FRAC_SHIFT; fd->mwidth = PCG_FRAC_WIDTH; - fd->mmask = PCG_FRAC_MASK; fd->nshift = PCG_PCD_SHIFT; fd->nwidth = PCG_PCD_WIDTH; - fd->nmask = PCG_PCD_MASK; fd->flags = CLK_FRAC_DIVIDER_ZERO_BASED; if (has_swrst) fd->lock = &imx_ccm_lock; From patchwork Sun Apr 2 09:42:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 78210 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1656931vqo; Sun, 2 Apr 2023 02:51:18 -0700 (PDT) X-Google-Smtp-Source: AK7set9E+CUp1uO8dLVA/+QAEaqFjEay9eeG99IoJYrTsXVn7cGdpxzunq0otk80yVsWKCXh+wLn X-Received: by 2002:a05:6a20:7a98:b0:d4:220d:a7e7 with SMTP id u24-20020a056a207a9800b000d4220da7e7mr29028403pzh.46.1680429078473; Sun, 02 Apr 2023 02:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680429078; cv=none; d=google.com; s=arc-20160816; b=p2lgFXqD2261MP9Gro8+JEZonOcWQnFwBRd9lvRLGmUD5vpKogOYJ4i8zTEPQ2NdCx ZUFVam7Lk0sOX+L+ebB9V1vMQEi79001GR0hpUQUXIJftsfXg8h/oOnJs3KPvSh6jR/e UwtOum20LmEgGQq0UL2J7c9Tu5W/UMfnk3KjZ/YmCyxqfnG8hXB2QElD6XqQ6F0YTMlz 4iLkAcssbwRcJxgTkSPqmf+U4tMkpkHgnHfV8EsgwKazLkxnlCFo6ccgSU2fqt2WfcYS crTytNllB/9STOaWkUKG6YTVdT2pwJjk6Ehj+cevibfWiaWH3tOagWegLzQ3IZC9KoLk rkhg== 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; bh=kEQHhDl5sDyKebY4a4Q61TLaJ7KzP6TXiBSUJ7OXxt8=; b=ywNmZn9q+KZIPamB+D9KqS57sYgAfv2/hYAWiRS75iJiJUyD5NE9jOdSrlvqfJtKod zlkgStCX6qSQT6/VEG62vGFnt39x4baGmZed/y6DjbvnxOp6HAYrGKveLrSRrfs3uX7m sUwjh1KRewbnu+fz8ACNwxRBs6cLq68mbsq797kKOWHD6isWrxLlPDRg1nAr4T7PvLGy Q/XvA7s5eIWwDoTOxoTjpxeacRoNWKQqFK2DTYHsB7qxCcUs2eslRD5B8XODadpDai1B X0vCz4x9vu9zpdC5qCievuvOCaDoCcwjb2+9HKbdCjpZv7llf1PWeI0CimO+oXsYY8/U GcKw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k29-20020aa79d1d000000b00623d0b5b8c4si6297395pfp.115.2023.04.02.02.51.05; Sun, 02 Apr 2023 02:51: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbjDBJma (ORCPT + 99 others); Sun, 2 Apr 2023 05:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbjDBJm3 (ORCPT ); Sun, 2 Apr 2023 05:42:29 -0400 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 190601BF72 for ; Sun, 2 Apr 2023 02:42:28 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id iuDzpwm4hwFKBiuEEpeDj1; Sun, 02 Apr 2023 11:42:26 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 02 Apr 2023 11:42:26 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: mturquette@baylibre.com, sboyd@kernel.org, abelvesa@kernel.org, peng.fan@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, heiko@sntech.de Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2 3/4] clk: rockchip: Remove values for mmask and nmask in struct clk_fractional_divider Date: Sun, 2 Apr 2023 11:42:06 +0200 Message-Id: <58e1950566e40e2fbb31004baee57a164ca6a390.1680423909.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762057600916429459?= X-GMAIL-MSGID: =?utf-8?q?1762057600916429459?= Now that fractional_divider clk computes mmask and nmask when needed, there is no more need to provide them explicitly anymore. Signed-off-by: Christophe JAILLET Reviewed-by: Heiko Stuebner --- drivers/clk/rockchip/clk.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index a8646794575a..4059d9365ae6 100644 --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c @@ -244,10 +244,8 @@ static struct clk *rockchip_clk_register_frac_branch( div->reg = base + muxdiv_offset; div->mshift = 16; div->mwidth = 16; - div->mmask = GENMASK(div->mwidth - 1, 0) << div->mshift; div->nshift = 0; div->nwidth = 16; - div->nmask = GENMASK(div->nwidth - 1, 0) << div->nshift; div->lock = lock; div->approximation = rockchip_fractional_approximation; div_ops = &clk_fractional_divider_ops; From patchwork Sun Apr 2 09:42:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 78209 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1655370vqo; Sun, 2 Apr 2023 02:45:27 -0700 (PDT) X-Google-Smtp-Source: AKy350ZjH9USQTqbVpllrgPRHTOxSNqsgkBNbp52afCTEEJ6/4UEDv6Bi8rLk1W/WERdu3ggWaj3 X-Received: by 2002:aa7:c3d7:0:b0:500:40f4:f8 with SMTP id l23-20020aa7c3d7000000b0050040f400f8mr30750805edr.0.1680428727640; Sun, 02 Apr 2023 02:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680428727; cv=none; d=google.com; s=arc-20160816; b=shMH/fBebrCJ+iFiab07IRJrZFxPztQdvCjpG1PCEFjfFxfqOImI14rljCWuQ6vaBU dsLxZn4J02uePm4Y+5wWymbnD5IHmGrgqaut/L+G8xeEl6k7VRf2+LuTd8iXP56Qzuhk +NO3LStOxneWa/afrNjzEnobUk1HM82DrPk+cIsC/h0TvuRmmLo0nczmYcWZh4mhcC4+ pWi+ty6eUCyMloEdq+av2qhDYXyAOsf6nPsjc1m2RILFa1vADs3QJRyRApBRZhaiOgT/ 2nX0bxhvwgNN/NjDO0HybZv7x2l/ux3Mifkslq2Ok+S//7T7uEi25EXABhldQAyT3n/k EEhg== 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; bh=U6YYinK+QQckszDxa73M5NSGK1OMahLPQw6lLhbBMHU=; b=Z2opxjxDCbYPsEbGRCkKXE35/m4vEc0Yf9ZCT11fxfqMvL8+3ULtCEvlqW7VhuIX5Z Zpr6d6zZlY+KvGPWmH2O5A7tRie4i3esU9HMVRgim34J8t223DgBoR+AACU6u7vqA9dT jJ7aC2JQ++1iZhRX4DaUcBrDlNJCOrzFuitLuFLeSuY55eE2zWw9njZkyIypYGkie6WE 9HgNphkK+hJ+Lh3UjI8mtCTk0WE1OfVVC1rVtRFg+MAGrarPhV3yXJ7EkYoTpD5DKUgn m+1Cz0Nlkg6aiHB2WM/+yNhdnOhSfWrtU0L7lgEwUSdpyEgo4BRYsHLouqewl1qAelLi rpxQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020aa7c9d0000000b004bf976a1b56si2942532edt.627.2023.04.02.02.45.04; Sun, 02 Apr 2023 02:45:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbjDBJmj (ORCPT + 99 others); Sun, 2 Apr 2023 05:42:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230362AbjDBJmg (ORCPT ); Sun, 2 Apr 2023 05:42:36 -0400 Received: from smtp.smtpout.orange.fr (smtp-21.smtpout.orange.fr [80.12.242.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F96A1BF72 for ; Sun, 2 Apr 2023 02:42:29 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id iuDzpwm4hwFKBiuEFpeDju; Sun, 02 Apr 2023 11:42:28 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 02 Apr 2023 11:42:28 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: mturquette@baylibre.com, sboyd@kernel.org, abelvesa@kernel.org, peng.fan@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, heiko@sntech.de Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2 4/4] clk: Remove mmask and nmask fields in struct clk_fractional_divider Date: Sun, 2 Apr 2023 11:42:07 +0200 Message-Id: <680357e5acb338433bfc94114b65b4a4ce2c99e2.1680423909.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762057233557547412?= X-GMAIL-MSGID: =?utf-8?q?1762057233557547412?= All users of these fields have been removed. They are now computed when needed with [mn]shift and [mn]width. This shrinks the size of struct clk_fractional_divider from 72 to 56 bytes. Signed-off-by: Christophe JAILLET Reviewed-by: Heiko Stuebner --- include/linux/clk-provider.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index faad3cdc1e48..eb6930ae550f 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -1154,10 +1154,8 @@ struct clk_fractional_divider { void __iomem *reg; u8 mshift; u8 mwidth; - u32 mmask; u8 nshift; u8 nwidth; - u32 nmask; u8 flags; void (*approximation)(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate,