Skip to contentSkip to conversation

cmd: Add a pwm command

PATCH Superseded Pragnesh Patel 4 participants 5 messages Nov 23, 2020 – Nov 24, 2020

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: Add a pwm command

Add the command "pwm" for controlling the pwm channels. This command provides pwm invert/config/enable/disable functionalities via PWM uclass drivers

---
 cmd/Kconfig  |   6 +++
 cmd/Makefile |   1 +
 cmd/pwm.c    | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 cmd/pwm.c
cmd/Kconfig +6 -0
index 1595de999b..4f3a70b1d5 100644
@@ -918,6 +918,12 @@ config CMD_GPIO
 	help
 	  GPIO support.
 
+config CMD_PWM
+	bool "pwm"
+	depends on DM_PWM
+	help
+	  PWM support.
+
 config CMD_GPT
 	bool "GPT (GUID Partition Table) command"
 	select EFI_PARTITION
cmd/Makefile +1 -0
index dd86675bf2..75df3c136c 100644
@@ -120,6 +120,7 @@ endif
 obj-$(CONFIG_CMD_PINMUX) += pinmux.o
 obj-$(CONFIG_CMD_PMC) += pmc.o
 obj-$(CONFIG_CMD_PSTORE) += pstore.o
+obj-$(CONFIG_CMD_PWM) += pwm.o
 obj-$(CONFIG_CMD_PXE) += pxe.o pxe_utils.o
 obj-$(CONFIG_CMD_WOL) += wol.o
 obj-$(CONFIG_CMD_QFW) += qfw.o
cmd/pwm.c new file +119 -0

119 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 cmd: Add a pwm command

Quoted 11 lines · Pragnesh Patel

Add the command "pwm" for controlling the pwm channels. This command provides pwm invert/config/enable/disable functionalities via PWM uclass drivers

---
 cmd/Kconfig  |   6 +++
 cmd/Makefile |   1 +
 cmd/pwm.c    | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 cmd/pwm.c

Can you please add some tests and dt fragments to sandbox for this? Thanks.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201123/3589e8f4/attachment.sig>
#2 lore raw

PATCH 1/1 cmd: Add a pwm command

Quoted 30 lines

-----Original Message-----
From: Tom Rini <[email protected]>
Sent: 23 November 2020 21:22
To: Pragnesh Patel <[email protected]>
Cc: u-boot at lists.denx.de; atish.patra at wdc.com; palmerdabbelt at google.com; bmeng.cn at gmail.com; Paul Walmsley ( Sifive) <[email protected]>; anup.patel at wdc.com; Sagar Kadam <[email protected]>;
rick at andestech.com; Simon Glass <[email protected]>; Heinrich Schuchardt <[email protected]>; Bin Meng <[email protected]>; Miquel Raynal <[email protected]>; Patrick Delaunay <[email protected]>; Sam Protsenko <[email protected]>; Philippe Reynes <[email protected]>; Fr?d?ric Danis <[email protected]>; Patrice Chotard <[email protected]>; Vladimir Olovyannikov <[email protected]>; Ramon Fried <[email protected]>; Eugeniu Rosca <[email protected]>
Subject: Re: [PATCH] cmd: Add a pwm command

Quoted 9 lines · Pragnesh Patel

Add the command "pwm" for controlling the pwm channels. This command provides pwm invert/config/enable/disable functionalities via PWM uclass drivers

---
 cmd/Kconfig  |   6 +++
 cmd/Makefile |   1 +
 cmd/pwm.c    | 119
Quoted 5 lines

+++++++++++++++++++++++++++++++++++++++++++++++++++

Quoted 2 lines
 3 files changed, 126 insertions(+)
 create mode 100644 cmd/pwm.c

Can you please add some tests and dt fragments to sandbox for this?

There is already a "test/dm/pwm.c".

Quoted 4 lines

Thanks.

--
Tom

#3 lore raw

