Re: [PATCH v6 6/6] samples: Add userspace example for TI TPS6594 PFSM

From: Guenter Roeck
Date: Fri Jun 16 2023 - 09:39:30 EST


On Thu, Apr 06, 2023 at 09:56:22AM +0200, Julien Panis wrote:
> This patch adds an example showing how to use PFSM devices
> from a userspace application. The PMIC is armed to be triggered
> by a RTC alarm to execute state transition.
>
> Signed-off-by: Julien Panis <jpanis@xxxxxxxxxxxx>
> ---
> samples/Kconfig | 6 ++
> samples/Makefile | 1 +
> samples/pfsm/.gitignore | 2 +
> samples/pfsm/Makefile | 4 ++
> samples/pfsm/pfsm-wakeup.c | 125 +++++++++++++++++++++++++++++++++++++
> 5 files changed, 138 insertions(+)
> create mode 100644 samples/pfsm/.gitignore
> create mode 100644 samples/pfsm/Makefile
> create mode 100644 samples/pfsm/pfsm-wakeup.c
>
> diff --git a/samples/Kconfig b/samples/Kconfig
> index 30ef8bd48ba3..f23aa60a74cf 100644
> --- a/samples/Kconfig
> +++ b/samples/Kconfig
> @@ -253,6 +253,12 @@ config SAMPLE_INTEL_MEI
> help
> Build a sample program to work with mei device.
>
> +config SAMPLE_TPS6594_PFSM
> + bool "Build example program working with TPS6594 PFSM driver"
> + depends on HEADERS_INSTALL

This also needs to depend on CC_CAN_LINK to avoid errors such as

Building arm:allmodconfig ... failed
--------------
Error log:
samples/pfsm/pfsm-wakeup.c:12:10: fatal error: fcntl.h: No such file or directory
12 | #include <fcntl.h>

seen when building images with kernel toolchains.

Guenter