From patchwork Thu May 11 09:51:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Panis X-Patchwork-Id: 681426 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85B4DC7EE2E for ; Thu, 11 May 2023 09:52:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237766AbjEKJwP (ORCPT ); Thu, 11 May 2023 05:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237774AbjEKJwK (ORCPT ); Thu, 11 May 2023 05:52:10 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CA3CA5E9 for ; Thu, 11 May 2023 02:51:36 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f42ba32e24so20949905e9.3 for ; Thu, 11 May 2023 02:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1683798695; x=1686390695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0OHd/V9Ix4o33YMmir4Y9clMG7lYBUHKDvAJeO5aW44=; b=B6QERsOmhTB/wzEMH4e7XD+W3iD3EdMaDAw30pwoi0gK8fs2UOO19yomXKtZcXF1eR auoqQZmATFHFuoTdIvBsFQeXIfrr4td0MgkKOGlaEOVI4/mL8inA0EnkUbKg7AKLCj9c XYC4IfMofM9NMMkyKLGwUElAiUs5ClFvpcLSzhoNCz1jNS/6gGVO3CiAc3JCZXRVrDe1 YxHV02mxevTnL8eHYuDu1rJlFhLIXT6TbUkadj5PvM9jQKeVUaAtW3fAQQp+rrriIRIJ ANBshwpI3tapk7D98jxHVL0Kt8ZVFcX6bk9VkWrkGQBKNv6X/N6U8rOEJx6MWQq0YhtX Amlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683798695; x=1686390695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0OHd/V9Ix4o33YMmir4Y9clMG7lYBUHKDvAJeO5aW44=; b=RSLFNLOI4KD2OHUYsJhbpnFHHjCNLI4agx7KV+whNbCKGgN/QmL3Sq/Q/Phs2x1gFt gJHIbWXrCyf50cLXTZF+aC8ZETk9Mf0uGkBjeERgevsqDpSSFIKSL/zLYTQNwD0XTsbr GzBz2KxZct0QlnwGjAxEbyLsPXR0TCs7G0l9R6BHAgnwfcGphKzcyrAYr6wE5EPX4IRt p6YpeS69U22xCW/Lv6+3wjotxsniShvO7lpXQcpXL6KrBRZPVFuEMDSCboFBZeQmdwjM JRzsXTO9R0rc4eN789VHEP3uLRfkfTq+/Hx2hQtRhVYvxwxVT1cm7qTfcTeysF1WbQwR yOQg== X-Gm-Message-State: AC+VfDzOLidBfWkKsxCz97eYPBoHGBoomjKDUyMcl6ycwbWHvZOV4W93 9t2l6DEuIhe0cHeddZ/dWG20cQ== X-Google-Smtp-Source: ACHHUZ7b+A9M13qv/yT2hJDG79tnQl/QEB7u0rYsAjJ7HKLv20UVPzWKTFn1gusLVVxmozjX2cbLzw== X-Received: by 2002:a7b:cb07:0:b0:3f1:7129:6b25 with SMTP id u7-20020a7bcb07000000b003f171296b25mr14539363wmj.18.1683798694748; Thu, 11 May 2023 02:51:34 -0700 (PDT) Received: from baylibre-ThinkPad-T14s-Gen-2i.. (120.205.87.79.rev.sfr.net. [79.87.205.120]) by smtp.gmail.com with ESMTPSA id z9-20020a05600c114900b003f4069417absm22389956wmz.24.2023.05.11.02.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 02:51:34 -0700 (PDT) From: Julien Panis To: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, corbet@lwn.net, arnd@arndb.de, gregkh@linuxfoundation.org, derek.kiernan@xilinx.com, dragan.cvetic@xilinx.com Cc: macro@orcam.me.uk, baolu.lu@linux.intel.com, yi.l.liu@intel.com, jirislaby@kernel.org, rostedt@goodmis.org, revest@chromium.org, gehao@kylinos.cn, akpm@linux-foundation.org, jgg@ziepe.ca, razor@blackwall.org, stephen@networkplumber.org, prabhakar.csengg@gmail.com, contact@emersion.fr, alex.williamson@redhat.com, akrowiak@linux.ibm.com, mark.rutland@arm.com, ye.xingchen@zte.com.cn, ojeda@kernel.org, me@kloenk.de, milan@mdaverde.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, sterzik@ti.com, u-kumar1@ti.com, eblanc@baylibre.com, jneanne@baylibre.com, aseketeli@baylibre.com Subject: [PATCH v7 5/6] Documentation: Add TI TPS6594 PFSM Date: Thu, 11 May 2023 11:51:25 +0200 Message-Id: <20230511095126.105104-6-jpanis@baylibre.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230511095126.105104-1-jpanis@baylibre.com> References: <20230511095126.105104-1-jpanis@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds documentation for the TPS6594 PFSM driver. The PFSM controls the operational states of the TPS6594 PMIC. Depending on the operational mode, some power domain networks remain energized while others can be off. Signed-off-by: Julien Panis --- Documentation/misc-devices/index.rst | 1 + Documentation/misc-devices/tps6594-pfsm.rst | 87 +++++++++++++++++++ .../userspace-api/ioctl/ioctl-number.rst | 1 + 3 files changed, 89 insertions(+) create mode 100644 Documentation/misc-devices/tps6594-pfsm.rst diff --git a/Documentation/misc-devices/index.rst b/Documentation/misc-devices/index.rst index 756be15a49a4..ecc40fbbcfb8 100644 --- a/Documentation/misc-devices/index.rst +++ b/Documentation/misc-devices/index.rst @@ -28,5 +28,6 @@ fit into other categories. oxsemi-tornado pci-endpoint-test spear-pcie-gadget + tps6594-pfsm uacce xilinx_sdfec diff --git a/Documentation/misc-devices/tps6594-pfsm.rst b/Documentation/misc-devices/tps6594-pfsm.rst new file mode 100644 index 000000000000..4ada37ccdcba --- /dev/null +++ b/Documentation/misc-devices/tps6594-pfsm.rst @@ -0,0 +1,87 @@ +.. SPDX-License-Identifier: GPL-2.0 + +===================================== +Texas Instruments TPS6594 PFSM driver +===================================== + +Author: Julien Panis (jpanis@baylibre.com) + +Overview +======== + +Strictly speaking, PFSM (Pre-configurable Finite State Machine) is not +hardware. It is a piece of code. + +The TPS6594 PMIC (Power Management IC) integrates a state machine which +manages operational modes. Depending on the current operational mode, +some voltage domains remain energized while others can be off. + +The PFSM driver can be used to trigger transitions between configured +states. It also provides R/W access to the device registers. + +Supported chips +--------------- + +- tps6594-q1 +- tps6593-q1 +- lp8764-q1 + +Driver location +=============== + +drivers/misc/tps6594-pfsm.c + +Driver type definitions +======================= + +include/uapi/linux/tps6594_pfsm.h + +Driver IOCTLs +============= + +:c:macro::`PMIC_GOTO_STANDBY` +All device resources are powered down. The processor is off, and +no voltage domains are energized. + +:c:macro::`PMIC_GOTO_LP_STANDBY` +The digital and analog functions of the PMIC, which are not +required to be always-on, are turned off (low-power). + +:c:macro::`PMIC_UPDATE_PGM` +Triggers a firmware update. + +:c:macro::`PMIC_SET_ACTIVE_STATE` +One of the operational modes. +The PMICs are fully functional and supply power to all PDN loads. +All voltage domains are energized in both MCU and Main processor +sections. + +:c:macro::`PMIC_SET_MCU_ONLY_STATE` +One of the operational modes. +Only the power resources assigned to the MCU Safety Island are on. + +:c:macro::`PMIC_SET_RETENTION_STATE` +One of the operational modes. +Depending on the triggers set, some DDR/GPIO voltage domains can +remain energized, while all other domains are off to minimize +total system power. + +Driver usage +============ + +See available PFSMs:: + + # ls /dev/pfsm* + +Dump the registers of pages 0 and 1:: + + # hexdump -C /dev/pfsm-0-0x48 + +See PFSM events:: + + # cat /proc/interrupts + +Userspace code example +---------------------- + +samples/pfsm/pfsm-wakeup.c diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst index 176e8fc3f31b..7167fe38a8f1 100644 --- a/Documentation/userspace-api/ioctl/ioctl-number.rst +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst @@ -180,6 +180,7 @@ Code Seq# Include File Comments 'P' 00-0F drivers/usb/class/usblp.c conflict! 'P' 01-09 drivers/misc/pci_endpoint_test.c conflict! 'P' 00-0F xen/privcmd.h conflict! +'P' 00-05 linux/tps6594_pfsm.h conflict! 'Q' all linux/soundcard.h 'R' 00-1F linux/random.h conflict! 'R' 01 linux/rfkill.h conflict!