MFD: add support for the RDC321x southbridge
PATCH v3 1/4 MFD: add support for the RDC321x southbridge
This patch adds a new MFD driver for the RDC321x southbridge. This southbridge is always present in the RDC321x System-on-a-Chip and provides access to some GPIOs as well as a watchdog. Access to these two functions is done using the southbridge PCI device configuration space.
Signed-off-by Florian Fainelli <[email protected]>
---
Changes from v2:
- pass the pci_dev pointer to MFD cell drivers as platform_data
- remove the printk(KERN_ERR and use dev_err instead
- removed pci_dev accessors
- use DEFINE_PCI_DEVICE_TABLE
drivers/mfd/Kconfig +9 -0
@@ -398,6 +398,15 @@ config LPC_SCH LPC bridge function of the Intel SCH provides support for System Management Bus and General Purpose I/O. +config MFD_RDC321X + tristate "Support for RDC-R321x southbridge" + select MFD_CORE + depends on PCI + help + Say yes here if you want to have support for the RDC R-321x SoC + southbridge which provides access to GPIOs and Watchdog using the + southbridge PCI device configuration space. + endmenu menu "Multimedia Capabilities Port drivers"
drivers/mfd/Makefile +2 -1
@@ -62,4 +62,5 @@ obj-$(CONFIG_AB3100_OTP) += ab3100-otp.o obj-$(CONFIG_AB4500_CORE) += ab4500-core.o obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o obj-$(CONFIG_PMIC_ADP5520) += adp5520.o -obj-$(CONFIG_LPC_SCH) += lpc_sch.o +obj-$(CONFIG_LPC_SCH) += lpc_sch.o +obj-$(CONFIG_MFD_RDC321X) += rdc321x-southbridge.o
drivers/mfd/rdc321x-southbridge.c new file +123 -0
123 lines not on this page · raw message
include/linux/mfd/rdc321x.h new file +26 -0
@@ -0,0 +1,26 @@ +#ifndef __RDC321X_MFD_H +#define __RDC321X_MFD_H + +#include <linux/types.h> +#include <linux/pci.h> + +/* Offsets to be accessed in the southbridge PCI +* device configuration register */ +#define RDC321X_WDT_CTRL 0x44 +#define RDC321X_GPIO_CTRL_REG1 0x48 +#define RDC321X_GPIO_DATA_REG1 0x4c +#define RDC321X_GPIO_CTRL_REG2 0x84 +#define RDC321X_GPIO_DATA_REG2 0x88 + +#define RDC321X_MAX_GPIO 58 + +struct rdc321x_gpio_pdata { +struct pci_dev *sb_pdev; +unsigned max_gpios; +}; + +struct rdc321x_wdt_pdata { +struct pci_dev *sb_pdev; +}; + +#endif /* __RDC321X_MFD_H */