From patchwork Tue Jul 16 19:28:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13734831 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011017.outbound.protection.outlook.com [52.101.70.17]) (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 3855E1A08B5 for ; Tue, 16 Jul 2024 19:28:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.17 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158139; cv=fail; b=KuPkRWyp1Jq9US42th/zZDJzGlJoLWbwSI5f3SJuMrIScKz9lGj7GnCujGEzjQLg6B0BWP0TeD9m55msXciqniXzdS3fYZOTZCuQoMnI+72NzOOK3tiNKa5tGkIhHNoG77218yv+TLBs2KsyjouI5WTjUNODxhV/5k6AT1yHm+4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158139; c=relaxed/simple; bh=thMYuw3K3tfwqHKNcFWNXXaV+D1MTytBhVgxdAZuLig=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=cvxJ6nIBs1+V3ACxRWfKmyXZIZoCJApqHdFwNpzo7cQPl/dOC2UKzMlUp4GjwyiGBZWFW5zcjwfAc1T/eXPQ912/qyz78HKENAqpkLibFzhcL/Iqi3k5gHnnClN2g//ta3WNUb4utBZiYFIV9ojwC/gKVkp7+vuLXHmmSVvnh+c= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=N9E9gtSZ; arc=fail smtp.client-ip=52.101.70.17 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="N9E9gtSZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XCfoWHzCT6M0ssfNl4yRJsIjciBwztvsYoBL0XqiHyAqvw/LPzR3G7rk8LiGydqK/vBaqbJ092OSxHY9JqikDKAb8QhmajQ+Fz3NHrwGKihks2Ge3afYWBSHCs/TQA508YFANbCzRQd4mAOiMnAAjJ4/gROxxNDbY3y3uTCa5BVtCh/4CQWxcGymuFWydHjPPsRcEpkWImyyS6nv7HgVvTO791yvjc9HSBhroka8ulp3TxDlab7OVZg+OCrv64Jm4a/EImFLWjqfm8zOHmzkpVlRTgXT10CCxURMEzCi7K52RWdNwQTJIvd1VKvSssML8nuQIvNeNHn5rEVvS7e4vA== 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=pOgSjsyJI4fpqnvbkGA1XIIeG3ehGHzyIXPXA2ivp7w=; b=EkB1MoOuZ9qbkoCnmVU3Cd9ugaHIYi7ZAS7dRmZJkvRN1AznUlENQpLt5d3Mp1dYhBEbb7XzCvlwpo6mVbqkB5YI5XiJjCVzsW/POLMQLokuAjN6rfOzDX3VEIcaqxelDdIVwC74OZ8ZsKoazrVJL7B7LHfVYsvz28DNG+MEznakAz1vFKI3zj9SDJL49XG5ANjXpAsmvlgrKC93KcXLrSSbDi+IXner/v+56STbUVV44/xjsB7EM0b7A398UkOWMGnhkw0LR/GusxwL/e6SRWjP+LQdJoiqqP9qxaSMBpNkKeGTNI32kBO1e/kutzXE6f7e6Darb4FUT6xQpOz5tA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pOgSjsyJI4fpqnvbkGA1XIIeG3ehGHzyIXPXA2ivp7w=; b=N9E9gtSZIF0cZGxT8rpjlyf+w20tdqnZ10o6U/GVtw2KJwlNVy45UvHn5ZPbW1v00f9pSzVo1qogiKx9Mi4OlFsOPs0LLjJXOOvPnvWOiE067DI8dJt0+6CBqmDkOAULBfLYua00X0RqERW9Vqiw8/v/5Ul4uhMct5dIlTDlVS4= 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 VE1PR04MB7325.eurprd04.prod.outlook.com (2603:10a6:800:1af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14; Tue, 16 Jul 2024 19:28:53 +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.7762.027; Tue, 16 Jul 2024 19:28:53 +0000 From: Frank Li Date: Tue, 16 Jul 2024 15:28:24 -0400 Subject: [PATCH 1/6] dt-bindings: mfd: Add i2c device adi5585 Message-Id: <20240716-adi-v1-1-79c0122986e7@nxp.com> References: <20240716-adi-v1-0-79c0122986e7@nxp.com> In-Reply-To: <20240716-adi-v1-0-79c0122986e7@nxp.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1721158123; l=2172; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=thMYuw3K3tfwqHKNcFWNXXaV+D1MTytBhVgxdAZuLig=; b=Sv+SmKSA8iSBcTYYYn4nHqs5dE4ZNuJZg0rQIHNnDh/nk5qGvWx7lk1WEvps2Zj8YOlbSPOSC 1S/1aQ/Xs90CHvgoubSb+XoQS7CdO258O6SYCxiX4gCpolfyIM15gxn X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0148.namprd03.prod.outlook.com (2603:10b6:a03:33c::33) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7325:EE_ X-MS-Office365-Filtering-Correlation-Id: b2e23c07-ce36-492d-124e-08dca5cd871d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?erKp4w17M4+9JbC6ayOW4zgIBgPnYkT?= =?utf-8?q?7tKnE32IRMSG9esOvRYrnKf7DzMQRW5R5w56ihd18jLVGAFRiNlowD2yj5Okwv5rc?= =?utf-8?q?AALmC9O4DlSmK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q?C16BSDeZ3Ca2qzm5Iozsp5lhGYH3IeNq+m6hl+5SkPS2Nc667z7pRDtMJ7H+W6aZW?= =?utf-8?q?vY0cEzHqfJ+luGOJLn4bHs3S/iEGvUX7GqgSMroc/P9jITendN59s1DDlr4Q6pm9s?= =?utf-8?q?+jKOhgj1/oomFeQCNA9pOFnzhcLzxcXIqfL1BoeJC+MP48a+xUd6yAAKosIlUnfMo?= =?utf-8?q?rRkHValbcBG1Kh+4lOpWrV51SMKESV/ve9m9rKiGXX7mKTDH2gjkQSi6rMXzcjCtx?= =?utf-8?q?XwWDrUgb5k0Hu0o1TA4dO0ZgGiOwnwWwV8fmhQB0CVA+hYxt/4ys9sS5mQOL4c7Kf?= =?utf-8?q?kMfW4sFgEoG+Ga2iNO8BRaQPyGMP9g2dcJIzEqHwZXzJa1qxKSit8Mkfs/9tj4Jqf?= =?utf-8?q?ynNB6z1z8rmq?= 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)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?aO59fo2ZJDcoY4gCoPZa4OjU1B2G?= =?utf-8?q?WhfNubdX+qIMHZPHxbHUewsm3w9MS39d8ocP+yGtO0D4UVUO1K02E7IlBm1tIhe3k?= =?utf-8?q?Uw2Qto3WtzEMCwD4mHGU0um+SE1bR6SfArlmHTWvhIYGhOz2CG0zWcBncZlHxgyUn?= =?utf-8?q?dMaU935h6AbJsSzGSFYh5M47Vt2LhyoJipQMO4jpF5beVkWkJoIa1RLn1H6FCXHjH?= =?utf-8?q?rJ4SRO6x60FW2P/asom2TZpwrihd7Kly7qwDIDaZ15g9XUqMEA5B/ji8/tpUGbEku?= =?utf-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q?dTwL77gmBh9po7FJW3vx5skteDqXeEgtldTg4ClPvzHJ7nKw/kkuBvWNY8HhyPnCg?= =?utf-8?q?/Cg1HBs+IG2PWZrXDnMx6ap7H7z1x/QuT8Wluj7/uL/xnnl+9svg7Y3krfqGgWg81?= =?utf-8?q?nTEzFUc3DgauivCw7i57e8VRpMMN+yamZREIxZ4K/Q9s/IMbqnocvnDrkKci4ur0s?= =?utf-8?q?iKIEonWp1aNIr4lJp92240/gSyQwuZxS3ihbZW1cBPN4CV5+zGBnadHIrq/qLDubU?= =?utf-8?q?QGx4DMlxWDlvkTEAREyjOJJbL1DUZ2TTQoucHsIQccIgJ/PTRT4Ixqio9Y7wXNW19?= =?utf-8?q?T1Hu6AQlsc4wPzg2WjtCo49eI+vy6kgeR4tb0kHX5in9iZWKySs4q3gHUpxfGeE8H?= =?utf-8?q?v31oY+NAb0cp?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2e23c07-ce36-492d-124e-08dca5cd871d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 19:28:53.4262 (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: 0waefRCDRqaPzMGx3U7F0aJFRK6xlT3dgCVQeDBkFrY0oCVG07ApQ5hPmolrpG6eHqgCQwNujJAuTQMDoWqPkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7325 Add adi5585, which provide gpio, pwm and keypad controller. Signed-off-by: Frank Li --- .../devicetree/bindings/mfd/adi,adp5585.yaml | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/adi,adp5585.yaml b/Documentation/devicetree/bindings/mfd/adi,adp5585.yaml new file mode 100644 index 0000000000000..03c4760242ddd --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/adi,adp5585.yaml @@ -0,0 +1,83 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/adi,adp5585.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ADI adp5585 GPIO, PWM, keypad controller + +maintainers: + - Frank Li + +description: + adp5585 is a multifunctional device that can provide GPIO, PWM and keypad. + +properties: + compatible: + const: adi,adp5585 + + reg: + items: + description: I2C device address. + + gpio: + type: object + properties: + compatible: + const: adp5585-gpio + + gpio-controller: true + + "#gpio-cells": + const: 2 + + required: + - compatible + - gpio-controller + - "#gpio-cells" + + additionalProperties: false + + pwm: + $ref: /schemas/pwm/pwm.yaml + properties: + compatible: + const: adp5585-pwm + + "#pwm-cells": + const: 3 + + required: + - compatible + - "#pwm-cells" + + unevaluatedProperties: false + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + mfd@34 { + compatible = "adi,adp5585"; + reg = <0x34>; + + gpio { + compatible = "adp5585-gpio"; + gpio-controller; + #gpio-cells = <2>; + }; + + pwm { + compatible = "adp5585-pwm"; + #pwm-cells = <3>; + }; + }; + }; From patchwork Tue Jul 16 19:28:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13734832 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011011.outbound.protection.outlook.com [52.101.70.11]) (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 17F3B1A01CD for ; Tue, 16 Jul 2024 19:29:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158144; cv=fail; b=Mx5UfzIZFlqOyNNy5fiQKz/lVjU0W/nORJvyJFkgQsjz1/4365tjseTqjhoziqC/+eJ6jhxKgfRVcw7YS8pjsqBN03ZlWLfyMqYwALX/6EwpmJag1jdoYV1Cboc749N4Vm2QjqpPxsUu1boQZAQP8JU4kd3WrQp8qQjwfOl9Ub0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158144; c=relaxed/simple; bh=tIN866nRYnmFKyNS/7v8vyjqhbmngZVnDLPmy5zmBiU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=QL2YeH3482762E7p8AXEoc4peNjaSpawF4+Fja5y9KB/2vkr/f0C38dBrjA/DEpLqm6dP9TXfBlQl2HP4ANYuFUqwaG+3IrWAwuxHUNwW8xRR+bIyW7+BRPqVef1KYO1qr4tZ5ilLYwIV9flhuqNhlGMW8oljyJQvRE7V/gjSqE= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=DJZENCTW; arc=fail smtp.client-ip=52.101.70.11 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="DJZENCTW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MwkSVNHle4llXnqi7KdW1VSi39R+ULX50vH36x0Nizm3bJwweb/Wr/W22gKsbNsDWoPvmHBakUqd4rEpWLdw/wagq6qbogPjviodMlJJMgTsH2vmqAtYHalJ8Bs2ZjpEOEDwqP4PGn+GbrU7L4/tkEEGCjZH8LvgQ0hsfcqOApQwDJNsJd32VSZ2wdZo30B/dPX4BfYHpKnvgpVEvjTCO8+3s0DYHf38Ub0s4LpfDpYkXBuy0Ei+4nNkmrCkVQJ1AUaQNQ9DsljC4+879VecvKt0VhuDSf2QkYxZZjffWl7QzEMimqknQZhlNKZHUdpU8FFqegJEVWcSt2FKB3oHlQ== 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=dTm/uWu9I7Njd1rjkCT57wQ/5Tb6Wr1OXZdDFiTUb4A=; b=g+YJ2Fw66IIqhS219kmQ5jdB7d9msesUFkmGIEOficSnflkSXVu5o+2C4OGc3mfdcMeFyZzRpQ+Tg/KZfVnndsJV+rHLckt7Rnu9eKKA3yCjHKZhe4C8t0DMgvApbVpsOUJZ3VHfoOZUSHVRKNeNdIX0syh06kI8v1yhaJPsxMwqvJwEAbjCXFOwOsyXC5fMZoKnPzk3W9Zq3VgSMxgF3czNAzgdjXo/KFVC6EJWiqmtuzHeedZthgi0AOdy0YVp3KMLuCtaoL30Ue6YCKpt6dcD0NHG/iGTDU6saC3okNLII5z4eORIRpIBKuYC4uqiEO4NbTr8e6LjLJRI4C7Ixg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dTm/uWu9I7Njd1rjkCT57wQ/5Tb6Wr1OXZdDFiTUb4A=; b=DJZENCTW/gagGk8lQX2Q4rpaY9WRfdl/082b+Mz4X2alAGfDJ5GFM7fbqbfeHzNT2e8LlMCullLivHFGNV3xdKWYACK4l0PHbyrPH7broyEijq1B1V5jhocTcB9lv73ajvXYq3BzHL0TQwpqhAZQmx4cf3TxSK9GF9BVOxaWaPU= 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 VE1PR04MB7325.eurprd04.prod.outlook.com (2603:10a6:800:1af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14; Tue, 16 Jul 2024 19:28:58 +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.7762.027; Tue, 16 Jul 2024 19:28:58 +0000 From: Frank Li Date: Tue, 16 Jul 2024 15:28:25 -0400 Subject: [PATCH 2/6] mfd: adp5585: add ADI adp5585 core support Message-Id: <20240716-adi-v1-2-79c0122986e7@nxp.com> References: <20240716-adi-v1-0-79c0122986e7@nxp.com> In-Reply-To: <20240716-adi-v1-0-79c0122986e7@nxp.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li , Haibo Chen , Jun Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1721158123; l=8573; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=IgJgFjLtK71g/mE/vm/NQBQ8b9zZWkXeIiGyZdg1VU0=; b=MAisj5ry27ICOsujoveLXygl5TIl/VDUYhD4Fq1OYoFJHfjO66z5GqPMFLXs8m9uCM00r0AZ8 mGCVYoLTsBICIa1/XwqonzB/BDjC/48n6fmN+y6/X9+7M6wAcT2nAnM X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0148.namprd03.prod.outlook.com (2603:10b6:a03:33c::33) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7325:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c13976a-f558-45e6-f1a4-08dca5cd8a3b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?asq7EBeWNF8cIqkZrIO4CnBi74bAAiX?= =?utf-8?q?0xANli36Gu1byzGhOkSThrE6e5g22Hsh3x9HrKOHUnkTkvq0g+LjtPvZyOXmp+4vK?= =?utf-8?q?Q6g56fgniVErg3gdXemPR/GoMPhqedciEaRIMvcFXQbLpHvwfxtr39mcdaMp1rcT1?= =?utf-8?q?EOMMZpPfotZv4zKqwfCFE8vY7wV74M7lMXdZrDNU54q/T1SrgwizjR0+mJTftBDgG?= =?utf-8?q?9Jzviw0YLlsIw617A4SGyi1w31fLpgNr4qgGlXDCIfEXHv2PprIbH7aXXsjoWC/FT?= =?utf-8?q?9iFrDYWIFKfDCIRK8RcIQN2pumihTUHRKR5uKkHxKcONRW9EFS03IjjGK5tiWZlCw?= =?utf-8?q?7Ge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aWlOSh23z75fi89oyPHSuUz9UZAA+DBb7WFOHIpiUlZS5arlVqGugi?= =?utf-8?q?ZHtugx5LvqF7SA7h8gETr8eL0OAfBlVk9RmmVvSB9b0imk83aX3ITCyjCGi0+TZpG?= =?utf-8?q?KnedwXk2AeL7shgktEkgTNwKUEh6HzoiUSFZbGFHtS7Qj0+m3kkDSBg=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)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?LlfaB/yUekrozh6NCUs0Vw20wqiU?= =?utf-8?q?AqZEEBpPr6+BE2RYJXFoe3LZASJcFcisW7y3jLIMWvfrKd+Dx6y7iLuFLvet2ABxw?= =?utf-8?q?5YVkrbNZq2J1tH6eYEZHoAEWu52l4TH1jS9jIbU9iH5KArr2HZa9Ru/j5oi85ly4Q?= =?utf-8?q?e0ylDipY8aikSpKjf2T5GA7L8s+1k2aB2+h/HC/WLskGRg9JS1rt6bZdcQm8kWR0Y?= =?utf-8?q?wZ0YKG18MVg9J3St6VKNOVJfYv1ERCf3TRC8uV/hiGBr2qq+9EnP74gQ1LqN31olc?= =?utf-8?q?x/d724oHJ5MGjP3tx4UaI1k+k2xVOD/7H4rC7rjztNNutlYd1q3Aq+avXUIRr2LWl?= =?utf-8?q?Y4AZO3ukuO8wxQJLsktTYLMu7seSFpPWZwSm54DOEEn0V0HGgYHDVRdcp9sP0+i+Z?= =?utf-8?q?u3qB1K70TjO4tSFdk0+S9J3KckoySbBG4gYdSnhltOmgAy5huf3UMqye23mjAj31S?= =?utf-8?q?Xu3YYHVyW48f38LvZOX0LD7sGyWto/phYeh0AUW08/LsVi7a75SyOFvqhM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l55ezh2ea?= =?utf-8?q?SH6IRSkmK3JnG/VoXcjigNIsEIEi411kDygyA5Myh0BfrMnU/GwRsWmJs9xMEZbe0?= =?utf-8?q?ZJNnIELxQvaAU+TjGuUGh+EF6wi8qzJXyYgaIAjHryyP8SjxJckpTdHMhWfc+VhBS?= =?utf-8?q?2MF2yHbyQpaj?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c13976a-f558-45e6-f1a4-08dca5cd8a3b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 19:28:58.6992 (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: mNhWgtCyY2YqVmoY0T22pI1Ejp6UU6GZltIa9kWcRmn+f+iJw5WODCtdjuhFkf2N9pOPk3yYFEUFzcx63DpuHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7325 From: Haibo Chen ADP5585 support multi function, include expander GPIO, pwm, keypad controller. Signed-off-by: Haibo Chen Reviewed-by: Jun Li Signed-off-by: Frank Li --- drivers/mfd/Kconfig | 9 +++ drivers/mfd/Makefile | 1 + drivers/mfd/adp5585.c | 134 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/mfd/adp5585.h | 100 +++++++++++++++++++++++++++++++++ 4 files changed, 244 insertions(+) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index bc8be2e593b6b..62a967ee8ae1c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -20,6 +20,15 @@ config MFD_CS5535 This is the core driver for CS5535/CS5536 MFD functions. This is necessary for using the board's GPIO and MFGPT functionality. +config MFD_ADP5585 + tristate "ADI ADP5585 core functions" + select MFD_CORE + depends on I2C && OF + + help + This is ADI adp5585 core support, implement the support for + communication through i2c bus. + config MFD_ALTERA_A10SR bool "Altera Arria10 DevKit System Resource chip" depends on ARCH_INTEL_SOCFPGA && SPI_MASTER=y && OF diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 02b651cd75352..2a9f91e81af83 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -193,6 +193,7 @@ obj-$(CONFIG_MFD_DB8500_PRCMU) += db8500-prcmu.o obj-$(CONFIG_AB8500_CORE) += ab8500-core.o ab8500-sysctrl.o obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o obj-$(CONFIG_PMIC_ADP5520) += adp5520.o +obj-$(CONFIG_MFD_ADP5585) += adp5585.o obj-$(CONFIG_MFD_KEMPLD) += kempld-core.o obj-$(CONFIG_MFD_INTEL_QUARK_I2C_GPIO) += intel_quark_i2c_gpio.o obj-$(CONFIG_LPC_SCH) += lpc_sch.o diff --git a/drivers/mfd/adp5585.c b/drivers/mfd/adp5585.c new file mode 100644 index 0000000000000..52cc0d38bf2c3 --- /dev/null +++ b/drivers/mfd/adp5585.c @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* ADP5585 IO Expander, Key controller core driver. + * + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct mfd_cell adp5585_devs[] = { + { + .name = "adp5585-gpio", + .of_compatible = "adp5585-gpio", + }, + { + .name = "adp5585-pwm", + .of_compatible = "adp5585-pwm", + }, +}; + +static int adp5585_i2c_read_reg(struct adp5585_dev *adp5585, u8 reg, u8 *val) +{ + struct i2c_client *i2c = adp5585->i2c_client; + struct i2c_msg xfer[2]; + int ret; + + /* Write register */ + xfer[0].addr = i2c->addr; + xfer[0].flags = 0; + xfer[0].len = 1; + xfer[0].buf = ® + + /* Read data */ + xfer[1].addr = i2c->addr; + xfer[1].flags = I2C_M_RD; + xfer[1].len = 1; + xfer[1].buf = val; + + ret = i2c_transfer(i2c->adapter, xfer, 2); + if (ret == 2) + return 0; + + dev_err(&i2c->dev, "Failed to read reg 0x%02x, ret is %d\n", reg, ret); + + return ret >= 0 ? -EIO : ret; +} + +static int adp5585_i2c_write_reg(struct adp5585_dev *adp5585, u8 reg, u8 val) +{ + struct i2c_client *i2c = adp5585->i2c_client; + u8 msg[2]; + int ret; + + msg[0] = reg; + msg[1] = val; + ret = i2c_master_send(i2c, msg, 2); + if (ret == 2) + return 0; + + dev_err(&i2c->dev, "Failed to write reg 0x%02x, ret is %d\n", reg, ret); + + return ret >= 0 ? -EIO : ret; +} + +static int adp5585_i2c_probe(struct i2c_client *i2c) +{ + struct adp5585_dev *adp; + u8 reg; + int ret; + + adp = devm_kzalloc(&i2c->dev, sizeof(struct adp5585_dev), GFP_KERNEL); + if (!adp) + return -ENOMEM; + + i2c_set_clientdata(i2c, adp); + adp->dev = &i2c->dev; + adp->i2c_client = i2c; + adp->read_reg = adp5585_i2c_read_reg; + adp->write_reg = adp5585_i2c_write_reg; + + ret = adp5585_i2c_read_reg(adp, ADP5585_ID, ®); + if (ret) + return ret; + + return devm_mfd_add_devices(adp->dev, PLATFORM_DEVID_AUTO, + adp5585_devs, ARRAY_SIZE(adp5585_devs), + NULL, 0, NULL); +} + +static const struct i2c_device_id adp5585_i2c_id[] = { + { "adp5585", 0 }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(i2c, adp5585_i2c_id); + +static const struct of_device_id adp5585_of_match[] = { + {.compatible = "adi,adp5585", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, adp5585_of_match); + +static struct i2c_driver adp5585_i2c_driver = { + .driver = { + .name = "adp5585", + .of_match_table = of_match_ptr(adp5585_of_match), + }, + .probe = adp5585_i2c_probe, + .id_table = adp5585_i2c_id, +}; + +static int __init adp5585_i2c_init(void) +{ + return i2c_add_driver(&adp5585_i2c_driver); +} + +/* init early so consumer devices can complete system boot */ +subsys_initcall(adp5585_i2c_init); + +static void __exit adp5585_i2c_exit(void) +{ + i2c_del_driver(&adp5585_i2c_driver); +} +module_exit(adp5585_i2c_exit); + +MODULE_DESCRIPTION("ADP5585 core driver"); +MODULE_AUTHOR("Haibo Chen "); +MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/adp5585.h b/include/linux/mfd/adp5585.h new file mode 100644 index 0000000000000..58a9f84c9a75a --- /dev/null +++ b/include/linux/mfd/adp5585.h @@ -0,0 +1,100 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Analog Devices ADP5585 I/O Expander, keypad controller, + * PWM contorller. + * + * Copyright 2022 NXP + */ + +#ifndef __ADP5585_H_ +#define __ADP5585_H_ + +#define ADP5585_ID 0x00 +#define ADP5585_INT_STATUS 0x01 +#define ADP5585_STATUS 0x02 +#define ADP5585_FIFO_1 0x03 +#define ADP5585_FIFO_2 0x04 +#define ADP5585_FIFO_3 0x05 +#define ADP5585_FIFO_4 0x06 +#define ADP5585_FIFO_5 0x07 +#define ADP5585_FIFO_6 0x08 +#define ADP5585_FIFO_7 0x09 +#define ADP5585_FIFO_8 0x0A +#define ADP5585_FIFO_9 0x0B +#define ADP5585_FIFO_10 0x0C +#define ADP5585_FIFO_11 0x0D +#define ADP5585_FIFO_12 0x0E +#define ADP5585_FIFO_13 0x0F +#define ADP5585_FIFO_14 0x10 +#define ADP5585_FIFO_15 0x11 +#define ADP5585_FIFO_16 0x12 +#define ADP5585_GPI_INT_STAT_A 0x13 +#define ADP5585_GPI_INT_STAT_B 0x14 +#define ADP5585_GPI_STATUS_A 0x15 +#define ADP5585_GPI_STATUS_B 0x16 +#define ADP5585_RPULL_CONFIG_A 0x17 +#define ADP5585_RPULL_CONFIG_B 0x18 +#define ADP5585_RPULL_CONFIG_C 0x19 +#define ADP5585_RPULL_CONFIG_D 0x1A +#define ADP5585_GPI_INT_LEVEL_A 0x1B +#define ADP5585_GPI_INT_LEVEL_B 0x1C +#define ADP5585_GPI_EVENT_EN_A 0x1D +#define ADP5585_GPI_EVENT_EN_B 0x1E +#define ADP5585_GPI_INTERRUPT_EN_A 0x1F +#define ADP5585_GPI_INTERRUPT_EN_B 0x20 +#define ADP5585_DEBOUNCE_DIS_A 0x21 +#define ADP5585_DEBOUNCE_DIS_B 0x22 +#define ADP5585_GPO_DATA_OUT_A 0x23 +#define ADP5585_GPO_DATA_OUT_B 0x24 +#define ADP5585_GPO_OUT_MODE_A 0x25 +#define ADP5585_GPO_OUT_MODE_B 0x26 +#define ADP5585_GPIO_DIRECTION_A 0x27 +#define ADP5585_GPIO_DIRECTION_B 0x28 +#define ADP5585_RESET1_EVENT_A 0x29 +#define ADP5585_RESET1_EVENT_B 0x2A +#define ADP5585_RESET1_EVENT_C 0x2B +#define ADP5585_RESET2_EVENT_A 0x2C +#define ADP5585_RESET2_EVENT_B 0x2D +#define ADP5585_RESET_CFG 0x2E +#define ADP5585_PWM_OFFT_LOW 0x2F +#define ADP5585_PWM_OFFT_HIGH 0x30 +#define ADP5585_PWM_ONT_LOW 0x31 +#define ADP5585_PWM_ONT_HIGH 0x32 +#define ADP5585_PWM_CFG 0x33 +#define ADP5585_LOGIC_CFG 0x34 +#define ADP5585_LOGIC_FF_CFG 0x35 +#define ADP5585_LOGIC_INT_EVENT_EN 0x36 +#define ADP5585_POLL_PTIME_CFG 0x37 +#define ADP5585_PIN_CONFIG_A 0x38 +#define ADP5585_PIN_CONFIG_B 0x39 +#define ADP5585_PIN_CONFIG_C 0x3A +#define ADP5585_GENERAL_CFG 0x3B +#define ADP5585_INT_EN 0x3C + +/* ID Register */ +#define ADP5585_DEVICE_ID_MASK 0xF +#define ADP5585_MAN_ID_MASK 0xF +#define ADP5585_MAN_ID_SHIFT 4 +#define ADP5585_MAN_ID 0x02 + +#define ADP5585_PWM_CFG_EN 0x1 +#define ADP5585_PWM_CFG_MODE 0x2 +#define ADP5585_PIN_CONFIG_R3_PWM 0x8 +#define ADP5585_PIN_CONFIG_R3_MASK 0xC +#define ADP5585_GENERAL_CFG_OSC_EN 0x80 + +#define ADP5585_REG_MASK 0xFF + +#define ADP5585_BANK(offs) ((offs) > 4) +#define ADP5585_BIT(offs) ((offs) > 4 ? \ + 1u << ((offs) - 5) : 1u << (offs)) + +struct adp5585_dev { + struct device *dev; + struct i2c_client *i2c_client; + + int (*read_reg)(struct adp5585_dev *adp5585, u8 reg, u8 *val); + int (*write_reg)(struct adp5585_dev *adp5585, u8 reg, u8 val); +}; + +#endif From patchwork Tue Jul 16 19:28:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13734833 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010069.outbound.protection.outlook.com [52.101.69.69]) (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 059121A2548 for ; Tue, 16 Jul 2024 19:29:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158149; cv=fail; b=EXO4W2Q2OMz3DZ0fLNIe0EDhLOoJCJco06xbd7U4ODoYdFkCblzQdUHZJe03g57MFmAgcwaTWQVjq5FEJnbwQ+SifuJgVw4H4VlYs9Z92IP+1YsdGFJibmsvKcj7bz8E0W1OL8bWPbyQ8Adq9fyn1Gwao/QV8PwpMhnBVBGLEEE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158149; c=relaxed/simple; bh=u6o5ZgVOhIDsk0rsR+s89WrDh8nd57MlF4eGf0tco7s=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=CkzJ1b5jkALX7UCNMDZoKML0Ayd9gVzXT/bnKgYgyTB3HuP5rNKbETjCQBvSR3jPWszft5wZc/ZQ6aPvAD1FPlak/0jcu9kapY/n0WZKrjsh6LOPwXenpJHYTVn5ce9Q2lh12gz96XtkACEaPwKydR9qiK922+uhz1qDBqKx1Wk= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=NEFevBNI; arc=fail smtp.client-ip=52.101.69.69 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="NEFevBNI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R4+we141gKYNvczBCXFZbpTa39fGlRyy+3MzdbZCdLxD9CStPUfwdxEzp4pSXOdP5W4VFAW1DLucfaVExmP5AQ0cGVOotLuYdwghWixpEyLYtCWoIBQjjfx4XRN9D4Va3HdkYP2og4O7blr9h2voJ1mmpapEk0M6Jc8wvcY8sSJmGCdoIeJUK2s1rD5+tu5yskNd8QVHZB7balMhz+NV3eDxZ743TEzhEjX2Z4jrIvFB8TF4ZjTrL1qu1nC3VciuntIvHWUx37L80SIZBcHODRGtWoxH6mfZdjgv6GdLz1njErMZmX3gg42WfKjJcAqiJxK+W3E4J68YcjGcWhYK/g== 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=+w2t/T6iFzLfIMCDVpUfoX1P4V02RfiRLH2a5fsRmGM=; b=QoyL873/PKqX5N/DTnWGapUYb7W6z9LB/4vO10g53ITtZDLuXLcRpitld3YJALMBmAhWIbd9GteYrtqlWHzBdO8U3p91mJddkUH//MjrSQn2+XIUOsui3WSOX77Nvx0UKh14D5B0O+wAhYMpiUaO34NUdl9sBqyrFA9rFdzS2p8Z6gspDHWLSxCUj9T+tPxAIFud1WKiUrIRqG43kbgxHB6sC8L3Ekd4+3Q6DDJ51M8KRq2bALmiSaVh213YF4zfJqQG0lcym2giX9savwIhd9+dhFkTlvhNGFyN8M7HNAqQfO+YPQIwq374EBlnktXbzTreb5ibrGSkGonwDCP5iw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+w2t/T6iFzLfIMCDVpUfoX1P4V02RfiRLH2a5fsRmGM=; b=NEFevBNI+zbhLgjopx5WkhLpEQaOQAI9uBS2LDZPmmweY4iYWAgMvHLSZf0glKkUy3F3gZVbHdtnROgRSvnN+/PiaZAnq1nSt04QpyFWgGGtTse7VkdMsy9Y1mIMo/Hx6WqaADLumQSRHPiTB6F7MaPSiVxMCLdfDtR5A3O9qUI= 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 VE1PR04MB7325.eurprd04.prod.outlook.com (2603:10a6:800:1af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14; Tue, 16 Jul 2024 19:29:03 +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.7762.027; Tue, 16 Jul 2024 19:29:03 +0000 From: Frank Li Date: Tue, 16 Jul 2024 15:28:26 -0400 Subject: [PATCH 3/6] gpio: adp5585-gpio: add adp5585-gpio support Message-Id: <20240716-adi-v1-3-79c0122986e7@nxp.com> References: <20240716-adi-v1-0-79c0122986e7@nxp.com> In-Reply-To: <20240716-adi-v1-0-79c0122986e7@nxp.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li , Haibo Chen , Jun Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1721158123; l=6743; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=DWKFapoE8P1FSqk1OvDAEQl8OhrCjAiJ3y8kQN6BUkw=; b=Gu4DsNZiq6XDAIm8e7HIsiPXLc8qNgVRLwW+bQewKukNoK23sU/6uI3X5HxUSjQJkR+OShj5X mEwMIZ+4B16AfephX1ZeWSxAqc30cgK6A4pFL2FUZ+nSbK8nWn1Z25J X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0148.namprd03.prod.outlook.com (2603:10b6:a03:33c::33) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7325:EE_ X-MS-Office365-Filtering-Correlation-Id: 0cd1a394-9e72-45d2-323e-08dca5cd8d36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?3CIEoUp0onmDzpUqeDvF7akVhhEp79g?= =?utf-8?q?G7BzWusUeKsvUBqmjSlKwLIlDFGnvLbAhhbFzhfWNiwtm0Pw+E4SDGzGJ+Qjud/U2?= =?utf-8?q?+TdCffj6nyIarKy/AetkFvsAMd8aN/ukdQhZE0Uiq4UmGV7zoNOxRCFUWDpBow3TR?= =?utf-8?q?jaWmxsupZrzUdGQ2q41w02yM/rwCB7YtrOJDSVhpvDZVUq4LAGCk/mUWAJI3bCP/8?= =?utf-8?q?h7std1seEDJBsW2KWPHL9DpMStoqVCgYwYweh6ycq926CzusBCT3d/5E5RQF7VjtK?= =?utf-8?q?yXkua1UBzi2JY0jBAe56YqogNjUJhYre2MPX3P4T0Fh6VNhD6DJmU34LcnWHwScUK?= =?utf-8?q?SxsJjJzJwft7x/+gJ0tDm9cQJ8uGCVWQk64hPpaceFY8m/YFIhrjCsH4levh5r0cl?= =?utf-8?q?QjyxPd3pwW29tT43vqGxnElylb9FUow3goaTFKpYqiJlWOzEqQY861r9kvof9U2bZ?= =?utf-8?q?YuxAbj6fMFpEs8oE45wNFcsTKaw+QZ+E6o4lUL6QvyDvqD78iEo9oTAf1XC2/1Jd6?= =?utf-8?q?/tCVpG8jVyYX7azS/btTzCIyJsxh8w8s9FhbqdHaigNOp9OvOSA2FjxTwWrdk9N/X?= =?utf-8?q?TUA2o1lm/JQaA9c7LOSSHop5uYB2J0gv5od0o39BnMOxxsc6kUfGTVrXdXdde5mUr?= =?utf-8?q?+8bKN3TGUr6VaFEzQKGpSirHWTt35HVwqTsvUugv+MSKYuH4rpr+WeFgkJ8+y+0F5?= =?utf-8?q?moXnD9Nhhuy5ot9OsxhbvyyciifiZ+xtwC8yFrTmGwmfFChzE0KW9HY7TLclsqBgV?= =?utf-8?q?DN2BXGAGFMdoXn6XmVXYeIixP9iGydU0TliyVA2DCACGkAbNk7GK78KLhUSe76/x8?= =?utf-8?q?PMJc4MtX/h6uFQNTEadgtN1DL4qPkoJ7fihPzN/+hmuHPNauQycUEV3n1MK1u1/Ta?= =?utf-8?q?nIjVGQBg/hdYdrOk73kN1S78GiCruPBZdqQf5IF8jDNmqL9VU17V65g5BGm2nkQZH?= =?utf-8?q?KWmZuSuNKW1A0srhzvK8V4bM+GCM/bpmfbaNhTxLj24vJwTS/HSCBRhTH374+UVrn?= =?utf-8?q?ixyY3KIuw3ci9m3r9hkZCKiN1j++QXLOAo/TjkLfQDoeuxOK4pqDXPGOcYPwQxQAi?= =?utf-8?q?r/B1NfWvKAEP2rqkDKqkjWmyruY9QZgcBQRdoOvqM53J7O3qOdUXDlSF0TuKBvz72?= =?utf-8?q?ql0730RY5WWzCmlmk3wy6KUcZRwhc2Ouqev2t26vkUYdwgpHaxzf1a/I01zATCgzf?= =?utf-8?q?wHkDuYXCnDP9U4uMdwXoQFIzzrCPRPmKVedSD0gaRtPH0+qVOMrC3s/RHN7fx2SuL?= =?utf-8?q?OJKu3SnSZiLNZTPeO1T/KUJ4e1V6ARFsiz0FSlkIeHZM8ONegMcULlPdtp32MP1fm?= =?utf-8?q?QD5WRPoTZFmLJg3nb2kEb9VeUbEikffA8Q=3D=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)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Il8ouWtJVaowqwAh8EHDo2BB0wK8?= =?utf-8?q?ThYv5cfuE+aU/m7UCwCfnwNN8IlH/aXeEg5HYh+O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THF6ammSu+kYFRapmg7s4/Y?= =?utf-8?q?Vr3J7zC6p2vVAXbmxmOUPbvMW55bOefbtbDreamcNatsPChT1O3NV+UWnK/Bj1DwN?= =?utf-8?q?rtXefbUv+O8UcNZhJ8J29w/Nmx7noRM19fC7/nbM0yXoBesCabBzDLQbSvgwrrppW?= =?utf-8?q?gswIi8IZd9k6PWb5xTfvtkoLxVu0VtXgZnY33CRgWUzzLqXPcLwewNJxiqO11i/6o?= =?utf-8?q?HEIn7lCo8EeaRgtrzmTHfnsjECLWYOIU1EvDm1+PUy7Mls57Pjek7V8NF3GeTVumB?= =?utf-8?q?N82rgqgSnRkJ8nA8gRYb+/0JUqu0V9/Rfkiyn3YfXsG3jPNDrgkDWS0EpX6WPMDV7?= =?utf-8?q?7crwE/jPHaUZ78tCKk6oSHM1XJykc5EIR01WZgig6WPghg2woEr0xLYMYjeOMNzZQ?= =?utf-8?q?YsOcCj75DqjXjujM5bm2YUNJ5VKsZR4RBExyONXm7QTIddDY7P6Og0xetl9CGYN5o?= =?utf-8?q?zIbUuh29Hco6q8H8OxojiUsrvEPbp+4mxJS+REdpHpVzJMHSx5eC2R/YloKnmaPwp?= =?utf-8?q?4jiShfA7v2MIyc+WqQWHEDYj9QUo7aXLwW2JD+saHyWtlYJgrU8xe/JM=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cd1a394-9e72-45d2-323e-08dca5cd8d36 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 19:29:03.8596 (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: 3qB6OGAyCPX0NCdsT+lQ4mU3vLqI75Kau7+GIO9/YJtNZT4qXVv23ix9JCIdB2AKMkP1EsAlpJfrQL8z7EAEaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7325 From: Haibo Chen Add gpio function support for MFD adp5585. Signed-off-by: Haibo Chen Reviewed-by: Jun Li Signed-off-by: Frank Li --- drivers/gpio/Kconfig | 7 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-adp5585.c | 184 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 58f43bcced7c1..20daa3d70abc7 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1233,6 +1233,13 @@ config GPIO_ADP5520 This option enables support for on-chip GPIO found on Analog Devices ADP5520 PMICs. +config GPIO_ADP5585 + tristate "GPIO Support for ADP5585" + depends on MFD_ADP5585 + help + This option enables support for on-chip GPIO found on Analog + devices ADP5585. + config GPIO_ALTERA_A10SR tristate "Altera Arria10 System Resource GPIO" depends on MFD_ALTERA_A10SR diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 64dd6d9d730d5..1429e8c0229b9 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -26,6 +26,7 @@ obj-$(CONFIG_GPIO_74X164) += gpio-74x164.o obj-$(CONFIG_GPIO_74XX_MMIO) += gpio-74xx-mmio.o obj-$(CONFIG_GPIO_ADNP) += gpio-adnp.o obj-$(CONFIG_GPIO_ADP5520) += gpio-adp5520.o +obj-$(CONFIG_GPIO_ADP5585) += gpio-adp5585.o obj-$(CONFIG_GPIO_AGGREGATOR) += gpio-aggregator.o obj-$(CONFIG_GPIO_ALTERA_A10SR) += gpio-altera-a10sr.o obj-$(CONFIG_GPIO_ALTERA) += gpio-altera.o diff --git a/drivers/gpio/gpio-adp5585.c b/drivers/gpio/gpio-adp5585.c new file mode 100644 index 0000000000000..7c9edbc16975b --- /dev/null +++ b/drivers/gpio/gpio-adp5585.c @@ -0,0 +1,184 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * GPIO driver for Analog Devices ADP5585 MFD + * + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#define ADP5585_GPIO_MAX 10 + +struct adp5585_gpio_dev { + struct device *parent; + struct gpio_chip gpio_chip; + struct mutex lock; + u8 dat_out[2]; + u8 dir[2]; +}; + +static int adp5585_gpio_reg_read(struct adp5585_gpio_dev *adp5585_gpio, u8 reg, u8 *val) +{ + struct adp5585_dev *adp5585 = dev_get_drvdata(adp5585_gpio->parent); + + return adp5585->read_reg(adp5585, reg, val); +} + +static int adp5585_gpio_reg_write(struct adp5585_gpio_dev *adp5585_gpio, u8 reg, u8 val) +{ + struct adp5585_dev *adp5585 = dev_get_drvdata(adp5585_gpio->parent); + + return adp5585->write_reg(adp5585, reg, val); +} + +static int adp5585_gpio_get_value(struct gpio_chip *chip, unsigned int off) +{ + struct adp5585_gpio_dev *adp5585_gpio; + unsigned int bank, bit; + u8 val; + + adp5585_gpio = gpiochip_get_data(chip); + bank = ADP5585_BANK(off); + bit = ADP5585_BIT(off); + + guard(mutex)(&adp5585_gpio->lock); + + /* There are dedicated registers for GPIO IN/OUT. */ + if (adp5585_gpio->dir[bank] & bit) + val = adp5585_gpio->dat_out[bank]; + else + adp5585_gpio_reg_read(adp5585_gpio, ADP5585_GPI_STATUS_A + bank, &val); + + return !!(val & bit); +} + +static void adp5585_gpio_set_value(struct gpio_chip *chip, unsigned int off, int val) +{ + struct adp5585_gpio_dev *adp5585_gpio; + unsigned int bank, bit; + + adp5585_gpio = gpiochip_get_data(chip); + bank = ADP5585_BANK(off); + bit = ADP5585_BIT(off); + + guard(mutex)(&adp5585_gpio->lock); + + if (val) + adp5585_gpio->dat_out[bank] |= bit; + else + adp5585_gpio->dat_out[bank] &= ~bit; + + adp5585_gpio_reg_write(adp5585_gpio, ADP5585_GPO_DATA_OUT_A + bank, + adp5585_gpio->dat_out[bank]); +} + +static int adp5585_gpio_direction_input(struct gpio_chip *chip, unsigned int off) +{ + struct adp5585_gpio_dev *adp5585_gpio; + unsigned int bank, bit; + int ret; + + adp5585_gpio = gpiochip_get_data(chip); + bank = ADP5585_BANK(off); + bit = ADP5585_BIT(off); + + guard(mutex)(&adp5585_gpio->lock); + + adp5585_gpio->dir[bank] &= ~bit; + ret = adp5585_gpio_reg_write(adp5585_gpio, ADP5585_GPIO_DIRECTION_A + bank, + adp5585_gpio->dir[bank]); + return ret; +} + +static int adp5585_gpio_direction_output(struct gpio_chip *chip, unsigned int off, int val) +{ + struct adp5585_gpio_dev *adp5585_gpio; + unsigned int bank, bit; + int ret; + + adp5585_gpio = gpiochip_get_data(chip); + bank = ADP5585_BANK(off); + bit = ADP5585_BIT(off); + + guard(mutex)(&adp5585_gpio->lock); + + adp5585_gpio->dir[bank] |= bit; + + if (val) + adp5585_gpio->dat_out[bank] |= bit; + else + adp5585_gpio->dat_out[bank] &= ~bit; + + ret = adp5585_gpio_reg_write(adp5585_gpio, ADP5585_GPO_DATA_OUT_A + bank, + adp5585_gpio->dat_out[bank]); + ret |= adp5585_gpio_reg_write(adp5585_gpio, ADP5585_GPIO_DIRECTION_A + bank, + adp5585_gpio->dir[bank]); + + return ret; +} + +static int adp5585_gpio_probe(struct platform_device *pdev) +{ + struct adp5585_gpio_dev *adp5585_gpio; + struct device *dev = &pdev->dev; + struct gpio_chip *gc; + int i; + + adp5585_gpio = devm_kzalloc(&pdev->dev, sizeof(struct adp5585_gpio_dev), GFP_KERNEL); + if (!adp5585_gpio) + return -ENOMEM; + + adp5585_gpio->parent = pdev->dev.parent; + + gc = &adp5585_gpio->gpio_chip; + gc->parent = dev; + gc->direction_input = adp5585_gpio_direction_input; + gc->direction_output = adp5585_gpio_direction_output; + gc->get = adp5585_gpio_get_value; + gc->set = adp5585_gpio_set_value; + gc->can_sleep = true; + + gc->base = -1; + gc->ngpio = ADP5585_GPIO_MAX; + gc->label = pdev->name; + gc->owner = THIS_MODULE; + + mutex_init(&adp5585_gpio->lock); + + for (i = 0; i < 2; i++) { + u8 *dat_out, *dir; + + dat_out = adp5585_gpio->dat_out; + dir = adp5585_gpio->dir; + adp5585_gpio_reg_read(adp5585_gpio, ADP5585_GPO_DATA_OUT_A + i, dat_out + i); + adp5585_gpio_reg_read(adp5585_gpio, ADP5585_GPIO_DIRECTION_A + i, dir + i); + } + + return devm_gpiochip_add_data(&pdev->dev, &adp5585_gpio->gpio_chip, adp5585_gpio); +} + +static const struct of_device_id adp5585_of_match[] = { + {.compatible = "adp5585-gpio", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, adp5585_of_match); + +static struct platform_driver adp5585_gpio_driver = { + .driver = { + .name = "adp5585-gpio", + .of_match_table = adp5585_of_match, + }, + .probe = adp5585_gpio_probe, +}; + +module_platform_driver(adp5585_gpio_driver); + +MODULE_AUTHOR("Haibo Chen "); +MODULE_DESCRIPTION("GPIO ADP5585 Driver"); +MODULE_LICENSE("GPL"); From patchwork Tue Jul 16 19:28:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13734834 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011055.outbound.protection.outlook.com [52.101.70.55]) (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 28EEF1A2572 for ; Tue, 16 Jul 2024 19:29:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158154; cv=fail; b=gX4URkkvxOSLoc+R4d4H+KSbLgIdByOVTwOh9y6OC939x/kSNZNUmocqwziVFQPfSkyVJKr9+HF0kvIIkiYaRPN3athe14QNJk3QQnJaLfXKJAYrqsUwzJXHMpav4o1BaBoChLgfSssWJwqOjdMyCUYIoaPNHCg+mjnn3mVg418= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158154; c=relaxed/simple; bh=po8Ool7o3UM4Uh/jsHpDjST0Gs9nOujmSWm9VP/qA9k=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=kY2321HXdRb3cSbBYxGk/cYN3FUG+rYfdeI5JSYMDdFxmLYrbEHxUvnpQfUnXAJq2umAQbnjVBvqN09/VQ0A0oetz4IwBfSvcxyFUqN8yKfpB1C0dJeZWSCx4WB1V1ZfrogcfL1uPeAK6lHZF4S9oyCjuDiWBkqENwwNp0q/80M= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=fzfDjYz8; arc=fail smtp.client-ip=52.101.70.55 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="fzfDjYz8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FVtZrR+PtCHAK8iSlGrAk3C6ma7EMDbHpJDHcHzoJOiF/s2p9bCFjDk3bfJX2WEo5T9HJF18+oojjn7uO9LlEwnecbnmMUzMn0G90kE6PkyJPWFN0dLKkXMGrjozU/aRRrxWHS1Sxcae8zoZSPBtEHo2bhYFWHyXcBA2KdTWKIjMixC9LYzqRtl1DCY58DegTB6OHaKFBKWO7diDC/TxanJZgmqcPy4iHOJ+dpL2ts9q/5Oh8/ykA/ZgGSsSCa+mb3+as3jFJ6LkTE0I90gh606QwROALQbYH7pIv9hFcYb2IITNMRLFfoMIRMMjTprKOOkPO75WvLSDkLPFfMrRjA== 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=audpQSg28RPcK+jB538LSGRNrGBU1eaNPR6AG8d/TA8=; b=oaJ/hECclSPN9PIh8ByyHgP1YfgfsNkhGQyLjwY8ZDfQGGzkZhgHmsBqKkuushUYpE5eFmFWCQNfqcrqy0oObQRLQqCuBJlfIe86ygrwJ+GoCW0hKm8v4A08I+4zmTRJj0okliJcs/0ZBXY6WRj15mPHsiO1JqDRWwpj2/fJtOwpL2717vCI4qyQf0gxjimrANYzBonE0y9OgW6RxHlYq34otdXiJ4Sp5O4P5eehB4YeLjh3SiCNm/jKXgnmsRxjRWgcPoBgDeluR4jpIdLl9nRuEPJ0MieCDgUpPlpXSbuBV8sSw7j3ud58YhPc0hRd0KIPnGPMhL63xf5nRpAVFQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=audpQSg28RPcK+jB538LSGRNrGBU1eaNPR6AG8d/TA8=; b=fzfDjYz8QjQSlIdLTuAuRhJj/5OacXaZiBjbsSDM8U+MMrBtkZ7e32wp2mxuLDN9OlN8f3y4AONHK3mTlUY1dfXOo87fziHtZlqyUI1rB/cJlBprQGKjBqI95P+MXHAC5hziEMuZd+OTqhlimR4z2nfINUCxM4p/kwSGDnmcSI0= 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 VE1PR04MB7325.eurprd04.prod.outlook.com (2603:10a6:800:1af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14; Tue, 16 Jul 2024 19:29:09 +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.7762.027; Tue, 16 Jul 2024 19:29:09 +0000 From: Frank Li Date: Tue, 16 Jul 2024 15:28:27 -0400 Subject: [PATCH 4/6] pwm: adp5585: add adp5585 PWM support Message-Id: <20240716-adi-v1-4-79c0122986e7@nxp.com> References: <20240716-adi-v1-0-79c0122986e7@nxp.com> In-Reply-To: <20240716-adi-v1-0-79c0122986e7@nxp.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li , Clark Wang , Haibo Chen , Jindong Yue X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1721158123; l=8057; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=EiVtoqMy75CK5ERMMGoJ/yXXvz/dg9oechvT32M0l38=; b=1VYa+Ewde+HKap6V5bmlRBVVooCEKmoZmOOrKajOsUzO6feYCNXSKQz9yq/kEfIlGTuEeQl/Y wtJgQJ0SDynAYynpwWRoamyZh3jVn3RV9yo7YAfMank6hHzR5GwrzgF X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0148.namprd03.prod.outlook.com (2603:10b6:a03:33c::33) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7325:EE_ X-MS-Office365-Filtering-Correlation-Id: 64b77f8a-08f5-496b-2a73-08dca5cd9096 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8oniFZyOgOgbfilU1+hUGHyrSyASH4C?= =?utf-8?q?l6gqRCSdaBVy4fOBmGQCB4AQRim3GKw0Kzp7YAadAqEIvEE+9ge8NaH3EeNSld+kg?= =?utf-8?q?epUvI8ed5T28buB0gwWirKtXUm82sIatcfD8yBLX5yNUsLrbf0tB5FnXeGfiBW11i?= =?utf-8?q?5dJTV2rdn39YcpwcZfOYQKwnpBfQsk7pFO9m3tw25Jz8wd53GR7y4nO1S5ZPFlsfJ?= =?utf-8?q?AlJbXbjgTSbBqZWrva09XEuFnJNoC5VCBtL+zOmZpUV8/yHMj8OmI9xGp6NHeSeiN?= =?utf-8?q?Uza4FPv1L1NMwcjNql7j4MutxfrrQauMUvETZ5FOEuriHETPGaIFfwbCUY1CrziNg?= =?utf-8?q?miCUfk/O0bwhOG5XNq4FwV77rkIqBOmgTNZAAmzKs8zTdLZvnEItT4g09pdMo1bX3?= =?utf-8?q?RWEyA3jGLt4rkGvWTAit1lXGPIaGdWzc5FWbotCV9r4TEi9YATDYGGYi2DIq7zCEq?= =?utf-8?q?GqODNEjQHp1V3uJQGaRVtl0xYBXuSs6zU2WXLOC1SCgpticol/i4NKikRjJ+q4bQH?= =?utf-8?q?sqqWfruorDIdEWPVhyrwPptoCS7ETeAMsexC1RjogYjxy1W9DaIyLSWRcVcS8nsMC?= =?utf-8?q?6RFeICHa2FOk5US/o1JHO5+4P65Ra7eLdqFlphWXeCYrWEmbSmU7QMVfjH2dnaQpt?= =?utf-8?q?WX0rYRW8g9dPxUKZ+2RII+JT+9/lUSxvV5pAUUsQPtWSEQDo2oExImaca/m5/d4/7?= =?utf-8?q?FdsPlWDheF6R2mmJAG4ahikYHvshnARJ36/frT+VND8UCRzpZOEakWGREDnE2j86i?= =?utf-8?q?FidKJsQ+6SoRJoKFs3PBGa/EPD5SiK5VeBmGmb/EqlhnisCp9J6It1CarUK0gCgSd?= =?utf-8?q?wjCadZLqYhKETjxEqrCXICkd4RvNBFtZvJuPPfWTvfzk4Hm2Qn90tYxOEjQPW8iNG?= =?utf-8?q?+zL0BOSHK/PlCFUi+U6/FzM43IEYFIvIjOyRIi7mKKT51ontyBupRQkXfnZ/He2Zo?= =?utf-8?q?XQL4rENE8xvyoZ6q0BNfPilYPRbaZySas0fv1x/73kaM3RzTqZlChDyUn+y5nqef/?= =?utf-8?q?PpczhCqUOEHdFkqzsI9hQETgEGBW5TMn2EiPtiElFEarB+aUfUmHIGjHAU6puA8HJ?= =?utf-8?q?FGC7s467lnVRYEgJ74iBeks4vUeTTgEl1jdMv+JJTjFNIKgm55TW5DHdjL8TBf2l5?= =?utf-8?q?s0bQhMZH7X1pS9AO4cXXnAAl38tSQJN1eiUo1EPemtK7Kz9Y/A1Z8/vPVfMXW2aRv?= =?utf-8?q?CkRLlmZCIEtgWHgmYH+aBkB4Y3l417cYB/TYZz1fwpK+Yqr7juxEuutVks20WbB/i?= =?utf-8?q?7FXSW7lD2eq6jg3itkJTDcqL6ElLVGJevnvqF7aHpxft9jkA1u/U806XpiiQvEBEu?= =?utf-8?q?0V4GDXc5C5H8uXElb/flWDyTBVG8nTNrLuLp6pdYhTPS16gaOi9Opno=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)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?gqvbE+e7OXvk6AFNyY7kuU5EJo2y?= =?utf-8?q?U85ytTMmn2WE/soczaPKjKCev4GBYi8hlhDF3gTmbczfmarArxgKpcXFzF2FAwbIK?= =?utf-8?q?zp1IyUdPMnVqOpS2Me+4ZkuoNlY3NzPek5SudC3QA5gMqmqnPNA3cEwOluQVtpjSC?= =?utf-8?q?tNtcFZsgkQ99P/tsf85GjNmwF3E0ihhv6ZPe3tiEdkzKT3VA/mH9cMzQrgai+rKRw?= =?utf-8?q?dUiCf/+6u6VVsmS6S7ye4VpZZTzMx++BckYvKuQQpvylLBsiQn1722YPALzLf3mn3?= =?utf-8?q?alhfkJjm9FHvRstBomV3up3qsKt7W4FNWoiJdT8ZJWguVYJXkiojfVCt+R8yZ4H/t?= =?utf-8?q?o6IRsG2002g10rH/mddcgguljhKNFksvYQqd5xF6nhZrjqcT1xZvcILa+SU7emqe3?= =?utf-8?q?ZS0IMcB8s7EfEY9lNaVA2GSiU6e7tWRUTaUZLwWLe3sBc+ZxxAWU7wqWi+ywoGxcP?= =?utf-8?q?bsUmhx8jtSHh2eU9ub0sQ3RbJG0TprzMsWA+RPHnUH/9WrD4Bzf4frA+tmRAoWh5m?= =?utf-8?q?9V1CZiUQCndhYft0qq4LrsSC5F6+uLIDadMV1fGr+Tcwb00eca0zo9ki0vFLvVvJI?= =?utf-8?q?1ZXvmybKPU8HyFOUezI9QPcz6dGNs0I9cPy7WwpZXXa9ohpSLKa67CnxM7sNfeTrS?= =?utf-8?q?0oYpz+SthfvRFp/MurVRWGFDpaosd5pLXC8TaLinelHbSIA7V0c10mmLrhBI0vW7T?= =?utf-8?q?fw97KVqzmECPmECMFUmBcOD2E1mI9LAMGe0FEj6pK22hiVgXbQytGbsaaWJvjKi/F?= =?utf-8?q?F0GbeKc9APwywrbqSs6u8gBUVZHClOmkdDbhfU7HQ4AwDq6AszMMW/c1U7M/G4gA/?= =?utf-8?q?1BKl1hWQlDCaqqiWEmGFo1FrrqYp/WayeEiDYEG4Tcaoy9EdSdPkM0IU8xNliWtFL?= =?utf-8?q?7JvnCvgATvUAvERTZVmeUhBXkLPpd+unCHtEPnZ6stT+f08DbKvY1ewvnl/IbEvFZ?= =?utf-8?q?ZO43RTSbU5wFpHCXoUUFs9tsvJ9hiCgu22oVMx8iUlY8zgNlbDxS96mfwBUYVbKPu?= =?utf-8?q?Xq9z6U8AqNDDd72LSvpJrIuSefytAM0qi3jf0zag1a+iZjh3S9zBiGBAjKZ49OqEz?= =?utf-8?q?qhufSLBOEbV5KsorxGX2VGRwuMyAgHP1BhuBtHxuXnQpRII8JnpJaO3677hsdkTT3?= =?utf-8?q?JeyYpr+dBtUpf6lDfxJrEsO4MtmkShM6BhKTcOlWyfZQh7gsPe5KHm6kGaBTehZWV?= =?utf-8?q?30FBT6bfprIudpWHDEz2aqbehAIuqb9pSrqdcdp3sWkzsQKkZ61OpfF02ANo1rF3s?= =?utf-8?q?3QsJYFbLeWb801ha9cXpbfgWz9hFaLd0Q4dfgMj/o7PI40I3U1R16m3uMT29iWJDT?= =?utf-8?q?0tMrsNtKasq/CGKNyAHFgV7pVbHx7EuY+O7NvkJYxMrdZXM83sxT56Nfj1uoaqoDM?= =?utf-8?q?rlFtC/i4o0m/TqLII8c20FARdspG54IzqaB+0DAPueDtsZIcFGu5nJnAovF5oYhf1?= =?utf-8?q?+NcZkgObWNlm9E4leErsOM/0T8op1zon3dyu/kk3akwMq0O98R5sovYU=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64b77f8a-08f5-496b-2a73-08dca5cd9096 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 19:29:09.3616 (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: ok7AGpBEwoU+aoFzu/jU65joWEhCwqV1NwzGcCao5HQU9jMWavrp7SxyXISHRQFnmeBybzD05Kbs80QJosC2EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7325 From: Clark Wang Add PWM function support for MFD adp5585. Reviewed-by: Haibo Chen Signed-off-by: Clark Wang Signed-off-by: Jindong Yue Signed-off-by: Frank Li --- drivers/pwm/Kconfig | 8 ++ drivers/pwm/Makefile | 1 + drivers/pwm/pwm-adp5585.c | 215 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+) diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 3e53838990f5b..baaadf877b9c6 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -38,6 +38,14 @@ config PWM_DEBUG It is expected to introduce some runtime overhead and diagnostic output to the kernel log, so only enable while working on a driver. +config PWM_ADP5585 + tristate "ADP5585 PWM support" + depends on MFD_ADP5585 + help + This option enables support for on-chip PWM found + on Analog Devices ADP5585. + + config PWM_AB8500 tristate "AB8500 PWM support" depends on AB8500_CORE && ARCH_U8500 diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index 0be4f3e6dd432..161131a261e94 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -2,6 +2,7 @@ obj-$(CONFIG_PWM) += core.o obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o obj-$(CONFIG_PWM_APPLE) += pwm-apple.o +obj-$(CONFIG_PWM_ADP5585) += pwm-adp5585.o obj-$(CONFIG_PWM_ATMEL) += pwm-atmel.o obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o obj-$(CONFIG_PWM_ATMEL_TCB) += pwm-atmel-tcb.o diff --git a/drivers/pwm/pwm-adp5585.c b/drivers/pwm/pwm-adp5585.c new file mode 100644 index 0000000000000..f578d24df5c74 --- /dev/null +++ b/drivers/pwm/pwm-adp5585.c @@ -0,0 +1,215 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * PWM driver for Analog Devices ADP5585 MFD + * + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ADP5585_PWM_CHAN_NUM 1 +#define ADP5585_PWM_FASTEST_PERIOD_NS 2000 +#define ADP5585_PWM_SLOWEST_PERIOD_NS 131070000 + +struct adp5585_pwm_chip { + struct device *parent; + struct mutex lock; + u8 pin_config_val; +}; + +static inline struct adp5585_pwm_chip * +to_adp5585_pwm_chip(struct pwm_chip *chip) +{ + return pwmchip_get_drvdata(chip); +} + +static int adp5585_pwm_reg_read(struct adp5585_pwm_chip *adp5585_pwm, u8 reg, u8 *val) +{ + struct adp5585_dev *adp5585 = dev_get_drvdata(adp5585_pwm->parent); + + return adp5585->read_reg(adp5585, reg, val); +} + +static int adp5585_pwm_reg_write(struct adp5585_pwm_chip *adp5585_pwm, u8 reg, u8 val) +{ + struct adp5585_dev *adp5585 = dev_get_drvdata(adp5585_pwm->parent); + + return adp5585->write_reg(adp5585, reg, val); +} + +static int pwm_adp5585_get_state(struct pwm_chip *chip, struct pwm_device *pwm, + struct pwm_state *state) +{ + struct adp5585_pwm_chip *adp5585_pwm = to_adp5585_pwm_chip(chip); + u32 on, off; + u8 temp; + + /* get period */ + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_PWM_OFFT_LOW, &temp); + off = temp; + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_PWM_OFFT_HIGH, &temp); + off |= temp << 8; + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_PWM_ONT_LOW, &temp); + on = temp; + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_PWM_ONT_HIGH, &temp); + on |= temp << 8; + state->period = (on + off) * NSEC_PER_USEC; + + state->duty_cycle = on; + state->polarity = PWM_POLARITY_NORMAL; + + /* get channel status */ + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_PWM_CFG, &temp); + state->enabled = temp & ADP5585_PWM_CFG_EN; + + return 0; +} + +static int pwm_adp5585_apply(struct pwm_chip *chip, + struct pwm_device *pwm, + const struct pwm_state *state) +{ + struct adp5585_pwm_chip *adp5585_pwm = to_adp5585_pwm_chip(chip); + u32 on, off; + u8 enabled; + int ret; + + if (state->period > ADP5585_PWM_SLOWEST_PERIOD_NS || + state->period < ADP5585_PWM_FASTEST_PERIOD_NS) + return -EINVAL; + + guard(mutex)(&adp5585_pwm->lock); + + /* set on/off cycle*/ + on = DIV_ROUND_CLOSEST_ULL(state->duty_cycle, NSEC_PER_USEC); + off = DIV_ROUND_CLOSEST_ULL((state->period - state->duty_cycle), NSEC_PER_USEC); + + ret = adp5585_pwm_reg_write(adp5585_pwm, ADP5585_PWM_OFFT_LOW, off & ADP5585_REG_MASK); + if (ret) + return ret; + + ret = adp5585_pwm_reg_write(adp5585_pwm, ADP5585_PWM_OFFT_HIGH, + (off >> 8) & ADP5585_REG_MASK); + if (ret) + return ret; + + ret = adp5585_pwm_reg_write(adp5585_pwm, ADP5585_PWM_ONT_LOW, on & ADP5585_REG_MASK); + if (ret) + return ret; + + ret = adp5585_pwm_reg_write(adp5585_pwm, ADP5585_PWM_ONT_HIGH, + (on >> 8) & ADP5585_REG_MASK); + if (ret) + return ret; + + /* enable PWM and set to continuous PWM mode*/ + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_PWM_CFG, &enabled); + if (state->enabled) + ret = adp5585_pwm_reg_write(adp5585_pwm, ADP5585_PWM_CFG, ADP5585_PWM_CFG_EN); + else + ret = adp5585_pwm_reg_write(adp5585_pwm, ADP5585_PWM_CFG, 0); + + return ret; +} + +static int pwm_adp5585_request(struct pwm_chip *chip, struct pwm_device *pwm) +{ + struct adp5585_pwm_chip *adp5585_pwm = to_adp5585_pwm_chip(chip); + u8 reg_cfg; + int ret; + + guard(mutex)(&adp5585_pwm->lock); + + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_PIN_CONFIG_C, &adp5585_pwm->pin_config_val); + reg_cfg = adp5585_pwm->pin_config_val & ~ADP5585_PIN_CONFIG_R3_MASK; + reg_cfg |= ADP5585_PIN_CONFIG_R3_PWM; + ret = adp5585_pwm_reg_write(adp5585_pwm, ADP5585_PIN_CONFIG_C, reg_cfg); + + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_GENERAL_CFG, &adp5585_pwm->pin_config_val); + reg_cfg |= ADP5585_GENERAL_CFG_OSC_EN; + ret = adp5585_pwm_reg_write(adp5585_pwm, ADP5585_GENERAL_CFG, reg_cfg); + + return ret; +} + +static void pwm_adp5585_free(struct pwm_chip *chip, struct pwm_device *pwm) +{ + struct adp5585_pwm_chip *adp5585_pwm = to_adp5585_pwm_chip(chip); + u8 reg_cfg; + + guard(mutex)(&adp5585_pwm->lock); + + adp5585_pwm_reg_read(adp5585_pwm, ADP5585_PIN_CONFIG_C, ®_cfg); + reg_cfg &= ~ADP5585_PIN_CONFIG_R3_MASK; + reg_cfg |= adp5585_pwm->pin_config_val & ADP5585_PIN_CONFIG_R3_MASK; + adp5585_pwm_reg_write(adp5585_pwm, ADP5585_PIN_CONFIG_C, reg_cfg); +} + +static const struct pwm_ops adp5585_pwm_ops = { + .request = pwm_adp5585_request, + .free = pwm_adp5585_free, + .get_state = pwm_adp5585_get_state, + .apply = pwm_adp5585_apply, +}; + +static int adp5585_pwm_probe(struct platform_device *pdev) +{ + struct adp5585_pwm_chip *adp5585_pwm; + struct pwm_chip *chip; + unsigned int npwm = ADP5585_PWM_CHAN_NUM; + int ret; + + chip = devm_pwmchip_alloc(&pdev->dev, npwm, sizeof(*adp5585_pwm)); + if (IS_ERR(chip)) + return PTR_ERR(chip); + + adp5585_pwm = to_adp5585_pwm_chip(chip); + adp5585_pwm->parent = pdev->dev.parent; + + platform_set_drvdata(pdev, adp5585_pwm); + + chip->ops = &adp5585_pwm_ops; + mutex_init(&adp5585_pwm->lock); + + ret = devm_pwmchip_add(&pdev->dev, chip); + if (ret) + dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret); + + return ret; +} + +static void adp5585_pwm_remove(struct platform_device *pdev) +{ + struct pwm_chip *chip = platform_get_drvdata(pdev); + + pwmchip_remove(chip); +} + +static const struct of_device_id adp5585_pwm_of_match[] = { + {.compatible = "adp5585-pwm", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, adp5585_pwm_of_match); + +static struct platform_driver adp5585_pwm_driver = { + .driver = { + .name = "adp5585-pwm", + .of_match_table = adp5585_pwm_of_match, + }, + .probe = adp5585_pwm_probe, + .remove = adp5585_pwm_remove, +}; +module_platform_driver(adp5585_pwm_driver); + +MODULE_AUTHOR("Xiaoning Wang "); +MODULE_DESCRIPTION("ADP5585 PWM Driver"); +MODULE_LICENSE("GPL"); From patchwork Tue Jul 16 19:28:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13734835 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012026.outbound.protection.outlook.com [52.101.66.26]) (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 A8A871A08B2 for ; Tue, 16 Jul 2024 19:29:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158158; cv=fail; b=PT0ZeVe7ZsxJ4cWhuO3e3/xRhtFR1HoJXlEOCZqIfy4GU363SaEN67wB8fBcfIqX8gjDbY3w3bmvhQ7PJo74IZCMHdvUybwNPonVpyl5NivtoN0U5kJ6wpnxJ/gC54DSDthB2rhR3jRzImQZeFsK2h1kLO7NS6XMzf874L/bb1E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158158; c=relaxed/simple; bh=uufbwtMH8Q4FcaHsYoiDpdowRKaQgK3Y3yz2947Q2s4=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=WgkndZFHrjHEe94GmJnbdkrbQNnySD60AmVD6wZMyDbH0rhQDLDiiAW2YKABg0dr1Q1Vxe7N+NTGl97Lm8EE2+tWSGK3ukrJSODdPjhen3YmUU1WlPGcmSXbSF1cagKRXyKMmqtazjA27psKOhiMChnxR5O/+keB5mwE3WwafGY= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=MIkklO6r; arc=fail smtp.client-ip=52.101.66.26 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="MIkklO6r" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=taSngX2xKOG1jCCNCWb+ENN60ye+oiKjzJenkjo292lqvu73nhseJV7okNI2nB4ntU7HtsX0Z6ZdBCdTaC727S1C5vl2liGOsGLloL9BPMkqcACdLdFtDQh5liRWn1BgEqa3p2r/faHb9abnHOakQbRrBsDwXazvYJfngPvZrSeKcaSsy9D808HbXIB8yXFyE7ocbj9CepSgyn/uVwRyqm77b1tps4GQMaSenbCvAfeSxl/fkJa3q2/g+2xoMXn9C9Qi0kvRJEAjsHmhSkGhw5zyUiJTko5qrCKK7xepPe+QrMFRqH1PUBus5xMWfD4ahwimpQbs80YvkfezQ/c3Ig== 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=GUMG4X1O8TFBRzq+Frl5S1x2kYBoqEitLdvdlDy43Ng=; b=kuZ/X0DZ0Vgor5xS4YW3NH3MRcVAVh8eJbL4UiWVJOPGQSiUslnl7n3ZAP4Vjz/ubMZ/FyRYIQ/OgaR+ckt0zpDRrqJoLTyFrK7A0NPzIEy46K25RkudOmGkf4jvhbU5dNWbvqFKn7fmDEnIE5ICQUCMOFbpvM/UngmfMTeUHRIGnWI/poYMhAbxCJtl3purOcItd73wipqEu1O9fF6/udEqe2Vz6OYfNX3Bvo5MRzolQ4O9BicJeAPKSWmJH8thizUoq+thy55y3AcjmvykTkb9rz4/1UTvpN/gifkjoFCAwIr3Sqk+Q1s69hnZeZWsXhSpsBVvdSQqU7CC3pECVw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GUMG4X1O8TFBRzq+Frl5S1x2kYBoqEitLdvdlDy43Ng=; b=MIkklO6rth4+/HWUoLsXSu1Exi3lGVnt2LxlrNODCM+BzHIPBOVn1lntkiuU5ugodTYrZ+euhvYA626ZWopfGQc5PTJW2GSg7KDmYABzmyCwVmoTbRfKzIyDYqtkU/KBJlnbVJJNNpeVRWKJdjhGUXhudaW5iAWS58HHQ87xlMM= 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 VE1PR04MB7325.eurprd04.prod.outlook.com (2603:10a6:800:1af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14; Tue, 16 Jul 2024 19:29:14 +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.7762.027; Tue, 16 Jul 2024 19:29:14 +0000 From: Frank Li Date: Tue, 16 Jul 2024 15:28:28 -0400 Subject: [PATCH 5/6] arm64: dts: imx93-11x11-evk: add adi,adp5585 gpio and pwm Message-Id: <20240716-adi-v1-5-79c0122986e7@nxp.com> References: <20240716-adi-v1-0-79c0122986e7@nxp.com> In-Reply-To: <20240716-adi-v1-0-79c0122986e7@nxp.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1721158123; l=865; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=uufbwtMH8Q4FcaHsYoiDpdowRKaQgK3Y3yz2947Q2s4=; b=lG7oqtHmWcsId33oB9iTm0k58jlm5f2ABLmtxtCik1gNCklvSep1FTPPVD55P332uICHR/lPh i8tZ/HVLdHgCPxqg+jOGmQMPHFMHQJqvc5guEsnNCRj30uPMiPvchI9 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0148.namprd03.prod.outlook.com (2603:10b6:a03:33c::33) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7325:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c986f20-53b7-4112-7066-08dca5cd934d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?YkNyXlUpLAsBno0U4zNql6oNcLk4L+B?= =?utf-8?q?ky+pgt9CzvBFtBoiBggBSpsUvJ83vPEpKITcjShC74KXbB6Yq1r607TeMjgDJj0qL?= =?utf-8?q?plmnU2N1WWbSZ7e/gVLyScElV0q1s6J6y42HQDQMhnCXBXdYla7HPcfexC8jcHeQF?= =?utf-8?q?ZNfwDti8JHtZgwEBBU/E5vqIumog5UWcFHoXHPMQ3UuLi/I6vc5kZUUfD1kZzW7iH?= =?utf-8?q?bb/QITSOLGbF0RHNcEtm92s5mAXdKlC+rmTK1gAb52Smn6PuWZQfpFNJs/305nm7v?= =?utf-8?q?7uzmb6Xmc0a52i6iBbjMl/7oAOACQWxWAzH72m/jjB6GgxcoEQ5NSWoox/X5iZmBa?= =?utf-8?q?EdmMG2xtIb6OusaHkkiwYQO79EJz5b6qeOockZgRJ6ZM6ALX4JaDSteGNofuzD0ot?= =?utf-8?q?DdZ1Bu8oThAxlzqxpldr8onkIkIRu2s8UWtRmgHnnhI/vDHd3SPyIrrqolrtHVMqB?= =?utf-8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?utf-8?q?WXD4ItRguiaYvauiW7bqs+pDZ1zi+X3G/e/5LkPgoxuSEmxLGf96AV0=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)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?2YRr0zoBdYrslQrVCnerw/eJY8rh?= =?utf-8?q?/nzgXvCPUjBgkCrow3yISlKOv2A2pNwsRVpGKuwGVx9Dbq6daeL6WKUqQPLz2K5K5?= =?utf-8?q?qK2ylRq8xw05TOQexhGLXIyTgpsxUiL0rITYwZ7FHvt0PcFCu/A4v0CeQXuiqzewP?= =?utf-8?q?O52XGjY2WiX05IW5nI/Y0LlVwUbJON/6jxWk3G724SDsMrC7xZqG7kqhJgmlB4GF7?= =?utf-8?q?covn71PZnA5/Qx9NX+GQT/Gg8hJfXe+O2eBO/mrM8BeaHsL1wTFDFr4i62AHNdOqn?= =?utf-8?q?M2ETkO30YdTjmo2fYmgVDsyxFknqBmV+gkZUSIRjp2ZQ7qxN+OBC3rZojXZeonvbS?= =?utf-8?q?68RvNu93cWaUC2iGaENdvEVTC5Gxc1ZE+sc2RqNZTWtEwTAvijtdkxXuHi14zUj/O?= =?utf-8?q?k4iHyavPcp5W5Uo+Gl4D7ooMIfMtpCdPlaCeftNtP6o1RfpI7tpR/sJxs1886IL0F?= =?utf-8?q?NTvstsq5tYbOzzo3V8y2Cg4ty5s2zMTHGlTrBmmE19Zm2Da7INCDHwb/DFXo6Ogmc?= =?utf-8?q?HWkGjFHQZm/K0GX6dURd+QhhCIA3ss9h9ZUkM9vPme5/ydPhfdjoj7BbO1mLYQ0SB?= =?utf-8?q?n33tbUVHvTtriplebcAL/RkyDkkK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mmbv6C0iiKgtvvpcbQmzONQloXvntf3Ltk=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c986f20-53b7-4112-7066-08dca5cd934d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 19:29:13.9302 (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: 0XBuE8ZrYsjsLtNUGO63mwGTL/fBlIFNY1MZ4Zu5MEzw+jVZdLzz5D5QZcQuR2xxDxV4XZvVR+vG75f0frAA5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7325 Add adi,adp5585 gpio and pwm for imx93-11x11-evk board. Signed-off-by: Frank Li --- arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts index a15987f49e8d6..6bfb90f4da63a 100644 --- a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts @@ -241,6 +241,22 @@ ldo5: LDO5 { }; }; }; + + adp5585: mfd@34 { + compatible = "adi,adp5585"; + reg = <0x34>; + + adp5585gpio: gpio { + compatible = "adp5585-gpio"; + gpio-controller; + #gpio-cells = <2>; + }; + + adp5585pwm: pwm { + compatible = "adp5585-pwm"; + #pwm-cells = <3>; + }; + }; }; &lpi2c3 { From patchwork Tue Jul 16 19:28:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13734836 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011048.outbound.protection.outlook.com [52.101.70.48]) (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 41C131A08C3 for ; Tue, 16 Jul 2024 19:29:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158163; cv=fail; b=G5yReD4AnL1SaywWlVfaSJEsCQ9gQyx28crRBUoGl3D6eY3byDrfNtcLuw5gBaBS3q4uJrpDQrlydGsWKVaaYr2Gd4TNBkO2A4PUWqUri2BBgjWAL9IjLSa8faDVGh9imXDBtK1clf1CFlRubGU679ors6JfWvc3SWMm8bdhR0s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721158163; c=relaxed/simple; bh=fB3KWOR9qVEj3neL/LeJEso6Ca2a7qbn0iJ12IBTwRw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=sjylJOp/sk5wSmN+t+NwUQvKTvGa1ux6DG8LS5656//pmswqXqAzeJCZfMwUV1PIgCnBg22GukgIUv1HVmS4hJlx86afQPulfMASkdfNXQ+4+eyzGxxW78NrTNO7Ja2c/kmzv4I6VxB5CN5R6sWwFkadCkodCfJOkGylicOcVdw= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=HnLNJFCJ; arc=fail smtp.client-ip=52.101.70.48 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="HnLNJFCJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=locObgZswZRSSSPMUJxQC/e9y18ai2VPOl5LfH2+igixANry3specEU2iEjY55ybwT+gzg+x/2CNCaOqWyLG+MeqzI3sRovoug/EaulyMuWp5kw1SDjmrePwcAsB9KxGEKlfXPOIRpNafikDD5RqGOFXbZuYRpOyYMnjNF+vC6/LKvV7fpIucnwBuEYewNRzpIb+rDikK7aVzp7inRx+dr10zsq9hXMY+Cvz5i6U6l1HTep1MOh4VWIwUcaZl5OJW4ssT7WrZvO2u4z5mbvxXSFjc2I43f9HNAdRzNLLoeurXCz97buAUj4ciedhXxzMC6Jz4zj3Uaiqh8rCQ8nArw== 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=mV4gpTwO1BX7D0VuhCO5AV4PaS9O/XtK6hGNoMOui3I=; b=K65o6FlH/xWPHb698pE3n8Bu7sqGmTL6glkDroZE2FU06ZceoQInIP9h4EHF85ftv+RDVgzXw41K+vMg6/psQWLO8wt79tZwG0mYWCadfv1FbnVvJlPWSXBkjMht4F7ePUuSzB1H8V82DxwJvCiJVcXjRRb2GMa6Eiigu82skdMTwRXICExt4g2/ISv408/OrQi/+t6b2pFywhBYEmhqZQ9xAM13YLlzp6vSop1atyO7TEusa2ylxIteZEJKAvrYFiMSzS+QFsD2Ttue1CgaNDnk7TJOsTMDy73oEngHsjAqJc0Q34ektn/vl8sUJL/C/j7HwRb1enL4AAC+p67PAg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mV4gpTwO1BX7D0VuhCO5AV4PaS9O/XtK6hGNoMOui3I=; b=HnLNJFCJcI2i9thchmTQRap6zKw48WKHFMjUfPBM1Fbbxnfgr/K8gMav8hmNFDsnZXFfuZpmSzzTkIEBakGbf+GH32+U5B87iUt03jjDRQlgoLK9xI6eOXHWt/3CzOkb0cH/6usNlQqA7ZYY6MVRT4MZkVzPumSLtchuxNpQ+ho= 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 VE1PR04MB7325.eurprd04.prod.outlook.com (2603:10a6:800:1af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14; Tue, 16 Jul 2024 19:29:18 +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.7762.027; Tue, 16 Jul 2024 19:29:18 +0000 From: Frank Li Date: Tue, 16 Jul 2024 15:28:29 -0400 Subject: [PATCH 6/6] arm64: dts: imx95-19x19-evk: add i2c2 and adi,adp5585 Message-Id: <20240716-adi-v1-6-79c0122986e7@nxp.com> References: <20240716-adi-v1-0-79c0122986e7@nxp.com> In-Reply-To: <20240716-adi-v1-0-79c0122986e7@nxp.com> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bartosz Golaszewski , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1721158123; l=1437; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=fB3KWOR9qVEj3neL/LeJEso6Ca2a7qbn0iJ12IBTwRw=; b=rfaaYgoalQNrbpVG4kUzRkVGTEO/SxNZ7H+ptYb/9MiHnC+OUjdiShJD40VYsFB/qVqpDMbNn RCxoZ7GORx8CRuoWdQ5rdc5njzLoMobyWNpYegxkJdV1PjFUZX6T680 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0148.namprd03.prod.outlook.com (2603:10b6:a03:33c::33) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7325:EE_ X-MS-Office365-Filtering-Correlation-Id: d6c16ad0-7883-407c-c9ae-08dca5cd962e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?GDIE/FI7+6umNXg/4AFUEZxR6jVqPtX?= =?utf-8?q?nxhtfbzQS5KX25RdWWT4TTZY+3XzleZlGzLWFXCjOR4Kn0beZZkHaKOy9m6K9PM5p?= =?utf-8?q?5usgFkAmZ1WZwZak7A8PA6ipK9BdTcMan5Kypx3lBsbA+z+SW1p7P1E3utrX2F2MQ?= =?utf-8?q?PVoNVD8809M+4UeiS/uEa1nJde8dy91f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M4DHcdsnpIs2UpOIHXsz4l00DGbNgLiZG?= =?utf-8?q?/8GeflEq7NfzrmGxVrYWNp7cG8b2dCqEAv0bq5zWBlebnXi8syBseGVvwxmvjjvFv?= =?utf-8?q?pfISAu6QA/Rrl3Ms/IYiF4g04K6Ff4D2qrUKbY+qHoyWVisopbfPjOMF4EKihzsl6?= =?utf-8?q?xI8R7PpLUAUYysDl77tLk1aG9ZceNNUQfw+CdQocrhsTMdYUNXy6G+v0I8WmPmriv?= =?utf-8?q?4es3tgqYgrFlGQBqfE3sRTTfibMeuXL2w/BdVdDNcpauV80LhohOVu8KxGL+sAPYJ?= =?utf-8?q?PiWMG0jCsQMoALBygFUIMCk3Nzv6XMNjopNpK6XmSy/ivwAQ93yuyAA=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)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?FP6Fz8lWl/JP1hpObLW2NX1c2qLm?= =?utf-8?q?hL4CjiTtZoL0BbQqJawPivgZiqf7PDVUi8nFZ14+BkqdzWJr8nQvP0HAEgxXTnkTW?= =?utf-8?q?KKpRcgBarfwYNyi0BguankC+zE3nS+5v4Ak6wmXSC+U6ZNdl+e5dV2OXfVRD0L9Xo?= =?utf-8?q?9WlFZHrK0oqwc0z1dhgY5l1mzv1s8plC/fru/esIlz4ZTZZOoaVS9772J07BOlq4T?= =?utf-8?q?46uWgYoNwtrRuSP9g0nQRSnPxzNe2psgOV8C3CwEBxM5BG1Olf2m2yOzFI/R1DIVe?= =?utf-8?q?xsRTxHHspTKYwGuJlEqkQuB0wnQWVIklNjl3p4fqZBxJAiRlML1903SEX6/Y6YZSK?= =?utf-8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=?utf-8?q?oRxSEWkUVX0TAS+rp5K3Fvaj/wo6g2HjTgNbS9K0gLWOO+IslarL51NDvyDsea5QN?= =?utf-8?q?brgB9Dc9LsxAoZ1QueP4UKeWrq3GGCTG5vHPdLINwbHb/AwxdaK3BYpcSNkxpe/fN?= =?utf-8?q?/Lrs4gv05rD82V6qtDpEual6MJlC1v+3GEZa4WVSUl0IgDclCo0bssznY50l0gCjX?= =?utf-8?q?FOlvqJewzk38C3hyZDIlDBgNEyIg72b9wae4lv9T3SwWReiIyclBWf0fboKAe7vPB?= =?utf-8?q?XgISWGq297Y8AML6LHYxdpqPBEcsBQi7ztCTB/J+XI2N50g1g2/+Zb8w=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6c16ad0-7883-407c-c9ae-08dca5cd962e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 19:29:18.7115 (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: U43SIJB8SeFIl1zzIf+L1GByPGj6WGUOW4ithFD1m3g9+tCokRhflIo5MVopUUzdgHTk09UILaeqIhakEMn3kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7325 Add adi,adp5585 gpio and pwm for imx95-19x19-evk board. Signed-off-by: Frank Li --- arch/arm64/boot/dts/freescale/imx95-19x19-evk.dts | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx95-19x19-evk.dts b/arch/arm64/boot/dts/freescale/imx95-19x19-evk.dts index d14a54ab4fd47..8c52fec79535f 100644 --- a/arch/arm64/boot/dts/freescale/imx95-19x19-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx95-19x19-evk.dts @@ -81,6 +81,29 @@ reg_usdhc2_vmmc: regulator-usdhc2 { }; }; +&lpi2c2 { + clock-frequency = <400000>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_lpi2c2>; + status = "okay"; + + adp5585: mfd@34 { + compatible = "adi,adp5585"; + reg = <0x34>; + + adp5585gpio: gpio-adp5585 { + compatible = "adp5585-gpio"; + gpio-controller; + #gpio-cells = <2>; + }; + + adp5585pwm: pwm-adp5585 { + compatible = "adp5585-pwm"; + #pwm-cells = <3>; + }; + }; +}; + &lpi2c7 { clock-frequency = <1000000>; pinctrl-names = "default"; @@ -159,6 +182,13 @@ &wdog3 { }; &scmi_iomuxc { + pinctrl_lpi2c2: lpi2c2grp { + fsl,pins = < + IMX95_PAD_I2C2_SCL__AONMIX_TOP_LPI2C2_SCL 0x40000b9e + IMX95_PAD_I2C2_SDA__AONMIX_TOP_LPI2C2_SDA 0x40000b9e + >; + }; + pinctrl_i2c7_pcal6524: i2c7pcal6524grp { fsl,pins = < IMX95_PAD_GPIO_IO36__GPIO5_IO_BIT16 0x31e