1.. SPDX-License-Identifier: GPL-2.0
2
3=====================================
4Texas Instruments TPS6594 PFSM driver
5=====================================
6
7Author: Julien Panis (jpanis@baylibre.com)
8
9Overview
10========
11
12Strictly speaking, PFSM (Pre-configurable Finite State Machine) is not
13hardware. It is a piece of code.
14
15The TPS6594 PMIC (Power Management IC) integrates a state machine which
16manages operational modes. Depending on the current operational mode,
17some voltage domains remain energized while others can be off.
18
19The PFSM driver can be used to trigger transitions between configured
20states. It also provides R/W access to the device registers.
21
22Supported chips
23---------------
24
25- tps6594-q1
26- tps6593-q1
27- lp8764-q1
28
29Driver location
30===============
31
32drivers/misc/tps6594-pfsm.c
33
34Driver type definitions
35=======================
36
37include/uapi/linux/tps6594_pfsm.h
38
39Driver IOCTLs
40=============
41
42:c:macro::`PMIC_GOTO_STANDBY`
43All device resources are powered down. The processor is off, and
44no voltage domains are energized.
45
46:c:macro::`PMIC_GOTO_LP_STANDBY`
47The digital and analog functions of the PMIC, which are not
48required to be always-on, are turned off (low-power).
49
50:c:macro::`PMIC_UPDATE_PGM`
51Triggers a firmware update.
52
53:c:macro::`PMIC_SET_ACTIVE_STATE`
54One of the operational modes.
55The PMICs are fully functional and supply power to all PDN loads.
56All voltage domains are energized in both MCU and Main processor
57sections.
58
59:c:macro::`PMIC_SET_MCU_ONLY_STATE`
60One of the operational modes.
61Only the power resources assigned to the MCU Safety Island are on.
62
63:c:macro::`PMIC_SET_RETENTION_STATE`
64One of the operational modes.
65Depending on the triggers set, some DDR/GPIO voltage domains can
66remain energized, while all other domains are off to minimize
67total system power.
68
69Driver usage
70============
71
72See available PFSMs::
73
74    # ls /dev/pfsm*
75
76Dump the registers of pages 0 and 1::
77
78    # hexdump -C /dev/pfsm-0-0x48
79
80See PFSM events::
81
82    # cat /proc/interrupts
83
84Userspace code example
85----------------------
86
87samples/pfsm/pfsm-wakeup.c
88