Skip to contentSkip to conversation

Add PWM support to EN7581

PATCH Superseded Lorenzo Bianconi 3 participants 8 messages Aug 11, 2024 – Aug 12, 2024

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add PWM support to EN7581

Introduce driver for PWM module available on EN7581 SoC.

Changes since v1:
- fix compilation errors
- fix comment style
- get rid of MODULE_ALIAS()

Benjamin Larsson (1):
pwm: airoha: Add support for EN7581 SoC

Christian Marangi (1):
dt-bindings: pwm: Document Airoha EN7581 PWM

 .../bindings/pwm/airoha,en7581-pwm.yaml       |  42 ++
 drivers/pwm/Kconfig                           |  10 +
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-airoha.c                      | 408 ++++++++++++++++++
 4 files changed, 461 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml
 create mode 100644 drivers/pwm/pwm-airoha.c
Signature · 1 line
2.46.0
#1 lore raw

PATCH v2 1/2 dt-bindings: pwm: Document Airoha EN7581 PWM

From: Christian Marangi <[email protected]>

Document required property for the Airoha EN7581 PWM. The device requires 3 different address for the sgpio, flash and cycle config.

---
 .../bindings/pwm/airoha,en7581-pwm.yaml       | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml
Documentation/devicetree/bindings/pwm/airoha,en7581-pwm.yaml new file +42 -0
new file mode 100644
index 000000000000..52470668f90e
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/airoha,en7581-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha EN7581 PWM
+
+maintainers:
+  - Christian Marangi <[email protected]>
+
+allOf:
+  - $ref: pwm.yaml#
+
+properties:
+  compatible:
+    const: airoha,en7581-pwm
+
+  reg:
+    items:
+      - description: sgpio config address
+      - description: flash config address
+      - description: cycle config address
+
+  "#pwm-cells":
+    const: 3
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    pwm@1fbf0224 {
+        compatible = "airoha,en7581-pwm";
+        reg = <0x1fbf0224 0x10>,
+              <0x1fbf0238 0x28>,
+              <0x1fbf0298 0x8>;
+        #pwm-cells = <3>;
+    };
Signature · 1 line
2.46.0
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: pwm: Document Airoha EN7581 PWM

Quoted 6 lines · Lorenzo Bianconi

From: Christian Marangi <[email protected]>

Document required property for the Airoha EN7581 PWM. The device requires 3 different address for the sgpio, flash and cycle config.

That's odd placement. Which tool placed it that way?

Quoted 2 lines

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: pwm: Document Airoha EN7581 PWM

Quoted 9 lines · Lorenzo Bianconi
Quoted 6 lines

From: Christian Marangi <[email protected]>

Document required property for the Airoha EN7581 PWM. The device requires 3 different address for the sgpio, flash and cycle config.

That's odd placement. Which tool placed it that way?

I placed it manually. Do you prefer to put the Reviewed-by tag at the end if the patch is unchanged?

Regards,
Lorenzo

Quoted 7 lines
Quoted 3 lines

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH v2 1/2] dt-bindings: pwm: Document Airoha EN7581 PWM

Quoted 6 lines · Lorenzo Bianconi
Quoted 6 lines · Lorenzo Bianconi
Quoted 5 lines

From: Christian Marangi <[email protected]>

Document required property for the Airoha EN7581 PWM. The device requires 3 different address for the sgpio, flash and cycle config.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

That's odd placement. Which tool placed it that way?

I placed it manually. Do you prefer to put the Reviewed-by tag at the end if the patch is unchanged?

Please do not place tags manually unless you carefully follow submitting patches and DCO process. Use b4 for this.

Tag must be moved further, because here it is placed incorrectly. Christian did not send this patch after receiving my review. I did not review it before he wrote it, either.

Best regards,
Krzysztof

#5 lore raw

PATCH v2 2/2 pwm: airoha: Add support for EN7581 SoC

In reply to Lorenzo Bianconi

From: Benjamin Larsson <[email protected]>

Introduce driver for PWM module available on EN7581 SoC.

---
 drivers/pwm/Kconfig      |  10 +
 drivers/pwm/Makefile     |   1 +
 drivers/pwm/pwm-airoha.c | 408 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 419 insertions(+)
 create mode 100644 drivers/pwm/pwm-airoha.c
drivers/pwm/Kconfig +10 -0
index 1dd7921194f5..0d702b394ea7 100644
@@ -47,6 +47,16 @@ config PWM_AB8500
 	  To compile this driver as a module, choose M here: the module
 	  will be called pwm-ab8500.
 
+config PWM_AIROHA
+	tristate "Airoha PWM support"
+	depends on ARCH_AIROHA || COMPILE_TEST
+	depends on OF
+	help
+	  Generic PWM framework driver for Airoha SoC.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called pwm-airoha.
+
 config PWM_APPLE
 	tristate "Apple SoC PWM support"
 	depends on ARCH_APPLE || COMPILE_TEST
drivers/pwm/Makefile +1 -0
index 90913519f11a..cef216753dd6 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_PWM)		+= core.o
 obj-$(CONFIG_PWM_AB8500)	+= pwm-ab8500.o
+obj-$(CONFIG_PWM_AIROHA)	+= pwm-airoha.o
 obj-$(CONFIG_PWM_APPLE)		+= pwm-apple.o
 obj-$(CONFIG_PWM_ATMEL)		+= pwm-atmel.o
 obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM)	+= pwm-atmel-hlcdc.o
drivers/pwm/pwm-airoha.c new file +408 -0

408 lines not on this page · raw message

Signature · 1 line
2.46.0
#6 lore raw

Re: [PATCH v2 2/2] pwm: airoha: Add support for EN7581 SoC

kernel test robot noticed the following build errors:

Hi Lorenzo,

kernel test robot noticed the following build errors:

[auto build test ERROR on robh/for-next]
[also build test ERROR on linus/master v6.11-rc3 next-20240812] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Lorenzo-Bianconi/dt-bindings-pwm-Document-Airoha-EN7581-PWM/20240812-003542
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/d5abef7ee63f2c5df8bf3400c4d8a5ff72c706a9.1723393857.git.lorenzo%40kernel.org
patch subject: [PATCH v2 2/2] pwm: airoha: Add support for EN7581 SoC
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240812/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240812/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>, old ones prefixed by <<):

WARNING: modpost: missing MODULE_DESCRIPTION() in arch/x86/mm/testmmiotrace.o
WARNING: modpost: missing MODULE_DESCRIPTION() in kernel/locking/test-ww_mutex.o
WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_objpool.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/clk/imx/mxc-clk.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/clk/imx/clk-imxrt1050.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/usb/serial/ch341.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/usb/serial/usb_debug.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/usb/serial/mxuport.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/usb/serial/navman.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/usb/serial/qcaux.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/usb/serial/usb-serial-simple.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/usb/serial/symbolserial.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/devfreq/governor_simpleondemand.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/devfreq/governor_performance.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/devfreq/governor_powersave.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/devfreq/governor_userspace.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-core.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-master-hub.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-master-aspeed.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-master-gpio.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-master-ast-cf.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fsi/fsi-scom.o

>> ERROR: modpost: "__ffsdi2" [drivers/pwm/pwm-airoha.ko] undefined!
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#7 lore raw

Re: [PATCH v2 2/2] pwm: airoha: Add support for EN7581 SoC

In reply to Lorenzo Bianconi
kernel test robot noticed the following build errors:

Hi Lorenzo,

kernel test robot noticed the following build errors:

[auto build test ERROR on robh/for-next]
[also build test ERROR on linus/master v6.11-rc3 next-20240812] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Lorenzo-Bianconi/dt-bindings-pwm-Document-Airoha-EN7581-PWM/20240812-003542
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/d5abef7ee63f2c5df8bf3400c4d8a5ff72c706a9.1723393857.git.lorenzo%40kernel.org
patch subject: [PATCH v2 2/2] pwm: airoha: Add support for EN7581 SoC
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20240812/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240812/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

ld: drivers/pwm/pwm-airoha.o: in function `airoha_pwm_config_flash_map':

>> pwm-airoha.c:(.text+0x127): undefined reference to `__ffsdi2'
   ld: drivers/pwm/pwm-airoha.o: in function `airoha_pwm_config_waveform':
   pwm-airoha.c:(.text+0x1ed): undefined reference to `__ffsdi2'
>> ld: pwm-airoha.c:(.text+0x26f): undefined reference to `__ffsdi2'
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki