Skip to content

Commit

Permalink
mfd: Add MAX8907 core driver
Browse files Browse the repository at this point in the history
The MAX8907 is an I2C-based power-management IC containing voltage
regulators, a reset controller, a real-time clock, and a touch-screen
controller.

The original driver was written by:
* Gyungoh Yoo <jack.yoo@maxim-ic.com>

Various fixes and enhancements by:
* Jin Park <jinyoungp@nvidia.com>
* Tom Cherry <tcherry@nvidia.com>
* Prashant Gaikwad <pgaikwad@nvidia.com>
* Dan Willemsen <dwillemsen@nvidia.com>
* Laxman Dewangan <ldewangan@nvidia.com>

During upstreaming, I (swarren):
* Converted to regmap.
* Converted to regmap-irq.
* Allowed probing from device tree.
* Renamed from max8907c->max8907, since the driver covers at least the
  C and B revisions.
* General cleanup.

Signed-off-by: Gyungoh Yoo <jack.yoo@maxim-ic.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> #v3
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Gyungoh Yoo authored and Samuel Ortiz committed Sep 17, 2012
1 parent 7fb9c1a commit a91d2f8
Show file tree
Hide file tree
Showing 5 changed files with 665 additions and 0 deletions.
71 changes: 71 additions & 0 deletions Documentation/devicetree/bindings/regulator/max8907.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
MAX8907 regulator

Required properties:
- compatible: "maxim,max8907"
- reg: I2C slave address
- interrupts: The interrupt output of the controller
- mbatt-supply: The input supply for MBATT, BBAT, SDBY, VRTC.
- in-v1-supply: The input supply for SD1.
- in-v2-supply: The input supply for SD2.
- in-v3-supply: The input supply for SD3.
- in1-supply: The input supply for LDO1.
...
- in20-supply: The input supply for LDO20.
- regulators: A node that houses a sub-node for each regulator within the
device. Each sub-node is identified using the regulator-compatible
property, with valid values listed below. The content of each sub-node
is defined by the standard binding for regulators; see regulator.txt.

Valid regulator-compatible values are:

sd1, sd2, sd3, ldo1, ldo2, ldo3, ldo4, ldo5, ldo6, ldo7, ldo8, ldo9, ldo10,
ldo11, ldo12, ldo13, ldo14, ldo15, ldo16, ldo17, ldo18, ldo19, ldo20, out5v,
out33v, bbat, sdby, vrtc.

Example:

max8907@3c {
compatible = "maxim,max8907";
reg = <0x3c>;
interrupts = <0 86 0x4>;

mbatt-supply = <&some_reg>;
in-v1-supply = <&mbatt_reg>;
...
in1-supply = <&mbatt_reg>;
...

regulators {
#address-cells = <1>;
#size-cells = <0>;

mbatt_reg: regulator@0 {
reg = <0>;
regulator-compatible = "mbatt";
regulator-name = "vbat_pmu";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
};

regulator@1 {
reg = <1>;
regulator-compatible = "sd1";
regulator-name = "nvvdd_sv1,vdd_cpu_pmu";
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1000000>;
regulator-always-on;
};

regulator@2 {
reg = <2>;
regulator-compatible = "sd2";
regulator-name = "nvvdd_sv2,vdd_core";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-always-on;
};
...
};
};
};
12 changes: 12 additions & 0 deletions drivers/mfd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,18 @@ config MFD_MAX77693
additional drivers must be enabled in order to use the functionality
of the device.

config MFD_MAX8907
tristate "Maxim Semiconductor MAX8907 PMIC Support"
select MFD_CORE
depends on I2C=y && GENERIC_HARDIRQS
select REGMAP_I2C
select REGMAP_IRQ
help
Say yes here to support for Maxim Semiconductor MAX8907. This is
a Power Management IC. This driver provides common support for
accessing the device; additional drivers must be enabled in order
to use the functionality of the device.

config MFD_MAX8925
bool "Maxim Semiconductor MAX8925 PMIC Support"
depends on I2C=y && GENERIC_HARDIRQS
Expand Down
1 change: 1 addition & 0 deletions drivers/mfd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o

obj-$(CONFIG_MFD_MAX77686) += max77686.o max77686-irq.o
obj-$(CONFIG_MFD_MAX77693) += max77693.o max77693-irq.o
obj-$(CONFIG_MFD_MAX8907) += max8907.o
max8925-objs := max8925-core.o max8925-i2c.o
obj-$(CONFIG_MFD_MAX8925) += max8925.o
obj-$(CONFIG_MFD_MAX8997) += max8997.o max8997-irq.o
Expand Down
Loading

0 comments on commit a91d2f8

Please sign in to comment.