Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752092AbdGMLrs (ORCPT ); Thu, 13 Jul 2017 07:47:48 -0400 Received: from mail-co1nam03on0054.outbound.protection.outlook.com ([104.47.40.54]:23936 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751288AbdGMLrk (ORCPT ); Thu, 13 Jul 2017 07:47:40 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; From: Dong Aisheng To: CC: , , , , , , , , Subject: [PATCH V2 03/10] clk: fractional-divider: add CLK_FRAC_DIVIDER_ZERO_BASED flag support Date: Thu, 13 Jul 2017 19:47:08 +0800 Message-ID: <1499946435-7177-4-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499946435-7177-1-git-send-email-aisheng.dong@nxp.com> References: <1499946435-7177-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131444200528199256;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39450400003)(39840400002)(39860400002)(39410400002)(39400400002)(39850400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(54534003)(9170700003)(8936002)(77096006)(4326008)(36756003)(305945005)(7416002)(53936002)(189998001)(54906002)(76176999)(50986999)(5003940100001)(50226002)(110136004)(6916009)(38730400002)(5660300001)(86362001)(106466001)(48376002)(85426001)(47776003)(356003)(33646002)(2950100002)(6666003)(105606002)(8676002)(39060400002)(626005)(81166006)(8656002)(2906002)(104016004)(50466002)(68736007)(498600001)(2351001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0606;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:ovrnspm;MX:1;A:1;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1BFFO11FD011;1:ubDnRaahmoA51Km/8kge2rT40Gckcov8S+dVevzVU?= =?us-ascii?Q?AnQjNaUM8nRZjOXIRqowITehEpwYiiuonU4ScDM8K7wU9M6L/3La6r3WvBWv?= =?us-ascii?Q?Ky1YWxFEt8sMf/GvWJmgrA7l9Ooim4T4MW82XBbOoHRq2OSapGgpLJSDjQJ5?= =?us-ascii?Q?BffhwKIt5RB7DdqqeBELyLkDvKEJz1Nvkrp40YUkYoXgc74u7VOUdzVF8908?= =?us-ascii?Q?2Hz9J1Bj6XtjlASIxapUiMd3DSYPHDKHR5u+7NoE+o2qpUUEBA8+eax1UgYw?= =?us-ascii?Q?3x4uUQeyIeHlS4gSrcVBoBrZKJ3vLcUw0Hryuole6CU1a/wvZq44ZZZyAYKZ?= =?us-ascii?Q?zsEgBIetOeAq85ZkmtSKuKeumrPlNSzeO8XhN1seZi2uSyQTrZhVDYnc56OS?= =?us-ascii?Q?+BpWBG+reEBw/NrknF+g/DSoLxdWKIz/k/8Pf2mbmf+PhmPXcHMHKzfxrNJ6?= =?us-ascii?Q?sjdsi3QYircszeyHhUu63sr2iiUh29ry9qbBLlidbQH6j6blw2A/w7Z47RXy?= =?us-ascii?Q?DRghKglwqtuf0fn0hclEeL0yvVZ4TZ0o/hMTH/Gcm8CZvGcX0WXv2+/WNSGo?= =?us-ascii?Q?fKmgjNRmnbnbaqObk7m0ap71+BDyynSaGqMWMzepPalP239YhtyhZW3xdgyN?= =?us-ascii?Q?IUv0azCViyZTd0pZJJMaGs0DOy0zFoFi6cN8NHIv6Qu9mGfYiTH8Rwktjftj?= =?us-ascii?Q?GXNoDPH3Bjz+2fFQn26SeyMWNFXimlibJKH9tfH5xDl5kTU5bfT3FyJtpJaZ?= =?us-ascii?Q?RF2hHCrsuYoZ8JC0/7x2zy3vVTThTtC4G6IXTiMwXzWXaKtQDUYoGWEAfArY?= =?us-ascii?Q?SkUzO0gso1QdvO6N1+ZAUYZVYGDenGbCqzaozSlpX4eiYTa4sINDj/Hqqqre?= =?us-ascii?Q?ijvbCdOL+dW3qz1Dq89Nr14x9uKFSD7eO6fbZQGZS/7L/BfVEFMDCK+yE/5I?= =?us-ascii?Q?FgoQ+TZ31WXAySxAVC7RPacZfyyWZ8hXAY9H9sSFbGr1D68AfHBvdUPO8Mcq?= =?us-ascii?Q?fMfMQAYrGAQJpOXRMMGuPAUWiyhyxeQsVV4RRTvUdA9JQ=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec942aa9-dbc7-47d6-5cf8-08d4c9e4f2b9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM2PR0301MB0606; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0606;3:+2GtuBCHTSo7H8Pfc586hEoYq7Ohqha62nV9K59TGtgXkYaTPN9cHb6wOaKpNA3wPPcQsphcHMotAnfTpO+MCcAk5OaA997K4wcyhlur2z451G6y0afUl9bbfxftwFGDOQrOEEXSGeotpOx1XxzVHwWjEqMqLOJbY45gzpvT50Q2dHdkqwOYFgICIj4b1BV9fubkgNeCFf5EbjwJp6WfmRwHZK3Y/Dn4HaZKGnbt6oNv8893U6JbQesLceXAoYRDgOsg2GwCb3eNEXezU6LzuwNj/5PH+tUuNdGzjB3i5w++FNHZH5MZTc+9yHbhoKk7/0l2ojHGal+ULciae5e5fLjbtOBMjSaQlBkLpvOc/9ZJCeui2ghxBiE031JaAPAfPOEa3WDT6NJH/gG+Gy7fqiBD+kgHgDr5CckVJvnReX/IK4CWkeyTc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yMSYGMr9vID40h4frrO++nBBSYzsILbJE3r9sdHWh93vZKpa3usxUtpANs/nr06XXiK+nkXHEaqsm5D9F+7yiAg== X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228)(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(2017060910075)(5005006)(13016025)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(20161123565025)(20161123561025)(20161123556025)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM2PR0301MB0606;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM2PR0301MB0606; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0606;4:qrX16MMqk73uDKVCFNaI7scbeFk13R6/uX+MM+TW?= =?us-ascii?Q?+WTG09fGL6Co118U9O5pgEseoeDvu0OnHtY0gzpJmQi86IDS7c8n3vL9M3GX?= =?us-ascii?Q?2do8qsRabgXv1uDp958l8b2j6tK/3kQaYQ6uz5EUWdMOZgRCJyFeMIlGCaex?= =?us-ascii?Q?VbY/MHd0qSKWhxqGuHBLzY7AIQ3Nz+prKCDOi6b9Cj8d4tW4vYWRLN7ekJ5M?= =?us-ascii?Q?zDhgfV9FKLkunb0QTQRybU7VC+0+vXMFe/zPIR9X7JU52CqXVxJZ+UL8nQsb?= =?us-ascii?Q?GmzD/+xrH/cICVN5XltkfHk8ALnBv8Dcg7y1JN0Y60ek2Z7c5P7S34rtCTZv?= =?us-ascii?Q?uykbnm8PKkVKLGbpDlO8eSbBhFywj91NVYDwij82hFJcd6MLXgBbFdM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VuX?= =?us-ascii?Q?ecSReTICt8h6+Lf0QRy65CmITM2obhqnarWZT8IpR6QTAqskWCVM+Qm5vuJq?= =?us-ascii?Q?84jjWMZQaCXAdkVLu0OIt7OBDtOPDjj8B/KOsrOfF2t33RKsjMtiVDbR8wA6?= =?us-ascii?Q?iysPEeYV9tpQj113wXSVR6kiapseqbTEL2f5rkBXN2Z5YFdQjDcnG4Q3Rgkg?= =?us-ascii?Q?C0shnPwOhDe14mci3lkRFmR1BvpA1DYcUS2bWCUosbwdx/g3Chjc+RHcKcuv?= =?us-ascii?Q?Bhaoue97dx8B+s89+kiU9+X0KhlWlb7qxuCWb1hEgl3yCfNovE2XNuB99TQa?= =?us-ascii?Q?/r6YJDrCAtVskux0yUplL/PbgJ5RBjNq4N0V/dyh8xejgadGhFhFQzLaUkSx?= =?us-ascii?Q?URC4U3jRI9YLj/OCSRvD89Fp/2taFebehEJHYpku13BYIMKHTdANXl9HXhBW?= =?us-ascii?Q?PhJ0dYc73cLcpCYCDuQ4rNDclwoMVWFrjJptCNGRNki+qf+oHKhRNESEcQze?= =?us-ascii?Q?SlwUPs5mUqw3f9K3FWErP8ZwHvidpVQF8aRetq01FRGvK1u43q16pcsKGS9K?= =?us-ascii?Q?F7cSSHD62thyskzoVFqPLRuuOi84jUynkiq6ngZJsziP7M3rdfrF4cCWIQJt?= =?us-ascii?Q?AjPf7bgLJLFcUHQUcR6QZVazpy857OyFeiiWmjUNIlBFRUOWAX+klCuxUI2f?= =?us-ascii?Q?Pqb+zQA=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0606;6:mm7h+ldoAbgy7tFZSlZUC3jEA9OHBcBMGC6JJ3dR?= =?us-ascii?Q?yHmhK2JiCHAiP6b7l0vYjw7jHvZIGaA/kNMb13y7wreD+DSXMdZtT+RtCTcs?= =?us-ascii?Q?IF0iJXBlpPjC0YVj7Jpty5dZ91YCk4NNoJfTBOA9L8ltbq9wNR6UhGKlPtyy?= =?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u6yWOEzxQ64EFBQFT79u6bcoFyZggCj2fF3/90dnD31k9mdscZ6nXgYwlK4oj6lgFPEQPnTP079HU4wsonffVZTikorx4huaUIq62osp7KJpVD1ab9ir/2BJYuePnUrWmLeKJoJIdP8DijRAqh3cmX7waCtf5JPYbriA3+W6IIlDUp45wBTmI0aGK1g1haB12GNWsqp7N20KzWZ0GQMRklsCAGrfuA9rOvMJsIqseq52U3vmn/7MW6knn8HuG0Ki6rNQA7Tfu9ngdrVwnriVFEw8sJoWxniUVLTdY+hw533aolP3LaGkKItqziAUKlgrk/h3C4QHqD89cUspQS4rzKZB+Fiheri/etjjk528uj6EQiS9KTqpyVq5oZvbPy0UU1jMbH86rwUvBISRdwHWpPoZh9bLRucA0tc4Yt4YY9LRvBzI3LVMp/tnJq8hom3isVd3DSYF5ZIBKuojMEXS3BY6v4WsPD0jIjo1nmi4d7YNFNDBSTVXH2XEnA7BdWOyRcuPsEA==;24:pvnVWPfyfzVIFMo53r/08kAyS7UX9Ufw8PmI1Usbvu6d+QOgGTOEWyO+ZE/fPK8wYGwsEzDn7TzO8npvCtUGX2geNTY2FxBfe3DW/+Sz2iY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0606;7:ZwcGZGyizVil/9ube//ewBspYgB0VMP0FQZEr6rWaqy65QSnQNUMPi3U/ycKVAJmI+5L3F0z5NycD41LN2Q3pDzoB5OjgrOvQVttHmNncpa3Jt7uqhimU2PxM06FOpKOK7t2j7gF1ze9B9anKaYQQMwnGbRpr/wN+fLqwoePq5RTQwddAXDeAtfRFv4XWOXDQlV9jn3221ehjF7Ore00nLKKMP/yFLkl5al2tA8IeaI4bS2yUHGJkK+/nxabUtqnIdXPr5I5oeDE1Toz+WKN7ee+4+m84GjH3343mFtB7AQkjVXueB02+UcJbjdgkYbg7ZIZn0RfUAmXfcc9bwsNrWYFs/HimSq/M/CkZhoag2Q1UFqVtDr8EgWSHurt+SUhgest5ybaf8522mdPnmH1x3pDz5+1ed6xysUZHRM9+JI71wvr67Xdqtt9iqui3ql2HkS5eioCvMEYDBUazPX31gKKuMEm0xkkorFwnbVZ7dMybo+tmtwWOcUZi7PuRc/JTEPU1XZffrQ3qQQvv6FTZTal2UbRBwQvzCVVMIYnHgfsMfMdJX+AUC8tKXdHwlk+WwanqgnIoVAiZ+Sxxybg7g8WjlPsEbritKLhKo5GQXqWLcBQ/PlO5FZ99MW0LcxH/VJi5WUGrCt7ciLvf3crawdL3a4e279L0LqMVNKVu10ckm+wKjhZ+IKG3z4/iQ3UzGSyBmLhxHW+3WQvUl95kDfvKgOVE+spGhrypoCNjvOLFo957zxMednDh4HsmJpCfR+W+dXSpA4p4Y5hbEFAjY7z7pSLIBhWG0QykouKkxs= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 11:47:32.6171 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0606 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2490 Lines: 79 Adding CLK_FRAC_DIVIDER_ZERO_BASED flag to indicate the numerator and denominator value in register are start from 0. This can be used to support frac dividers like below: Divider output clock = Divider input clock x [(frac +1) / (div +1)] where frac/div in register is: 000b - Divide by 1. 001b - Divide by 2. 010b - Divide by 3. Cc: Stephen Boyd Cc: Michael Turquette Signed-off-by: Dong Aisheng --- ChangeLog: v1->v2: * improve comments suggested by Stephen --- drivers/clk/clk-fractional-divider.c | 10 ++++++++++ include/linux/clk-provider.h | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c index aab9046..455bec5 100644 --- a/drivers/clk/clk-fractional-divider.c +++ b/drivers/clk/clk-fractional-divider.c @@ -40,6 +40,11 @@ static unsigned long clk_fd_recalc_rate(struct clk_hw *hw, m = (val & fd->mmask) >> fd->mshift; n = (val & fd->nmask) >> fd->nshift; + if (fd->flags & CLK_FRAC_DIVIDER_ZERO_BASED) { + m++; + n++; + } + if (!n || !m) return parent_rate; @@ -91,6 +96,11 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate, GENMASK(fd->mwidth - 1, 0), GENMASK(fd->nwidth - 1, 0), &m, &n); + if (fd->flags & CLK_FRAC_DIVIDER_ZERO_BASED) { + m--; + n--; + } + if (fd->lock) spin_lock_irqsave(fd->lock, flags); else diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index efaf5cf..4568a12 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -563,6 +563,12 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw); * @lock: register lock * * Clock with adjustable fractional divider affecting its output frequency. + * + * Flags: + * CLK_FRAC_DIVIDER_ZERO_BASED - by default the numerator and denominator + * is the value read from the register. If CLK_FRAC_DIVIDER_ZERO_BASED + * is set then the numerator and denominator are both the value read + * plus one. */ struct clk_fractional_divider { struct clk_hw hw; @@ -579,6 +585,8 @@ struct clk_fractional_divider { #define to_clk_fd(_hw) container_of(_hw, struct clk_fractional_divider, hw) +#define CLK_FRAC_DIVIDER_ZERO_BASED BIT(0) + extern const struct clk_ops clk_fractional_divider_ops; struct clk *clk_register_fractional_divider(struct device *dev, const char *name, const char *parent_name, unsigned long flags, -- 2.7.4