Skip to content

Commit d3092e4

Browse files
committed
Merge tag 'mfd-next-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones: "New drivers: - Add support for Cherry Trail Dollar Cove TI PMIC - Add support for Add Spreadtrum SC27xx series PMICs New device support: - Add support Regulator to axp20x New functionality: - Add DT support; aspeed-scu sc27xx-pmic - Add power saving support; rts5249 Fix-ups: - DT clean-up/rework; tps65217, max77693, iproc-cdru, iproc-mhb, tps65218 - Staticise/constify; stw481x - Use new succinct IRQ API; fsl-imx25-tsadc - Kconfig fix-ups; MFD_TPS65218 - Identify SPI method; lpc_ich - Use managed resources (devm_*) calls; ssbi - Remove unused/obsolete code/documentation; mc13xxx Bug fixes: - Fix typo in MAINTAINERS - Fix error handling; mxs-lradc - Clean-up IRQs on .remove; fsl-imx25-tsadc" * tag 'mfd-next-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (21 commits) dt-bindings: mfd: mc13xxx: Remove obsolete property mfd: axp20x: Add axp20x-regulator cell for AXP813 mfd: Add Spreadtrum SC27xx series PMICs driver dt-bindings: mfd: Add Spreadtrum SC27xx PMIC documentation mfd: ssbi: Use devm_of_platform_populate() mfd: fsl-imx25: Clean up irq settings during removal mfd: mxs-lradc: Fix error handling in mxs_lradc_probe() mfd: lpc_ich: Avoton/Rangeley uses SPI_BYT method mfd: tps65218: Introduce dependency on CONFIG_OF mfd: tps65218: Correct the config description MAINTAINERS: Fix Dialog search term for watchdog binding file mfd: fsl-imx25: Set irq handler and data in one go mfd: rts5249: Add support for RTS5250S power saving ACPI / PMIC: Add opregion driver for Intel Dollar Cove TI PMIC mfd: Add support for Cherry Trail Dollar Cove TI PMIC syscon: dt-bindings: Add binding document for iProc MHB block syscon: dt-bindings: Add binding doc for Broadcom iProc CDRU mfd: max77693: Add muic of_compatible in mfd_cell mfd: stw481x: Make three arrays static const, reduces object code size mfd: tps65217: Introduce dependency on CONFIG_OF ...
2 parents 2bf16b7 + b2596d7 commit d3092e4

30 files changed

Lines changed: 1138 additions & 75 deletions

‎Documentation/devicetree/bindings/mfd/aspeed-scu.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ Required properties:
99
"aspeed,g5-scu", "syscon", "simple-mfd"
1010

1111
- reg: contains the offset and length of the SCU memory region
12+
- #clock-cells: should be set to <1> - the system controller is also a
13+
clock provider
14+
- #reset-cells: should be set to <1> - the system controller is also a
15+
reset line provider
1216

1317
Example:
1418

1519
syscon: syscon@1e6e2000 {
1620
compatible = "aspeed,ast2400-scu", "syscon", "simple-mfd";
1721
reg = <0x1e6e2000 0x1a8>;
22+
#clock-cells = <1>;
23+
#reset-cells = <1>;
1824
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Broadcom iProc Chip Device Resource Unit (CDRU)
2+
3+
Various Broadcom iProc SoCs have a set of registers that provide various
4+
chip specific device and resource configurations. This node allows access to
5+
these CDRU registers via syscon.
6+
7+
Required properties:
8+
- compatible: should contain:
9+
"brcm,sr-cdru", "syscon" for Stingray
10+
- reg: base address and range of the CDRU registers
11+
12+
Example:
13+
cdru: syscon@6641d000 {
14+
compatible = "brcm,sr-cdru", "syscon";
15+
reg = <0 0x6641d000 0 0x400>;
16+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Broadcom iProc Multi Host Bridge (MHB)
2+
3+
Certain Broadcom iProc SoCs have a multi host bridge (MHB) block that controls
4+
the connection and configuration of 1) internal PCIe serdes; 2) PCIe endpoint
5+
interface; 3) access to the Nitro (network processing) engine
6+
7+
This node allows access to these MHB registers via syscon.
8+
9+
Required properties:
10+
- compatible: should contain:
11+
"brcm,sr-mhb", "syscon" for Stingray
12+
- reg: base address and range of the MHB registers
13+
14+
Example:
15+
mhb: syscon@60401000 {
16+
compatible = "brcm,sr-mhb", "syscon";
17+
reg = <0 0x60401000 0 0x38c>;
18+
};

‎Documentation/devicetree/bindings/mfd/max77693.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ Required properties for the LED child node:
127127
Optional properties for the LED child node:
128128
- label : see Documentation/devicetree/bindings/leds/common.txt
129129

