mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julien Panis <jpanis@baylibre.com>
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	[thread overview]
Message-ID: <20230511095126.105104-6-jpanis@baylibre.com> (raw)
In-Reply-To: <20230511095126.105104-1-jpanis@baylibre.com>

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 <jpanis@baylibre.com>
---
 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!
-- 
2.37.3


  parent reply	other threads:[~2023-05-11  9:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11  9:51 [PATCH v7 0/6] TI TPS6594 PMIC support (Core, ESM, PFSM) Julien Panis
2023-05-11  9:51 ` [PATCH v7 1/6] dt-bindings: mfd: Add TI TPS6594 PMIC Julien Panis
2023-06-08 12:31   ` Lee Jones
2023-05-11  9:51 ` [PATCH v7 2/6] mfd: tps6594: Add driver for " Julien Panis
2023-05-18 15:07   ` Lee Jones
2023-06-07 17:33     ` Rob Herring
2023-06-08 12:32       ` Lee Jones
2023-05-11  9:51 ` [PATCH v7 3/6] misc: tps6594-esm: Add driver for TI TPS6594 ESM Julien Panis
2023-05-11  9:51 ` [PATCH v7 4/6] misc: tps6594-pfsm: Add driver for TI TPS6594 PFSM Julien Panis
2023-05-11  9:51 ` Julien Panis [this message]
2023-05-11  9:51 ` [PATCH v7 6/6] samples: Add userspace example " Julien Panis
2023-05-23  7:44 ` [GIT PULL] Immutable branch containing TPS6594 core (MFD) support due for the v6.5 merge window Lee Jones
2023-06-15 11:40   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230511095126.105104-6-jpanis@baylibre.com \
    --to=jpanis@baylibre.com \
    --cc=akpm@linux-foundation.org \
    --cc=akrowiak@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=arnd@arndb.de \
    --cc=aseketeli@baylibre.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=conor+dt@kernel.org \
    --cc=contact@emersion.fr \
    --cc=corbet@lwn.net \
    --cc=derek.kiernan@xilinx.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dragan.cvetic@xilinx.com \
    --cc=eblanc@baylibre.com \
    --cc=gehao@kylinos.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@ziepe.ca \
    --cc=jirislaby@kernel.org \
    --cc=jneanne@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=mark.rutland@arm.com \
    --cc=me@kloenk.de \
    --cc=milan@mdaverde.com \
    --cc=ojeda@kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=razor@blackwall.org \
    --cc=revest@chromium.org \
    --cc=robh+dt@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stephen@networkplumber.org \
    --cc=sterzik@ti.com \
    --cc=u-kumar1@ti.com \
    --cc=ye.xingchen@zte.com.cn \
    --cc=yi.l.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®