Skip to content

Commit

Permalink
Merge tag 'mfd-next-5.3' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/lee/mfd

Pull MFD updates from Lee Jones:
 "Core Frameworks:
   - Set 'struct device' fwnode when registering a new device

  New Drivers:
   - Add support for ROHM BD70528 PMIC

  New Device Support:
   - Add support for LP87561 4-Phase Regulator to TI LP87565 PMIC
   - Add support for RK809 and RK817 to Rockchip RK808
   - Add support for Lid Angle to ChromeOS core
   - Add support for CS47L15 CODEC to Madera core
   - Add support for CS47L92 CODEC to Madera core
   - Add support for ChromeOS (legacy) Accelerometers in ChromeOS core
   - Add support for Add Intel Elkhart Lake PCH to Intel LPSS

  New Functionality:
   - Provide regulator supply information when registering; madera-core
   - Additional Device Tree support; lp87565, madera, cros-ec, rohm,bd71837-pmic
   - Allow over-riding power button press via Device Tree; rohm-bd718x7
   - Differentiate between running processors; cros_ec_dev

  Fix-ups:
   - Big header file update; cros_ec_commands.h
   - Split header per-subsystem; rohm-bd718x7
   - Remove superfluous code; menelaus, cs5535-mfd, cs47lXX-tables
   - Trivial; sorting, coding style; intel-lpss-pci
   - Only remove Power Off functionality if set locally; rk808
   - Make use for Power Off Prepare(); rk808
   - Fix spelling mistake in header guards; stmfx
   - Properly free IDA resources
   - SPDX fixups; cs47lXX-tables, madera
   - Error path fixups; hi655x-pmic

  Bug Fixes:
   - Add missing break in case() statement
   - Repair undefined behaviour when not initialising variables; arizona-core, madera-core
   - Fix reference to Device Tree documentation; madera"

* tag 'mfd-next-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits)
  mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk
  mfd: madera: Fixup SPDX headers
  mfd: madera: Remove some unused registers and fix some defaults
  mfd: intel-lpss: Release IDA resources
  mfd: intel-lpss: Add Intel Elkhart Lake PCH PCI IDs
  mfd: cs5535-mfd: Remove ifdef OLPC noise
  mfd: stmfx: Fix macro definition spelling
  dt-bindings: mfd: Add link to ROHM BD71847 Datasheet
  MAINAINERS: Swap words in INTEL PMIC MULTIFUNCTION DEVICE DRIVERS
  mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice
  mfd: rk808: Prepare rk805 for poweroff
  mfd: rk808: Check pm_power_off pointer
  mfd: cros_ec: differentiate SCP from EC by feature bit
  dt-bindings: Add binding for cros-ec-rpmsg
  mfd: madera: Add Madera core support for CS47L92
  mfd: madera: Add Madera core support for CS47L15
  mfd: madera: Update DT bindings to add additional CODECs
  mfd: madera: Add supply mapping for MICVDD
  mfd: madera: Fix potential uninitialised use of variable
  mfd: madera: Fix bad reference to pinctrl.txt file
  ...
  • Loading branch information
torvalds committed Jul 16, 2019
2 parents be8454a + 7efd105 commit 8de2625
Show file tree
Hide file tree
Showing 57 changed files with 7,524 additions and 549 deletions.
5 changes: 4 additions & 1 deletion Documentation/devicetree/bindings/mfd/cros-ec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ChromeOS Embedded Controller
Google's ChromeOS EC is a Cortex-M device which talks to the AP and
implements various function such as keyboard and battery charging.

The EC can be connect through various means (I2C, SPI, LPC) and the
The EC can be connect through various means (I2C, SPI, LPC, RPMSG) and the
compatible string used depends on the interface. Each connection method has
its own driver which connects to the top level interface-agnostic EC driver.
Other Linux driver (such as cros-ec-keyb for the matrix keyboard) connect to
Expand All @@ -17,6 +17,9 @@ Required properties (SPI):
- compatible: "google,cros-ec-spi"
- reg: SPI chip select

Required properties (RPMSG):
- compatible: "google,cros-ec-rpmsg"

Optional properties (SPI):
- google,cros-ec-spi-pre-delay: Some implementations of the EC need a little
time to wake up from sleep before they can receive SPI transfers at a high
Expand Down
36 changes: 36 additions & 0 deletions Documentation/devicetree/bindings/mfd/lp87565.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,39 @@ lp87565_pmic: pmic@60 {
};
};
};

TI LP87561 PMIC:

This is a single output 4-phase regulator configuration

