From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B7D8CD98E1 for ; Mon, 15 Jun 2026 16:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ADPK6n0GVxo/ZPbJHgmTdgmMhhUS9Ja78x9rBrhogys=; b=VFQFNmZlXcpln1 W34YjiQXfOk+ST1b9bJyG2TN/8ogIysLyXegvOo/MbW3QCd6BuZkXI3ZVxVPnawUxTW1X0/kWEXon KQWxXa1x1v140CM8nxgXUEZa0MnntghBd9AwB1JQcZRvmLIE1NV1S0OmJtZ16JsI/4aGV6pqoKrGo gfjoCjm7s3QTEslYIE6rFVEyh8ciBiB2Gr1UdxEDdiustFrXLUgVdauH+GP4PKR0UbLxCEUi3V2Ow HFc7jAJa82l+LEB+Zb2SC3rFb7Gcnid62Z8sHkQ7ZQ6U1WLTcjFoRtrTd18d0vdyyzQldrxXmzHug IoWEwilkgaQBU9A/4VQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wZ9wf-0000000EYb5-1Cdb; Mon, 15 Jun 2026 16:13:53 +0000 Received: from mail-bjschn02on20723.outbound.protection.partner.outlook.cn ([2406:e500:4440:2::723] helo=CHN02-BJS-obe.outbound.protection.partner.outlook.cn) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wZ9wc-0000000EYYv-2XXe for linux-riscv@lists.infradead.org; Mon, 15 Jun 2026 16:13:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L+AoGWH1O2ry7jHnZFKQ7n3N29tuIllUuTW78OMoJuWy8sbXN735hnO+f2KvzKzIhueCf0Kb1ZT1Kvs+VcRrx1rSx/+6N5R0DqPUAUDEZsEzWoG0Rg10RceDYfXw8X9Fbtse2tLvGtdsKdda/IH23VJd6r4Dmc3Z0xW1xzd0poKABMTcsBkTDr0L5peuFVNToZcmmFDGO1GyRwyvPDphUFk/8SuIRmXoHbHwMnJHvmkP8TFbRyt3NLZ5iJ1zB7tHPyThHDR9/pYJsAlBLabPfVCShqt3u0ywak9ciw6MaDR3l8+UYM3zYD/k1f0hCIvPrxLoRcZ8mKvNjjqLQJtuPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WwPyaAmZNKxEweQBz5hloUliHo67YernfyFmIqA9r2g=; b=IO1XUZ3ErJLAM+i8N3WLV/pQ6XQoMErSCtyVEBpPd0kaxSGSxQ2PIGOSG3jupsDDctyqO76IHQ3qkn+KIPZLfEOsp2K5lVfqxVIHOXDplx6eeG4apK/QYko5xxPM/cZ+kmK11vtmY6vprMszN/VTG9AC0gKQCXUnE5WwzKAQMcFcylbBxhOiYJFwY6j9Pc5Zge35FPF7KbBTZ1XuigpIQljQNvb1BeRlEvgB1h8YTyGgrjjCBSHUPgYNM5I5VoppcP8GYY0x2fcrPXHVJmkFyHdC9FiwZxJDrRN3XN6e2gcspm4JKxVxwhZ+5OBT0pvkOK3BgMkBi7IofZLobrN+Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) by ZQ2PR01MB1321.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.113.18; Mon, 15 Jun 2026 15:58:06 +0000 Received: from ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::4386:5cc4:3bc4:4795]) by ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn ([fe80::4386:5cc4:3bc4:4795%3]) with mapi id 15.21.0113.015; Mon, 15 Jun 2026 15:58:06 +0000 From: Hal Feng To: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Palmer Dabbelt , Paul Walmsley , Albert Ou Cc: Hal Feng , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v19 0/3] Add OpenCores PTC PWM support Date: Mon, 15 Jun 2026 23:57:56 +0800 Message-ID: <20260615155759.129210-1-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.43.2 X-ClientProxiedBy: BJXPR01CA0065.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:12::32) To ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:7::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZQ2PR01MB1307:EE_|ZQ2PR01MB1321:EE_ X-MS-Office365-Filtering-Correlation-Id: 24b8424f-4c39-4bbd-ad24-08decaf6e3b8 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|52116014|376014|23010399003|38350700014|18002099003|56012099006; X-Microsoft-Antispam-Message-Info: J9S3YCcVbH2+k9WsZLykQrmSgJGuqZgZJjQu1GEUuoZdrqtLx4htLyNBlefsHpI56Uw3qE2KnYAn2lk/BFfcZNllrVWistHQdJRCAYnJw0gDaAQro8IJAO4qWLMpwi8myfPgDsqenjwgaxp0eZNqhwN07DUUvuA88vT8x7KbPPZPYojidy1dxh7Vi0PejLYgZ6EpVJDUhrT8STEql6Y7UwCExOr0CYTtALO/2dJbqNw9gLYVhVM1R8xTqAdm662YHTS3TM28KX58hvvTi6VCrGJbxqTDZTPju+YePro4YwreF7DrmHPm60TyFoxMz5Px8ym7aab8dZ/EP++yUfFGdLIiG9BUEP7KA6Bbn5Eg0KVI9vqJ41xl234gEHXcAZnEIFk8JDlBc4UtShGcSShNwFvPRq/loUO4G2YsEKwC+OFibg9/pNGngQVlz5zSS0S9ety/rS9YNBW3wWdjOP/Bc9d2RfD9807raR1Egm1ncUuDhq8m2hPkBW5L49UcNRo1I89/Ch10p4ouISHY6IshGdKzJLs1bfRMLvDkxBv1iXkdJxDYPMyRICGFl9lW61Hw X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(7416014)(52116014)(376014)(23010399003)(38350700014)(18002099003)(56012099006);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GS58SaXA89PbKpKmFiaY2UAbBEKB4a/QEtVXTBfYPgiG62TneW8AjWhvA8oB?= =?us-ascii?Q?5W9C+JfUUkUh20ac2E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ascii?Q?PfKk24MpCf0ns10Pa1L+LvwO9uy4zAKgWItR5OoWESJFST3BaMAd2rkUT0Dn?= =?us-ascii?Q?01ea0MtuCGIvy+qPibG2mEIpRIbwlgMjwmeGGKUzIteXthmV/FZ4a6FvWt9N?= =?us-ascii?Q?RuI8PewVwN+rXwl/oBRRktS3mSft6NBNXjo83esr1PYw0quzLyK0vTSBU6rP?= =?us-ascii?Q?p1ZSaXY/eUbQbGhXH/5SSDGAbLuXbsJ96NJi3CJjPDT+JxhEDk0oT0VqMRTG?= =?us-ascii?Q?s3Je6zAPXrEleBOKS6w2XCAyHnqlXYzQFcaE09VTHpJrPIZwzZzd7IqQicd0?= =?us-ascii?Q?BtaSnoj9i6ySwmS6KCzvewrZNu11uXMYeCOOtu3iPCBf0uW5rz1D/L1kOXbl?= =?us-ascii?Q?EpVUJbcEV1IMq+PA/UBzlgFhDyrCWqbaMgCwau4nXQjTL4pTWYDtjZbhn7HT?= =?us-ascii?Q?ppjiDxF9xF1FILD+WlQnOYJaGSDZQJm4xpBrE+GFlM/jxYJtwxrC/MiCGm6y?= =?us-ascii?Q?U8JFLMjeAeN0IJaa6E8869WVgpgTxyaDMxOllxq0BTXpNfZoukb5B+hrusg6?= =?us-ascii?Q?wNewrSqYRsuCtB19Ubrp3PHzLht3gNi+VFGI1KkNBi8+S5iFzOifqwU6DtKK?= =?us-ascii?Q?G2GKa0l63kCWEcPXvW7/8/RhGnuhxMrmgztbRnDICU7POV+CunE/43tjZCU2?= =?us-ascii?Q?J4+Cpm65ABwPw+emMwXx+UkAAebQlIMN8Kjmm4dh6tWI5I01EFpKoyN1/nyD?= =?us-ascii?Q?c+EaglWwy9dv5UPB4R779OfhXuwqO2iaYc/JrRUylDVrdzZYwHhOe5L9ZsXE?= =?us-ascii?Q?inIT1aGeduDYIO+pCDyM5Hq+VaAk5P0=3D?= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24b8424f-4c39-4bbd-ad24-08decaf6e3b8 X-MS-Exchange-CrossTenant-AuthSource: ZQ2PR01MB1307.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2026 15:58:06.5804 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oOFS7nYfVzy0IQ79UdKGiiY/ATUmwm/yAh2h8MlPmiwNOJ2O5lN+3k/lii3rAngQA9RxmrijjDK8cGuKEaVt3TMVFelkaow+KcKqxyt0AWw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ2PR01MB1321 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260615_091350_642315_D6D030F3 X-CRM114-Status: GOOD ( 11.90 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add OpenCores PTC PWM driver which is used in StarFive JH7100/JH7110/JHB100 SoC. I will maintain this pwm module in place of William. Changes since v18: - Address Sashiko AI review comments for the OpenCores PWM driver. - Fix runtime PM usage count handling on probe, error paths, PWM release and driver teardown. - Reject period or duty cycle values below the hardware minimum. - Restore PWM registers across system sleep resume. - Return the real error from devm_pwmchip_alloc(). - Preserve bootloader-configured PWM state during probe and keep runtime PM active if the PWM is already enabled. - Use synchronous runtime PM put before possible teardown. Changes since v17: - Simplify the code. Make it more readable. - Restructure the driver to register the pwm chip for one pwm channel, because each OpenCores PTC IP core only supports one PWM channel. Drop starfive compatibles. Add patches to fix the dt-bindings and device tree. - Support runtime pm and system sleep pm. - Disable the pwm module and reset the pwm counter before updating the period and duty cycle. - Improve the descriptions. - Update the dt-bindings maintainer to Hal Feng. History: v18: https://lore.kernel.org/all/20260515054723.25024-1-hal.feng@starfivetech.com/ v17: https://lore.kernel.org/all/20250106103540.10079-1-william.qiu@starfivetech.com/ Hal Feng (3): dt-bindings: pwm: opencores: Update compatibles, examples and maintainers riscv: dts: starfive: Correct pwm nodes pwm: Add OpenCores PTC PWM driver .../bindings/pwm/opencores,pwm.yaml | 16 +- MAINTAINERS | 6 + .../boot/dts/starfive/jh7100-common.dtsi | 28 +- arch/riscv/boot/dts/starfive/jh7100.dtsi | 67 +++- .../boot/dts/starfive/jh7110-common.dtsi | 27 +- .../boot/dts/starfive/jh7110-milkv-mars.dts | 6 +- .../dts/starfive/jh7110-milkv-marscm.dtsi | 6 +- .../dts/starfive/jh7110-pine64-star64.dts | 6 +- .../jh7110-starfive-visionfive-2-lite.dtsi | 6 +- .../jh7110-starfive-visionfive-2.dtsi | 6 +- arch/riscv/boot/dts/starfive/jh7110.dtsi | 67 +++- drivers/pwm/Kconfig | 12 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-ocores.c | 312 ++++++++++++++++++ 14 files changed, 538 insertions(+), 28 deletions(-) create mode 100644 drivers/pwm/pwm-ocores.c base-commit: 95e56f0f293ef797123eb032f78f5b5d56a035a6 -- 2.43.2 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv