Skip to contentSkip to conversation

mfd: tqmx86: IO controller with i2c, wachdog and gpio

PATCH Applied Andrew Lunn 2 participants 2 messages Feb 8, 2019 – Feb 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 mfd: tqmx86: IO controller with i2c, wachdog and gpio

The QMX86 is a PLD present on some TQ-Systems ComExpress modules. It provides 1 or 2 I2C bus masters, 8 GPIOs and a watchdog timer. Add an MFD which will instantiate the individual drivers.

---
v2:

Drop setting i2c bus speed, which removes the build dependencies on the i2c ocores patches. This can be added back later.

v3

Fix indentation of help
Fix SPDX to match MODULE_LICENSE
Remove warranty text
Add my Copyright
Sort include files
Add _REG_ to register defines
Add #defines for all resources
Replace magic numbers with #defines
Rename pld_clock to pld_clock_rate
Remove wrapper around ioread8()/iowrite8() Scatter const keyword in a few places
Remove enum for calls
Implement lookup for board in tq_board_if Rename ioeic to io_ext_int_val to make is more readable Handle optional calls in a different way Better group code and structures
Kill all the sysfs attributes
Use devm_mfd_add_devices()
Don't exist silently for unknown board ID

Not addressed, waiting for answers:
MODULE_PARM for GPIO interrupts
Not using regmap, intel IO not supported by regmap Setting GPIO irq on resource structure Global tqmx86_pdev
Jumping through hoops

v4

Remove -- to avoid broken mailer

v5

Remove device data since it is only used in the probe function Remove platform data, since it only contains well know values Move GPIO IRQ resource first and comment about this assumption Fixup platform data naming
Use true for ignore_resource_conflicts
Use ARRAY_SIZE for num_resources
Replace tq_board_info with two functions using switch
Error out for invalid GPIO IRQ configuration
Error out if GPIO IRQ cannot be configured in the hardware Split registering cells into two calls
Validate GPIO IRQ using a switch statement, and derive the HW configuration

v6

Minimize switch statement in tqmx86_board_id_to_clk_rate Wrap io_ext_int_val differently
Read TQMX86_REG_IO_EXT_INT into variable before comparing Move GPIO IRQ validation into probe

---
 drivers/mfd/Kconfig  |   8 ++
 drivers/mfd/Makefile |   1 +
 drivers/mfd/tqmx86.c | 281 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 290 insertions(+)
 create mode 100644 drivers/mfd/tqmx86.c
drivers/mfd/Kconfig +8 -0
index f461460a2aeb..226f7eeb2093 100644
@@ -1677,6 +1677,14 @@ config MFD_TC6393XB
 	help
 	  Support for Toshiba Mobile IO Controller TC6393XB
 
+config MFD_TQMX86
+	tristate "TQ-Systems IO controller TQMX86"
+	select MFD_CORE
+	help
+	  Say yes here to enable support for various functions of the
+	  TQ-Systems IO controller and watchdog device, found on their
+	  ComExpress CPU modules.
+
 config MFD_VX855
 	tristate "VIA VX855/VX875 integrated south bridge"
 	depends on PCI
drivers/mfd/Makefile +1 -0
index 12980a4ad460..7f4790662988 100644
@@ -36,6 +36,7 @@ obj-$(CONFIG_MFD_TC3589X)	+= tc3589x.o
 obj-$(CONFIG_MFD_T7L66XB)	+= t7l66xb.o tmio_core.o
 obj-$(CONFIG_MFD_TC6387XB)	+= tc6387xb.o tmio_core.o
 obj-$(CONFIG_MFD_TC6393XB)	+= tc6393xb.o tmio_core.o
+obj-$(CONFIG_MFD_TQMX86)	+= tqmx86.o
 
 obj-$(CONFIG_MFD_ARIZONA)	+= arizona-core.o
 obj-$(CONFIG_MFD_ARIZONA)	+= arizona-irq.o
drivers/mfd/tqmx86.c new file +281 -0

281 lines not on this page · raw message

Signature · 1 line
2.20.1
Applied
#1 lore raw
Quoted 11 lines · Andrew Lunn

The QMX86 is a PLD present on some TQ-Systems ComExpress modules. It provides 1 or 2 I2C bus masters, 8 GPIOs and a watchdog timer. Add an MFD which will instantiate the individual drivers.

---
 drivers/mfd/Kconfig  |   8 ++
 drivers/mfd/Makefile |   1 +
 drivers/mfd/tqmx86.c | 281 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 290 insertions(+)
 create mode 100644 drivers/mfd/tqmx86.c

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog