Skip to contentSkip to conversation

Add support control UP board CPLD onboard LEDS

PATCH New chengwei 1 participant 3 messages Oct 11, 2022

Subsystems (3)
lore
Share & tools
lore

chengwei

author
#0 lore raw

v3 cover Add support control UP board CPLD onboard LEDS

The UP board <http://www.upboard.com> is the computer board for Professional Makers and Industrial Applications. We want to upstream the UP board 40-pin GP-bus Kernel driver for giving the users better experience on the software release. (not just download from UP board github)

These patches are generated from the Linux kernel mainline tag v6.0. PATCH v3 fixed the auto build test ERROR on ARCH=arm64 or ARCH=mips.

chengwei (2):
mfd: Add support for UP board CPLD/FPGA
leds: Add support for UP board CPLD onboard LEDS

 drivers/leds/Kconfig             |  11 +
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-upboard.c      |  78 +++++
 drivers/mfd/Kconfig              |  12 +
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/upboard-fpga.c       | 482 +++++++++++++++++++++++++++++++
 include/linux/mfd/upboard-fpga.h |  49 ++++
 7 files changed, 634 insertions(+)
 create mode 100644 drivers/leds/leds-upboard.c
 create mode 100644 drivers/mfd/upboard-fpga.c
 create mode 100644 include/linux/mfd/upboard-fpga.h

base-commit: 4fe89d07dcc2804c8b562f6c7896a45643d34b2f

Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v3 1/2 mfd: Add support for UP board CPLD/FPGA

The UP Squared board <http://www.upboard.com> implements certain features (pin control, onboard LEDs or CEC) through an on-board CPLD/FPGA.

This mfd driver implements the line protocol to read and write registers from the FPGA through regmap. The register address map is also included.

The UP Boards provide a few I/O pin headers (for both GPIO and functions), including a 40-pin Raspberry Pi compatible header.

This patch implements support for the FPGA-based pin controller that manages direction and enable state for those header pins.

Partial support UP boards:
* UP core + CREX
* UP core + CRST02

---
 drivers/mfd/Kconfig              |  12 +
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/upboard-fpga.c       | 482 +++++++++++++++++++++++++++++++
 include/linux/mfd/upboard-fpga.h |  49 ++++
 4 files changed, 544 insertions(+)
 create mode 100644 drivers/mfd/upboard-fpga.c
 create mode 100644 include/linux/mfd/upboard-fpga.h
drivers/mfd/Kconfig +12 -0
index abb58ab1a1a4..e6fbdc8be1b6 100644
@@ -2104,6 +2104,18 @@ config MFD_QCOM_PM8008
 	  under it in the device tree. Additional drivers must be enabled in
 	  order to use the functionality of the device.
 
+config MFD_UPBOARD_FPGA
+	tristate "Support for the UP board FPGA"
+	select MFD_CORE
+	depends on X86 && ACPI
+	help
+	  Select this option to enable the UP and UP^2 on-board FPGA. The UP
+	  board implements certain features (pin control, onboard LEDs or CEC)
+	  through an on-board FPGA.
+
+	  To compile this driver as a module, choose M here: the module will be
+	  called upboard-fpga.
+
 menu "Multimedia Capabilities Port drivers"
 	depends on ARCH_SA1100
 
drivers/mfd/Makefile +1 -0
index 858cacf659d6..d9d10e3664f7 100644
@@ -250,6 +250,7 @@ obj-$(CONFIG_MFD_ALTERA_A10SR)	+= altera-a10sr.o
 obj-$(CONFIG_MFD_ALTERA_SYSMGR) += altera-sysmgr.o
 obj-$(CONFIG_MFD_STPMIC1)	+= stpmic1.o
 obj-$(CONFIG_MFD_SUN4I_GPADC)	+= sun4i-gpadc.o
+obj-$(CONFIG_MFD_UPBOARD_FPGA)	+= upboard-fpga.o
 
 obj-$(CONFIG_MFD_STM32_LPTIMER)	+= stm32-lptimer.o
 obj-$(CONFIG_MFD_STM32_TIMERS) 	+= stm32-timers.o
drivers/mfd/upboard-fpga.c new file +482 -0

482 lines not on this page · raw message

include/linux/mfd/upboard-fpga.h new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.17.1
author
#2 lore raw

PATCH v3 2/2 leds: Add support for UP board CPLD onboard LEDS

In reply to chengwei

The UP boards come with a few FPGA-controlled onboard LEDs:
* UP Board: yellow, green, red
* UP Squared: blue, yellow, green, red

this patch depends on patch "mfd: Add support for UP board CPLD/FPGA"

---
 drivers/leds/Kconfig        | 11 ++++++
 drivers/leds/Makefile       |  1 +
 drivers/leds/leds-upboard.c | 78 +++++++++++++++++++++++++++++++++++++
 3 files changed, 90 insertions(+)
 create mode 100644 drivers/leds/leds-upboard.c
drivers/leds/Kconfig +11 -0
index 499d0f215a8b..ae35a4c7e1e6 100644
@@ -872,6 +872,17 @@ source "drivers/leds/flash/Kconfig"
 comment "RGB LED drivers"
 source "drivers/leds/rgb/Kconfig"
 
+config LEDS_UPBOARD
+	tristate "LED support for the UP board"
+	depends on LEDS_CLASS
+	depends on MFD_UPBOARD_FPGA
+	depends on X86
+	help
+	  This option enables support for the UP board LEDs.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called leds-upboard.
+
 comment "LED Triggers"
 source "drivers/leds/trigger/Kconfig"
 
drivers/leds/Makefile +1 -0
index 4fd2f92cd198..e72956645646 100644
@@ -83,6 +83,7 @@ obj-$(CONFIG_LEDS_TI_LMU_COMMON)	+= leds-ti-lmu-common.o
 obj-$(CONFIG_LEDS_TLC591XX)		+= leds-tlc591xx.o
 obj-$(CONFIG_LEDS_TPS6105X)		+= leds-tps6105x.o
 obj-$(CONFIG_LEDS_TURRIS_OMNIA)		+= leds-turris-omnia.o
+obj-$(CONFIG_LEDS_UPBOARD)		+= leds-upboard.o
 obj-$(CONFIG_LEDS_WM831X_STATUS)	+= leds-wm831x-status.o
 obj-$(CONFIG_LEDS_WM8350)		+= leds-wm8350.o
 obj-$(CONFIG_LEDS_WRAP)			+= leds-wrap.o
drivers/leds/leds-upboard.c new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
2.17.1