From patchwork Tue Jun 10 19:47:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Kayode via B4 Relay X-Patchwork-Id: 895419 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EC031264A9D; Tue, 10 Jun 2025 19:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749584887; cv=none; b=qJxjklGWUPWzM8ebI9xiw/Okfg0s0IwOqKBR5ZgyGKaoAuhLz7kl0QOFdsqVb7rkIcJBfEuG3RJFJnZ+iR9RX3OxzUevPGIMwHLn3T0hDsn+hHscKmhnmEMVLCLhBniYtKIW4OE3U24jxYXwWfLpeMPDmTIlFDcSjzW4gAkhEx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749584887; c=relaxed/simple; bh=TltlaAcSK2n9anlvrWgSMS3gsD6Tu13DXNeDNWEr41A=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=Z1NXahchRxl06XAU2D2AEB311qM0DkS9haV96RoztHqPvqb9Jrxd5hTkUgM87ZV3hmsIifrZsNw702aZ0Cjue/YKLbhqahOixlnysbinJ0dz5Czch1yzFGQ0VeR+/J0JOOZDoSP9g5/btJJTtf9DEYCRk+21/ZJ1yEfN83uyK4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c7ZDlY+/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c7ZDlY+/" Received: by smtp.kernel.org (Postfix) with ESMTPS id 71EBDC4CEF0; Tue, 10 Jun 2025 19:48:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749584886; bh=TltlaAcSK2n9anlvrWgSMS3gsD6Tu13DXNeDNWEr41A=; h=From:Subject:Date:To:Cc:Reply-To:From; b=c7ZDlY+/qFo01ekXlduitqC/GIeKEwVxS8hBX+F3YYdzdaxEIKsX7vt5Ft1DP2iCz Hn31t33kMIbvjXQTw16EPB2eVrXMFdgjXBomQnK9Sxs5RE1kDPRUJolXH9Zsytt+Du T4SvIVQ4SI7hog0zO+KbMGDW/6GmtTbJ2dmxkJPp3mPYufq8UYS5EyqsGFB9JOOd16 LyrYPnKcTkDEqFVhXWjrwTVpLKgw5JaCCuhO+vjvPzkNhlMNw5nuLXEOrLlSozBVm4 sUFceXSggJJf2/5pROg72fP+TBGQOXJ0py//+QFA/ztknAu0u1RKSktsOJUtX9Yh9Z 0nDLikqEciqXA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F916C61DB2; Tue, 10 Jun 2025 19:48:06 +0000 (UTC) From: Samuel Kayode via B4 Relay Subject: [PATCH v5 0/6] add support for pf1550 PMIC MFD-based drivers Date: Tue, 10 Jun 2025 15:47:28 -0400 Message-Id: <20250610-pf1550-v5-0-ed0d9e3aaac7@savoirfairelinux.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANCLSGgC/3XOQQrCMBAF0KuUrI1M2kyrXXkPcdEmEx3QtiY1K NK7G1tQEFz+4fP+PEUgzxREnT2Fp8iB+y4FXGXCnJruSJJtyiKHHAHzSg5OIYK0GpQDC1W7AZH KgyfH9xnaH5bs6XpL3rgcRdsEkqa/XHiss1iuFYp38cRh7P1jfiAWc/N3KxYSpEZXbjUWxqLah Sb27F3Dns7c3e7r5M5a1F+hhOIj6CS0zjpURLg15o8wTdMLwqTIIhIBAAA= X-Change-ID: 20250527-pf1550-d401f0d07b80 To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown , Dmitry Torokhov , Sebastian Reichel Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-pm@vger.kernel.org, Abel Vesa , Abel Vesa , Robin Gong , Robin Gong , Enric Balletbo i Serra , Samuel Kayode , Abel Vesa , Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1749584885; l=5150; i=samuel.kayode@savoirfairelinux.com; s=20250527; h=from:subject:message-id; bh=TltlaAcSK2n9anlvrWgSMS3gsD6Tu13DXNeDNWEr41A=; b=RaaBxCelwqzwSwRF30SQQbsElM16NZvYsRXWD4c2cf/4plyujBa2OpbnoasBge+ynRBOjqTM9 8/oHShqXwIzADCxGnOurEOOXdajlV2fs69jF3sS+Fm5YWYXHFlKyBIj X-Developer-Key: i=samuel.kayode@savoirfairelinux.com; a=ed25519; pk=TPSQGQ5kywnnPyGs0EQqLajLFbdDu17ahXz8/gxMfio= X-Endpoint-Received: by B4 Relay for samuel.kayode@savoirfairelinux.com/20250527 with auth_id=412 X-Original-From: Samuel Kayode Reply-To: samuel.kayode@savoirfairelinux.com This series adds support for pf1550 PMIC. It provides the core mfd driver and a set of three sub-drivers for the regulator, power supply and input subsystems. Patch 1 adds the DT binding document for the PMIC. Patches 2-5 adds the pertinent drivers. Last patch adds a MAINTAINERS entry for the drivers. Changes since v1: - DT bindings for all devices included - Add onkey driver - Add driver for the regulators - Ensure charger is activated as some variants have it off by default - Update mfd and charger driver per feedback from eballetbo@gmail.com - Add myself as maintainer for these drivers - Link to v1: https://lore.kernel.org/1523974819-8711-1-git-send-email-abel.vesa@nxp.com/ Changes since v2: - Rebase on recent mainline kernel v6.15 - Single yaml file containing dt bindings for all pf1550 devices - irq mapping done in MFD driver as suggested by Dmitry Torokhov - Drop unnecessary includes in drivers - Replace dev_err with dev_err_probe in probe method of drivers - Drop compatible string from drivers of the sub-devices - Remove dependency on OF from drivers of the sub-devices - onkey: move driver from input/keyboard into input/misc - onkey: remove dependency on OF - onkey: use onkey virqs instead of central irq - onkey: fix integer overflow for regmap_write when unmasking interrupts during pf1550_onkey_resume - charger: add support for monitored-battery which is used in setting a constant voltage for the charger. - Address other feedback from Dmitry Torokhov and Krzysztof Kozlowski - Link to v2: https://lore.kernel.org/cover.1747409892.git.samuel.kayode@savoirfairelinux.com/ Changes since v3: - Update manufacturer from Freescale to NXP in compatible, dt-binding and Kconfigs - Use C++ style comments for SPDX license in .c code - Add portions copyright to source code - irqs are defined as struct resource in mfd cell such that platform_get_irq is used in the sub-devices - Make struct pf1550_dev of type const in sub-device driver - irq variable dropped from sub-device driver struct - EXPORT_SYMBOL of global pf1550_read_otp function for use in regulator driver - Drop unneeded info in driver_data when defining device table id - regulator: validate ramp_delay - regulator: report overcurrent and over temperature events - onkey: drop unnecessary keycode variable - onkey: change wakeup variable to type bool - onkey: replace (error < 0) with error in if statement when possible - onkey: use pm_sleep_ptr when defining driver.pm - charger: finish handling of some interrupts in threaded irq handler - Link to v3: https://lore.kernel.org/20250527-pf1550-v3-0-45f69453cd51@savoirfairelinux.com/ Changes since v4: - Use top level interrupt to minimize number of registers checked on each interrupt - Fix bad offset for temperature interrupts of regulator irq chip - Address Krzysztof's comments for dt-binding - regulator: add comments to clarify difference in its interrupts - regulator: issue warn event for _LS interrupt and error event for _HS interrupt - regulator: validate maximum and minimum ramp_delay - charger: drop lock in battery and charger delayed_work - charger: more conservative locking for vbus delayed_work - charger: apply lock when setting power_supply type during register intialization - Link to v4: https://lore.kernel.org/r/20250603-pf1550-v4-0-bfdf51ee59cc@savoirfairelinux.com Signed-off-by: Samuel Kayode Reviewed-by: Mark Brown --- Samuel Kayode (6): dt-bindings: mfd: add pf1550 mfd: pf1550: add core mfd driver regulator: pf1550: add support for regulator input: pf1550: add onkey support power: supply: pf1550: add battery charger support MAINTAINERS: add an entry for pf1550 mfd driver .../devicetree/bindings/mfd/nxp,pf1550.yaml | 137 +++++ MAINTAINERS | 10 + drivers/input/misc/Kconfig | 11 + drivers/input/misc/Makefile | 1 + drivers/input/misc/pf1550-onkey.c | 183 ++++++ drivers/mfd/Kconfig | 14 + drivers/mfd/Makefile | 2 + drivers/mfd/pf1550.c | 335 +++++++++++ drivers/power/supply/Kconfig | 11 + drivers/power/supply/Makefile | 1 + drivers/power/supply/pf1550-charger.c | 645 +++++++++++++++++++++ drivers/regulator/Kconfig | 9 + drivers/regulator/Makefile | 1 + drivers/regulator/pf1550-regulator.c | 366 ++++++++++++ include/linux/mfd/pf1550.h | 259 +++++++++ 15 files changed, 1985 insertions(+) --- base-commit: 0a4b866d08c6adaea2f4592d31edac6deeb4dcbd change-id: 20250527-pf1550-d401f0d07b80 Best regards,