Skip to content

Commit a91d2f8

Browse files
Gyungoh YooSamuel Ortiz
authored andcommitted
mfd: Add MAX8907 core driver
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>
1 parent 7fb9c1a commit a91d2f8

5 files changed

Lines changed: 665 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
MAX8907 regulator
2+
3+
Required properties:
4+
- compatible: "maxim,max8907"
5+
- reg: I2C slave address
6+
- interrupts: The interrupt output of the controller
7+
- mbatt-supply: The input supply for MBATT, BBAT, SDBY, VRTC.
8+
- in-v1-supply: The input supply for SD1.
9+
- in-v2-supply: The input supply for SD2.
10+
- in-v3-supply: The input supply for SD3.
11+
- in1-supply: The input supply for LDO1.
12+
...
13+
- in20-supply: The input supply for LDO20.
14+
- regulators: A node that houses a sub-node for each regulator within the
15+
device. Each sub-node is identified using the regulator-compatible
16+
property, with valid values listed below. The content of each sub-node
17+
is defined by the standard binding for regulators; see regulator.txt.
18+
19+
Valid regulator-compatible values are:
20+
21+
sd1, sd2, sd3, ldo1, ldo2, ldo3, ldo4, ldo5, ldo6, ldo7, ldo8, ldo9, ldo10,
22+
ldo11, ldo12, ldo13, ldo14, ldo15, ldo16, ldo17, ldo18, ldo19, ldo20, out5v,
23+
out33v, bbat, sdby, vrtc.
24+
25+
Example:
26+
27+
max8907@3c {
28+
compatible = "maxim,max8907";
29+
reg = <0x3c>;
30+
interrupts = <0 86 0x4>;
31+
32+
mbatt-supply = <&some_reg>;
33+
in-v1-supply = <&mbatt_reg>;
34+
...
35+
in1-supply = <&mbatt_reg>;
36+
...
37+
38+
regulators {
39+
#address-cells = <1>;
40+
#size-cells = <0>;
41+
42+
mbatt_reg: regulator@0 {
43+
reg = <0>;
44+
regulator-compatible = "mbatt";
45+
regulator-name = "vbat_pmu";
46+
regulator-min-microvolt = <5000000>;
47+
regulator-max-microvolt = <5000000>;
48+
regulator-always-on;
49+
};
50+
51+
regulator@1 {
52+
reg = <1>;
53+
regulator-compatible = "sd1";
54+
regulator-name = "nvvdd_sv1,vdd_cpu_pmu";
55+
regulator-min-microvolt = <1000000>;
56+
regulator-max-microvolt = <1000000>;
57+
regulator-always-on;
58+
};
59+
60+
regulator@2 {
61+
reg = <2>;
62+
regulator-compatible = "sd2";
63+
regulator-name = "nvvdd_sv2,vdd_core";
64+
regulator-min-microvolt = <1200000>;
65+
regulator-max-microvolt = <1200000>;
66+
regulator-always-on;
67+
};
68+
...
69+
};
70+
};
71+
};

‎drivers/mfd/Kconfig‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,18 @@ config MFD_MAX77693
476476
additional drivers must be enabled in order to use the functionality
477477
of the device.
478478

479+
config MFD_MAX8907
480+
tristate "Maxim Semiconductor MAX8907 PMIC Support"
481+
select MFD_CORE
482+
depends on I2C=y && GENERIC_HARDIRQS
483+
select REGMAP_I2C
484+
select REGMAP_IRQ
485+
help
486+
Say yes here to support for Maxim Semiconductor MAX8907. This is
487+
a Power Management IC. This driver provides common support for
488+
accessing the device; additional drivers must be enabled in order
489+
to use the functionality of the device.
490+
479491
config MFD_MAX8925
480492
bool "Maxim Semiconductor MAX8925 PMIC Support"
481493
depends on I2C=y && GENERIC_HARDIRQS

‎drivers/mfd/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o
9292

9393
obj-$(CONFIG_MFD_MAX77686) += max77686.o max77686-irq.o
9494
obj-$(CONFIG_MFD_MAX77693) += max77693.o max77693-irq.o
95+
obj-$(CONFIG_MFD_MAX8907) += max8907.o
9596
max8925-objs := max8925-core.o max8925-i2c.o
9697
obj-$(CONFIG_MFD_MAX8925) += max8925.o
9798
obj-$(CONFIG_MFD_MAX8997) += max8997.o max8997-irq.o

0 commit comments

Comments
 (0)