Required properties:
- compatible: "ti,lp87561-q1"
- reg: I2C slave address.
- gpio-controller: Marks the device node as a GPIO Controller.
- #gpio-cells: Should be two. The first cell is the pin number and
the second cell is used to specify flags.
See ../gpio/gpio.txt for more information.
- xxx-in-supply: Phandle to parent supply node of each regulator
populated under regulators node. xxx should match
the supply_name populated in driver.
Example:

lp87561_pmic: pmic@62 {
compatible = "ti,lp87561-q1";
reg = <0x62>;
gpio-controller;
#gpio-cells = <2>;

buck3210-in-supply = <&vsys_3v3>;

regulators: regulators {
buck3210_reg: buck3210 {
/* VDD_CORE */
regulator-name = "buck3210";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <800000>;
regulator-always-on;
regulator-boot-on;
};
};
};
8 changes: 6 additions & 2 deletions Documentation/devicetree/bindings/mfd/madera.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ bindings/sound/madera.txt
Required properties:

- compatible : One of the following chip-specific strings:
"cirrus,cs47l15"
"cirrus,cs47l35"
"cirrus,cs47l85"
"cirrus,cs47l90"
"cirrus,cs47l91"
"cirrus,cs42l92"
"cirrus,cs47l92"
"cirrus,cs47l93"
"cirrus,wm1840"

- reg : I2C slave address when connected using I2C, chip select number when
using SPI.

- DCVDD-supply : Power supply for the device as defined in
bindings/regulator/regulator.txt
Mandatory on CS47L35, CS47L90, CS47L91
Mandatory on CS47L15, CS47L35, CS47L90, CS47L91, CS42L92, CS47L92, CS47L93
Optional on CS47L85, WM1840

- AVDD-supply, DBVDD1-supply, DBVDD2-supply, CPVDD1-supply, CPVDD2-supply :
Expand All @@ -35,7 +39,7 @@ Required properties:
(CS47L85, WM1840)

- SPKVDD-supply : Power supply for the device
(CS47L35)
(CS47L15, CS47L35)

- interrupt-controller : Indicates that this device is an interrupt controller

Expand Down
44 changes: 44 additions & 0 deletions Documentation/devicetree/bindings/mfd/rk808.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ RK8XX Power Management Integrated Circuit
The rk8xx family current members:
rk805
rk808
rk809
rk817
rk818

Required properties:
- compatible: "rockchip,rk805"
- compatible: "rockchip,rk808"
- compatible: "rockchip,rk809"
- compatible: "rockchip,rk817"
- compatible: "rockchip,rk818"
- reg: I2C slave address
- interrupts: the interrupt outputs of the controller.
Expand Down Expand Up @@ -45,6 +49,23 @@ Optional RK808 properties:
the gpio controller. If DVS GPIOs aren't present, voltage changes will happen
very quickly with no slow ramp time.

Optional shared RK809 and RK817 properties:
- vcc1-supply: The input supply for DCDC_REG1
- vcc2-supply: The input supply for DCDC_REG2
- vcc3-supply: The input supply for DCDC_REG3
- vcc4-supply: The input supply for DCDC_REG4
- vcc5-supply: The input supply for LDO_REG1, LDO_REG2, LDO_REG3
- vcc6-supply: The input supply for LDO_REG4, LDO_REG5, LDO_REG6
- vcc7-supply: The input supply for LDO_REG7, LDO_REG8, LDO_REG9

Optional RK809 properties:
- vcc8-supply: The input supply for SWITCH_REG1
- vcc9-supply: The input supply for DCDC_REG5, SWITCH_REG2

Optional RK817 properties:
- vcc8-supply: The input supply for BOOST
- vcc9-supply: The input supply for OTG_SWITCH

Optional RK818 properties:
- vcc1-supply: The input supply for DCDC_REG1
- vcc2-supply: The input supply for DCDC_REG2
Expand Down Expand Up @@ -86,6 +107,21 @@ number as described in RK808 datasheet.
- SWITCH_REGn
- valid values for n are 1 to 2

Following regulators of the RK809 and RK817 PMIC blocks are supported. Note that
the 'n' in regulator name, as in DCDC_REGn or LDOn, represents the DCDC or LDO
number as described in RK809 and RK817 datasheets.

- DCDC_REGn
- valid values for n are 1 to 5 for RK809.
- valid values for n are 1 to 4 for RK817.
- LDO_REGn
- valid values for n are 1 to 9 for RK809.
- valid values for n are 1 to 9 for RK817.
- SWITCH_REGn
- valid values for n are 1 to 2 for RK809.
- BOOST for RK817
- OTG_SWITCH for RK817