130+
Optional nodes:
131+
- max77693-muic :
132+
Node used only by extcon consumers.
133+
Required properties:
134+
- compatible : "maxim,max77693-muic"
135+
130136
Example:
131137
#include <dt-bindings/leds/common.h>
132138

‎Documentation/devicetree/bindings/mfd/mc13xxx.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ MC13892 regulators:
113113
Examples:
114114

115115
ecspi@70010000 { /* ECSPI1 */
116-
fsl,spi-num-chipselects = <2>;
117116
cs-gpios = <&gpio4 24 0>, /* GPIO4_24 */
118117
<&gpio4 25 0>; /* GPIO4_25 */
119118

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Spreadtrum SC27xx Power Management Integrated Circuit (PMIC)
2+
3+
The Spreadtrum SC27xx series PMICs contain SC2720, SC2721, SC2723, SC2730
4+
and SC2731. The Spreadtrum PMIC belonging to SC27xx series integrates all
5+
mobile handset power management, audio codec, battery management and user
6+
interface support function in a single chip. It has 6 major functional
7+
blocks:
8+
- DCDCs to support CPU, memory.
9+
- LDOs to support both internal and external requirement.
10+
- Battery management system, such as charger, fuel gauge.
11+
- Audio codec.
12+
- User interface function, such as indicator, flash LED and so on.
13+
- IC level interface, such as power on/off control, RTC and typec and so on.
14+
15+
Required properties:
16+
- compatible: Should be one of the following:
17+
"sprd,sc2720"
18+
"sprd,sc2721"
19+
"sprd,sc2723"
20+
"sprd,sc2730"
21+
"sprd,sc2731"
22+
- reg: The address of the device chip select, should be 0.
23+
- spi-max-frequency: Typically set to 26000000.
24+
- interrupts: The interrupt line the device is connected to.
25+
- interrupt-controller: Marks the device node as an interrupt controller.
26+
- #interrupt-cells: The number of cells to describe an PMIC IRQ, must be 2.
27+
- #address-cells: Child device offset number of cells, must be 1.
28+
- #size-cells: Child device size number of cells, must be 0.
29+
30+
Example:
31+
pmic@0 {
32+
compatible = "sprd,sc2731";
33+
reg = <0>;
34+
spi-max-frequency = <26000000>;
35+
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
36+
interrupt-controller;
37+
#interrupt-cells = <2>;
38+
#address-cells = <1>;
39+
#size-cells = <0>;
40+
};

‎MAINTAINERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4146,7 +4146,7 @@ F: Documentation/devicetree/bindings/mfd/da90*.txt
41464146
F: Documentation/devicetree/bindings/input/da90??-onkey.txt
41474147
F: Documentation/devicetree/bindings/thermal/da90??-thermal.txt
41484148
F: Documentation/devicetree/bindings/regulator/da92*.txt
4149-
F: Documentation/devicetree/bindings/watchdog/da92??-wdt.txt
4149+
F: Documentation/devicetree/bindings/watchdog/da90??-wdt.txt
41504150
F: Documentation/devicetree/bindings/sound/da[79]*.txt
41514151
F: drivers/gpio/gpio-da90??.c
41524152
F: drivers/hwmon/da90??-hwmon.c

‎drivers/acpi/Kconfig‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,12 @@ config CHT_WC_PMIC_OPREGION
527527
help
528528
This config adds ACPI operation region support for CHT Whiskey Cove PMIC.
529529

530+
config CHT_DC_TI_PMIC_OPREGION
531+
bool "ACPI operation region support for Dollar Cove TI PMIC"
532+
depends on INTEL_SOC_PMIC_CHTDC_TI
533+
help
534+
This config adds ACPI operation region support for Dollar Cove TI PMIC.
535+
530536
endif
531537

532538
config ACPI_CONFIGFS

‎drivers/acpi/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o
106106
obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o
107107
obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += pmic/intel_pmic_bxtwc.o
108108
obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += pmic/intel_pmic_chtwc.o
109+
obj-$(CONFIG_CHT_DC_TI_PMIC_OPREGION) += pmic/intel_pmic_chtdc_ti.o
109110

110111
obj-$(CONFIG_ACPI_CONFIGFS) += acpi_configfs.o
111112

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/*
2+
* Dollar Cove TI PMIC operation region driver
3+
* Copyright (C) 2014 Intel Corporation. All rights reserved.
4+
*
5+
* Rewritten and cleaned up
6+
* Copyright (C) 2017 Takashi Iwai <tiwai@suse.de>
7+
*/
8+
9+
#include <linux/acpi.h>
10+
#include <linux/init.h>
11+
#include <linux/mfd/intel_soc_pmic.h>
12+
#include <linux/platform_device.h>
13+
#include "intel_pmic.h"
14+
15+
/* registers stored in 16bit BE (high:low, total 10bit) */
16+
#define CHTDC_TI_VBAT 0x54
17+
#define CHTDC_TI_DIETEMP 0x56
18+
#define CHTDC_TI_BPTHERM 0x58
19+
#define CHTDC_TI_GPADC 0x5a
20+
21+
static struct pmic_table chtdc_ti_power_table[] = {
22+
{ .address = 0x00, .reg = 0x41 },
23+
{ .address = 0x04, .reg = 0x42 },
24+
{ .address = 0x08, .reg = 0x43 },
25+
{ .address = 0x0c, .reg = 0x45 },
26+
{ .address = 0x10, .reg = 0x46 },
27+
{ .address = 0x14, .reg = 0x47 },
28+
{ .address = 0x18, .reg = 0x48 },
29+
{ .address = 0x1c, .reg = 0x49 },
30+
{ .address = 0x20, .reg = 0x4a },
31+
{ .address = 0x24, .reg = 0x4b },
32+
{ .address = 0x28, .reg = 0x4c },
33+
{ .address = 0x2c, .reg = 0x4d },
34+
{ .address = 0x30, .reg = 0x4e },
35+
};
36+
37+
static struct pmic_table chtdc_ti_thermal_table[] = {
38+
{
39+
.address = 0x00,
40+
.reg = CHTDC_TI_GPADC
41+
},
42+
{
43+
.address = 0x0c,
44+
.reg = CHTDC_TI_GPADC
45+
},
46+
/* TMP2 -> SYSTEMP */
47+
{
48+
.address = 0x18,
49+
.reg = CHTDC_TI_GPADC
50+
},
51+
/* TMP3 -> BPTHERM */
52+
{
53+
.address = 0x24,
54+
.reg = CHTDC_TI_BPTHERM
55+
},
56+
{
57+
.address = 0x30,
58+
.reg = CHTDC_TI_GPADC
59+
},
60+
/* TMP5 -> DIETEMP */
61+
{
62+
.address = 0x3c,
63+
.reg = CHTDC_TI_DIETEMP
64+
},
65+
};
66+
67+
static int chtdc_ti_pmic_get_power(struct regmap *regmap, int reg, int bit,
68+
u64 *value)
69+
{
70+
int data;
71+
72+
if (regmap_read(regmap, reg, &data))
73+
return -EIO;
74+
75+
*value = data & 1;
76+
return 0;
77+
}
78+
79+
static int chtdc_ti_pmic_update_power(struct regmap *regmap, int reg, int bit,
80+
bool on)
81+
{
82+
return regmap_update_bits(regmap, reg, 1, on);
83+
}
84+
85+
static int chtdc_ti_pmic_get_raw_temp(struct regmap *regmap, int reg)
86+
{
87+
u8 buf[2];
88+
89+
if (regmap_bulk_read(regmap, reg, buf, 2))
90+
return -EIO;
91+
92+
/* stored in big-endian */
93+
return ((buf[0] & 0x03) << 8) | buf[1];
94+
}
95+
96+
static struct intel_pmic_opregion_data chtdc_ti_pmic_opregion_data = {
97+
.get_power = chtdc_ti_pmic_get_power,
98+
.update_power = chtdc_ti_pmic_update_power,
99+
.get_raw_temp = chtdc_ti_pmic_get_raw_temp,
100+
.power_table = chtdc_ti_power_table,
101+
.power_table_count = ARRAY_SIZE(chtdc_ti_power_table),
102+
.thermal_table = chtdc_ti_thermal_table,
103+
.thermal_table_count = ARRAY_SIZE(chtdc_ti_thermal_table),
104+
};
105+
106+
static int chtdc_ti_pmic_opregion_probe(struct platform_device *pdev)
107+
{
108+
struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent);
109+
int err;
110+
111+
err = intel_pmic_install_opregion_handler(&pdev->dev,
112+
ACPI_HANDLE(pdev->dev.parent), pmic->regmap,
113+
&chtdc_ti_pmic_opregion_data);
114+
if (err < 0)
115+
return err;
116+
117+
/* Re-enumerate devices depending on PMIC */
118+
acpi_walk_dep_device_list(ACPI_HANDLE(pdev->dev.parent));
119+
return 0;
120+
}
121+
122+
static const struct platform_device_id chtdc_ti_pmic_opregion_id_table[] = {
123+
{ .name = "chtdc_ti_region" },
124+
{},
125+
};
126+
127+
static struct platform_driver chtdc_ti_pmic_opregion_driver = {
128+
.probe = chtdc_ti_pmic_opregion_probe,
129+
.driver = {
130+
.name = "cht_dollar_cove_ti_pmic",
131+
},
132+
.id_table = chtdc_ti_pmic_opregion_id_table,
133+
};
134+
module_platform_driver(chtdc_ti_pmic_opregion_driver);
135+
136+
MODULE_DESCRIPTION("Dollar Cove TI PMIC opregion driver");
137+
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)