From patchwork Wed Feb 24 13:10:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 386952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41F79C433E9 for ; Wed, 24 Feb 2021 14:19:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0ED0C64F03 for ; Wed, 24 Feb 2021 14:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbhBXORC (ORCPT ); Wed, 24 Feb 2021 09:17:02 -0500 Received: from mail-dm6nam11on2058.outbound.protection.outlook.com ([40.107.223.58]:52065 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236057AbhBXNNU (ORCPT ); Wed, 24 Feb 2021 08:13:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=glB/E+VKPUpzX2MJ/Jwb+pLo96bSYiLiWQLNvE5CGZkE3M+lPm+d+3horL6W8aqCLb9irZJ9DX7LiUIdWxMkL42CMQLmPOHKeTuUd5VpPy9bOmWpJOicl5nGHBlKDx/ZSyh3I5nKPBmQRP1Y6cnYHeGvOhi/TgS9e9RK/eUH6JTr3aTpohOolnyJCXUS2GtTLRn2ppta7amG1nnJkDKWFjtbExicaH4OvmDPsOXLio8CtrxMn7tizCw7/FamFlHBTbZpTx4iWVJ/9INl9EbihdsX4vmX4L0yCyv5scoh+G9SAG2gMQRLPCDAnClfEeueY9n4UEXGsYX561DraCeiAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EZWyBMiRlWqknzViXQyTbqPa9qHBi5PttgCzMQK+Afg=; b=QSnXBrYy8uddjReZ0z1WUecWOvjYTCA8zs3O3+n5xTLpt95WbAalHviYIoeWonicolMeu5ujUCRk27uM2iEQvyTXm/4/6Cu7rz+iUfbo6SBa97B28yidO25BIP6cGSA2u/0z4mzCfzBqM84ZOwAbxG2Mi/IS1OG6YRlebb+VcjiDX+0/HfKfm5rcZfdB6xadMbRzheFmgKZqnGfwHjEA6TvYKCdsRzQKVkXj9x8LZmWIMmvV0pthaYnnL5aEtOqOAeyGmt0xl/bFnVYrOoesfGqS9/hnLhj48eO+MzSHUD3kDPokcNk3EdZQ4AVlkLMwf9V5ASSQwO1ZsLDsds5bsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EZWyBMiRlWqknzViXQyTbqPa9qHBi5PttgCzMQK+Afg=; b=E+N/KSxmBdGJ0AqDVqgNZDMCj/Ev9zVVUj8/tQJ4J4zPJy8kWGxifWmyc/OMxoDrQ+3gM54TeGjs8VCepd4LW9lQFVcJ7P/Ht2ubZBcmzh8yP9r2163+jccH3eDA3ysUzDdJJ+CI9kd5g3kVjV/2f7Ais1X4EMkM4pV/mcJ1aP4= Received: from CY4PR13CA0041.namprd13.prod.outlook.com (2603:10b6:903:99::27) by DM6PR02MB4713.namprd02.prod.outlook.com (2603:10b6:5:13::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.26; Wed, 24 Feb 2021 13:11:22 +0000 Received: from CY1NAM02FT057.eop-nam02.prod.protection.outlook.com (2603:10b6:903:99:cafe::ff) by CY4PR13CA0041.outlook.office365.com (2603:10b6:903:99::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.10 via Frontend Transport; Wed, 24 Feb 2021 13:11:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT057.mail.protection.outlook.com (10.152.75.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Wed, 24 Feb 2021 13:11:21 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 24 Feb 2021 05:10:53 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 24 Feb 2021 05:10:53 -0800 Envelope-to: git@xilinx.com, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, gregkh@linuxfoundation.org, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com, shubhrajyoti.datta@gmail.com, miquel.raynal@bootlin.com, devel@driverdev.osuosl.org Received: from [10.140.6.59] (port=34848 helo=xhdshubhraj40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lEtwH-0001ry-Hy; Wed, 24 Feb 2021 05:10:49 -0800 From: Shubhrajyoti Datta To: CC: , , , , , , , , , Shubhrajyoti Datta Subject: [PATCH v10 1/9] staging: clocking-wizard: Fix kernel-doc warning Date: Wed, 24 Feb 2021 18:40:33 +0530 Message-ID: <1614172241-17326-2-git-send-email-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com> References: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c6335fa-2d51-4f33-1f09-08d8d8c5ae7b X-MS-TrafficTypeDiagnostic: DM6PR02MB4713: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:590; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cSAYqcEqlR5/gt1D0GjzPpAuiExvxQ6KwpAMSG/Y01vfHLhrNqzlDqq5+n8klyJPj/U0oUXoNzSZ4seA/mOepVppliWk0ZHK/odOIe65o8I+qcbAPbgBv0al/HfNylUnsRKYKn+0nnFMOLIQlYX2c+AkLrZv1BRxx0bG5rh6q3LYarH6g1HdQGoDcvZjoaVFXF64i4dq2IgkwnwFQJHRkzOrMBlf43nfIflcO9VGebrgWuHOQlfxmMiuOue+wRohjyJj9XrhU37Yyic04JziZ/9BhkxRPn0UT7sQhj1LbiF32QK5clFzz78VN76dC90LTh0jRTZEMokFSPo+Mpl4YwcpuY0kI4cNmIST+34EPCbZabdxYFeSitKV5ndoVRiiPUHxwXYkAZSwPL7InNAe2BFSkPwP9nZQ5RBJzVYyypRjtkCd5ITPZwUkb/WujOr7efLfi8xVE0S5ASYigTd9C8kxncDMBGTEgR2H0TitJWIPpCuurRYHWQNAPAtI2mUQFf1o1yi7cgdU9AwWwQGLEXTSNiKSECx6kX9VTPaMkB8QjTbhyYVDVxx6Pa5TIJMGdXXXRrM/faBY3/iAx9Gbajv0u0LayyqDASiV3XGntXge2JunRVbijNkDxwPSDYQZduEho2PS+kjFsosY2cPIOgMuExdHDU4uVaV9dBO8sqt57Wkp9zlxKLnC6RsWA6wg X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(376002)(39860400002)(346002)(136003)(396003)(36840700001)(46966006)(8936002)(44832011)(186003)(36756003)(336012)(8676002)(26005)(356005)(7636003)(2906002)(7696005)(426003)(82310400003)(36860700001)(9786002)(47076005)(6916009)(54906003)(4744005)(478600001)(316002)(5660300002)(70586007)(83380400001)(2616005)(4326008)(70206006)(107886003)(6666004)(82740400003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 13:11:21.9716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c6335fa-2d51-4f33-1f09-08d8d8c5ae7b X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT057.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4713 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Fix the clocking wizard main structure kernel documentation. Signed-off-by: Shubhrajyoti Datta --- v10: Updated the description drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index e52a64b..1973587 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -38,7 +38,8 @@ enum clk_wzrd_int_clks { }; /** - * struct clk_wzrd: + * struct clk_wzrd - Clock wizard private data structure + * * @clk_data: Clock data * @nb: Notifier block * @base: Memory base From patchwork Wed Feb 24 13:10:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 386949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E17D9C4332D for ; Wed, 24 Feb 2021 14:19:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B949064F07 for ; Wed, 24 Feb 2021 14:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235252AbhBXOSA (ORCPT ); Wed, 24 Feb 2021 09:18:00 -0500 Received: from mail-mw2nam10on2059.outbound.protection.outlook.com ([40.107.94.59]:25140 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236068AbhBXNN0 (ORCPT ); Wed, 24 Feb 2021 08:13:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=El9JogSmC5pP2aZ002WMDR4Z64g53pAMzx3vh36DppmhpLOqii8cWcdrZfI2uDEARdedC68ao+tkGkSHfBHoMI/whwMpFF5folLjlupWNSo5y685w7TahhANWHAtuLFFT7xCWMjl2Xm4Tyjlk+0ht48M57o8LoWSzeMg+C0ls/3OCwx5wMq2QMbTw/d12sWpNZu7uvNEkMmYMTItfC3AwCsCsA+GCs5NOVbtmL/CPDNDJlIS1zZrNj2U4p9qoEfMoj0ifIq8IV1Teq6Cpu9qqUg/qceNJBKZBE93WSxM+r3jNAHozvFTBJxWED6OszNUnrKgLg60+TJQfcRLZGx3jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Auiuu1OCZDbzXBKbZONr0sRhXxitYJBjxX3EoQi4Mys=; b=bsgi6yR74LRiEENaIe6EMuNNnFGGWb1laMmsoo5wRmk+GfHHhDd0EWRNXlPOXELt0ltJE5oD0FybJ1uBKwn8R/MMxI7zxQiTp7Hq/h4V9ZZ2WL8wO6h5c16YPfVn5efHYPdQMAGYl4vg8Y2NLMhlVGlQXGFIqyAjoqwwEIWxZAl5TqU/4bXby3SkBDMq+R0ILojkGD3mnopQS8k2ckD74HWs48AmElY4XILqJoPsPf0KUxMUA+oedeijqbLL17P6hJOau0+2Un5ZGkLtpA/wb8lM1fbkshssC9TNTuq5IhZmbp4/7zEGld0eorEFCAhOVodxZiu/mZsMy+hXm+7JYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Auiuu1OCZDbzXBKbZONr0sRhXxitYJBjxX3EoQi4Mys=; b=oVLzr0oHwyI/UCIa/5K478GAgTbfVVHFmZbuDygdZrQso4gZb5zQgUd2ttQVn6CLtYTbAMve3iWVgVt2O+EXSUbYgD6Fq2iNHzJ+seXLnCrgENMntIEb8k0wPXoHTDohSSPSx0+5UtgzgkuYU5QSYk2DY6BFaIGCGx/vuysSEf8= Received: from CY4PR14CA0044.namprd14.prod.outlook.com (2603:10b6:903:101::30) by SJ0PR02MB7616.namprd02.prod.outlook.com (2603:10b6:a03:328::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.33; Wed, 24 Feb 2021 13:11:32 +0000 Received: from CY1NAM02FT022.eop-nam02.prod.protection.outlook.com (2603:10b6:903:101:cafe::1d) by CY4PR14CA0044.outlook.office365.com (2603:10b6:903:101::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Wed, 24 Feb 2021 13:11:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT022.mail.protection.outlook.com (10.152.75.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Wed, 24 Feb 2021 13:11:31 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 24 Feb 2021 05:11:02 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 24 Feb 2021 05:11:02 -0800 Envelope-to: git@xilinx.com, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, gregkh@linuxfoundation.org, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com, shubhrajyoti.datta@gmail.com, miquel.raynal@bootlin.com, devel@driverdev.osuosl.org Received: from [10.140.6.59] (port=34848 helo=xhdshubhraj40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lEtwS-0001ry-CP; Wed, 24 Feb 2021 05:11:00 -0800 From: Shubhrajyoti Datta To: CC: , , , , , , , , , Shubhrajyoti Datta Subject: [PATCH v10 4/9] staging: clocking-wizard: Allow changing of parent rate for single output Date: Wed, 24 Feb 2021 18:40:36 +0530 Message-ID: <1614172241-17326-5-git-send-email-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com> References: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42b9644b-3c31-4cae-ed74-08d8d8c5b46c X-MS-TrafficTypeDiagnostic: SJ0PR02MB7616: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jyUJ3OMhi28k05v5mBGyI1e5Ca8xktrfMxZTH8JpJdg1im0xiJhbq9tfdQeil4um55mavnCaFul4tuSjM7jlG1xhce785xinRyyaRluPVK50m2kLi92dlOW9RkSLw4G0/DNBHP2i2rhoTjq4b6T8aPtvtJ5g5tfFUv56IxXbuQAsszYhRb/Hiot8JzuM9CYgToGO7RQujLuwrtnEt3ca/Z0famTP8AFbbaeTGUekZCjg8gdUE7CQQ61djufOytaqX0OFnpm68I5QA7/BlL3U8ogiyVzj+12FL6Ug8u02+dBYWY/arfr+7tQadxA6lYxp1V+JBnufnoFLK0wQHPt3WYooLfWBH5WOHw2b+zFB1fi8S3bBXF/nZaZ0BJLbQIbxBjSfp4ks8/KsQ7xYs4k/V3e9bCSDMlaHF+M5KEEHQdzNwSX5OYbMEtSjZYvWVgBNR+GxibOmO3BLMAjWipkutS/vABUAvkFvlZ3Zg/LXTc10bP++Ak9EHn9Us8JcYVzDmwdrm8hd8pNJw/zI/FiSGlZhlVKoA99U/d5x1vBNfcX2nNdGigPKDC1jeOnCk71Ihf+PUuw1Qvx4NYGrvGIdVkDlR5xD8JjfdRFpI8Qbys1PNrn4v2gHhc4ivUliJ1F8xl71yqL88O0fK+2UY5l8EL8UbnMJppdmu/Nnz6ds+o5GmeG+0/8+X/rXiNZN+pys X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(39860400002)(396003)(346002)(136003)(376002)(46966006)(36840700001)(8936002)(8676002)(44832011)(9786002)(54906003)(2616005)(82740400003)(7696005)(6916009)(36906005)(36860700001)(316002)(36756003)(186003)(26005)(336012)(2906002)(356005)(47076005)(478600001)(7636003)(107886003)(426003)(70206006)(6666004)(83380400001)(82310400003)(4326008)(5660300002)(70586007)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 13:11:31.9439 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 42b9644b-3c31-4cae-ed74-08d8d8c5b46c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT022.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB7616 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org If there is only one output then allow changing of the parent rate. Signed-off-by: Shubhrajyoti Datta --- drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index 9cc2f6d..e08fc2f 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -138,6 +138,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) void __iomem *ctrl_reg; struct clk_wzrd *clk_wzrd; struct device_node *np = pdev->dev.of_node; + int nr_outputs; unsigned long flags = 0; clk_wzrd = devm_kzalloc(&pdev->dev, sizeof(*clk_wzrd), GFP_KERNEL); @@ -201,6 +202,14 @@ static int clk_wzrd_probe(struct platform_device *pdev) goto err_disable_clk; } + ret = of_property_read_u32(np, "nr-outputs", &nr_outputs); + if (ret || nr_outputs > WZRD_NUM_OUTPUTS) { + ret = -EINVAL; + goto err_disable_clk; + } + if (nr_outputs == 1) + flags = CLK_SET_RATE_PARENT; + clk_wzrd->clks_internal[wzrd_clk_mul] = clk_register_fixed_factor (&pdev->dev, clk_name, __clk_get_name(clk_wzrd->clk_in1), From patchwork Wed Feb 24 13:10:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 386948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8708CC43333 for ; Wed, 24 Feb 2021 14:19:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FEE664EDD for ; Wed, 24 Feb 2021 14:19:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236453AbhBXOTE (ORCPT ); Wed, 24 Feb 2021 09:19:04 -0500 Received: from mail-dm6nam08on2057.outbound.protection.outlook.com ([40.107.102.57]:65377 "EHLO NAM04-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236078AbhBXNNl (ORCPT ); Wed, 24 Feb 2021 08:13:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U5/FfcOAyraJBqLAy9rDoEIppZfLIPRI+mCgeB98+iTB1QjdoPU4UJLYvhzlC5CjMKtdDpZYyPWLytv+cP/FE5XtbmZ6feE+mHbbqjn5QvRUCdpphCU9uyfO091gr0Rrz6WxBIy+Zcp/mGgfRt/zWNvnyoU5onX32+ztETvLNTnhsUVK3lopHXlwswClfjT82neH/RVYeM4UszRTJk+Fv9Atibwv3kuGTOhAX+X+dagUBxq+q3y3edtp1OvyKdZ9meD3ETkGBCa/evEQo/gE3bqk1SC2kxoiEKUlf+UElyUH1mBc+kSGnMywP9ZFGmhTu+Cyf3AxXYztYrmqIVBU7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pQvaENyuknexIRmK4Ondt1wnTaiHhqrlEZO46wJHld4=; b=NvBO2YGmvYk9cCre7UKl0llvjk6sMfGM/cdw7PqeD4AswBYkymE4o/c4+eVrd0Vs+KzSkrWXQiCqSLh8WB7Q//jEKWsNvRv5npGf499/WyTsa3hqloSpP/1W7+oTlOz7eUXqwh707ywGzOfVtlkpJVQbPN/wf/fz6jZviWldQvGuRBvz3/AD/YqrLRrsMhQBcvrySKHv7xv9Ytr//I0zaUa8MUN+EtmBWrEwwyoU6f+DNmO5lradXQf1IguCA5Do6vVlyqjeKT967kgxwiFK/3nlxU+EuDB6qimpehcQK6kNeVsRQxSLwAO/xprnTsBHJAQSV9RAXxsC+9zMGAra8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pQvaENyuknexIRmK4Ondt1wnTaiHhqrlEZO46wJHld4=; b=ppud/w/E11RCCV1gPxlgjPlrRdpAj6qjpgv1JdsNFRSm7hmjOdylTr5WpXBnoCmKOdh2o1rNw55K5ev9kTKo95+XfpjL1J/oCtQlFSIpJJjVMK07tJsC1461B2P/lFk4rk1PPw+OhVdjZ+ejs8zEiNPRKV09jRyg2k+HBiK8hAQ= Received: from CY4PR21CA0009.namprd21.prod.outlook.com (2603:10b6:903:dd::19) by BY5PR02MB6308.namprd02.prod.outlook.com (2603:10b6:a03:1b1::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25; Wed, 24 Feb 2021 13:11:49 +0000 Received: from CY1NAM02FT039.eop-nam02.prod.protection.outlook.com (2603:10b6:903:dd:cafe::d0) by CY4PR21CA0009.outlook.office365.com (2603:10b6:903:dd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.3 via Frontend Transport; Wed, 24 Feb 2021 13:11:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT039.mail.protection.outlook.com (10.152.75.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3868.27 via Frontend Transport; Wed, 24 Feb 2021 13:11:48 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 24 Feb 2021 05:11:06 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 24 Feb 2021 05:11:06 -0800 Envelope-to: git@xilinx.com, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, gregkh@linuxfoundation.org, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com, shubhrajyoti.datta@gmail.com, miquel.raynal@bootlin.com, devel@driverdev.osuosl.org Received: from [10.140.6.59] (port=34848 helo=xhdshubhraj40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lEtwX-0001ry-5h; Wed, 24 Feb 2021 05:11:05 -0800 From: Shubhrajyoti Datta To: CC: , , , , , , , , , Shubhrajyoti Datta Subject: [PATCH v10 5/9] staging: clocking-wizard: Add support for dynamic reconfiguration Date: Wed, 24 Feb 2021 18:40:37 +0530 Message-ID: <1614172241-17326-6-git-send-email-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com> References: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7bcf89a7-d276-4d5a-2555-08d8d8c5be73 X-MS-TrafficTypeDiagnostic: BY5PR02MB6308: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1060; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PmPEfSAcmA/V3v51HxlVc9nzoKHLRcr7SFUHOWw5YEdNgZLQSLHmQHSyS56PGCUvKabTc7Z82sIguV7RMp0N2T2hG6icJvrVs69KnStGPgRHGdJiWrux9CZSa1LlLnRqYDTbaRv7XeHP/skOMBa928+viz6rb/b99/6dov6WgHB8b+hYWm8QW+4QppnACFK2TDFkRrsUeDG68Climu5Th4nkVc2ncrPYJlT+4szjrmsbM5bmJ3auwbuzYbXlHM61xZj8r58vp1GqGqWFtFat7LDNzqVCBSUtb6ec1im9wi0vkDxoG8nw4CxmKi8Tl9qwALbDMUgVsNuried6EVYK1hvuKmzXil3sAnAeKb/GzyCFBfOTQxMbU9BP9X9Ca2xYQRZXcSbjVMGUQ3RCQ184asOq+DyxQ0b54lMWEDaFGkhbGZzzWPQKf7CHfYeWwnEofG+ThWIXcENAmsX12Cq0Ap210Ci+NkcNfuC1D88G5xkIhH+rIaN8eTwcCD+hNuGVMbOH94E6SXdsFZQa7ywRYTH6p7o3noMA0ZglrBbe5ZOvcCvSNbzIIReUV7YfJ+q2y59n4VRprzUE9Myxu1sdsRvFpXOssfvT2bw/cWfzVu3n6v4ap8QdeWrzvKYxqVcjw8gB5SUse42ssNiePsi6RLDRmkvvEYsDZhqeUgahRblVhYqIDDbs9nf+HojzjoTL X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(376002)(346002)(136003)(396003)(39860400002)(46966006)(36840700001)(336012)(5660300002)(4326008)(6666004)(2616005)(83380400001)(26005)(2906002)(7636003)(7696005)(36860700001)(70586007)(82740400003)(426003)(36756003)(9786002)(8676002)(478600001)(82310400003)(186003)(316002)(107886003)(70206006)(36906005)(47076005)(6916009)(8936002)(44832011)(54906003)(356005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 13:11:48.7629 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7bcf89a7-d276-4d5a-2555-08d8d8c5be73 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT039.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6308 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The patch adds support for dynamic reconfiguration of clock output rate. Output clocks are registered as dividers and set rate callback function is used for dynamic reconfiguration. Signed-off-by: Shubhrajyoti Datta Co-developed-by: Chirag Parekh --- v6: Remove the typecast. use min for capping frequency. use polled timeout v7: Use devm functions Add the spinlock v10: Add a codeveloped by tag. .../clocking-wizard/clk-xlnx-clock-wizard.c | 178 ++++++++++++++++++++- 1 file changed, 173 insertions(+), 5 deletions(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index e08fc2f..b1bfdb86 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -15,6 +15,7 @@ #include #include #include +#include #define WZRD_NUM_OUTPUTS 7 #define WZRD_ACLK_MAX_FREQ 250000000UL @@ -29,8 +30,24 @@ #define WZRD_DIVCLK_DIVIDE_SHIFT 0 #define WZRD_DIVCLK_DIVIDE_MASK (0xff << WZRD_DIVCLK_DIVIDE_SHIFT) #define WZRD_CLKOUT_DIVIDE_SHIFT 0 +#define WZRD_CLKOUT_DIVIDE_WIDTH 8 #define WZRD_CLKOUT_DIVIDE_MASK (0xff << WZRD_DIVCLK_DIVIDE_SHIFT) +#define WZRD_DR_MAX_INT_DIV_VALUE 255 +#define WZRD_DR_STATUS_REG_OFFSET 0x04 +#define WZRD_DR_LOCK_BIT_MASK 0x00000001 +#define WZRD_DR_INIT_REG_OFFSET 0x25C +#define WZRD_DR_DIV_TO_PHASE_OFFSET 4 +#define WZRD_DR_BEGIN_DYNA_RECONF 0x03 + +#define WZRD_USEC_POLL 10 +#define WZRD_TIMEOUT_POLL 1000 +/* Get the mask from width */ +#define div_mask(width) ((1 << (width)) - 1) + +/* Extract divider instance from clock hardware instance */ +#define to_clk_wzrd_divider(_hw) container_of(_hw, struct clk_wzrd_divider, hw) + enum clk_wzrd_int_clks { wzrd_clk_mul, wzrd_clk_mul_div, @@ -62,6 +79,29 @@ struct clk_wzrd { bool suspended; }; +/** + * struct clk_wzrd_divider - clock divider specific to clk_wzrd + * + * @hw: handle between common and hardware-specific interfaces + * @base: base address of register containing the divider + * @offset: offset address of register containing the divider + * @shift: shift to the divider bit field + * @width: width of the divider bit field + * @flags: clk_wzrd divider flags + * @table: array of value/divider pairs, last entry should have div = 0 + * @lock: register lock + */ +struct clk_wzrd_divider { + struct clk_hw hw; + void __iomem *base; + u16 offset; + u8 shift; + u8 width; + u8 flags; + const struct clk_div_table *table; + spinlock_t *lock; /* divider lock */ +}; + #define to_clk_wzrd(_nb) container_of(_nb, struct clk_wzrd, nb) /* maximum frequencies for input/output clocks per speed grade */ @@ -71,6 +111,131 @@ static const unsigned long clk_wzrd_max_freq[] = { 1066000000UL }; +/* spin lock variable for clk_wzrd */ +static DEFINE_SPINLOCK(clkwzrd_lock); + +static unsigned long clk_wzrd_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); + void __iomem *div_addr = divider->base + divider->offset; + unsigned int val; + + val = readl(div_addr) >> divider->shift; + val &= div_mask(divider->width); + + return divider_recalc_rate(hw, parent_rate, val, divider->table, + divider->flags, divider->width); +} + +static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + int err; + u32 value; + unsigned long flags = 0; + struct clk_wzrd_divider *divider = to_clk_wzrd_divider(hw); + void __iomem *div_addr = divider->base + divider->offset; + + if (divider->lock) + spin_lock_irqsave(divider->lock, flags); + else + __acquire(divider->lock); + + value = DIV_ROUND_CLOSEST(parent_rate, rate); + + /* Cap the value to max */ + min_t(u32, value, WZRD_DR_MAX_INT_DIV_VALUE); + + /* Set divisor and clear phase offset */ + writel(value, div_addr); + writel(0x00, div_addr + WZRD_DR_DIV_TO_PHASE_OFFSET); + + /* Check status register */ + err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET, + value, value & WZRD_DR_LOCK_BIT_MASK, + WZRD_USEC_POLL, WZRD_TIMEOUT_POLL); + if (err) + goto err_reconfig; + + /* Initiate reconfiguration */ + writel(WZRD_DR_BEGIN_DYNA_RECONF, + divider->base + WZRD_DR_INIT_REG_OFFSET); + + /* Check status register */ + err = readl_poll_timeout(divider->base + WZRD_DR_STATUS_REG_OFFSET, + value, value & WZRD_DR_LOCK_BIT_MASK, + WZRD_USEC_POLL, WZRD_TIMEOUT_POLL); +err_reconfig: + if (divider->lock) + spin_unlock_irqrestore(divider->lock, flags); + else + __release(divider->lock); + return err; +} + +static long clk_wzrd_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) +{ + u8 div; + + /* + * since we don't change parent rate we just round rate to closest + * achievable + */ + div = DIV_ROUND_CLOSEST(*prate, rate); + + return *prate / div; +} + +static const struct clk_ops clk_wzrd_clk_divider_ops = { + .round_rate = clk_wzrd_round_rate, + .set_rate = clk_wzrd_dynamic_reconfig, + .recalc_rate = clk_wzrd_recalc_rate, +}; + +static struct clk *clk_wzrd_register_divider(struct device *dev, + const char *name, + const char *parent_name, + unsigned long flags, + void __iomem *base, u16 offset, + u8 shift, u8 width, + u8 clk_divider_flags, + const struct clk_div_table *table, + spinlock_t *lock) +{ + struct clk_wzrd_divider *div; + struct clk_hw *hw; + struct clk_init_data init; + int ret; + + div = devm_kzalloc(dev, sizeof(*div), GFP_KERNEL); + if (!div) + return ERR_PTR(-ENOMEM); + + init.name = name; + init.ops = &clk_wzrd_clk_divider_ops; + init.flags = flags; + init.parent_names = &parent_name; + init.num_parents = 1; + + div->base = base; + div->offset = offset; + div->shift = shift; + div->width = width; + div->flags = clk_divider_flags; + div->lock = lock; + div->hw.init = &init; + div->table = table; + + hw = &div->hw; + ret = devm_clk_hw_register(dev, hw); + if (ret) + hw = ERR_PTR(ret); + + return hw->clk; +} + static int clk_wzrd_clk_notifier(struct notifier_block *nb, unsigned long event, void *data) { @@ -251,11 +416,14 @@ static int clk_wzrd_probe(struct platform_device *pdev) ret = -EINVAL; goto err_rm_int_clks; } - reg = readl(clk_wzrd->base + WZRD_CLK_CFG_REG(2) + i * 12); - reg &= WZRD_CLKOUT_DIVIDE_MASK; - reg >>= WZRD_CLKOUT_DIVIDE_SHIFT; - clk_wzrd->clkout[i] = clk_register_fixed_factor - (&pdev->dev, clkout_name, clk_name, 0, 1, reg); + clk_wzrd->clkout[i] = clk_wzrd_register_divider(&pdev->dev, + clkout_name, + clk_name, 0, + clk_wzrd->base, (WZRD_CLK_CFG_REG(2) + i * 12), + WZRD_CLKOUT_DIVIDE_SHIFT, + WZRD_CLKOUT_DIVIDE_WIDTH, + CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO, + NULL, &clkwzrd_lock); if (IS_ERR(clk_wzrd->clkout[i])) { int j; From patchwork Wed Feb 24 13:10:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 386950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43107C43331 for ; Wed, 24 Feb 2021 14:19:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0577164F07 for ; Wed, 24 Feb 2021 14:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236355AbhBXOSt (ORCPT ); Wed, 24 Feb 2021 09:18:49 -0500 Received: from mail-bn7nam10on2057.outbound.protection.outlook.com ([40.107.92.57]:33576 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236080AbhBXNNj (ORCPT ); Wed, 24 Feb 2021 08:13:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GzMmEwdz9MKRefMAPa16Yq3P8Ko7gWoi9gmvMRTkug31inZNq+2FJlST67IxxRq/VaHt9PUxCNQF8EVpaAYCQcqt04Bejeyz8H9lnQ2BqmsofJpEYRFRwQP2sVBdF/+wH5hJRNsOEGFk03wD2K4E2Zi0WcXkAxDAJYOz4iXLSuXzOBzoIEXvbe4VjV5HLavmCEnJaIb519O35UCRkOV5ltioO4SvpYEmdUgfW+E38CvxwYYbdjEOrv3SSX4t/fHDgaZiqXXbwdhp31NhcmU1EH98n+TPAyviFq3yLuUZmroofj+W0ZjwveL/esDIhWrO4Tkepr/uDlbLjNG/u66DFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a9psyoKRCRDkMjRUPCwI2RO3YBj1Mhwt9yyQgsxiVWc=; b=bVDF3vfXJEQ+TM6xXYf2SklErTf7m/We6WzjQgRGmrHMWVtZ0iI9gYKQKKfPGD9Mox9U7cKdflYMj79uRZqA18pLclnc2u+NBqdqIzRzYt26MCmD4eCUZkzE8VAaj2iA5u33UyLDM1q6MJlrbTw5B2wNI+LcyjHe0T8yg3JO8upajmimJ2hHg4/Yin7S222XpNQ+WPZE3VQ+FRoZMFDpj94g4jutpS3rjBXEDydiXhwckL7PcbIYFUhv+ghviHU+lWRzTSpXCbYT9VpUKEirItyqRwiQJUHgXkBuhndCgMEKh6+DETwXIQDygD45Wg82qruoooRFdiSp8dGhFBh5pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a9psyoKRCRDkMjRUPCwI2RO3YBj1Mhwt9yyQgsxiVWc=; b=OXkHK3+M4VC4KhaQCeLNxZ+Y0dlSUBszpKFDrfW5YHti1Yh5VvTXqx4BrbdRxJ/uioW/clnPoO50pSbhX6fB94wH0QXYuej8lNfGa2VTAqUjTAyA7/QxcDf4RqaQDWDBJXgAjFREtHs1T/L6hLRp9t0oCdJ/8OBbzVcbcu28HuE= Received: from CY4PR18CA0030.namprd18.prod.outlook.com (2603:10b6:903:9a::16) by CY4PR02MB2392.namprd02.prod.outlook.com (2603:10b6:903:d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27; Wed, 24 Feb 2021 13:11:50 +0000 Received: from CY1NAM02FT006.eop-nam02.prod.protection.outlook.com (2603:10b6:903:9a:cafe::b8) by CY4PR18CA0030.outlook.office365.com (2603:10b6:903:9a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Wed, 24 Feb 2021 13:11:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by CY1NAM02FT006.mail.protection.outlook.com (10.152.74.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3890.19 via Frontend Transport; Wed, 24 Feb 2021 13:11:50 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 24 Feb 2021 05:11:13 -0800 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Wed, 24 Feb 2021 05:11:13 -0800 Envelope-to: git@xilinx.com, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, gregkh@linuxfoundation.org, robh+dt@kernel.org, sboyd@kernel.org, mturquette@baylibre.com, shubhrajyoti.datta@gmail.com, miquel.raynal@bootlin.com, devel@driverdev.osuosl.org Received: from [10.140.6.59] (port=34848 helo=xhdshubhraj40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lEtwe-0001ry-50; Wed, 24 Feb 2021 05:11:12 -0800 From: Shubhrajyoti Datta To: CC: , , , , , , , , , Shubhrajyoti Datta Subject: [PATCH v10 7/9] staging: clocking-wizard: Remove the hardcoding of the clock outputs Date: Wed, 24 Feb 2021 18:40:39 +0530 Message-ID: <1614172241-17326-8-git-send-email-shubhrajyoti.datta@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com> References: <1614172241-17326-1-git-send-email-shubhrajyoti.datta@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 827eeefc-d62c-4240-b533-08d8d8c5bf38 X-MS-TrafficTypeDiagnostic: CY4PR02MB2392: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8J7VMr4vh0prnsXHkHNdl4wFbaGbLMsxL19CWVBqLPhxp902aLvIVuoGolQUzKOxOaQl+uQSbOpBc4IcBhduaztp3QupZEi9jZmcVWDRR8LqR9RijrpotUo72CHzTm2SQfLU+4GDGytRgxwp5BE+SO53r/hvg4iR6NUBAoc4IOTmslb4dXofxAoFkB+pef/EZhGpIFPWUiTvnLiFANWrvVGn5+buNOn1zQoZzldFeLuFn0zzopIRZ1UoBM9fxM0FlDG8g//rRYxkEC6bEeZIMmzgdXGty7AzutzpAvY7xXKIiLbzED0nZkYt+b+LwF5LuapwdW49uIFMleRZFYGcub55GpoQ/3HEDKtKhJpLb0cG4ecdfUx+aZJXfK3vhgFfJ7zoEU0PAiYtSDrMVPt8Q4YwGcPlxJW9JQBqnwx+jH3R2FWNb43YnF99ewsAmurKdsDbdtmddrYvkB/xewm18fCGPdB+L96pkDKiJXjwmR9FwcJHr/U8RvYmuwpsQdm9rG/sAyXOv2V+i6nnttJZBUUat9XlIx4ZX+u1vziytzEhNI0LQNfLvVVSJOn6suwpdXK6+UwJxkx96H4vwXk3UhcLYU5VI0Ojaam4V6wm73xS9xkRtw5xOerSgpt9yriHbT3TEJ8E4tD1l35bQQhgbKzHQJK89olm/THe4vqFRJ8ylHbSe3hkwZXnaExBRy3L X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(136003)(39860400002)(46966006)(36840700001)(70586007)(36756003)(36860700001)(70206006)(2906002)(5660300002)(8936002)(7696005)(8676002)(6916009)(316002)(36906005)(9786002)(83380400001)(4326008)(478600001)(2616005)(107886003)(426003)(47076005)(44832011)(54906003)(7636003)(356005)(82740400003)(82310400003)(186003)(6666004)(336012)(26005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 13:11:50.0577 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 827eeefc-d62c-4240-b533-08d8d8c5bf38 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT006.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB2392 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The number of output clocks are configurable in the hardware. Currently the driver registers the maximum number of outputs. Fix the same by registering only the outputs that are there. Signed-off-by: Shubhrajyoti Datta --- v10: generate the names runtime. drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c index a70f09e..b0ced42 100644 --- a/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +++ b/drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c @@ -517,16 +518,15 @@ static int clk_wzrd_probe(struct platform_device *pdev) } /* register div per output */ - for (i = WZRD_NUM_OUTPUTS - 1; i >= 0 ; i--) { + for (i = nr_outputs - 1; i >= 0 ; i--) { const char *clkout_name; - if (of_property_read_string_index(np, "clock-output-names", i, - &clkout_name)) { - dev_err(&pdev->dev, - "clock output name not specified\n"); - ret = -EINVAL; - goto err_rm_int_clks; + clkout_name = kasprintf(GFP_KERNEL, "%s_out%d", dev_name(&pdev->dev), i); + if (!clkout_name) { + ret = -ENOMEM; + goto err_rm_int_clk; } + if (!i) clk_wzrd->clkout[i] = clk_wzrd_register_divf (&pdev->dev, clkout_name, @@ -548,7 +548,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) if (IS_ERR(clk_wzrd->clkout[i])) { int j; - for (j = i + 1; j < WZRD_NUM_OUTPUTS; j++) + for (j = i + 1; j < nr_outputs; j++) clk_unregister(clk_wzrd->clkout[j]); dev_err(&pdev->dev, "unable to register divider clock\n");