PATCH 1/1 cmd: Add a pwm command

Quoted 30 lines · Pragnesh Patel
Quoted 30 lines

-----Original Message-----
From: Tom Rini <[email protected]>
Sent: 23 November 2020 21:22
To: Pragnesh Patel <[email protected]>
Cc: u-boot at lists.denx.de; atish.patra at wdc.com; palmerdabbelt at google.com; bmeng.cn at gmail.com; Paul Walmsley ( Sifive) <[email protected]>; anup.patel at wdc.com; Sagar Kadam <[email protected]>;
rick at andestech.com; Simon Glass <[email protected]>; Heinrich Schuchardt <[email protected]>; Bin Meng <[email protected]>; Miquel Raynal <[email protected]>; Patrick Delaunay <[email protected]>; Sam Protsenko <[email protected]>; Philippe Reynes <[email protected]>; Fr?d?ric Danis <[email protected]>; Patrice Chotard <[email protected]>; Vladimir Olovyannikov <[email protected]>; Ramon Fried <[email protected]>; Eugeniu Rosca <[email protected]>
Subject: Re: [PATCH] cmd: Add a pwm command

Quoted 9 lines · Pragnesh Patel

Add the command "pwm" for controlling the pwm channels. This command provides pwm invert/config/enable/disable functionalities via PWM uclass drivers

---
 cmd/Kconfig  |   6 +++
 cmd/Makefile |   1 +
 cmd/pwm.c    | 119
Quoted 7 lines
Quoted 5 lines

+++++++++++++++++++++++++++++++++++++++++++++++++++

Quoted 2 lines
 3 files changed, 126 insertions(+)
 create mode 100644 cmd/pwm.c

Can you please add some tests and dt fragments to sandbox for this?

There is already a "test/dm/pwm.c".

Right, but for the new command as well please, similar to test/py/tests/test_gpio.py.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201124/2b5f7fa3/attachment.sig>
#4 lore raw

PATCH 1/1 cmd: Add a pwm command

Hi,

Quoted 36 lines · Tom Rini
Quoted 34 lines · Pragnesh Patel
Quoted 34 lines

-----Original Message-----
From: Tom Rini <[email protected]>
Sent: 23 November 2020 21:22
To: Pragnesh Patel <[email protected]>
Cc: u-boot at lists.denx.de; atish.patra at wdc.com; palmerdabbelt at google.com; bmeng.cn at gmail.com; Paul Walmsley ( Sifive) <[email protected]>; anup.patel at wdc.com; Sagar Kadam <[email protected]>;
rick at andestech.com; Simon Glass <[email protected]>; Heinrich Schuchardt <[email protected]>; Bin Meng <[email protected]>; Miquel Raynal <[email protected]>; Patrick Delaunay <[email protected]>; Sam Protsenko <[email protected]>; Philippe Reynes <[email protected]>; Fr?d?ric Danis <[email protected]>; Patrice Chotard <[email protected]>; Vladimir Olovyannikov <[email protected]>; Ramon Fried <[email protected]>; Eugeniu Rosca <[email protected]>
Subject: Re: [PATCH] cmd: Add a pwm command

Quoted 9 lines · Pragnesh Patel

Add the command "pwm" for controlling the pwm channels. This command provides pwm invert/config/enable/disable functionalities via PWM uclass drivers

---
 cmd/Kconfig  |   6 +++
 cmd/Makefile |   1 +
 cmd/pwm.c    | 119

+++++++++++++++++++++++++++++++++++++++++++++++++++

Quoted 2 lines
 3 files changed, 126 insertions(+)
 create mode 100644 cmd/pwm.c
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Can you please add some tests and dt fragments to sandbox for this?

There is already a "test/dm/pwm.c".

Right, but for the new command as well please, similar to test/py/tests/test_gpio.py.

I would be happier with a C test like [1] as it is faster and allows debugging, etc.

Regards,
Simon

[1] test/cmd/mem_search.c