da9062: DA9062 driver submission
Subsystems (6)
v4 cover da9062: DA9062 driver submission
From: S Twiss <[email protected]>
This patch set adds support for the Dialog DA9062 Power Management IC.
In this patch set the following is provided:
- [PATCH V4 1/3]: MFD core support
- [PATCH V4 2/3]: Watchdog driver
- [PATCH V4 3/3]: Add bindings for all DA9062 components
Changes in V4
- Rebase patches from linux-next/v4.1-rc3 to linux-next/v4.1-rc5
- [PATCH V3 2/4] BUCK and LDO regulator driver accepted by Mark Brown
- See https://lkml.org/lkml/2015/5/21/313 for details
- Reorder remaining patches for the PATCH V4 submission
Changes in V3:
- No overall main changes, see individal patches for details
Changes in V2:
- Alter subject title in 'cover letter'
- Reordered the patch numbering: now 4/4 patches instead of 6/6
- Dropped [PATCH V1 3/6] RTC driver
- Dropped [PATCH V1 4/6] OnKey driver
This patch applies against linux-next and v4.1-rc5
Thank you,
Steve Twiss, Dialog Semiconductor Ltd.
S Twiss (3):
mfd: da9062: DA9062 MFD core driver
watchdog: da9062: DA9062 watchdog driver
devicetree: da9062: Add bindings for DA9062 driver
Documentation/devicetree/bindings/mfd/da9062.txt | 79 ++ drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 3 +- drivers/mfd/da9062-core.c | 512 ++++++++++ drivers/watchdog/Kconfig | 9 + drivers/watchdog/Makefile | 1 + drivers/watchdog/da9062_wdt.c | 253 +++++ include/linux/mfd/da9062/core.h | 50 + include/linux/mfd/da9062/registers.h | 1108 ++++++++++++++++++++++ 9 files changed, 2026 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/mfd/da9062.txt create mode 100644 drivers/mfd/da9062-core.c create mode 100644 drivers/watchdog/da9062_wdt.c create mode 100644 include/linux/mfd/da9062/core.h create mode 100644 include/linux/mfd/da9062/registers.h
Signature · 1 line
end-of-patch for PATCH V4
PATCH v4 1/3 mfd: da9062: DA9062 MFD core driver
From: S Twiss <[email protected]>
Add MFD core driver support for DA9062
---
Changes in V4:
- Removal of struct da9062 unrequired data from core.h and driver code
- Remove IRQ handler for VDD_WARN and corresponding IRQ request code
- Use DEFINE_RES_NAMED() macro for resource definitions
- Refactor da9062_clear_fault_log() to remove inconsistencies
- Refactor da9062_device_init() and da9062_irq_init() into probe()
- Add new function get_device_type() for variant and device_id information
- devm_kzalloc to alloc *chip instead of struct and use not-chip on error
- Move da9062_dt_ids closer to usage
- Move LUT definitions into da9062_regmap_config structure
- Erase da9062_device_exit() abstractions
- Clean up header inclusions through removal of redundant entries
- Whitespace and string literal discipline
Changes in V3:
- Removed references to the RTC and OnKey in the mfd_cell definition.
Changes in V2:
- Copyright headers GPL v2 (and later) match correct 'GPL' in MODULE_LICENSE
- Ensure DA9062 core is tristate in Kconfig so it can be built as a module
- Move VDD_WARN code and resource into the core instead of regulator driver
This patch applies against linux-next and v4.1-rc5
drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 3 +- drivers/mfd/da9062-core.c | 512 ++++++++++++++++ include/linux/mfd/da9062/core.h | 50 ++ include/linux/mfd/da9062/registers.h | 1108 ++++++++++++++++++++++++++++++++++ 5 files changed, 1684 insertions(+), 1 deletion(-) create mode 100644 drivers/mfd/da9062-core.c create mode 100644 include/linux/mfd/da9062/core.h create mode 100644 include/linux/mfd/da9062/registers.h
drivers/mfd/Kconfig +12 -0
@@ -183,6 +183,18 @@ config MFD_DA9055 This driver can be built as a module. If built as a module it will be called "da9055" +config MFD_DA9062 + tristate "Dialog Semiconductor DA9062 PMIC Support" + select MFD_CORE + select REGMAP_I2C + select REGMAP_IRQ + depends on I2C=y + help + Say yes here for support for the Dialog Semiconductor DA9062 PMIC. + This includes the I2C driver and core APIs. + Additional drivers must be enabled in order to use the functionality + of the device. + config MFD_DA9063 bool "Dialog Semiconductor DA9063 PMIC Support" select MFD_CORE
drivers/mfd/Makefile +2 -1
@@ -110,10 +110,11 @@ obj-$(CONFIG_MFD_LP8788) += lp8788.o lp8788-irq.o da9055-objs := da9055-core.o da9055-i2c.o obj-$(CONFIG_MFD_DA9055) += da9055.o - +obj-$(CONFIG_MFD_DA9062) += da9062-core.o da9063-objs := da9063-core.o da9063-irq.o da9063-i2c.o obj-$(CONFIG_MFD_DA9063) += da9063.o obj-$(CONFIG_MFD_DA9150) += da9150-core.o + obj-$(CONFIG_MFD_MAX14577) += max14577.o obj-$(CONFIG_MFD_MAX77686) += max77686.o obj-$(CONFIG_MFD_MAX77693) += max77693.o
drivers/mfd/da9062-core.c new file +512 -0
512 lines not on this page · raw message
include/linux/mfd/da9062/core.h new file +50 -0
50 lines not on this page · raw message
include/linux/mfd/da9062/registers.h new file +1108 -0
1,108 lines not on this page · raw message
Signature · 1 line
end-of-patch for PATCH V4
PATCH v4 2/3 watchdog: da9062: DA9062 watchdog driver
In reply to S TwissFrom: S Twiss <[email protected]>
Add watchdog driver support for DA9062
---
Changes in V4:
- Added reviewed-by from Guenter Roeck
Changes in V3:
- Removed unnecessary return statement in da9062_apply_window_protection()
- Deleted dev_err() kernel noise in da9062_wdt_update_timeout_register()
- Changed dev_alert() to be a dev_err() in da9062_wdt_stop()
- Deleted the "watchdog ping" debug message in da9062_wdt_ping()
- Refactored the error path inthe probe() to remove redundant error gotos
- Altered dev_err() string to notify failures more specifically in probe()
- Removed the space in MODULE_ALIAS string "platform: da9062-watchdog"
- Ensure request for devm_request_threaded_irq() removal is completed
Changes in V2:
- Removed informational dev_info() 'installed watchdog' message
- Copyright headers GPL v2 (and later) match correct 'GPL' in MODULE_LICENSE
- Removed the explicit 300 msecs delay from the reset_watchdog_timer() function and replaced it with a variable delay (depending on the difference since the last ping). A debug message is used to catch the multiple pings trying to break the 300 msecs protection barrier.
- Fix error paths for the functions da9062_wdt_update_timeout_register() and da9062_wdt_stop()
- Add error paths in the probe() and correctly clean-up the registered device if there is a problem after registration.
This patch applies against linux-next and v4.1-rc5
drivers/watchdog/Kconfig | 9 ++ drivers/watchdog/Makefile | 1 + drivers/watchdog/da9062_wdt.c | 253 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 263 insertions(+) create mode 100644 drivers/watchdog/da9062_wdt.c
drivers/watchdog/Kconfig +9 -0
@@ -96,6 +96,15 @@ config DA9063_WATCHDOG This driver can be built as a module. The module name is da9063_wdt. +config DA9062_WATCHDOG + tristate "Dialog DA9062 Watchdog" + depends on MFD_DA9062 + select WATCHDOG_CORE + help + Support for the watchdog in the DA9062 PMIC. + + This driver can be built as a module. The module name is da9062_wdt. + config GPIO_WATCHDOG tristate "Watchdog device controlled through GPIO-line" depends on OF_GPIO
drivers/watchdog/Makefile +1 -0
@@ -179,6 +179,7 @@ obj-$(CONFIG_XEN_WDT) += xen_wdt.o # Architecture Independent obj-$(CONFIG_DA9052_WATCHDOG) += da9052_wdt.o obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o +obj-$(CONFIG_DA9062_WATCHDOG) += da9062_wdt.o obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o obj-$(CONFIG_GPIO_WATCHDOG) += gpio_wdt.o obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
drivers/watchdog/da9062_wdt.c new file +253 -0
253 lines not on this page · raw message
Signature · 6 lines
end-of-patch for PATCH V4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 3/3 devicetree: da9062: Add bindings for DA9062 driver
In reply to S TwissFrom: S Twiss <[email protected]>
Add device tree bindings for the DA9062 driver
---
Changes in V4:
- No change
Changes in V3:
- No change
Changes in V2:
- Dropped the RTC and Onkey binding information in this patch-set Those drivers have been dropped from this patch set and the binding information has been removed accordingly.
This patch applies against linux-next and v4.1-rc5
Documentation/devicetree/bindings/mfd/da9062.txt | 79 ++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/da9062.txt
Documentation/devicetree/bindings/mfd/da9062.txt new file +79 -0
@@ -0,0 +1,79 @@ +* Dialog DA9062 Power Management Integrated Circuit (PMIC) + +DA9062 consists of a large and varied group of sub-devices: + +Device Supply Names Description +------ ------------ ----------- +da9062-regulator : : LDOs & BUCKs +da9062-watchdog : : Watchdog Timer + +====== + +Required properties: + +- compatible : Should be "dlg,da9062". +- reg : Specifies the I2C slave address (this defaults to 0x58 but it can be + modified to match the chip's OTP settings). +- interrupt-parent : Specifies the reference to the interrupt controller for + the DA9062. +- interrupts : IRQ line information. +- interrupt-controller + +See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for +further information on IRQ bindings. + +Sub-nodes: + +- regulators : This node defines the settings for the LDOs and BUCKs. The + DA9062 regulators are bound using their names listed below: + + buck1 : BUCK_1 + buck2 : BUCK_2 + buck3 : BUCK_3 + buck4 : BUCK_4 + ldo1 : LDO_1 + ldo2 : LDO_2 + ldo3 : LDO_3 + ldo4 : LDO_4 + + The component follows the standard regulator framework and the bindings + details of individual regulator device can be found in: + Documentation/devicetree/bindings/regulator/regulator.txt + + +- watchdog: This node defines the settings for the watchdog driver associated + with the DA9062 PMIC. The compatible = "dlg,da9062-watchdog" should be added + if a node is created. + + +Example: + + pmic0: da9062@58 { + compatible = "dlg,da9062"; + reg = <0x58>; + interrupt-parent = <&gpio6>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + + watchdog { + compatible = "dlg,da9062-watchdog"; + }; + + regulators { + DA9062_BUCK1: buck1 { + regulator-name = "BUCK1"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1570000>; + regulator-min-microamp = <500000>; + regulator-max-microamp = <2000000>; + regulator-boot-on; + }; + DA9062_LDO1: ldo1 { + regulator-name = "LDO_1"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <3600000>; + regulator-boot-on; + }; + }; + }; +
Signature · 6 lines
end-of-patch for PATCH V4 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html