Following regulators of the RK818 PMIC block are supported. Note that
the 'n' in regulator name, as in DCDC_REGn or LDOn, represents the DCDC or LDO
number as described in RK818 datasheet.
Expand All @@ -98,6 +134,14 @@ number as described in RK818 datasheet.
- HDMI_SWITCH
- OTG_SWITCH

It is necessary to configure three pins for both the RK809 and RK817, the three
pins are "gpio_ts" "gpio_gt" "gpio_slp".
The gpio_gt and gpio_ts pins support the gpio function.
The gpio_slp pin is for controlling the pmic states, as below:
- reset
- power down
- sleep

Standard regulator bindings are used inside regulator subnodes. Check
Documentation/devicetree/bindings/regulator/regulator.txt
for more details
Expand Down
102 changes: 102 additions & 0 deletions Documentation/devicetree/bindings/mfd/rohm,bd70528-pmic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
* ROHM BD70528 Power Management Integrated Circuit bindings

BD70528MWV is an ultra-low quiescent current general purpose, single-chip,
power management IC for battery-powered portable devices. The IC
integrates 3 ultra-low current consumption buck converters, 3 LDOs and 2
LED Drivers. Also included are 4 GPIOs, a real-time clock (RTC), a 32kHz
clock gate, high-accuracy VREF for use with an external ADC, flexible
dual-input power path, 10 bit SAR ADC for battery temperature monitor and
1S battery charger with scalable charge currents.

Required properties:
- compatible : Should be "rohm,bd70528"
- reg : I2C slave address.
- interrupts : The interrupt line the device is connected to.
- interrupt-controller : To indicate BD70528 acts as an interrupt controller.
- #interrupt-cells : Should be 2. Usage is compliant to the 2 cells
variant of ../interrupt-controller/interrupts.txt
- gpio-controller : To indicate BD70528 acts as a GPIO controller.
- #gpio-cells : Should be 2. The first cell is the pin number and
the second cell is used to specify flags. See
../gpio/gpio.txt for more information.
- #clock-cells : Should be 0.
- regulators: : List of child nodes that specify the regulators.
Please see ../regulator/rohm,bd70528-regulator.txt

Optional properties:
- clock-output-names : Should contain name for output clock.

Example:
/* External oscillator */
osc: oscillator {
compatible = "fixed-clock";
#clock-cells = <1>;
clock-frequency = <32768>;
clock-output-names = "osc";
};

pmic: pmic@4b {
compatible = "rohm,bd70528";
reg = <0x4b>;
interrupt-parent = <&gpio1>;
interrupts = <29 GPIO_ACTIVE_LOW>;
clocks = <&osc 0>;
#clock-cells = <0>;
clock-output-names = "bd70528-32k-out";
#gpio-cells = <2>;
gpio-controller;
interrupt-controller;
#interrupt-cells = <2>;

regulators {
buck1: BUCK1 {
regulator-name = "buck1";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
regulator-ramp-delay = <125>;
};
buck2: BUCK2 {
regulator-name = "buck2";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-ramp-delay = <125>;
};
buck3: BUCK3 {
regulator-name = "buck3";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
regulator-ramp-delay = <250>;
};
ldo1: LDO1 {
regulator-name = "ldo1";
regulator-min-microvolt = <1650000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};
ldo2: LDO2 {
regulator-name = "ldo2";
regulator-min-microvolt = <1650000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};

ldo3: LDO3 {
regulator-name = "ldo3";
regulator-min-microvolt = <1650000>;
regulator-max-microvolt = <3300000>;
};
led_ldo1: LED_LDO1 {
regulator-name = "led_ldo1";
regulator-min-microvolt = <200000>;
regulator-max-microvolt = <300000>;
};
led_ldo2: LED_LDO2 {
regulator-name = "led_ldo2";
regulator-min-microvolt = <200000>;
regulator-max-microvolt = <300000>;
};
};
};
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and 6 LDOs.

Datasheet for BD71837 is available at:
https://www.rohm.com/datasheet/BD71837MWV/bd71837mwv-e
Datasheet for BD71847 is available at:
https://www.rohm.com/datasheet/BD71847AMWV/bd71847amwv-e

Required properties:
- compatible : Should be "rohm,bd71837" for bd71837
Expand Down Expand Up @@ -38,6 +40,14 @@ target state is set to READY by default. If SNVS state is used the boot
crucial regulators must have the regulator-always-on and regulator-boot-on
properties set in regulator node.

- rohm,short-press-ms : Short press duration in milliseconds
- rohm,long-press-ms : Long press duration in milliseconds

