From nobody Sat Nov 30 07:39:51 2024 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013052.outbound.protection.outlook.com [52.101.67.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48E691A7AD6; Tue, 10 Sep 2024 19:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725995272; cv=fail; b=I9EeAFzu0eAWhwkVrWv8W9Qw8wzFOFLGl/voGkELbmtthFvo7idk802eIbF/a1gFRVgCi5lshll5uXQw84mRfr4OCleL1czWe4qHxhoRBO2qRhp38/HshTw5ScBLLhN8pQZQ8A9103HY5Wmfh6Npl+VDN+dbJHCcrDkwIofQWEw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725995272; c=relaxed/simple; bh=7cPnhCSJUSFQl0yVoLJxwbOrnCIHH/QeAWGfdDS7p3I=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=k0tXtE+M2dR20Zqw1KIpjjbSfcotKUvmtIUSC6blsqZ4XFqT2EM9Y5+yhU0i7BQsvVvJic7Z2jNK/DeNM51zJHMViaw/QkS2OcnLDJ5JEdaAzxJH/xt1vHBgh+ylblm7HgI+S4GvZwKwJsJ/aAYo/NXQyj9QXpRP2wAG6BQrZHA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=gjLAY4YH; arc=fail smtp.client-ip=52.101.67.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="gjLAY4YH" 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' Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-Ant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ZPcEZwenFIR0ZqSkl4M3E4OGh5QjFSeEpwelczUUM4K2UvdEdwV2lR?= =?utf-8?B?ZmFIL25VQzJSQlBLN3JQTGxlRmNTbWlROTJKMHllRkFNMHFxOUJjQ3NMMTdu?= =?utf-8?B?TlVKTkhzMDVWN2VUaUp1VS91ZE1MRVZqWTd0cm1NYUd6cmRjL0U3S3VzK1dG?= =?utf-8?Q?EDKRBT2Fae8=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?B?YmRDWW8rc0V4dnV3bG5kN0wwTzZzMmxZdml4ODhyWmFTNGY2WTgyZjZOMkpi?= =?utf-8?B?Z05CTm9NaUFBbDFyb01FMThsV3lNbUtaYS9IaXFwOGJSYytnNHVpVGNaLzZE?= =?utf-8?B?L2RFVFJlU1FZY3pXQ1hidWp5RDhjdzhiYWVyOHd3WWN6NmhBaTFnWDBTeGdz?= =?utf-8?B?WWdMNURlUkNFVVJpNU40WnV4WlhtU3RHcGVHR0R4UUxETjhYaVF3eUFsMVlk?= =?utf-8?B?UWdZemdCK1dJcWQ3Nm11eDg3UG1LaExLNU9PUzNmRDNhdEUvenJkV2sycjdV?= =?utf-8?B?Q2J2b3A3YU96cG0zbHRHdkJVZU1TbkhZQi9IY2pWc1RKYVhFUkRaQ2c0a0tW?= =?utf-8?B?TEVUdEE0RXQxNG9IWjFxVnp1UURPMkxJdEFGMGtHMGhhL1dUWmxqY09kSkd1?= =?utf-8?B?RVVQY0ttZWwwUDc5NWtqSG5GaU55ZXg4NVVGN3N2ckcvZTRtem9objAyNnpp?= =?utf-8?B?anU5QmZTVlIzUjc3TWZ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?RFFwV1l6VDZYQWRxYTMybzRqZjNkWkU5SVlxcjFtRkRSdXJRUEVEV052Yk9G?= =?utf-8?B?RHlCUEFpaldUbURXZGFWdnJYY2xoY2d6a1lvVGN2ejhGU2NsT3Y0YTNzMTJ3?= =?utf-8?B?ZExOd09tL0JKUjZET0hCYk16cFVYZkZxa3Y4ZHovYlk2Q1NWT0FIMlBKZGl0?= =?utf-8?B?UW90bkhvN0tuZXU1Tkt1NkxTMzFjaWZlUkNOOUxzRjFQbFBYVzNhNFRNUlUw?= =?utf-8?B?aVdKQzZoSEMwUzNldGk1aGxqV3BUSUxQZlUvMVlyMW1XMzV0Y2xvREQvRk5U?= =?utf-8?B?SGJnNFZLQm90VzlIVVVxUTZvWmQ5VGR4Yjl1dWFKQm5oV2puajlXeFdCaVky?= =?utf-8?B?ZUNsc0paRS90SzhxU045Y3B4WDd2NFMzTFRodG04eFpTVmptQjc1dWtwaXp4?= =?utf-8?B?ZTRsQ2VYK1JqeWk2b2RwRkY0SGFsV3dQMlVMR0xEQVBaUlpuRWthZnNiamVa?= =?utf-8?B?UitJLzRwQjAvK1dGVlR5VlRWRmdPaHhmZVBveVhBV3RUY1MrRTB6NUNoVm9z?= =?utf-8?B?azVGaUZMUlJ4ZGpYUUQ5MFdGOFhrb21vNThSU2dhYXNub3ZzS2QrRnJ5TkMz?= =?utf-8?B?SE5xZ1BoWUJwMzh5U3lVZ1NPSUU0akhTVi9jdmI2aG5HNVlqSGkrdHNpeS9y?= =?utf-8?B?cGdEc3JiVmh1dG1VMmFmSlZKMHdVNVlmYmE0S3lqTityK0I5dUVBWC9lU0tQ?= =?utf-8?Q?hamE=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 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/Documenta= tion/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 =20 clock-names: items: - const: ipg - const: per + - const: 32k + minItems: 2 =20 interrupts: maxItems: 1 --=20 2.34.1 From nobody Sat Nov 30 07:39:51 2024 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011014.outbound.protection.outlook.com [52.101.70.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D50081ABEDB; Tue, 10 Sep 2024 19:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.14 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725995276; cv=fail; b=C9RWAK+bv3aVxyEb/kO1uipBjHiU+IwE85a2iPqTRk6kMH2IuMnAYwAp1l7enFSVkZce8z8VJNrj7HgOI/BeBTbX6grqBJ5O7KiBgnlDSHTeZA+0oIxjhC/yI/1iH1dXIC6hB92JrjktkG3ITxr6yzt5CKz4HQ7b1Z/v279ztSI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725995276; c=relaxed/simple; bh=Fv/rjc6K+Tgi8oLugRWIWJNXxGBfq8oLj375Kdahgzk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=UB60f205vOACOAv/eV4hyvJHZ9RN8ApQgLGHN9n/IU1waZl3CLuhlmWhi6+0CGx1SVwD+1uUqKgOXK1VnlQSZxhWrpOmErTffS4nl01ppPcA7oHZNwKnN+bk9UjZaPho1jf4SQ+ZdYg+kFmr7/g/8da+lHDXLw2/K4RxPzjPtBw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=ewNIZjD6; arc=fail smtp.client-ip=52.101.70.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="ewNIZjD6" 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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?B?Q1NFMHJaYktLeFdjR0Rxc0J0TEw0UDdIL3UvOWNvR2lKbjYzellZSTFsbnZv?= =?utf-8?B?dFJZQUFWYlc0VnFFalEvYU1KcDdKQkV6aGdBWDlxcENrM1MzQ2RwdCtURW1J?= =?utf-8?B?dW9DT0xEaUdFVTRkdkhYMFpSNjhtQXJVU0ZQbzNkcVc2dGIyZk5GbnRud0k2?= =?utf-8?B?NVp1bFB1ZFEzZWwyUm5FVHFGNW13TjdKRGdBdkhFUHBUZVgwZE9BOCtNT3lN?= =?utf-8?B?a0tOQkp4NGxnODZOV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;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?B?dEw5VGlIL25GT095bzhZdkdxTU9ka3VnU0xhK1VtajNMY0VhcTg2V1czTThH?= =?utf-8?B?QkEvZmczRFNydkNTb3FqSmdvQ2x5a01Iem80clpYUjhSSDVtZ2tDR29USXJp?= =?utf-8?B?UWxtNSs4TUpNTThqWHZmcnU0Q2NTWSs1a1JhdUlUL3kzeXJITE1PNmZIWmZl?= =?utf-8?B?WFBkUEZVQXVQRDcya2pIUTVUODN2MnViV2R2dlJnNGRtY0RJanY0TGRqZHRM?= =?utf-8?B?L2k0VWZGZGpMY3hhVk9pWHFqTkQrbStnMzhEV2RBR3laTjU0dThFRENPaHBm?= =?utf-8?B?L0h2UFZaaTJMOW9pSkVuZGFZZ2F5WGpVeExRa1Z1WjY3aFJZcDdvMExlYWN4?= =?utf-8?B?ZFpMYmxiVjVVNmtrdmV3dWo1THI0NE50M1FjZUNmK3VZam9reXYrby9KZHE2?= =?utf-8?B?akZRRkJneTF1RWRObm1KMGVGbjZ2NGY2WThBSG91blo5VVB5alNORTRjSlhn?= =?utf-8?B?UkJCODhOZU0zeklmdWpIWGRIekJKUWxyMFA5Q1N6VWt6dktWWlg1TXQrczdx?= =?utf-8?B?MkZkVHpUMlE4bktCZDFnODZyb2ZzWVlnb0ZabVFoYnNrdTlabWhzRjJxVitS?= =?utf-8?B?RnlCRTIrcXVTMWVIdjdDZHAvd1A2dEpkUTBGdUt0SjB0SDFrTy9CMzM4T1Jh?= =?utf-8?B?czlLY3FoYTdxUWVjNkhpNk9ITjRCbW0wM1hHOHdUWUhhUk1jRDFZeFE2T1hn?= =?utf-8?B?OE9SNGNPVzMvbGt5RHpiN3FnK3BWaHlGS2VWOHpmTUFOQmE5eG9FelM3ZWVj?= =?utf-8?B?aV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r?= =?utf-8?B?ZGxrN0tmdzJBZTZBRmVucjRjREpqN21TSUtNRm5MR1JYczZqamRDdzVGeXpW?= =?utf-8?B?a2dVU1pjMmJVaVpnUHZrWlR1YWxCR000UGkxbnJrT1NnTUN4OXNSWUtwWVZU?= =?utf-8?B?d0ZzRW9vNE9xREdTWS85cXlVZmZ5TjNvS1NGcnJRd0srQktZU2IydU81ZGR5?= =?utf-8?B?YVMxRUhWTXoxdXlEd0NFa3Y4N05mTDRpQ1Q1dHlyOFlLa0xOYnB4akEvRFY1?= =?utf-8?B?c01ORk9XMGtyTFYzZjFNZ0pxOGVveDVlWS9XY3BHQUlJdzEybXUzRGZCeFFZ?= =?utf-8?B?SlZWT2t6UkFvcjEvdFRGbytQYmFyOHdXOHQ1NHBGazBrMFR0T0lUUXJXL3BW?= =?utf-8?B?M3NCb3htZUE3Tk1mMzN0UEhJYzh6TTlUUzZwRVFtYnUyTVRlQTJ0MjhCN0hZ?= =?utf-8?Q?BMfQ=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 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 =20 +static const char * const pwm_imx27_clks[] =3D {"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; =20 /* @@ -98,29 +101,6 @@ static inline struct pwm_imx27_chip *to_pwm_imx27_chip(= struct pwm_chip *chip) return pwmchip_get_drvdata(chip); } =20 -static int pwm_imx27_clk_prepare_enable(struct pwm_imx27_chip *imx) -{ - int ret; - - ret =3D clk_prepare_enable(imx->clk_ipg); - if (ret) - return ret; - - ret =3D 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; =20 - ret =3D pwm_imx27_clk_prepare_enable(imx); + ret =3D clk_bulk_prepare_enable(imx->clks_cnt, imx->clks); if (ret < 0) return ret; =20 @@ -152,7 +132,7 @@ static int pwm_imx27_get_state(struct pwm_chip *chip, } =20 prescaler =3D MX3_PWMCR_PRESCALER_GET(val); - pwm_clk =3D clk_get_rate(imx->clk_per); + pwm_clk =3D clk_get_rate(imx->clks[PWM_IMX27_PER].clk); val =3D readl(imx->mmio_base + MX3_PWMPR); period =3D val >=3D MX3_PWMPR_MAX ? MX3_PWMPR_MAX : val; =20 @@ -172,7 +152,7 @@ static int pwm_imx27_get_state(struct pwm_chip *chip, tmp =3D NSEC_PER_SEC * (u64)(val) * prescaler; state->duty_cycle =3D DIV_ROUND_UP_ULL(tmp, pwm_clk); =20 - pwm_imx27_clk_disable_unprepare(imx); + clk_bulk_disable_unprepare(imx->clks_cnt, imx->clks); =20 return 0; } @@ -229,7 +209,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struc= t pwm_device *pwm, int ret; u32 cr; =20 - clkrate =3D clk_get_rate(imx->clk_per); + clkrate =3D clk_get_rate(imx->clks[PWM_IMX27_PER].clk); c =3D clkrate * state->period; =20 do_div(c, NSEC_PER_SEC); @@ -259,7 +239,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struc= t pwm_device *pwm, if (pwm->state.enabled) { pwm_imx27_wait_fifo_slot(chip, pwm); } else { - ret =3D pwm_imx27_clk_prepare_enable(imx); + ret =3D clk_bulk_prepare_enable(imx->clks_cnt, imx->clks); if (ret) return ret; =20 @@ -352,7 +332,7 @@ static int pwm_imx27_apply(struct pwm_chip *chip, struc= t pwm_device *pwm, writel(cr, imx->mmio_base + MX3_PWMCR); =20 if (!state->enabled) - pwm_imx27_clk_disable_unprepare(imx); + clk_bulk_disable_unprepare(imx->clks_cnt, imx->clks); =20 return 0; } @@ -374,21 +354,22 @@ static int pwm_imx27_probe(struct platform_device *pd= ev) struct pwm_imx27_chip *imx; int ret; u32 pwmcr; + int i; =20 chip =3D devm_pwmchip_alloc(&pdev->dev, 1, sizeof(*imx)); if (IS_ERR(chip)) return PTR_ERR(chip); imx =3D to_pwm_imx27_chip(chip); =20 - imx->clk_ipg =3D 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 =3D ARRAY_SIZE(pwm_imx27_clks); + for (i =3D 0; i < imx->clks_cnt; ++i) + imx->clks[i].id =3D pwm_imx27_clks[i]; =20 - imx->clk_per =3D 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 =3D devm_clk_bulk_get(&pdev->dev, imx->clks_cnt, imx->clks); + + if (ret) + return dev_err_probe(&pdev->dev, ret, + "getting clocks failed\n"); =20 chip->ops =3D &pwm_imx27_ops; =20 @@ -396,14 +377,14 @@ static int pwm_imx27_probe(struct platform_device *pd= ev) if (IS_ERR(imx->mmio_base)) return PTR_ERR(imx->mmio_base); =20 - ret =3D pwm_imx27_clk_prepare_enable(imx); + ret =3D clk_bulk_prepare_enable(imx->clks_cnt, imx->clks); if (ret) return ret; =20 /* keep clks on if pwm is running */ pwmcr =3D 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); =20 return devm_pwmchip_add(&pdev->dev, chip); } --=20 2.34.1 From nobody Sat Nov 30 07:39:51 2024 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011060.outbound.protection.outlook.com [52.101.65.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 275631AC436; Tue, 10 Sep 2024 19:07:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725995281; cv=fail; b=PsenX0JOHAfabkst70bHHWPeqVy2qMOUZu6KXrY1INUeaSo5eSfGvMfmxYwhcFENokX+GUAeKiFdrfAG0JP80w2wCOfg/q0Mrjwb5SuKFWXld54mQCezrvrYv+Uyn3n3FX4m8TsKDPfrpu6ansedPcA1Oj5n/9M1ri6Rezaf86E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725995281; c=relaxed/simple; bh=OPJTK5Szo3uv98miP/aIaKW04fTtNNv1xFO57Ma99VM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=oKdFQVfhKLxPmkX11PFH44BKrjHMfBA65gZn6Mz8yW8FZZWNfj9iaZqP8cq9oCD6cp/vNIPTv0xwxe9pzsPZ9+8BS1cPH6hZrm4m+j09oLOaLG+Kfv7hnF/z/ww9Gkla7hamH7FNItljoMyk0QaH8XUE1oD4Wc2Ql9DEFl7pXm8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=c3UjM5OJ; arc=fail smtp.client-ip=52.101.65.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="c3UjM5OJ" 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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?B?VWxvR1JRekhzQkhHSkRmenRGbldNV0M1c2U2MUVhcFhTMEJ3d25MdnBjZ2NJ?= =?utf-8?B?ZWlaQ1JuUkVwMUp5U05JcHlZREdqVkZBK243SnZRbUdLREZhdGtSTUQ4UmRy?= =?utf-8?B?U2s1Q0p4ZlRadGNxR2MrMTBVakF3K28wQlJOeWZRZk0ycGF6dVhTR2VGdFpF?= =?utf-8?B?VzhFN3RCVVhtcFkyc2QxWUlRbVZVVXZEU3JncHgvZ1FzTVRlVkJ1V09pWm9E?= =?utf-8?B?NlFib1pDaG5FQTJZWFpHNHpwUVdENmtHaWRoUk1aenRyUnVDSmlXckpKUktG?= =?utf-8?B?ZHByYnBsaDVMQ3k5NlZBU0xwUFlJNkVPbjFPSDBNQSs0L0RNV3JxWmZYMWJ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3RFJhR3hPQ0ZG?= =?utf-8?B?am0rMzFySWdaSERZZGZwQ2o5WXJ1U1BlL0psNkJCTlI0aU5ha1B1bm9hWC9N?= =?utf-8?B?ejZBNlhBMzRMTEVnZEVRa0xTY0NJK0gvaHZkTzhxN29XalJTOUtuUGlBdEE3?= =?utf-8?B?bG15dFlFTXgzOWk2VTVVZ244TW9WaUJiRFZHT1V3MUYwM1VtVUZxRHN5VlZ5?= =?utf-8?B?K05wZHlOUHdJNGVPWmtkcDZFeGxsbm5VM3R5Vkc4TG1HUmUzUHV4Q2N1SlhG?= =?utf-8?B?c21McTZjSDE4ZCs3NTdFeDBHY0RMem8rOHIvSEZQS0psSGlldGpxNFBDT2t1?= =?utf-8?B?Y3dxdGNES2orWUtVRWs4NEd3YnI4SW5HS3ZXSlBrd3FxR3R1d1ZRckRIZnZi?= =?utf-8?B?V3VjSDNoNzFHYTJFN3lnaDFBMXdjS3h2SEthR0Y2c3hkSUNWd0pLNVFIR1la?= =?utf-8?B?WGFvUDBBY2N3eGR1ZEkwZGRQV2IxTzNBaWhQRTRMUXhsaWJGV3BKT2NXV3hO?= =?utf-8?B?K3haOVRXM29QeWFiRUxsUExJR0xKK2U4S0k3ck95UVMzNTBOVnBXcUdZdWpZ?= =?utf-8?B?MmQvS0hNc3JoTVhuK0dkQ1NwWnY3YVZCNHZmaDdzbVdqaGNpalg5Z05JdmNE?= =?utf-8?B?S05LRTVFbHBOVjdoUmoyeXVhczVzS0ExQ2Q3VHlKK2luczQ4L0pHZ2JabWV3?= =?utf-8?Q?CZQqt13E1Dc=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-Anti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lnb1A0REhGNWptMzZJYkhnbDJFUEFaN0srTHBG?= =?utf-8?B?eEsyQ24zKzFBeXVxdmRTMU9KQndDbFppenk0cm9wWmhrY0VMUk9XUWFJbmZR?= =?utf-8?B?dEV4bHFWTGkwdWQwMndxSWhJU1RUZXRTYUhPSE5VaGJHeW0yb1QyQTF5WHVM?= =?utf-8?B?SHpsci94SzZMNkxUZVgxVUZJTTBRUnErWmdzN1doZGxremhzVmIrSUJFMndJ?= =?utf-8?B?NC9RR3NhaTRwNTY5MUpDSXFWbWtad21lQitNeUZraTNGaHpHcTN4TDVlTnVk?= =?utf-8?B?dnBZT1NwSk1yaERVYzd3NEh6d0Y3dmxQQVkyNHk3MWUveG9UVUg1a29rMzVE?= =?utf-8?Q?GPlQ=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 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 =20 static const char * const pwm_imx27_clks[] =3D {"ipg", "per"}; +static const char * const pwm_imx27_opt_clks[] =3D {"32k"}; #define PWM_IMX27_PER 1 =20 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_imx= 27_opt_clks)]; int clks_cnt; void __iomem *mmio_base; =20 @@ -371,6 +372,16 @@ static int pwm_imx27_probe(struct platform_device *pde= v) return dev_err_probe(&pdev->dev, ret, "getting clocks failed\n"); =20 + for (i =3D 0; i < ARRAY_SIZE(pwm_imx27_opt_clks); i++) + imx->clks[i + imx->clks_cnt].id =3D pwm_imx27_opt_clks[i]; + + ret =3D devm_clk_bulk_get_optional(&pdev->dev, ARRAY_SIZE(pwm_imx27_opt_c= lks), + imx->clks + imx->clks_cnt); + if (ret) + return dev_err_probe(&pdev->dev, ret, "get optional clocks failed\n"); + + imx->clks_cnt +=3D ARRAY_SIZE(pwm_imx27_opt_clks); + chip->ops =3D &pwm_imx27_ops; =20 imx->mmio_base =3D devm_platform_ioremap_resource(pdev, 0); --=20 2.34.1