Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbdGMLrf (ORCPT ); Thu, 13 Jul 2017 07:47:35 -0400 Received: from mail-co1nam03on0080.outbound.protection.outlook.com ([104.47.40.80]:17993 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751288AbdGMLr3 (ORCPT ); Thu, 13 Jul 2017 07:47:29 -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 01/10] clk: clk-divider: add CLK_DIVIDER_ZERO_GATE clk support Date: Thu, 13 Jul 2017 19:47:06 +0800 Message-ID: <1499946435-7177-2-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: 131444200468828121;(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;BY2FFO11FD048;1:IXK8Tyz1IWHUjylQz3ansbHwxcB9sMPPDh7odJj6do?= =?us-ascii?Q?NtyIuACHTHzzFYJ3tPlTpJV42QPv2VMaKTOiSksHHGYEV1FqQwLdoFl94R8w?= =?us-ascii?Q?8W9HqTeNwso6le/D4BApx1gAeYuw9zA+m1S9ouziKAJ2ZUbCV+4Q5PVm/ulh?= =?us-ascii?Q?QWepeyzR/3ct6DRxixNCVg+9aNgQQMTcnG9jkYMuxBSaYID3eTeeh3++WnzD?= =?us-ascii?Q?wJcU5/kQbkcGpRPW05jBbdcybWUv8GujdzVU+enQw7+0VbmdZ4eCIIWn6mLs?= =?us-ascii?Q?a4kRUMYUFG8v43MlQb2T6Vbu9kWfkDakyb+T573b54tS5S2kwiu0i20Qu6Kw?= =?us-ascii?Q?qwFkyXLYjRxfKal/Rwbtewm8zot/HVfhfLM9ENFyeUqZUFeCTx8gZEbHV6Qx?= =?us-ascii?Q?wAatoABp2UvCKuKTiIwBTkCanrkykEyFdHapjcWLQX0CgO193ivXUHXh5fNO?= =?us-ascii?Q?MD96laoVUrEJCWgrQ1L0No3uCk746vQjeJ1X7Neq/Rq6Nctjx5dJ6lZb5hqd?= =?us-ascii?Q?5xnprTSHBNZaWMwOoXO7G05fJhHiQW+S6gBw5m8v+8C8EFIUD/p9vDMWZEE7?= =?us-ascii?Q?Tr/0RJd4oYg48ABVoZpR6QHXDpndGx8i6CWMN06rmrc3P00wcryA/uj4niof?= =?us-ascii?Q?k5WmYyk62GLCUJ8xU0WKRvfghZ1S10QX7KnDUrMmXq9+CwrCRcinFSJEsfZ1?= =?us-ascii?Q?dE8zZgze//3Y+rF1T6MrFWUEI22UyLykfq/azJy2jr6zOKbA4ywpOqCz9UmI?= =?us-ascii?Q?hhtHscl1R+AvRF63V3vVW3u6wLj6Dvj8rUxcVvufvtg1L+ESRT3l+4PH082Z?= =?us-ascii?Q?TZgsDk1GS788C1m8bTzyxvIgU1yWFd8oP5jI1w5Hy3U5jIzlmY7DPwtfUnVc?= =?us-ascii?Q?GbDFOkP3VbSRMHcSx2Ic05vSASNzRItzNpGR9eJ6FGTRm+s3UmPQmcOMXw1k?= =?us-ascii?Q?Lb6sqY+Xog244kDNDmzt9hcso5ULy47FIdt4H1Qc1NwEEXyJe27lHejCF2T6?= =?us-ascii?Q?7LbGjfLFsrHQclqeKKPO2zdFR0w1WX39QORMAZZ+mJGg=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ffdff819-6d76-4c1a-c4e9-08d4c9e4ef1e 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:KnAu8PlWico7rf01od1scicvdJNECrh3lByjlXwdqMHUZXo7i7MsHVp9qzbJARk3QPBG0Wgbjv2PK+qABDcXYaqadsy20nNj5Wy9wummXe/clqI8zqLc6jEV6k0nov2SetJJNhajHgMMXL+eAlcuCPqIRukopWHbIgZSAzq63ZnRJR05QwAWMOfuVTUPV9sm9MnhIM4gUOM/Q4rQpnpdSR12b5DF7BMbzng3fh90noBTQ7oou+P+tcZFIiJohP2i1ScJD1/egi/IQRpW1Y4ma0OfZFGLksoBqfkuCf70Bi9Z5zHbzSUnI1/f4/Wyo9nk++qHRQnhR0dM/6mp1Wd5liz3ybtmkPjyJJbhqG0rMAhe/SwFdVf+YeVYPl20r92Zyx7LR7+iOlxcohzrT9Qqlora6PobUi4ozH25Rjp3RfZLKNpQElKvQNoxSpDrowSy15OP2biOuCfMZheWwQbArEKF/FtcTgzVdi8U0faqj+W/TcPkEodaXJdMa51UhgntENNYXSXPmxmZ4smi8v4LonrSykszUBMKg5RD82TBcU6xg99RhtqsEZs9VSpu3xjuVHamL3CK3cy1QXL9vPSqU8+FNuWFc/xAjuUDFE639f/TkyQk3fITlEtxsYCWJXnovbyI11PjHOBdlQNZg7PnOYmpfpeWyFigyULAWh74clXQRDZFBcZtpeQ0PmwPzhoQq7uU8udlDthg75/qF1akAvlAcMd8kwNWBYysvmDzLpRV1QYphbHQDTTkxNyLVB6cFX72foEyTk7hM23vrEvA928YYMQdMvf2JM3vfxaYAdhndleyzVRE7vXS2vlMkTXNb4VoxvnPFM/00L5LbiQT9cpxEY4YAHEOwsAicJDDxXrnfEwIL/1OLSxJogeeAohY X-MS-TrafficTypeDiagnostic: DM2PR0301MB0606: X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0606;25:bOP2s9IVHN8XngHYEF3RZlT/HiOFZAb6N1PqSWMCHl+s82g9YKAvT4ZuhRpq8p0CElweldALokNatn9Ra9fqwFPgN16sQ/lWV15sd8daZypl64axEt1Rt9KcwSUg0SVWzkMhHEWK3G0cn8ZGhSO88ntMjqPmB7F5T23XzePr8lRHeUdt8J7Mt85jh07564avWgWhBtws3q+RI+atcGvQv1BTBONRJykkH6Qj50jJxz4oFeZ4iC6Tb9uee+OnGhB5SsAed3iw1LlSgKfhDcQaV2I6MxcbSJFnF4MChWts3RqNJitpgUtRrJADnOP8bhyVhahMjSEW4J+M7Xdi0dF8j3dIUhe6FOT7sg0Fk9+Gu1DX0lPA9Y8ohtHZ3qYlqGFBHQqkIAZvxAmZQRquwb2awSafGaJkQ6CVAa1LX8JM9nW0kDKEZUz93NTA1XNjG21QtyqVgs5w4w0k+i31k1YNe/oGjyKtoQLWJBNhwMx6ae2TfwgCGsllyIwc4sOIM4UDmF/juCho6w78/9nN/sZvvKZnyX9UHzDI6OR5Psbg/DsRVL+U/VKi271yuyH+6qELAkhlMfrghyeQsX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CWIR/wEPbn+yjYcbbILOEfWjS/akc/pVZzrC/iKwssKw== 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:qEUE73x/hqfRvT8VH/U7maL7NNhIVQtqk56l4nGS?= =?us-ascii?Q?0FiPaaru0ohEAtKLeQe/22rfcyxJ0rZgH1Rv+F+eGghi6YBP3wRbwB1vuHeB?= =?us-ascii?Q?mxPXhAageyJ9rICJuE8QG+tQ3bQ3d0UWBq2kKx5zHuoIft0YsHusNj7eilSN?= =?us-ascii?Q?+y/sX09ZjuJe9i8R1x2tQ3BWGDfM4aqJWprXU5OkrMnKaenalQ2J5lkpbKvm?= =?us-ascii?Q?FYNhKjs+XzEH3PnrYtDV3rADgVFkuSAGKJXeCVXdk7lvb7qXq/R5RvDEVWff?= =?us-ascii?Q?6UEKWMT84y1Hdkfqa+nfzzMUIHsQCxCk2TVjKQVIShw37y8S5ILCGUw14CRN?= =?us-ascii?Q?8FyOpv26RNYADgCaL41/h7ixjBUJlgYFZkk4C0mmGZLtQX8f41Dh7hZyMcGo?= =?us-ascii?Q?nGlkTKRzG2qgUS1n0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ukQsfVokp0/mKI0y6AINC07f+EQ84GQ5kP8fwWIVQ0VVeFeQLctL9OB0bzP?= =?us-ascii?Q?hkbiDvvQ0UgI6F1gzGvRLtzJbdI=3D?= X-Forefront-PRVS: 0367A50BB1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0606;23:G3RXURhrlZIv+dqALIJvlZ11LpDarMO3+FXXKS2?= =?us-ascii?Q?DY1b+P7AHQFCsuC9Ih2id6pyQWXEIN6BQcspHcpqu+S1jqOccGB+fk50NNGK?= =?us-ascii?Q?+kbHSfM031gnsNt0JCPDCXvBid7O9gCpil1yt6j85pMag4GAvVtbZGzgWF6h?= =?us-ascii?Q?hp8bJayarmgTZRSSaWSejcEVMFY4kj0ILnC/eOURB9sZwUtma8wLc/s64Ega?= =?us-ascii?Q?xLMDoJFtFQrOFcdgwyidnfBlSifvTOiqyBghvcuJHop38M/epbEYz2XXnK7L?= =?us-ascii?Q?i8wD5sKBAUrTIsUl4IWv0hjeS0A52DA+aLSvKW2S+hSHaHcK8hTo258ITwEF?= =?us-ascii?Q?hZ+SC211Rq0/0zpSG29s+I07n/0MLUN/UHxMEXuvKbclpzUDZUI2XVp6qYgK?= =?us-ascii?Q?25oijCBMytOIQHyW6VJQwzY9c51t4E+JiuyBPke8Dc8iUgbMOMtKBRzTgP6Z?= =?us-ascii?Q?AKxTeMQu9nFWHf6rH+JbnaPm9GsPyko9kTbSM9jU7fuPlho2xD1oTj4wGNJX?= =?us-ascii?Q?qjke5xqO2HVhZix5ko7+Xz8HvVANHIp5aij+t4Glhilajq/1T5klCugh14Xo?= =?us-ascii?Q?D4HLhnkQCzbIKkteTL+ijMGqyuW3BBuXrM5ln57deb9/Z5/QvHaLTpAuFMTK?= =?us-ascii?Q?z6x3Jjq2fW6CL52wC7krRyN7DrGJ6pqw1kawX4QJ2BfT1HgfJ78x9xdvjjQx?= =?us-ascii?Q?ej7EZUqdgSkK6I1DJAwx03JLdXl9+qeIYeCFwcEvaWZNisbtsdgXXdQ4tsGZ?= =?us-ascii?Q?2UrUUHAgYzS+tclVmF2b+fbHy3o0lu6OtXpPq5KGe1dLuM8PxJsMLukgrhPz?= =?us-ascii?Q?Tx8ONgvz0a1K4SKTLrV/zg8OAnAbar81ehO2xLILqqAUpmVJm5Z8PY1VNRlv?= =?us-ascii?Q?3Fp59uFw2r/8EaNZgu19pHJ8BAtXZxrZONCIystf++d9sLa27ZFh2bievQL8?= =?us-ascii?Q?31EAb4xlwW5Vq2KcUEErM34yDUimSvyLsVkbVlsWA7zuHd4nxxLA3wfZDM67?= =?us-ascii?Q?jMQ5MMfkF+gL5QraM7Hbm5/pp2qs7tmHf89syfTryRkJARDpNXayBqfBjH5o?= =?us-ascii?Q?YCfhh+erebjsMq0epjI5jdz24AEQknULLyGJu6R+MUPPgcnZxWTl6HqCtK8Z?= =?us-ascii?Q?w+w3yOega9htgW2tYnFsmcW/aYeqtzvfonX/LF/qoaeS6ADkSYPrl+KJUZWx?= =?us-ascii?Q?UIZftsqhU4ssaKrRMcdYDZLALuig+8G5jqldK5L+F7ptFesapk/wh15fSo6O?= =?us-ascii?Q?wVhPBx7ioo3McTpXRQ5u3kBhlb24e1P8R4tIV8xw7m0ChdrPoHvuf+K9l9T1?= =?us-ascii?Q?5FsgjZ9hqfCT+RgErcKdVXZJgxHg3eoeA9dtWp5Jx7OAce+k4VuIqymN8BBf?= =?us-ascii?Q?em/OgpQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0606;6:NXQZvdT94xajyIogPkYD122CtxAmXjAlU0LYvdRr?= =?us-ascii?Q?JhAUmco9J5WiYenLr78Oloy0/XBsz5ncpOyxyrQTyIXu/CPUes3w03Uq4sOK?= =?us-ascii?Q?3T/2tQ/NUndH45x2bGsUNkPKxQu7cprSkLyFJyDA8SyHAPGggF9TVPJWYwNJ?= =?us-ascii?Q?XIf2l+CghikJSXL5jxT4KBkiHpx1/Cs0B/nKpO/9lXJ4lG5566O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PD/DA80lE60C3Ij0o46whPrnNBj89ftgYhYJs2Yps3jgPjMXbhAz33DruLxRFclePvRzHSUt1YfugQ2BXRBQCxHqDtDHR5Si3dvS/aaG+INfh4baMpsIC/s8nkLedotcOaBdZCqsD461sFoFhS35nYfplQtxF4B8u/hI5ST+2C3sSALwyur5O5CbJJVuQagARPLYXtwpbbqFWXEVl0J7Qjk5io+ocQomUaZCBj2U6RzSXOY0AQjXripsmnPtL7kJy3jIvXyp/44lMVRR3WAPPup77IMCbrEpIVS82Zzt9svFUHGgzzTHAeZ0Wnw8pB8NX1dld6mMR6LfOr9gH8UUZIQVoUO7DMbRF04uH1Z7MYFnrByRYKPCGAM9b1pfYWGznSNUvenep8I3TBr21CX4ClSHcZSt0PwoDL+bwZ8oGO8V3UtanlklRDAjPRohkhDpTRqRQQ==;24:OLJXHMrGN613RpXNt67Kg27eShitJUNXIT/fQZ8dduNIPcQMvrkfCeoOY3Q81hK1V7e+DQNQnAsREbwQwxDuTLRqxHQrcr2K8K/FGE2Ekp0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0606;7:2AIbLLVJDtY4FzVAvb+BPv+E+pPzeamo40QofA79BkSdA+uxOQWr/giEzRU9+R+ym4AD500kW4TJQfUWbrTq34SPnebkDYkAfex9K+qb6kbbeR+kWXujTh++5vSLSnCWXPO9D3hg01opC1UE2w/hLCH1g+18joTSQB6FioNxFqk1x08JfZ70UYmftavzA/tQ/ShPNMM7Y4h7PtjIqZAzup/Vj5swCq7Sz+DRy++eeV//fgtdqY2AqNkEBhtcAh1V11x7+IoFocdzyYDCbv+t98lF37f1tAzkjDCetUTxtPNQUakBr+54EWtuq+iRMBm0eio0gxcMlt4S6ioBIUrsAhwg7ZNsGKgMu8FUa3h2FAeG/XiPIYFqtazoN83LO7RhkkX0j8zAVng0pwSbcqhy2lVux7jVHh9x4KAP6FE7llgt1Xm14+GLVPNCj2CkMnGPquXhuZrnrD8z8oMrPmSfC6rKIqmI/cf9j6JKGUJNn9r3Yl43eLcRzvDwPNdXJwRzOOpZkJQkLbc8otDv26pCyGPdKBbBBSdrHbnzvX5pXjQxcEaypJCuaOezyIcGMV9mmy/IBkrEk+PJal0pe8uholhPcExJrPvJ69B4+KaK0zeiMt/OItRZR0eAnV2PFhOaxJz3s1wgUeI8+KFKzJI2ov/MVATEiTg01WcdMNNd1T3/atgcCdDbgnYfBssW9/DGTT/drjhPCb6NxsiWkefJpWk4OsJb4D1mE6+OhSCk7VHohBGkh4C0dOCyHHR+rDINP+WIwNmuGu1vtwbVYzy9nwTUgTkSr8QKnNIcky3AyBA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 11:47:26.5552 (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: 7313 Lines: 231 For dividers with zero indicating clock is disabled, instead of giving a warning each time like "clkx: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set" in exist code, we'd like to introduce enable/disable function for it. e.g. 000b - Clock disabled 001b - Divide by 1 010b - Divide by 2 ... Set rate when the clk is disabled will cache the rate request and only when the clk is enabled will the driver actually program the hardware to have the requested divider value. Similarly, when the clk is disabled we'll write a 0 there, but when the clk is enabled we'll restore whatever rate (divider) was chosen last. It does mean that recalc rate will be sort of odd, because when the clk is off it will return 0, and when the clk is on it will return the right rate. So to make things work, we'll need to return the cached rate in recalc rate when the clk is off and read the hardware when the clk is on. NOTE for the default off divider, the recalc rate will still return 0 as there's still no proper preset rate. Enable such divider will give user a reminder error message. Cc: Stephen Boyd Cc: Michael Turquette Cc: Shawn Guo Signed-off-by: Dong Aisheng --- ChangeLog: v1->v2: * add enable/disable for the type of CLK_DIVIDER_ZERO_GATE dividers --- drivers/clk/clk-divider.c | 100 ++++++++++++++++++++++++++++++++++++++++++- include/linux/clk-provider.h | 9 ++++ 2 files changed, 107 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index 9bb472c..55f8c41 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -123,6 +123,9 @@ unsigned long divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate, struct clk_divider *divider = to_clk_divider(hw); unsigned int div; + if (flags & CLK_DIVIDER_ZERO_GATE && !val) + return 0; + div = _get_div(table, val, flags, divider->width); if (!div) { WARN(!(flags & CLK_DIVIDER_ALLOW_ZERO), @@ -141,8 +144,13 @@ static unsigned long clk_divider_recalc_rate(struct clk_hw *hw, struct clk_divider *divider = to_clk_divider(hw); unsigned int val; - val = clk_readl(divider->reg) >> divider->shift; - val &= div_mask(divider->width); + if ((divider->flags & CLK_DIVIDER_ZERO_GATE) && + !clk_hw_is_enabled(hw)) { + val = divider->cached_val; + } else { + val = clk_readl(divider->reg) >> divider->shift; + val &= div_mask(divider->width); + } return divider_recalc_rate(hw, parent_rate, val, divider->table, divider->flags); @@ -392,6 +400,12 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, value = divider_get_val(rate, parent_rate, divider->table, divider->width, divider->flags); + if ((divider->flags & CLK_DIVIDER_ZERO_GATE) && + !clk_hw_is_enabled(hw)) { + divider->cached_val = value; + return 0; + } + if (divider->lock) spin_lock_irqsave(divider->lock, flags); else @@ -414,10 +428,85 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, return 0; } +static int clk_divider_enable(struct clk_hw *hw) +{ + struct clk_divider *divider = to_clk_divider(hw); + unsigned long flags = 0; + u32 val; + + if (!(divider->flags & CLK_DIVIDER_ZERO_GATE)) + return 0; + + if (!divider->cached_val) { + pr_err("%s: no valid preset rate\n", clk_hw_get_name(hw)); + return -EINVAL; + } + + if (divider->lock) + spin_lock_irqsave(divider->lock, flags); + else + __acquire(divider->lock); + + /* restore div val */ + val = clk_readl(divider->reg); + val |= divider->cached_val << divider->shift; + clk_writel(val, divider->reg); + + if (divider->lock) + spin_unlock_irqrestore(divider->lock, flags); + else + __release(divider->lock); + + return 0; +} + +static void clk_divider_disable(struct clk_hw *hw) +{ + struct clk_divider *divider = to_clk_divider(hw); + unsigned long flags = 0; + u32 val; + + if (!(divider->flags & CLK_DIVIDER_ZERO_GATE)) + return; + + if (divider->lock) + spin_lock_irqsave(divider->lock, flags); + else + __acquire(divider->lock); + + /* store the current div val */ + val = clk_readl(divider->reg) >> divider->shift; + val &= div_mask(divider->width); + divider->cached_val = val; + clk_writel(0, divider->reg); + + if (divider->lock) + spin_unlock_irqrestore(divider->lock, flags); + else + __release(divider->lock); +} + +static int clk_divider_is_enabled(struct clk_hw *hw) +{ + struct clk_divider *divider = to_clk_divider(hw); + u32 val; + + if (!(divider->flags & CLK_DIVIDER_ZERO_GATE)) + return __clk_get_enable_count(hw->clk); + + val = clk_readl(divider->reg) >> divider->shift; + val &= div_mask(divider->width); + + return val ? 1 : 0; +} + const struct clk_ops clk_divider_ops = { .recalc_rate = clk_divider_recalc_rate, .round_rate = clk_divider_round_rate, .set_rate = clk_divider_set_rate, + .enable = clk_divider_enable, + .disable = clk_divider_disable, + .is_enabled = clk_divider_is_enabled, }; EXPORT_SYMBOL_GPL(clk_divider_ops); @@ -436,6 +525,7 @@ static struct clk_hw *_register_divider(struct device *dev, const char *name, struct clk_divider *div; struct clk_hw *hw; struct clk_init_data init; + u32 val; int ret; if (clk_divider_flags & CLK_DIVIDER_HIWORD_MASK) { @@ -468,6 +558,12 @@ static struct clk_hw *_register_divider(struct device *dev, const char *name, div->hw.init = &init; div->table = table; + if (div->flags & CLK_DIVIDER_ZERO_GATE) { + val = clk_readl(reg) >> shift; + val &= div_mask(width); + div->cached_val = val; + } + /* register the clock */ hw = &div->hw; ret = clk_hw_register(dev, hw); diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index c59c625..efaf5cf 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -357,6 +357,7 @@ struct clk_div_table { * @shift: shift to the divider bit field * @width: width of the divider bit field * @table: array of value/divider pairs, last entry should have div = 0 + * @cached_val: cached div hw value used for CLK_DIVIDER_ZERO_GATE * @lock: register lock * * Clock with an adjustable divider affecting its output frequency. Implements @@ -385,6 +386,12 @@ struct clk_div_table { * CLK_DIVIDER_MAX_AT_ZERO - For dividers which are like CLK_DIVIDER_ONE_BASED * except when the value read from the register is zero, the divisor is * 2^width of the field. + * CLK_DIVIDER_ZERO_GATE - For dividers when the value read from the register + * is zero, it means the divisor is gated. For this case, the cached_val + * will be used to store the intermediate div for the normal rate + * operation, like set_rate/get_rate/recalc_rate. When the divider is + * ungated, the driver will actually program the hardware to have the + * requested divider value. */ struct clk_divider { struct clk_hw hw; @@ -393,6 +400,7 @@ struct clk_divider { u8 width; u8 flags; const struct clk_div_table *table; + u32 cached_val; spinlock_t *lock; }; @@ -405,6 +413,7 @@ struct clk_divider { #define CLK_DIVIDER_ROUND_CLOSEST BIT(4) #define CLK_DIVIDER_READ_ONLY BIT(5) #define CLK_DIVIDER_MAX_AT_ZERO BIT(6) +#define CLK_DIVIDER_ZERO_GATE BIT(7) extern const struct clk_ops clk_divider_ops; extern const struct clk_ops clk_divider_ro_ops; -- 2.7.4