Configure the "short press" and "long press" timers for the power button.
Values are rounded to what hardware supports (500ms multiple for short and
1000ms multiple for long). If these properties are not present the existing
configuration (from bootloader or OTP) is not touched.

Example:

/* external oscillator node */
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8222,7 +8222,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git
F: drivers/gpio/gpio-*cove.c
F: drivers/gpio/gpio-msic.c

INTEL MULTIFUNCTION PMIC DEVICE DRIVERS
INTEL PMIC MULTIFUNCTION DEVICE DRIVERS
R: Andy Shevchenko <[email protected]>
S: Maintained
F: drivers/mfd/intel_msic.c
Expand Down
15 changes: 7 additions & 8 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ config COMMON_CLK_MAX9485
This driver supports Maxim 9485 Programmable Audio Clock Generator

config COMMON_CLK_RK808
tristate "Clock driver for RK805/RK808/RK818"
tristate "Clock driver for RK805/RK808/RK809/RK817/RK818"
depends on MFD_RK808
---help---
This driver supports RK805, RK808 and RK818 crystal oscillator clock. These
multi-function devices have two fixed-rate oscillators,
clocked at 32KHz each. Clkout1 is always on, Clkout2 can off
by control register.
This driver supports RK805, RK809 and RK817, RK808 and RK818 crystal oscillator clock.
These multi-function devices have two fixed-rate oscillators, clocked at 32KHz each.
Clkout1 is always on, Clkout2 can off by control register.

config COMMON_CLK_HI655X
tristate "Clock driver for Hi655x" if EXPERT
Expand Down Expand Up @@ -293,10 +292,10 @@ config COMMON_CLK_STM32H7

config COMMON_CLK_BD718XX
tristate "Clock driver for ROHM BD718x7 PMIC"
depends on MFD_ROHM_BD718XX
depends on MFD_ROHM_BD718XX || MFD_ROHM_BD70528
help
This driver supports ROHM BD71837 and ROHM BD71847
PMICs clock gates.
This driver supports ROHM BD71837, ROHM BD71847 and
ROHM BD70528 PMICs clock gates.

config COMMON_CLK_FIXED_MMIO
bool "Clock driver for Memory Mapped Fixed values"
Expand Down
24 changes: 18 additions & 6 deletions drivers/clk/clk-bd718x7.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/mfd/rohm-bd718x7.h>
#include <linux/mfd/rohm-bd70528.h>
#include <linux/clk-provider.h>
#include <linux/clkdev.h>
#include <linux/regmap.h>
Expand All @@ -17,7 +18,7 @@ struct bd718xx_clk {
u8 reg;
u8 mask;
struct platform_device *pdev;
struct bd718xx *mfd;
struct rohm_regmap_dev *mfd;
};

static int bd71837_clk_set(struct clk_hw *hw, int status)
Expand Down Expand Up @@ -68,7 +69,7 @@ static int bd71837_clk_probe(struct platform_device *pdev)
int rval = -ENOMEM;
const char *parent_clk;
struct device *parent = pdev->dev.parent;
struct bd718xx *mfd = dev_get_drvdata(parent);
struct rohm_regmap_dev *mfd = dev_get_drvdata(parent);
struct clk_init_data init = {
.name = "bd718xx-32k-out",
.ops = &bd71837_clk_ops,
Expand All @@ -86,9 +87,20 @@ static int bd71837_clk_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "No parent clk found\n");
return -EINVAL;
}

c->reg = BD718XX_REG_OUT32K;
c->mask = BD718XX_OUT32K_EN;
switch (mfd->chip_type) {
case ROHM_CHIP_TYPE_BD71837:
case ROHM_CHIP_TYPE_BD71847:
c->reg = BD718XX_REG_OUT32K;
c->mask = BD718XX_OUT32K_EN;
break;
case ROHM_CHIP_TYPE_BD70528:
c->reg = BD70528_REG_CLK_OUT;
c->mask = BD70528_CLK_OUT_EN_MASK;
break;
default:
dev_err(&pdev->dev, "Unknown clk chip\n");
return -EINVAL;
}
c->mfd = mfd;
c->pdev = pdev;
c->hw.init = &init;
Expand Down Expand Up @@ -119,5 +131,5 @@ static struct platform_driver bd71837_clk = {
module_platform_driver(bd71837_clk);

MODULE_AUTHOR("Matti Vaittinen <[email protected]>");
MODULE_DESCRIPTION("BD71837 chip clk driver");
MODULE_DESCRIPTION("BD71837/BD71847/BD70528 chip clk driver");
MODULE_LICENSE("GPL");
Loading

0 comments on commit 8de2625

Please sign in to comment.