From patchwork Tue Sep 10 19:07:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13799276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 437C7EDE9AD for ; Tue, 10 Sep 2024 19:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6S5qPC9dLd+uFJW3y7aEhwRdoqpfhTFn0U6wBratWY8=; b=qAB/kVmJ93mXqnGwuy2y0qXt8+ PuoKtkQPaNzLNeXGUURdWaasWjkvsY7Ij8SJqLVLTy21/nd3AMI3NNgI9U5VtlkjO/U5xE/CayAUa Sy91wrDJrtVC6AximASXtJsM311oJlcFN7QMEEGqTsjqVZRFLNa/103VTFpb4r2TneLFgCr7I0Yk3 f5ZRfQdLByQrzN46x7iOqDbp5nNXr06qDtlmnhHniMaJ97KMJPsYSXeePdDrm5zB2kgCauwRDPUNZ d4Emce9MXm2TEJl92+b8E4t1NFflfk4/3Y03//jQainM/I2t7OfvrVHrTvxr2hjxWA/BgW+Fcg2HI MYPvNhvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1so6Fc-00000006r2v-2FGZ; Tue, 10 Sep 2024 19:10:08 +0000 Received: from mail-northeuropeazlp170120003.outbound.protection.outlook.com ([2a01:111:f403:c200::3] helo=DU2PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1so6DS-00000006qOT-2bqt for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2024 19:07:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Op+sTRss2a/ybrnVnsykXl+jkyBHi1BV2IU4skeSKYRDIR1HfS3yid3h0O8MdiRlDnVozxbtTt4f1CnjmCKm+oyWc1BzcNVDqDHil1BOIpUCkM74GpPK3XJ/Tga4BgxWj6s/Si5vWQ5zFmxyV1ylmOmjNhDa4CwlKqsel1jxMq3J4aOCpS/6j09GrpekNFGEgElbB26/lfDo9rIi9kBva+edapDX1QowSXd5gM+NFaUZZpks3Hf9tlD3It6uSzFpz2epYBMRQekf7wmvCSbbASYgnJuen9zRnmEdZwy20chQVF5VQuwdt0XOqsw1NmZ4Q6b8j/1y00klaPO89DCE0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6S5qPC9dLd+uFJW3y7aEhwRdoqpfhTFn0U6wBratWY8=; b=EEUCoRAtnwe9wVVnbGbNLF42pa70bLlrkZRYKHRQ/pKc8e3q6iWHK7ZqAz9yrGvuCL3fdBbb3xkD+KtjNPSsdkBNYKN+kswUYZqYJqrBM/mcwVLCjVcGwkMLu+z4WjVPaS924w6ooWdqh9i4rBdkkfhiZLoYE3pyJ9MhjL04lm2tiaSS1HxGrz7ryEceqDv7dn1V20lFH539YmbyV4EyySNYehOnEOiaNOEVcop+7Il0OnM9+ZY1GEaGtSMRzMwO4B7Rm+KuBMcD7gxtEljxU9X4qI9HD9b0A7YzZIs8i4zcdiJex0AHdpz1iqLfdZl8GU9iq96aIzSXm6dyQsNerA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6S5qPC9dLd+uFJW3y7aEhwRdoqpfhTFn0U6wBratWY8=; b=gjLAY4YHP7y+JL7bJrsVz4uvKu/W8KxGEXkwQTYb3F1huOA3iIR4UvdESnf0wcff+jyUpTWnNsrK2T7wJNI5IyeUGLByRoaak3k1HQW2YlRjOErPrl/cD4gS4zZZnZfwwDs2OkAH55ObdLI0i6pEpUZNaRuVHn+2zmmEdePzwKBmXCpb8SMkEU6uH1NymrA0mKisXu62JGyjpvbuLsWTVbT7iTaLttHDDfhDHJPUxf8cPkN7g56Vtg/k20RCYwtCE5gnN6nneEggsgeDfYEfxnWVwBgTQXigfJL8EUnnw5vXeo3ITAFjO63CzJZu8KlCFqXm78oVO6GuchCkF8+iUw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VI2PR04MB10115.eurprd04.prod.outlook.com (2603:10a6:800:21d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23; Tue, 10 Sep 2024 19:07:47 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7939.022; Tue, 10 Sep 2024 19:07:47 +0000 From: Frank Li Date: Tue, 10 Sep 2024 15:07:18 -0400 Subject: [PATCH v3 1/3] dt-bindings: pwm: imx: Add optional clock '32k' Message-Id: <20240910-pwm-v3-1-fbb047896618@nxp.com> References: <20240910-pwm-v3-0-fbb047896618@nxp.com> In-Reply-To: <20240910-pwm-v3-0-fbb047896618@nxp.com> To: Marek Vasut , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Philipp Zabel Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pratikmanvar09@gmail.com, francesco@dolcini.it, Frank Li , Conor Dooley X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1725995258; l=1015; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=7cPnhCSJUSFQl0yVoLJxwbOrnCIHH/QeAWGfdDS7p3I=; b=Bam3qE7LdW7I8HK40G++J9Q0EB+MBDWjitKUiXZu3VvyFX7WYHIGXD5FQeHsAq6Y1vE5HF6SR KunCul3BIqIA7SWUVYZMgADG8IdDa7Xoe9WV7R/v2+/MzERRUsmErMS X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0145.namprd13.prod.outlook.com (2603:10b6:a03:2c6::30) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VI2PR04MB10115:EE_ X-MS-Office365-Filtering-Correlation-Id: 2358c602-47fb-4aaa-97a0-08dcd1cbdbcc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?cZAAP8Ey5BXgnY031Zjh7FcNfSnrsmx?= =?utf-8?q?NJqbqmAkz8TXmGHpXQ6PVXMkNZV53C8gWmt0DPe3ksv1BAv11TwOf8+Z1gXEmnBBb?= =?utf-8?q?Xb7BWrrgvB8S+YTxyB6/PwrS19cpmnwSyrGN1VW+yr8sr1aS9qBg9M6RZmalkcWLM?= =?utf-8?q?BROQn6e3xc0OEPViZyIgAVGfQ8mKtzpH333M90ZGbOneiguEatcSMvvWUaD4hbOVi?= =?utf-8?q?H5faCRIu30aerPEstQLXv0Y8EgL796hKf10zDKc2aeyeSsy40Ug5Ptqn5ilXAovZu?= =?utf-8?q?VWg7fNYRwUAv2COSQdut3FMbCLfrctVJ5zd1FyMax7UFiX3jjfUvQ9NxNsyPl0zhh?= =?utf-8?q?dHlWC2XAsl2DY4oqUzGuBYOsu3WeJGVupPZqdci4aHVgrwmu1JYHN6/i3Ycqbp26I?= =?utf-8?q?FBYyzAZZ7+6zD78QGkSZwjuHSSIzZQWrbHpM4lwPX74IBx/LskOVoGgrfebjWQMBo?= =?utf-8?q?YD9QQBxGOB9KQkWTK6vagbRiGftVMUdB2Y9lUk53QVin1FiDBAyXJYt3MH9cCwN6v?= =?utf-8?q?m1ei8gX3lnRxodWSxPdPGmjrGJop+CtjA2IU/K3uy/jMzdIY3vm2wg8m2xA0VP1iY?= =?utf-8?q?4VVdFdG7WXwm4OMpF43k2IFkIh37Z73MMQWbxS/gVVyYrbeO2dyi79gvrM7RFZ9Az?= =?utf-8?q?JLBGSBmcXXq603QVe2Whl6YLveGL5tV7T16Gph54wbfH+/KGlw+0pdSUWunMv0J4S?= =?utf-8?q?wRhb3ws9j9xlADu8umlv2/klHZHofYNxvYzCDVdW+RliZyxk1mNdtlu+d0XYdrLaB?= =?utf-8?q?c8NJsh2t6tUG3hxyEtxh250WA6llY79YPD+EIl4K0lmL8TobxeuOuHGCvPuc90Nzd?= =?utf-8?q?KDAAXJo9Oxsg3iIEO0YtX6MPjhH3aGjtZE2O6lA33sc3eOkTQWcLzZ3Iww7lh3Pqj?= =?utf-8?q?XbiO3SpjV99SkeySEg/2+VhRcvIuoWVxPXMbqX3JUBDmuznSF6olc6/XVA+5GKuZz?= =?utf-8?q?yuuu6mPhX1HCtWGq5z3dns03S8T1bFyaACopO5trz1jX8nx1VuTgha5tqdYVgceQG?= =?utf-8?q?xsyzoNnwF1nwZj604uU7Bgdk45JuYAJSHEAys+mD1F8BCeOFe6dZKRugKHC5ggZpm?= =?utf-8?q?ckjTMXSzMfu84kDnXfm8vvNV5i7U9mbt8/qxpXtmjwQRrFh5L/jiuZCgIRHgMK+qL?= =?utf-8?q?i7j81dlFIzzqHzeEQfowEx97vyhHFPoMoeMz+KUsIgIiWXkHBS/tFD7LcmdBDmtDF?= =?utf-8?q?Nor0zOt0EeIdWC/f21Fvd1oANhNZDz13pI82OAtQF4C6OpFpzqHGFjJIx3q88hyB1?= =?utf-8?q?RxJpzW3QC8+e/tGpWiQfaH/nUC2RBPK7rPLleFcSmiQ92J0yeFAM0qq9BcCsL17nN?= =?utf-8?q?UJNHs05V7eTiJuU/udMLEVjY7trmMaGzrdc/E7Kus+WFEDKRBT2Fae8=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?bdCYo+sExvuwlnd7L0O6s2lYvix8?= =?utf-8?q?8rZaS4f6Y82f6N2JbgNBNoMiAAl1roME18lWyMmKZa/Hiqp8bRc+g4uiTcZ/6D/dE?= =?utf-8?q?TReSQYczWCXbujyD8cw8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cmn9+1WQn+kDQpWYzT6XAdqa32o4jf3dZE9IYqr1mFDR?= =?utf-8?q?urQPEDWNvbOFDyBPAijWTmDWdaVvrXclhcgzkYoTcvz8FSclOv4a3s12wdLNwOm/B?= =?utf-8?q?JR6DOHBbMzpUXfFqkv8dz/bY6CSVOAH2PJditQotnHo7Kneu5NKu6LS31cifeRCN9?= =?utf-8?q?LsF1PlPXW3a4TMRU0iWJC6hHC0S3eti5hljWpTILPfU/1Yr1mW35tcloDD/FNTHbg?= =?utf-8?q?4VKBotW9HUUqQ6oZd9Tdxb9uuaJBnhWjnj9WxWBiY2eClsJZE/tK8qSN9cpxX7v4S?= =?utf-8?q?3LThtm8xZSVjmB75ukpizxe4lCeX+Rjyi6odpFF4HalWwP2ULGLDAPZRZnEkafsbj?= =?utf-8?q?eZR+I/4pB0/+WFVTyVTVFgOhxfePoyXAWtTcS+E0z5ChVosk5FiFLRRxdjXQD90WF?= =?utf-8?q?8Xkomo58RSgaasnovsKd+FryNC3HNqgPhYBp38ySyUgSOIE4jHSV/cvb6hnG5YjHi?= =?utf-8?q?+tsiy/rpgDsrbVhutmU2afJVJ0wU5Yfba4KyjN+r+B9uEAX/eSKPhamE=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2358c602-47fb-4aaa-97a0-08dcd1cbdbcc X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2024 19:07:47.6981 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4TrNZ2CmquKfk+8L0bSiUTMfyg8ocuWj/qWVtKcT04dSwIjeBJmSKZFiWVnPVWWa7LVabEjQBgrvwjrViSbwEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10115 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240910_120754_734775_AC6FE46D X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The pwm in imx8qxp mipi subsystem require one extra '32k' clock. So increase maxItems for clock and clock-names. Acked-by: Conor Dooley Signed-off-by: Frank Li --- Change from v1 to v2 - remove compatible string fsl,imx8qxp-mipi-pwm --- Documentation/devicetree/bindings/pwm/imx-pwm.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/pwm/imx-pwm.yaml b/Documentation/devicetree/bindings/pwm/imx-pwm.yaml index 04148198e34d0..bc6991bd466e1 100644 --- a/Documentation/devicetree/bindings/pwm/imx-pwm.yaml +++ b/Documentation/devicetree/bindings/pwm/imx-pwm.yaml @@ -51,11 +51,15 @@ properties: items: - description: SoC PWM ipg clock - description: SoC PWM per clock + - description: 32k clock + minItems: 2 clock-names: items: - const: ipg - const: per + - const: 32k + minItems: 2 interrupts: maxItems: 1 From patchwork Tue Sep 10 19:07:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13799277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90E4BEDE9AB for ; Tue, 10 Sep 2024 19:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BCtkPEOKBRoUNpB05Iym30l5jBGSebnuQxLOOU+RHjA=; b=Rg7+h1yZ2sJ90OP6UtlR7ppyWB iP5FPi3yd6ByWSWPV5knMXa0C3lTx1eIT/0SY+ZjjhIqYPfrJtaC4mHzQutYsvEhPAH9XxvnaCQie chIWqcFcKKJBTABCdfUee97ligu4RuMnTvOv3+410gHiq0JUkhSx3WicxCm+JflYDwt/1g2wpALkh V9ZUNV0WZUxU0cG/UYzGga6RV3KaMAf3gMAGnEUjCrCZzwr+uGvjVpkzaWgI6wweYxrlKQ1598Pdx IUF+mK9NPZq9Oz1mw8Mb9rAm0Bdw/TDMjVfkK6ecTIVmJNmWKwlNM8dtpE0idMN71T208jjU+NtEv wcw2wJLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1so6Gg-00000006rP3-1ccI; Tue, 10 Sep 2024 19:11:14 +0000 Received: from mail-northeuropeazlp170120003.outbound.protection.outlook.com ([2a01:111:f403:c200::3] helo=DU2PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1so6DU-00000006qOT-45rO for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2024 19:07:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yDvlDqsiayQ4hyOQv/34HSiCfVQV+X08NzZCgWwbJC18SS6s1KTVaa1NZs0lNxS0837op18jXHJqx3ib8mXZ/C89+Cv0FtQ4oDEzQ6a+Z7+QG12fJ1COfp4/U3gJAqLel6Mh0aF2L8qzrto/uUh6VhfpDdUpqxE3DyeLqDgAcq37bU/yxE0Uy5R9sQsQnI9ie2FKxTpIOmAMtvSkwD58gEGry89Ymsb/OfZwlpFLbBl7PQU45QK1wINMqXEixR03r4tZTP1OskYCIISzcyIedA3od87phFkP8zo8PSzuZMOWdi5TK0cJGis0EVrcYsh0J9f7S9yuyr2sZa85jw/Wwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BCtkPEOKBRoUNpB05Iym30l5jBGSebnuQxLOOU+RHjA=; b=ZIfhrPRdujTRCKtUczVpnpOkV4vTSxnpmLw9SFkay/kUeJDa6O8mLHvK9uCuZuo/GG8ZGug4cCLQJNV20tapSS8CzhOOc6kSqbLdB7Ay3uir5W+1wex+xUV2IqZfl0IstzKdgXidgLQ3I5gDTgWnm89CaJj3G9bQ3/VKVbF97NcG3LxgwsO8KhB+qX6l9blT+qUJ7rn5BqdaCM60sicdkKiP0KuZoRNbUbohCI+SrU/DpufK9KEglGDia0PSULUqQ3E2XZOircT8yKIP5iNJkykq202pHbXZX685/wUojmIFMFp/Az2LxIQ0Gix1r9Ccht9eO28Q7MABa1sHaVmgAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BCtkPEOKBRoUNpB05Iym30l5jBGSebnuQxLOOU+RHjA=; b=ewNIZjD6NcYfKkYu3Wns9m6Ic2N8SBH5BrhDrpGon45RzfLF2O7DXE8Pglk9LM5+I/WHq+56WwvKOcqgJchbd2XM2yZL7btMIB450IrRzfxZletbsEdVxOc/VJ7/z3VGBKe0FyIkr+rRttGrwFcFRJD8t42jj8fdszY7k5MHSUNpHmeldWUZcR76JfGtZJNZ7uLxqR4Nt5kR4cCX5iReeT1xvtSgQHMfEFVjI3xTx+2H0J2oyQnQYtNUeGlW6dHcx3MlyVP+LPT4sdDsyfqoEOmvcgn7dmtz+1flad1uLHiV4EXS9X23R7/do5QYUHrZia4SPpr27Ipzticq5TOCTw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VI2PR04MB10115.eurprd04.prod.outlook.com (2603:10a6:800:21d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23; Tue, 10 Sep 2024 19:07:52 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7939.022; Tue, 10 Sep 2024 19:07:52 +0000 From: Frank Li Date: Tue, 10 Sep 2024 15:07:19 -0400 Subject: [PATCH v3 2/3] pwm: imx27: Use clk_bulk_*() API to simplify clock handling Message-Id: <20240910-pwm-v3-2-fbb047896618@nxp.com> References: <20240910-pwm-v3-0-fbb047896618@nxp.com> In-Reply-To: <20240910-pwm-v3-0-fbb047896618@nxp.com> To: Marek Vasut , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Philipp Zabel Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pratikmanvar09@gmail.com, francesco@dolcini.it, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1725995258; l=4875; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=Fv/rjc6K+Tgi8oLugRWIWJNXxGBfq8oLj375Kdahgzk=; b=90s3Uzgics86Z6o3Iv4aNOpDLSGdNdKlOXofzw60xM3AW2vPOLSZfG/NPlWTEer9h2mF5ypWD n62gBae1B5gBJyui0M2Y1lfosNwzY+wm0s7KYLQFG0qfOInhIrQ6Mac X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0145.namprd13.prod.outlook.com (2603:10b6:a03:2c6::30) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VI2PR04MB10115:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b708ad6-8efe-481d-52cb-08dcd1cbde5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?CSE0rZbKKxWcGDqsBtLL4P7H/u/9coG?= =?utf-8?q?iJn63zYYI1lnvotRYAAVbW4VqEjQ/aMJp7JBEzhgAX9qpCk3S3Cdpt+TEmIuoCOLD?= =?utf-8?q?iGEU4dvHX0ZR68mArUSFPo3dqW6tb2fNFntnwI65ZulPudQ3el2RnETqF5mwN7JDg?= =?utf-8?q?AvHEPpTeX0dOA8+MOyMkKNBJx4lg86NWu0T8R8z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ZP4GQi2bciui4U?= =?utf-8?q?UOYIXasgQdBgS+kybPXWgOQRoOQOq8+pjED6Qs1hL3ds1HwWWAojOd+Zs/DNCTmbX?= =?utf-8?q?jWA+DC8XzkPzM3vwjKAbJeFyuBRTSlIprYiQVXiOpSs2f/E7gqrThCz7SwjiXjHIE?= =?utf-8?q?GKTO/si1pfGOJ8pKEU+BG0RcMxICNFA0pmIsBu8NI3zcYMAxQXT2slpUD3J9ueVAL?= =?utf-8?q?ztLccmAvNgIfPcUJP8W9fCGzPw1mzMZ/Q5JsTYuunGxod82QLBQArwDDbbR0fD6LB?= =?utf-8?q?TpUeFDwF025Qe+iwCh5SDdw6JUzuLSF7ERw47bM7Q0zIyQNMl1Ok/Y4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?tL9TiH/nFOOyo8YvGqMOdkugSLa+?= =?utf-8?q?Umj3LcEaq86WW3M8GBA/fg3DSrvCSoqjJgoClykMHzo4rZXR8RH5mgkCGoTIriQlm?= =?utf-8?q?5+8MJMM8jXvfru4CcSY+5kRauIT/y3yrHLMO6fHZfeXPdPFUAuPD72kjHQ5T83v2u?= =?utf-8?q?bWdvvRg4dmcDIjv4LdjdtL/i4UfFdjLcxaVOiXqjND+m+g38DWdAGyZN54u8EDCOh?= =?utf-8?q?pf/HvPVZi2L9oiJEndaYgayXjUxLQkVuZ67hRYp7o0LeacxdZLblbV5U6kkvewuj5?= =?utf-8?q?Lr44Nt3QceCf+uYjokyv+o/Jdq6jFQFBgy1uEdNnmJ0eFn6v4f6Y8AHounZ9UPyjS?= =?utf-8?q?NE4cJXgRBB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7Kfw2Ae6AFenr4cDJj7mSIKMFnLGRXs6jjdCw5FyzVkgUSZc2bUiZgPvkZTualBGM?= =?utf-8?q?4Pi1nrkOSgMCx9sRYKpYVTwFsEoo4OqDGSY/9qyUffyN3oKSFrrQwK+BKYSb2uO5d?= =?utf-8?q?dyaS1EHVMz1uyDwCEkv87NfL4iCT5tyr8YKkLNbpxjA/DV5sMNFOW0krLV3f1MgJq?= =?utf-8?q?8eox5eY/WcpGAIIw12mu3DfBxQYJVVOkzRAor1/tTFo+Pbar8wW8t54pFk0k0TtOI?= =?utf-8?q?TQrW/pV3sBoxmeA7NMf33tPHIc8zM9TS6pEQmbu2MTeA2t28B7HYBMfQ=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b708ad6-8efe-481d-52cb-08dcd1cbde5d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2024 19:07:52.0602 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NsnNLfNAyCp20Csa5uSc6eX8CMN9MDIY7GhznR1svb1CvSh32szNpLU58RGRUyjOGihh/YuBzZd+xVvE8vkhvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10115 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240910_120757_060907_CA1AACB0 X-CRM114-Status: GOOD ( 17.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simplify the clock handling logic by using the clk_bulk_*() API. Signed-off-by: Frank Li --- drivers/pwm/pwm-imx27.c | 63 +++++++++++++++++-------------------------------- 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/drivers/pwm/pwm-imx27.c b/drivers/pwm/pwm-imx27.c index 14706c3bb96cc..ce9208540f1b8 100644 --- a/drivers/pwm/pwm-imx27.c +++ b/drivers/pwm/pwm-imx27.c @@ -80,9 +80,12 @@ /* PWMPR register value of 0xffff has the same effect as 0xfffe */ #define MX3_PWMPR_MAX 0xfffe +static const char * const pwm_imx27_clks[] = {"ipg", "per"}; +#define PWM_IMX27_PER 1 + struct pwm_imx27_chip { - struct clk *clk_ipg; - struct clk *clk_per; + struct clk_bulk_data clks[ARRAY_SIZE(pwm_imx27_clks)]; + int clks_cnt; void __iomem *mmio_base; /* @@ -98,29 +101,6 @@ static inline struct pwm_imx27_chip *to_pwm_imx27_chip(struct pwm_chip *chip) return pwmchip_get_drvdata(chip); } -static int pwm_imx27_clk_prepare_enable(struct pwm_imx27_chip *imx) -{ - int ret; - - ret = clk_prepare_enable(imx->clk_ipg); - if (ret) - return ret; - - ret = clk_prepare_enable(imx->clk_per); - if (ret) { - clk_disable_unprepare(imx->clk_ipg); - return ret; - } - - return 0; -} - -static void pwm_imx27_clk_disable_unprepare(struct pwm_imx27_chip *imx) -{ - clk_disable_unprepare(imx->clk_per); - clk_disable_unprepare(imx->clk_ipg); -} - static int pwm_imx27_get_state(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_state *state) { @@ -129,7 +109,7 @@ static int pwm_imx27_get_state(struct pwm_chip *chip, u64 tmp; int ret; - ret = pwm_imx27_clk_prepare_enable(imx); + ret = clk_bulk_prepare_enable(imx->clks_cnt, imx->clks); if (ret < 0) return ret; @@ -152,7 +132,7 @@ static int pwm_imx27_get_state(struct pwm_chip *chip, } prescaler = MX3_PWMCR_PRESCALER_GET(val); - pwm_clk = clk_get_rate(imx->clk_per); + pwm_clk = clk_get_rate(imx->clks[PWM_IMX27_PER].clk); val = readl(imx->mmio_base + MX3_PWMPR); period = val >= MX3_PWMPR_MAX ? MX3_PWMPR_MAX : val; @@ -172,7 +152,7 @@ static int pwm_imx27_get_state(struct pwm_chip *chip, tmp = NSEC_PER_SEC * (u64)(val) * prescaler; state->duty_cycle = DIV_ROUND_UP_ULL(tmp, pwm_clk); - pwm_imx27_clk_disable_unprepare(imx); + clk_bulk_disable_unprepare(imx->clks_cnt, imx->clks); return 0; } @@ -229,7 +209,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struct pwm_device *pwm, int ret; u32 cr; - clkrate = clk_get_rate(imx->clk_per); + clkrate = clk_get_rate(imx->clks[PWM_IMX27_PER].clk); c = clkrate * state->period; do_div(c, NSEC_PER_SEC); @@ -259,7 +239,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struct pwm_device *pwm, if (pwm->state.enabled) { pwm_imx27_wait_fifo_slot(chip, pwm); } else { - ret = pwm_imx27_clk_prepare_enable(imx); + ret = clk_bulk_prepare_enable(imx->clks_cnt, imx->clks); if (ret) return ret; @@ -352,7 +332,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struct pwm_device *pwm, writel(cr, imx->mmio_base + MX3_PWMCR); if (!state->enabled) - pwm_imx27_clk_disable_unprepare(imx); + clk_bulk_disable_unprepare(imx->clks_cnt, imx->clks); return 0; } @@ -374,21 +354,22 @@ static int pwm_imx27_probe(struct platform_device *pdev) struct pwm_imx27_chip *imx; int ret; u32 pwmcr; + int i; chip = devm_pwmchip_alloc(&pdev->dev, 1, sizeof(*imx)); if (IS_ERR(chip)) return PTR_ERR(chip); imx = to_pwm_imx27_chip(chip); - imx->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); - if (IS_ERR(imx->clk_ipg)) - return dev_err_probe(&pdev->dev, PTR_ERR(imx->clk_ipg), - "getting ipg clock failed\n"); + imx->clks_cnt = ARRAY_SIZE(pwm_imx27_clks); + for (i = 0; i < imx->clks_cnt; ++i) + imx->clks[i].id = pwm_imx27_clks[i]; - imx->clk_per = devm_clk_get(&pdev->dev, "per"); - if (IS_ERR(imx->clk_per)) - return dev_err_probe(&pdev->dev, PTR_ERR(imx->clk_per), - "failed to get peripheral clock\n"); + ret = devm_clk_bulk_get(&pdev->dev, imx->clks_cnt, imx->clks); + + if (ret) + return dev_err_probe(&pdev->dev, ret, + "getting clocks failed\n"); chip->ops = &pwm_imx27_ops; @@ -396,14 +377,14 @@ static int pwm_imx27_probe(struct platform_device *pdev) if (IS_ERR(imx->mmio_base)) return PTR_ERR(imx->mmio_base); - ret = pwm_imx27_clk_prepare_enable(imx); + ret = clk_bulk_prepare_enable(imx->clks_cnt, imx->clks); if (ret) return ret; /* keep clks on if pwm is running */ pwmcr = readl(imx->mmio_base + MX3_PWMCR); if (!(pwmcr & MX3_PWMCR_EN)) - pwm_imx27_clk_disable_unprepare(imx); + clk_bulk_disable_unprepare(imx->clks_cnt, imx->clks); return devm_pwmchip_add(&pdev->dev, chip); } From patchwork Tue Sep 10 19:07:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13799283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB222EDE9AB for ; Tue, 10 Sep 2024 19:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RpQmdIpW1nEf/t8itYF7d7iwzZIIlNVQvBzSUpk1TFU=; b=Z8bAVWPT6AQ83M/wu37/7Ai2jD KVO8QXLZ7KIr+l7jROzsQNL10kYDa+g/PzJA98tx1vQwrfJGM5RK9OtQ8XJQgvlo3wHTWNs/oqkB1 e5+pnvwelK86QDl8Bad8s3a4kRjLZ+9ooubaKNXcUuZ5rUsbO3j7EI1tMrQKAT4kODmLN/GY4hqZY rzRF8V0as3PEjSLhuFSkelbw/Q6xfHfRSppTJabwLU8s1yPVDjV8fxsSSJoLpr5nRqbyil6gQ2uV0 fm7c68jpx0HpJus8Fg0U+ag7jk67OEsZX7qePvYjq6vPflTluXEvj7HY/hfrA5VRREqdQaZRG4jUd wA8eCaSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1so6Hf-00000006raC-3AyG; Tue, 10 Sep 2024 19:12:15 +0000 Received: from mail-northeuropeazlp170120003.outbound.protection.outlook.com ([2a01:111:f403:c200::3] helo=DU2PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1so6DW-00000006qOT-2lgO for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2024 19:07:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C6Cl1NEwZSpvSftV4Jq+hjyPDgC0R320BL6DKaO6pkDUcIhXsuUbxOsURcCxGs6jiTZrC4zJEqBQgPPBEuS57MVpbvjkEKXiAV002hQrKmK84Gy99505LHezVfcF650rT+O5HNK78N1VyXqYNoLiXKkIREHa5++yo4/zP8fUoMBjaHlF2GCETVA90mZl53Y+16HJShAExXhHS41iZTiUeSS8dGJd7AJdJTDBxbNJnZqiObuxN94DIdbgUU2Mls79SmtJ53TYMepZPhz8X4kqW4SZDN6IyC72cvduVEgnJvgLnZHVAUGm+Qo2WiwflL4AC6fIHWUrKaO6Ohpare3ONA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RpQmdIpW1nEf/t8itYF7d7iwzZIIlNVQvBzSUpk1TFU=; b=kESMwTh3vpGTPrT2+3VPRWdwLPMWyhdn/sg7d8PVS1/P7nb1GgUb8emI3PFX6uz4nNjUJ89Hk9goXv/VRr4EpNMUy3NK0XqD1wUWfrOU8Na1AxZPitpA2pIatzl8B5+eLUAPS7j3oNgDkGR2JozDJO41hTOfIIeXEVjauWjzg6AVxSMyqiX3rI2zqQwtpX8GnFZEUxP+5abhJwMrJHp2aAnmb4YZVyaHeMT+f9/KNu6YOVFodzVCx+9OrXioImPOWodKnZMD/5u+vmL6g5/L3CUJexHJ6hwL8KgVzFhwLdIxmTAcqJzdDrzpQayghtGHgLpeCOT+zbMSAYKFcSejLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RpQmdIpW1nEf/t8itYF7d7iwzZIIlNVQvBzSUpk1TFU=; b=c3UjM5OJNtXG/VTMw6/meZCCVPoNahXHOkJ4UJFAYeB9f8D+pF0dD0CfYyYbgH78Xrr1tg8w7LvRXSE7PPe5fggSMGhjv22B3gNqYOT6EMvP2Nwoi4v/Jpdtn1jz9jZl4DfShv7lhYflmY/T4tC0lJ9IpS+QutUsrzRzxEjF6cko8KZb5s6G4h8c3Ma+ECcaf/1d+1Zryen+WiLndfnEapWViGNX0DA73VNoOs/7Myepj1/uMc/JsMyYDQ/LvReooG+j++YQ/aJDJXYfC7tD/YT85+Gs4pY6TXWcrMQC/6k/j8QfPbbozSWAOm5/UsisUPBcKHfhD4RO4Hr3t2CI1w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VI2PR04MB10115.eurprd04.prod.outlook.com (2603:10a6:800:21d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23; Tue, 10 Sep 2024 19:07:56 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7939.022; Tue, 10 Sep 2024 19:07:56 +0000 From: Frank Li Date: Tue, 10 Sep 2024 15:07:20 -0400 Subject: [PATCH v3 3/3] pwm: imx27: Add optional 32k clock for pwm in i.MX8QXP MIPI subsystem Message-Id: <20240910-pwm-v3-3-fbb047896618@nxp.com> References: <20240910-pwm-v3-0-fbb047896618@nxp.com> In-Reply-To: <20240910-pwm-v3-0-fbb047896618@nxp.com> To: Marek Vasut , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Philipp Zabel Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pratikmanvar09@gmail.com, francesco@dolcini.it, Frank Li , Liu Ying X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1725995258; l=1677; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=L/XPTHuau3NF7c+XW7u38Kz5DmqTCXnWMscgXXRISiw=; b=3OAc+pyLPshIlPRvYlJxzCzQT5iymtxjjZlMgi2MYCbWOLWkSC6fLCzcIH7YuUwpsE8vhjLPw Jha9yD8YRN7BkboLQX8tgXsBK2FKzHwr1WjV14yeqo0pMeTWbp5pM/v X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0145.namprd13.prod.outlook.com (2603:10b6:a03:2c6::30) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VI2PR04MB10115:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ae88040-9e20-4c45-b046-08dcd1cbe117 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?UloGRQzHsBHGJDfztFnWMWC5se61Eap?= =?utf-8?q?XS0BwwnLvpcgcIeiZCRnREp1JySNIpyYDGjVFA+n7JvQmGKDFatkRMD8RdrSk5CJx?= =?utf-8?q?fTZtcqGc+10UjAw+o0BRNyfQfM2pazuXSGeFtZEW8E7tBUXmpY2sd1YIQmVUUvDSr?= =?utf-8?q?gpx/gQsMTeVBuWOiZoD6QboZChnEA2YXZG4zpQWD6kGidhRMZztrRuCJiWrJJRKFd?= =?utf-8?q?prbplh5LCy96VASLpPYI6EOn1OH0MA+4/DMWrqZfX1bH0UcOkgMUEvRPEn1uLO32o?= =?utf-8?q?w5hAnwMW+oDEcT/9D60mEWTB5H0uFn3KsISEleVKwYifpxjgN9WTYN+tT4WckKG7R?= =?utf-8?q?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ccwxdudI0ddPWb1O3AihPE4LQxlibFWpJOcWWxN+xZ9TW3oPyabELlPLIGLJ+e8KI?= =?utf-8?q?7rOyQS350NVpWqGYujY2d/KHMsrhMXn+GdCSpZv7aVB4vfh7smWjhcijX9gNIvcDK?= =?utf-8?q?NKE5ElpNV7hRj2yuas5sKA1Cd7TyJ+ins48/JGgbZmewCZQqt13E1Dc=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?QaX/jAM5vRe4dWeJ2r35/f4WRoLJ?= =?utf-8?q?ZdUG7T3CQ8oQFc3uZyGGycyt9j88h+G2FTZc3lbiGGmRnbbHEsA4YLMWRUSXk/xze?= =?utf-8?q?VudaKMB0ZLnA1l4m1CuKA2dihuSSqtmKNCzbfR4wd1t7Ee7J8ckaGjfiPjxvtOZVx?= =?utf-8?q?rLinF3tybYytvFeXvsWHbthIFmijf/XS/yVs4mzJBzuOIVefWTV8b3Ft3fL+TldxT?= =?utf-8?q?AFqHlAK4z1W8RlRHRiDN/47ORMKopm4ai0dVWYB+w5QhSlVprY5k8P5WJO04zruYh?= =?utf-8?q?f/ylz+91xMDZ89i2OoWzS3LMsK0i42wC2tE2S0FjU1knRAGUHiZZdZi45K80QvYJ5?= =?utf-8?q?JIr2W/p406srBPcyI50XTvrGSjljGFssVWnSdwEk3POhkweWpuy6FCu60tNvmk7ly?= =?utf-8?q?3co7yIihCEDnMzZx/FGCoAHL2q4kIy0/ts+wserm/oP0eAnB6/ml4tlAq6vBkvzzX?= =?utf-8?q?HPZduQ0wPJ3uqjJPFQXFD2MInUBdMFrei4NC65xg3DfQIiQYHX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XuLHzlr/xK6L6LTeX1UFI?= =?utf-8?q?M0QRq+Zgs7WhdlkzhsVb+IBE2wI4/QGsai4p5691JCIqVmkZwmeB+MyFki3FhzGq3?= =?utf-8?q?xL5eNudvpYOSpJMrhDUc7w4HzwF7vlPAY24y71e/xoTUH5kok35DGPlQ=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ae88040-9e20-4c45-b046-08dcd1cbe117 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2024 19:07:56.5704 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XbROQMiS5Nuq1wRXo9P8nNoeqfXBgrLIvMBa36/6lZ3pWoLVBxxuCh4Q64KaCb3LcXYwKsV9fpVTMrcD9VL4fA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10115 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240910_120758_744399_ED090BA2 X-CRM114-Status: GOOD ( 16.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Liu Ying PWM in i.MX8QXP MIPI subsystem needs the clock '32k'. Use it if the DTS provides that. Signed-off-by: Liu Ying Signed-off-by: Frank Li --- Change from v2 to v3 - use buck clk API Change from v1 to v2 - remove if check for clk - use dev_err_probe - remove int val --- drivers/pwm/pwm-imx27.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-imx27.c b/drivers/pwm/pwm-imx27.c index ce9208540f1b8..2a9fba6f9d0a8 100644 --- a/drivers/pwm/pwm-imx27.c +++ b/drivers/pwm/pwm-imx27.c @@ -81,10 +81,11 @@ #define MX3_PWMPR_MAX 0xfffe static const char * const pwm_imx27_clks[] = {"ipg", "per"}; +static const char * const pwm_imx27_opt_clks[] = {"32k"}; #define PWM_IMX27_PER 1 struct pwm_imx27_chip { - struct clk_bulk_data clks[ARRAY_SIZE(pwm_imx27_clks)]; + struct clk_bulk_data clks[ARRAY_SIZE(pwm_imx27_clks) + ARRAY_SIZE(pwm_imx27_opt_clks)]; int clks_cnt; void __iomem *mmio_base; @@ -371,6 +372,16 @@ static int pwm_imx27_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, ret, "getting clocks failed\n"); + for (i = 0; i < ARRAY_SIZE(pwm_imx27_opt_clks); i++) + imx->clks[i + imx->clks_cnt].id = pwm_imx27_opt_clks[i]; + + ret = devm_clk_bulk_get_optional(&pdev->dev, ARRAY_SIZE(pwm_imx27_opt_clks), + imx->clks + imx->clks_cnt); + if (ret) + return dev_err_probe(&pdev->dev, ret, "get optional clocks failed\n"); + + imx->clks_cnt += ARRAY_SIZE(pwm_imx27_opt_clks); + chip->ops = &pwm_imx27_ops; imx->mmio_base = devm_platform_ioremap_resource(pdev, 0);