Merge tag 'regulator-v6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "There's a bunch of new drivers here, plus a lot of hardening for the
  supply resolution code which allow us to support systems where we have
  two PMICs each of which has regulators supplied by the other. This did
  work a long time ago but got broken as part of improved integration
  with the device model, it's fairly rare so nobody noticed.

   - Improvements for supply handling from André Draszik to allow
     systems with two PMICs with supply/consumer relationships in both
     directions to instantiate.

   - New drivers for Maxim MAX776750, Realtek RT8902, Samsung S2MPG11,
     Texas Instuments TPS65185.

  This have also pulls in some MFD updates which are build dependencies
  for the Samsung S2MPG11 support"

* tag 'regulator-v6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (42 commits)
  regulator: s2mps11: more descriptive gpio consumer name
  regulator: s2mps11: add S2MPG11 regulator
  regulator: s2mps11: refactor S2MPG10 regulator macros for S2MPG11 reuse
  regulator: s2mps11: refactor S2MPG10 ::set_voltage_time() for S2MPG11 reuse
  regulator: s2mps11: add S2MPG10 regulator
  regulator: s2mps11: refactor handling of external rail control
  regulator: s2mps11: update node parsing (allow -supply properties)
  regulator: s2mps11: place constants on right side of comparison tests
  regulator: s2mps11: use dev_err_probe() where appropriate
  regulator: s2mps11: drop two needless variable initialisations
  regulator: add REGULATOR_LINEAR_VRANGE macro
  regulator: dt-bindings: add s2mpg11-pmic regulators
  regulator: dt-bindings: add s2mpg10-pmic regulators
  dt-bindings: firmware: google,gs101-acpm-ipc: convert regulators to lowercase
  mfd: sec: Add support for S2MPG11 PMIC via ACPM
  mfd: sec: s2mpg10: Reorder regulators for better probe performance
  dt-bindings: mfd: Add samsung,s2mpg11-pmic
  dt-bindings: mfd: samsung,s2mpg10-pmic: Link to its regulators
  dt-bindings: mfd: samsung,s2mps11: Split s2mpg10-pmic into separate file
  mfd: sec: Drop now unused struct sec_pmic_dev::irq_data
  ...
This commit is contained in:
Linus Torvalds
2026-02-11 09:40:12 -08:00
34 changed files with 4974 additions and 343 deletions
@@ -75,7 +75,7 @@ examples:
interrupts-extended = <&gpa0 6 IRQ_TYPE_LEVEL_LOW>;
regulators {
LDO1 {
ldo1m {
regulator-name = "vdd_ldo1";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
@@ -84,7 +84,7 @@ examples:
// ...
BUCK1 {
buck8m {
regulator-name = "vdd_mif";
regulator-min-microvolt = <450000>;
regulator-max-microvolt = <1300000>;
@@ -0,0 +1,120 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/samsung,s2mpg10-pmic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung S2MPG10 Power Management IC
maintainers:
- André Draszik <andre.draszik@linaro.org>
description: |
This is part of the device tree bindings for the S2MPG10 Power Management IC
(PMIC).
The Samsung S2MPG10 is a Power Management IC for mobile applications with buck
converters, various LDOs, power meters, RTC, clock outputs, and additional
GPIO interfaces and is typically complemented by S2MPG10 PMIC in a main/sub
configuration as the main PMIC.
properties:
compatible:
const: samsung,s2mpg10-pmic
clocks:
$ref: /schemas/clock/samsung,s2mps11.yaml
description:
Child node describing clock provider.
interrupts:
maxItems: 1
regulators:
type: object
$ref: /schemas/regulator/samsung,s2mpg10-regulator.yaml
description:
List of child nodes that specify the regulators.
system-power-controller: true
wakeup-source: true
patternProperties:
"^vinb([1-9]|10)m-supply$":
description:
Phandle to the power supply for each buck rail of this PMIC. There is a
1:1 mapping of supply to rail, e.g. vinb1m-supply supplies buck1m.
"^vinl([1-9]|1[0-5])m-supply$":
description: |
Phandle to the power supply for one or multiple LDO rails of this PMIC.
The mapping of supply to rail(s) is as follows:
vinl1m - ldo13m
vinl2m - ldo15m
vinl3m - ldo1m, ldo5m, ldo7m
vinl4m - ldo3m, ldo8m
vinl5m - ldo16m
vinl6m - ldo17m
vinl7m - ldo6m, ldo11m, ldo24m, ldo28m
vinl8m - ldo12m
vinl9m - ldo2m, ldo4m
vinl10m - ldo9m, ldo14m, ldo18m, 19m, ldo20m, ldo25m
vinl11m - ldo23m, ldo31m
vinl12m - ldo29m
vinl13m - ldo30m
vinl14m - ldo21m
vinl15m - ldo10m, ldo22m, ldo26m, ldo27m
required:
- compatible
- interrupts
- regulators
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/regulator/samsung,s2mpg10-regulator.h>
pmic {
compatible = "samsung,s2mpg10-pmic";
interrupts-extended = <&gpa0 6 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pmic_int>;
system-power-controller;
wakeup-source;
vinl3m-supply = <&buck8m>;
clocks {
compatible = "samsung,s2mpg10-clk";
#clock-cells = <1>;
clock-output-names = "rtc32k_ap", "peri32k1", "peri32k2";
};
regulators {
buck8m {
regulator-name = "vdd_mif";
regulator-min-microvolt = <450000>;
regulator-max-microvolt = <1300000>;
regulator-ramp-delay = <6250>;
};
ldo1m {
regulator-name = "vdd_ldo1";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
};
ldo20m {
regulator-name = "vdd_dmics";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
regulator-always-on;
samsung,ext-control = <S2MPG10_EXTCTRL_LDO20M_EN2>;
};
};
};
@@ -0,0 +1,88 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/samsung,s2mpg11-pmic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung S2MPG11 Power Management IC
maintainers:
- André Draszik <andre.draszik@linaro.org>
description: |
This is part of the device tree bindings for the S2MPG11 Power Management IC
(PMIC).
The Samsung S2MPG11 is a Power Management IC for mobile applications with buck
converters, various LDOs, power meters, NTC thermistor inputs, and additional
GPIO interfaces and typically complements an S2MPG10 PMIC in a main/sub
configuration as the sub-PMIC.
properties:
compatible:
const: samsung,s2mpg11-pmic
interrupts:
maxItems: 1
regulators:
type: object
$ref: /schemas/regulator/samsung,s2mpg11-regulator.yaml
description:
List of child nodes that specify the regulators.
wakeup-source: true
patternProperties:
"^vinb(([1-9]|10)s|[abd])-supply$":
description:
Phandle to the power supply for each buck rail of this PMIC. There is a
1:1 mapping of numbered supply to rail, e.g. vinb1s-supply supplies
buck1s. The remaining mapping is as follows
vinba - bucka
vinbb - buck boost
vinbd - buckd
"^vinl[1-6]s-supply$":
description: |
Phandle to the power supply for one or multiple LDO rails of this PMIC.
The mapping of supply to rail(s) is as follows
vinl1s - ldo1s, ldo2s
vinl2s - ldo8s, ldo9s
vinl3s - ldo3s, ldo5s, ldo7s, ldo15s
vinl4s - ldo10s, ldo11s, ldo12s, ldo14s
vinl5s - ldo4s, ldo6s
vinl6s - ldo13s
required:
- compatible
- interrupts
- regulators
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/regulator/samsung,s2mpg10-regulator.h>
pmic {
compatible = "samsung,s2mpg11-pmic";
interrupts-extended = <&gpa0 7 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pmic_int>;
wakeup-source;
vinl1s-supply = <&buck8m>;
vinl2s-supply = <&buck6s>;
regulators {
buckd {
regulator-name = "vcc_ufs";
regulator-ramp-delay = <6250>;
enable-gpios = <&gpp0 1 GPIO_ACTIVE_HIGH>;
samsung,ext-control = <S2MPG11_EXTCTRL_UFS_EN>;
};
};
};
@@ -20,7 +20,6 @@ description: |
properties:
compatible:
enum:
- samsung,s2mpg10-pmic
- samsung,s2mps11-pmic
- samsung,s2mps13-pmic
- samsung,s2mps14-pmic
@@ -59,42 +58,16 @@ properties:
reset (setting buck voltages to default values).
type: boolean
system-power-controller: true
wakeup-source: true
required:
- compatible
- reg
- regulators
additionalProperties: false
allOf:
- if:
properties:
compatible:
contains:
const: samsung,s2mpg10-pmic
then:
properties:
reg: false
samsung,s2mps11-acokb-ground: false
samsung,s2mps11-wrstbi-ground: false
# oneOf is required, because dtschema's fixups.py doesn't handle this
# nesting here. Its special treatment to allow either interrupt property
# when only one is specified in the binding works at the top level only.
oneOf:
- required: [interrupts]
- required: [interrupts-extended]
else:
properties:
system-power-controller: false
required:
- reg
- if:
properties:
compatible:
@@ -0,0 +1,184 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/adi,max77675.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim MAX77675 PMIC Regulator
maintainers:
- Joan Na <joan.na@analog.com>
description:
The MAX77675 is a Power Management IC providing four switching buck
regulators (SBB0SBB3) accessible via I2C. It supports configuration
of output voltages and enable controls for each regulator.
allOf:
- $ref: /schemas/input/input.yaml
- $ref: /schemas/pinctrl/pincfg-node.yaml
properties:
compatible:
const: adi,max77675
reg:
maxItems: 1
reset-time-sec:
description: Manual reset time in seconds
enum: [4, 8, 12, 16]
default: 4
bias-disable:
type: boolean
description: Disable internal pull-up for EN pin
input-debounce:
description: Debounce time for the enable pin, in microseconds
items:
- enum: [100, 30000]
default: 100
adi,en-mode:
description: |
Enable mode configuration.
The debounce time set by 'input-debounce' applies to
both push-button and slide-switch modes.
"push-button" - A long press triggers power-on or power-down
"slide-switch" - Low : powers on, High : powers down
"logic" - Low : powers on, High : powers down (no debounce time)
$ref: /schemas/types.yaml#/definitions/string
enum: [push-button, slide-switch, logic]
default: slide-switch
adi,voltage-change-latency-us:
description:
Specifies the delay (in microseconds) between an output voltage change
request and the start of the SBB voltage ramp.
enum: [10, 100]
default: 100
adi,drv-sbb-strength:
description: |
SIMO Buck-Boost Drive Strength Trim.
Controls the drive strength of the SIMO regulator's power MOSFETs.
This setting affects switching speed, impacting power efficiency and EMI.
"max" Maximum drive strength (~0.6 ns transition time)
"high" High drive strength (~1.2 ns transition time)
"low" Low drive strength (~1.8 ns transition time)
"min" Minimum drive strength (~8 ns transition time)
$ref: /schemas/types.yaml#/definitions/string
enum: [max, high, low, min]
default: max
adi,dvs-slew-rate-mv-per-us:
description:
Dynamic rising slew rate for output voltage transitions, in mV/μs.
This setting is only used when 'adi,fixed-slew-rate' is not present.
enum: [5, 10]
default: 5
adi,bias-low-power-request:
type: boolean
description: Request low-power bias mode
adi,simo-ldo-always-on:
type: boolean
description: Set internal LDO to always supply 1.8V
regulators:
type: object
description: Regulator child nodes
patternProperties:
"^sbb[0-3]$":
type: object
$ref: regulator.yaml#
properties:
adi,fps-slot:
description: |
FPS (Flexible Power Sequencer) slot selection.
The Flexible Power Sequencer allows resources to power up under
hardware or software control. Additionally, each resource can
power up independently or among a group of other regulators with
adjustable power-up and power-down slots.
"slot0" - Assign to FPS Slot 0
"slot1" - Assign to FPS Slot 1
"slot2" - Assign to FPS Slot 2
"slot3" - Assign to FPS Slot 3
"default" - Use the default FPS slot value stored in register
$ref: /schemas/types.yaml#/definitions/string
enum: [slot0, slot1, slot2, slot3, default]
default: default
adi,fixed-slew-rate:
type: boolean
description:
When this property is present, the device uses a constant 2 mV/μs
slew rate and ignores any dynamic slew rate configuration.
When absent, the device uses the dynamic slew rate specified
by 'adi,dvs-slew-rate-mv-per-us'
unevaluatedProperties: false
required:
- compatible
- reg
- regulators
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
max77675: pmic@44 {
compatible = "adi,max77675";
reg = <0x44>;
reset-time-sec = <4>;
input-debounce = <100>;
adi,en-mode = "slide-switch";
adi,voltage-change-latency-us = <100>;
adi,drv-sbb-strength = "max";
adi,dvs-slew-rate-mv-per-us = <5>;
regulators {
sbb0: sbb0 {
regulator-name = "sbb0";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <5500000>;
adi,fps-slot = "default";
adi,fixed-slew-rate;
};
sbb1: sbb1 {
regulator-name = "sbb1";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <5500000>;
adi,fps-slot = "default";
adi,fixed-slew-rate;
};
sbb2: sbb2 {
regulator-name = "sbb2";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <5500000>;
adi,fps-slot = "default";
adi,fixed-slew-rate;
};
sbb3: sbb3 {
regulator-name = "sbb3";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <5500000>;
adi,fps-slot = "default";
adi,fixed-slew-rate;
};
};
};
};
@@ -40,13 +40,13 @@ patternProperties:
unevaluatedProperties: false
"^ldo-v(dig18|emc33|ibr|mc|mch|mipi|rtc|sim1|sim2|sram|usb10)$":
"^ldo-v(dig18|emc33|ibr|io28|mc|mch|mipi|rtc|sim1|sim2|sram|usb10)$":
type: object
$ref: regulator.yaml#
properties:
regulator-name:
pattern: "^v(dig18|emc33|ibr|mc|mch|mipi|rtc|sim1|sim2|sram|usb)$"
pattern: "^v(dig18|emc33|ibr|io28|mc|mch|mipi|rtc|sim1|sim2|sram|usb)$"
unevaluatedProperties: false
@@ -24,6 +24,11 @@ properties:
reg:
maxItems: 1
gpio-controller: true
"#gpio-cells":
const: 2
additionalProperties: false
required:
@@ -274,6 +274,7 @@ patternProperties:
suspend. This property is now deprecated, instead setting voltage
for suspend mode via the API which regulator driver provides is
recommended.
deprecated: true
regulator-changeable-in-suspend:
description: whether the default voltage and the regulator on/off
@@ -15,6 +15,10 @@ description: |
supply of 2.5V to 5.5V. It can provide up to 3.5A continuous current
capability at over 80% high efficiency.
The RT8092 is similar type buck converter. Compared to RT5739, it can offer
up to 4A output current and more output voltage range to meet the application
on most mobile products.
allOf:
- $ref: regulator.yaml#
@@ -23,6 +27,7 @@ properties:
enum:
- richtek,rt5733
- richtek,rt5739
- richtek,rt8092
reg:
maxItems: 1
@@ -0,0 +1,158 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/samsung,s2mpg10-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung S2MPG10 Power Management IC regulators
maintainers:
- André Draszik <andre.draszik@linaro.org>
description: |
This is part of the device tree bindings for the S2MG10 Power Management IC
(PMIC).
The S2MPG10 PMIC provides 10 buck and 31 LDO regulators.
See also Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml for
additional information and example.
properties:
# 1 LDO with possible (but limited) external control
ldo20m:
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for a single LDO regulator.
allOf:
- $ref: "#/$defs/s2mpg10-ext-control"
properties:
regulator-ramp-delay: false
samsung,ext-control:
minimum: 11
patternProperties:
# 10 bucks
"^buck([1-9]|10)m$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for a single buck regulator.
allOf:
- $ref: "#/$defs/s2mpg10-ext-control"
properties:
regulator-ramp-delay:
enum: [6250, 12500, 25000]
default: 6250
samsung,ext-control:
maximum: 10
# 12 standard LDOs
"^ldo(2[1-9]?|3[0-1])m$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for single LDO regulator.
properties:
regulator-ramp-delay: false
# 12 LDOs with possible external control
"^ldo([3-689]|1[046-9])m$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for a single LDO regulator.
allOf:
- $ref: "#/$defs/s2mpg10-ext-control"
properties:
regulator-ramp-delay: false
samsung,ext-control:
maximum: 10
# 6 LDOs with ramp support, 5 out of those with possible external control
"^ldo(1[1235]?|7)m$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for a single LDO regulator.
allOf:
- $ref: "#/$defs/s2mpg10-ext-control"
properties:
regulator-ramp-delay:
enum: [6250, 12500]
default: 6250
samsung,ext-control:
maximum: 10
$defs:
s2mpg10-ext-control:
properties:
samsung,ext-control:
description: |
These rails can be controlled via one of several possible external
(hardware) signals. If so, this property configures the signal the PMIC
should monitor. For S2MPG10 rails where external control is possible other
than ldo20m, the following values generally corresponding to the
respective on-chip pin are valid:
- 0 # S2MPG10_EXTCTRL_PWREN - PWREN pin
- 1 # S2MPG10_EXTCTRL_PWREN_MIF - PWREN_MIF pin
- 2 # S2MPG10_EXTCTRL_AP_ACTIVE_N - ~AP_ACTIVE_N pin
- 3 # S2MPG10_EXTCTRL_CPUCL1_EN - CPUCL1_EN pin
- 4 # S2MPG10_EXTCTRL_CPUCL1_EN2 - CPUCL1_EN & PWREN pins
- 5 # S2MPG10_EXTCTRL_CPUCL2_EN - CPUCL2_EN pin
- 6 # S2MPG10_EXTCTRL_CPUCL2_EN2 - CPUCL2_E2 & PWREN pins
- 7 # S2MPG10_EXTCTRL_TPU_EN - TPU_EN pin
- 8 # S2MPG10_EXTCTRL_TPU_EN2 - TPU_EN & ~AP_ACTIVE_N pins
- 9 # S2MPG10_EXTCTRL_TCXO_ON - TCXO_ON pin
- 10 # S2MPG10_EXTCTRL_TCXO_ON2 - TCXO_ON & ~AP_ACTIVE_N pins
For S2MPG10 ldo20m, the following values are valid
- 11 # S2MPG10_EXTCTRL_LDO20M_EN2 - VLDO20M_EN & LDO20M_SFR
- 12 # S2MPG10_EXTCTRL_LDO20M_EN - VLDO20M_EN pin
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 0
maximum: 12
enable-gpios:
description:
For rails where external control is done via a GPIO, this optional
property describes the GPIO line used.
dependentRequired:
enable-gpios: [ "samsung,ext-control" ]
allOf:
# Bucks 8, 9, and LDO 1 can not be controlled externally - above definition
# allows it and we deny it here. This approach reduces repetition.
- if:
anyOf:
- required: [buck8m]
- required: [buck9m]
- required: [ldo1m]
then:
patternProperties:
"^(buck[8-9]|ldo1)m$":
properties:
samsung,ext-control: false
additionalProperties: false
@@ -0,0 +1,136 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/samsung,s2mpg11-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung S2MPG11 Power Management IC regulators
maintainers:
- André Draszik <andre.draszik@linaro.org>
description: |
This is part of the device tree bindings for the S2MG11 Power Management IC
(PMIC).
The S2MPG11 PMIC provides 12 buck, 1 buck-boost, and 15 LDO regulators.
See also Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml for
additional information and example.
properties:
buckboost:
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for the buck-boost regulator.
properties:
regulator-ramp-delay: false
patternProperties:
# 12 bucks
"^buck(([1-9]|10)s|[ad])$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for a single buck regulator.
allOf:
- $ref: "#/$defs/s2mpg11-ext-control"
properties:
regulator-ramp-delay:
enum: [6250, 12500, 25000]
default: 6250
# 11 standard LDOs
"^ldo([3-79]|1[01245])s$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for a single LDO regulator.
properties:
regulator-ramp-delay: false
# 2 LDOs with possible external control
"^ldo(8|13)s$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for single LDO regulator.
allOf:
- $ref: "#/$defs/s2mpg11-ext-control"
properties:
regulator-ramp-delay: false
# 2 LDOs with ramp support and possible external control
"^ldo[12]s$":
type: object
$ref: regulator.yaml#
unevaluatedProperties: false
description:
Properties for a single LDO regulator.
allOf:
- $ref: "#/$defs/s2mpg11-ext-control"
properties:
regulator-ramp-delay:
enum: [6250, 12500]
default: 6250
$defs:
s2mpg11-ext-control:
properties:
samsung,ext-control:
description: |
These rails can be controlled via one of several possible external
(hardware) signals. If so, this property configures the signal the PMIC
should monitor. The following values generally corresponding to the
respective on-chip pin are valid:
- 0 # S2MPG11_EXTCTRL_PWREN - PWREN pin
- 1 # S2MPG11_EXTCTRL_PWREN_MIF - PWREN_MIF pin
- 2 # S2MPG11_EXTCTRL_AP_ACTIVE_N - ~AP_ACTIVE_N pin
- 3 # S2MPG11_EXTCTRL_G3D_EN - G3D_EN pin
- 4 # S2MPG11_EXTCTRL_G3D_EN2 - G3D_EN & ~AP_ACTIVE_N pins
- 5 # S2MPG11_EXTCTRL_AOC_VDD - AOC_VDD pin
- 6 # S2MPG11_EXTCTRL_AOC_RET - AOC_RET pin
- 7 # S2MPG11_EXTCTRL_UFS_EN - UFS_EN pin
- 8 # S2MPG11_EXTCTRL_LDO13S_EN - VLDO13S_EN pin
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 0
maximum: 8
enable-gpios:
description:
For rails where external control is done via a GPIO, this optional
property describes the GPIO line used.
dependentRequired:
enable-gpios: [ "samsung,ext-control" ]
allOf:
# Bucks 4, 6, 7 and 10 can not be controlled externally - above definition
# allows it and we deny it here. This approach reduces repetition.
- if:
anyOf:
- required: [buck4s]
- required: [buck6s]
- required: [buck7s]
- required: [buck10s]
then:
patternProperties:
"^buck([467]|10)s$":
properties:
samsung,ext-control: false
additionalProperties: false
@@ -0,0 +1,96 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/ti,tps65185.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI TPS65185 Power Management Integrated Circuit
maintainers:
- Andreas Kemnade <andreas@kemnade.info>
description:
TPS65185 is a Power Management IC to provide Power for EPDs with one 3.3V
switch, 2 symmetric LDOs behind 2 DC/DC converters, and one unsymmetric
regulator for a compensation voltage.
properties:
compatible:
const: ti,tps65185
reg:
maxItems: 1
enable-gpios:
description:
PWRUP pin
maxItems: 1
pwr-good-gpios:
maxItems: 1
vcom-ctrl-gpios:
maxItems: 1
wakeup-gpios:
maxItems: 1
vin-supply: true
interrupts:
maxItems: 1
regulators:
type: object
additionalProperties: false
patternProperties:
"^(vcom|vposneg|v3p3)$":
unevaluatedProperties: false
type: object
$ref: /schemas/regulator/regulator.yaml
required:
- compatible
- reg
- pwr-good-gpios
- vin-supply
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic@18 {
compatible = "ti,tps65185";
reg = <0x18>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tps65185_gpio>;
pwr-good-gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>;
vcom-ctrl-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
enable-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
wakeup-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
vin-supply = <&epdc_pmic_supply>;
interrupts-extended = <&gpio2 0 IRQ_TYPE_LEVEL_LOW>;
regulators {
vcom {
regulator-name = "vcom";
};
vposneg {
regulator-name = "vposneg";
regulator-min-microvolt = <15000000>;
regulator-max-microvolt = <15000000>;
};
v3p3 {
regulator-name = "v3p3";
};
};
};
};
+1
View File
@@ -23308,6 +23308,7 @@ F: drivers/mfd/sec*.[ch]
F: drivers/regulator/s2*.c
F: drivers/regulator/s5m*.c
F: drivers/rtc/rtc-s5m.c
F: include/dt-bindings/regulator/samsung,s2m*.h
F: include/linux/mfd/samsung/
SAMSUNG S3C24XX/S3C64XX SOC SERIES CAMIF DRIVER
+167 -4
View File
@@ -13,6 +13,7 @@
#include <linux/mfd/samsung/core.h>
#include <linux/mfd/samsung/rtc.h>
#include <linux/mfd/samsung/s2mpg10.h>
#include <linux/mfd/samsung/s2mpg11.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -216,6 +217,155 @@ static const struct regmap_config s2mpg10_regmap_config_meter = {
.cache_type = REGCACHE_FLAT,
};
static const struct regmap_range s2mpg11_common_registers[] = {
regmap_reg_range(0x00, 0x02), /* CHIP_ID_S, INT, INT_MASK */
regmap_reg_range(0x0a, 0x0c), /* Speedy control */
regmap_reg_range(0x1a, 0x27), /* Debug */
};
static const struct regmap_range s2mpg11_common_ro_registers[] = {
regmap_reg_range(0x00, 0x01), /* CHIP_ID_S, INT */
regmap_reg_range(0x25, 0x27), /* Debug */
};
static const struct regmap_range s2mpg11_common_nonvolatile_registers[] = {
regmap_reg_range(0x00, 0x00), /* CHIP_ID_S */
regmap_reg_range(0x02, 0x02), /* INT_MASK */
regmap_reg_range(0x0a, 0x0c), /* Speedy control */
};
static const struct regmap_range s2mpg11_common_precious_registers[] = {
regmap_reg_range(0x01, 0x01), /* INT */
};
static const struct regmap_access_table s2mpg11_common_wr_table = {
.yes_ranges = s2mpg11_common_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_common_registers),
.no_ranges = s2mpg11_common_ro_registers,
.n_no_ranges = ARRAY_SIZE(s2mpg11_common_ro_registers),
};
static const struct regmap_access_table s2mpg11_common_rd_table = {
.yes_ranges = s2mpg11_common_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_common_registers),
};
static const struct regmap_access_table s2mpg11_common_volatile_table = {
.no_ranges = s2mpg11_common_nonvolatile_registers,
.n_no_ranges = ARRAY_SIZE(s2mpg11_common_nonvolatile_registers),
};
static const struct regmap_access_table s2mpg11_common_precious_table = {
.yes_ranges = s2mpg11_common_precious_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_common_precious_registers),
};
static const struct regmap_config s2mpg11_regmap_config_common = {
.name = "common",
.reg_bits = ACPM_ADDR_BITS,
.val_bits = 8,
.max_register = S2MPG11_COMMON_SPD_DEBUG4,
.wr_table = &s2mpg11_common_wr_table,
.rd_table = &s2mpg11_common_rd_table,
.volatile_table = &s2mpg11_common_volatile_table,
.precious_table = &s2mpg11_common_precious_table,
.num_reg_defaults_raw = S2MPG11_COMMON_SPD_DEBUG4 + 1,
.cache_type = REGCACHE_FLAT,
};
static const struct regmap_range s2mpg11_pmic_registers[] = {
regmap_reg_range(0x00, 0x5a), /* All PMIC registers */
regmap_reg_range(0x5c, 0xb7), /* All PMIC registers */
};
static const struct regmap_range s2mpg11_pmic_ro_registers[] = {
regmap_reg_range(0x00, 0x05), /* INTx */
regmap_reg_range(0x0c, 0x0d), /* STATUS OFFSRC */
regmap_reg_range(0x98, 0x98), /* GPIO input */
};
static const struct regmap_range s2mpg11_pmic_nonvolatile_registers[] = {
regmap_reg_range(0x06, 0x0b), /* INTxM */
};
static const struct regmap_range s2mpg11_pmic_precious_registers[] = {
regmap_reg_range(0x00, 0x05), /* INTx */
};
static const struct regmap_access_table s2mpg11_pmic_wr_table = {
.yes_ranges = s2mpg11_pmic_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_pmic_registers),
.no_ranges = s2mpg11_pmic_ro_registers,
.n_no_ranges = ARRAY_SIZE(s2mpg11_pmic_ro_registers),
};
static const struct regmap_access_table s2mpg11_pmic_rd_table = {
.yes_ranges = s2mpg11_pmic_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_pmic_registers),
};
static const struct regmap_access_table s2mpg11_pmic_volatile_table = {
.no_ranges = s2mpg11_pmic_nonvolatile_registers,
.n_no_ranges = ARRAY_SIZE(s2mpg11_pmic_nonvolatile_registers),
};
static const struct regmap_access_table s2mpg11_pmic_precious_table = {
.yes_ranges = s2mpg11_pmic_precious_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_pmic_precious_registers),
};
static const struct regmap_config s2mpg11_regmap_config_pmic = {
.name = "pmic",
.reg_bits = ACPM_ADDR_BITS,
.val_bits = 8,
.max_register = S2MPG11_PMIC_LDO_SENSE2,
.wr_table = &s2mpg11_pmic_wr_table,
.rd_table = &s2mpg11_pmic_rd_table,
.volatile_table = &s2mpg11_pmic_volatile_table,
.precious_table = &s2mpg11_pmic_precious_table,
.num_reg_defaults_raw = S2MPG11_PMIC_LDO_SENSE2 + 1,
.cache_type = REGCACHE_FLAT,
};
static const struct regmap_range s2mpg11_meter_registers[] = {
regmap_reg_range(0x00, 0x3e), /* Meter config */
regmap_reg_range(0x40, 0x8a), /* Meter data */
regmap_reg_range(0x8d, 0x9c), /* Meter data */
};
static const struct regmap_range s2mpg11_meter_ro_registers[] = {
regmap_reg_range(0x40, 0x9c), /* Meter data */
};
static const struct regmap_access_table s2mpg11_meter_wr_table = {
.yes_ranges = s2mpg11_meter_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_meter_registers),
.no_ranges = s2mpg11_meter_ro_registers,
.n_no_ranges = ARRAY_SIZE(s2mpg11_meter_ro_registers),
};
static const struct regmap_access_table s2mpg11_meter_rd_table = {
.yes_ranges = s2mpg11_meter_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_meter_registers),
};
static const struct regmap_access_table s2mpg11_meter_volatile_table = {
.yes_ranges = s2mpg11_meter_ro_registers,
.n_yes_ranges = ARRAY_SIZE(s2mpg11_meter_ro_registers),
};
static const struct regmap_config s2mpg11_regmap_config_meter = {
.name = "meter",
.reg_bits = ACPM_ADDR_BITS,
.val_bits = 8,
.max_register = S2MPG11_METER_LPF_DATA_NTC7_2,
.wr_table = &s2mpg11_meter_wr_table,
.rd_table = &s2mpg11_meter_rd_table,
.volatile_table = &s2mpg11_meter_volatile_table,
.num_reg_defaults_raw = S2MPG11_METER_LPF_DATA_NTC7_2 + 1,
.cache_type = REGCACHE_FLAT,
};
struct sec_pmic_acpm_shared_bus_context {
const struct acpm_handle *acpm;
unsigned int acpm_chan_id;
@@ -364,10 +514,12 @@ static int sec_pmic_acpm_probe(struct platform_device *pdev)
if (IS_ERR(regmap_pmic))
return PTR_ERR(regmap_pmic);
regmap = sec_pmic_acpm_regmap_init(dev, shared_ctx, SEC_PMIC_ACPM_ACCESSTYPE_RTC,
pdata->regmap_cfg_rtc, true);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
if (pdata->regmap_cfg_rtc) {
regmap = sec_pmic_acpm_regmap_init(dev, shared_ctx, SEC_PMIC_ACPM_ACCESSTYPE_RTC,
pdata->regmap_cfg_rtc, true);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
}
regmap = sec_pmic_acpm_regmap_init(dev, shared_ctx, SEC_PMIC_ACPM_ACCESSTYPE_METER,
pdata->regmap_cfg_meter, true);
@@ -399,8 +551,18 @@ static const struct sec_pmic_acpm_platform_data s2mpg10_data = {
.regmap_cfg_meter = &s2mpg10_regmap_config_meter,
};
static const struct sec_pmic_acpm_platform_data s2mpg11_data = {
.device_type = S2MPG11,
.acpm_chan_id = 2,
.speedy_channel = 1,
.regmap_cfg_common = &s2mpg11_regmap_config_common,
.regmap_cfg_pmic = &s2mpg11_regmap_config_pmic,
.regmap_cfg_meter = &s2mpg11_regmap_config_meter,
};
static const struct of_device_id sec_pmic_acpm_of_match[] = {
{ .compatible = "samsung,s2mpg10-pmic", .data = &s2mpg10_data, },
{ .compatible = "samsung,s2mpg11-pmic", .data = &s2mpg11_data, },
{ },
};
MODULE_DEVICE_TABLE(of, sec_pmic_acpm_of_match);
@@ -408,6 +570,7 @@ MODULE_DEVICE_TABLE(of, sec_pmic_acpm_of_match);
static struct platform_driver sec_pmic_acpm_driver = {
.driver = {
.name = "sec-pmic-acpm",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
.pm = pm_sleep_ptr(&sec_pmic_pm_ops),
.of_match_table = sec_pmic_acpm_of_match,
},
+49 -13
View File
@@ -23,9 +23,13 @@
#include <linux/regmap.h>
#include "sec-core.h"
static const struct resource s5m8767_rtc_resources[] = {
DEFINE_RES_IRQ_NAMED(S5M8767_IRQ_RTCA1, "alarm"),
};
static const struct mfd_cell s5m8767_devs[] = {
MFD_CELL_NAME("s5m8767-pmic"),
MFD_CELL_NAME("s5m-rtc"),
MFD_CELL_RES("s5m-rtc", s5m8767_rtc_resources),
MFD_CELL_OF("s5m8767-clk", NULL, NULL, 0, 0, "samsung,s5m8767-clk"),
};
@@ -33,50 +37,72 @@ static const struct mfd_cell s2dos05_devs[] = {
MFD_CELL_NAME("s2dos05-regulator"),
};
static const struct resource s2mpg10_rtc_resources[] = {
DEFINE_RES_IRQ_NAMED(S2MPG10_IRQ_RTCA0, "alarm"),
};
static const struct mfd_cell s2mpg10_devs[] = {
MFD_CELL_NAME("s2mpg10-meter"),
MFD_CELL_NAME("s2mpg10-regulator"),
MFD_CELL_NAME("s2mpg10-rtc"),
MFD_CELL_RES("s2mpg10-rtc", s2mpg10_rtc_resources),
MFD_CELL_OF("s2mpg10-clk", NULL, NULL, 0, 0, "samsung,s2mpg10-clk"),
MFD_CELL_OF("s2mpg10-gpio", NULL, NULL, 0, 0, "samsung,s2mpg10-gpio"),
};
static const struct mfd_cell s2mpg11_devs[] = {
MFD_CELL_NAME("s2mpg11-meter"),
MFD_CELL_NAME("s2mpg11-regulator"),
MFD_CELL_OF("s2mpg11-gpio", NULL, NULL, 0, 0, "samsung,s2mpg11-gpio"),
};
static const struct resource s2mps11_rtc_resources[] = {
DEFINE_RES_IRQ_NAMED(S2MPS11_IRQ_RTCA0, "alarm"),
};
static const struct mfd_cell s2mps11_devs[] = {
MFD_CELL_NAME("s2mps11-regulator"),
MFD_CELL_NAME("s2mps14-rtc"),
MFD_CELL_RES("s2mps14-rtc", s2mps11_rtc_resources),
MFD_CELL_OF("s2mps11-clk", NULL, NULL, 0, 0, "samsung,s2mps11-clk"),
};
static const struct resource s2mps14_rtc_resources[] = {
DEFINE_RES_IRQ_NAMED(S2MPS14_IRQ_RTCA0, "alarm"),
};
static const struct mfd_cell s2mps13_devs[] = {
MFD_CELL_NAME("s2mps13-regulator"),
MFD_CELL_NAME("s2mps13-rtc"),
MFD_CELL_RES("s2mps13-rtc", s2mps14_rtc_resources),
MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"),
};
static const struct mfd_cell s2mps14_devs[] = {
MFD_CELL_NAME("s2mps14-regulator"),
MFD_CELL_NAME("s2mps14-rtc"),
MFD_CELL_RES("s2mps14-rtc", s2mps14_rtc_resources),
MFD_CELL_OF("s2mps14-clk", NULL, NULL, 0, 0, "samsung,s2mps14-clk"),
};
static const struct mfd_cell s2mps15_devs[] = {
MFD_CELL_NAME("s2mps15-regulator"),
MFD_CELL_NAME("s2mps15-rtc"),
MFD_CELL_RES("s2mps15-rtc", s2mps14_rtc_resources),
MFD_CELL_OF("s2mps13-clk", NULL, NULL, 0, 0, "samsung,s2mps13-clk"),
};
static const struct mfd_cell s2mpa01_devs[] = {
MFD_CELL_NAME("s2mpa01-pmic"),
MFD_CELL_NAME("s2mps14-rtc"),
MFD_CELL_RES("s2mps14-rtc", s2mps14_rtc_resources),
};
static const struct mfd_cell s2mpu02_devs[] = {
MFD_CELL_NAME("s2mpu02-regulator"),
};
static const struct resource s2mpu05_rtc_resources[] = {
DEFINE_RES_IRQ_NAMED(S2MPU05_IRQ_RTCA0, "alarm"),
};
static const struct mfd_cell s2mpu05_devs[] = {
MFD_CELL_NAME("s2mpu05-regulator"),
MFD_CELL_NAME("s2mps15-rtc"),
MFD_CELL_RES("s2mps15-rtc", s2mpu05_rtc_resources),
};
static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
@@ -84,8 +110,13 @@ static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
unsigned int val;
/* For s2mpg1x, the revision is in a different regmap */
if (sec_pmic->device_type == S2MPG10)
switch (sec_pmic->device_type) {
case S2MPG10:
case S2MPG11:
return;
default:
break;
}
/* For each device type, the REG_ID is always the first register */
if (!regmap_read(sec_pmic->regmap_pmic, S2MPS11_REG_ID, &val))
@@ -143,6 +174,7 @@ sec_pmic_parse_dt_pdata(struct device *dev)
int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
struct regmap *regmap, struct i2c_client *client)
{
struct regmap_irq_chip_data *irq_data;
struct sec_platform_data *pdata;
const struct mfd_cell *sec_devs;
struct sec_pmic_dev *sec_pmic;
@@ -167,9 +199,9 @@ int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
sec_pmic->pdata = pdata;
ret = sec_irq_init(sec_pmic);
if (ret)
return ret;
irq_data = sec_irq_init(sec_pmic);
if (IS_ERR(irq_data))
return PTR_ERR(irq_data);
pm_runtime_set_active(sec_pmic->dev);
@@ -190,6 +222,10 @@ int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
sec_devs = s2mpg10_devs;
num_sec_devs = ARRAY_SIZE(s2mpg10_devs);
break;
case S2MPG11:
sec_devs = s2mpg11_devs;
num_sec_devs = ARRAY_SIZE(s2mpg11_devs);
break;
case S2MPS11X:
sec_devs = s2mps11_devs;
num_sec_devs = ARRAY_SIZE(s2mps11_devs);
@@ -220,7 +256,7 @@ int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
sec_pmic->device_type);
}
ret = devm_mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs,
NULL, 0, NULL);
NULL, 0, regmap_irq_get_domain(irq_data));
if (ret)
return ret;
+1 -1
View File
@@ -18,6 +18,6 @@ int sec_pmic_probe(struct device *dev, int device_type, unsigned int irq,
struct regmap *regmap, struct i2c_client *client);
void sec_pmic_shutdown(struct device *dev);
int sec_irq_init(struct sec_pmic_dev *sec_pmic);
struct regmap_irq_chip_data *sec_irq_init(struct sec_pmic_dev *sec_pmic);
#endif /* __SEC_CORE_INT_H */
+114 -36
View File
@@ -11,6 +11,7 @@
#include <linux/mfd/samsung/core.h>
#include <linux/mfd/samsung/irq.h>
#include <linux/mfd/samsung/s2mpg10.h>
#include <linux/mfd/samsung/s2mpg11.h>
#include <linux/mfd/samsung/s2mps11.h>
#include <linux/mfd/samsung/s2mps14.h>
#include <linux/mfd/samsung/s2mpu02.h>
@@ -79,6 +80,64 @@ static const struct regmap_irq s2mpg10_pmic_irqs[] = {
REGMAP_IRQ_REG(S2MPG10_IRQ_PWR_WARN_CH7, 5, S2MPG10_IRQ_PWR_WARN_CH7_MASK),
};
static const struct regmap_irq s2mpg11_irqs[] = {
REGMAP_IRQ_REG(S2MPG11_COMMON_IRQ_PMIC, 0, S2MPG11_COMMON_INT_SRC_PMIC),
/* No documentation or other reference for remaining bits */
REGMAP_IRQ_REG(S2MPG11_COMMON_IRQ_UNUSED, 0, GENMASK(7, 1)),
};
static const struct regmap_irq s2mpg11_pmic_irqs[] = {
REGMAP_IRQ_REG(S2MPG11_IRQ_PWRONF, 0, S2MPG11_IRQ_PWRONF_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWRONR, 0, S2MPG11_IRQ_PWRONR_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PIF_TIMEOUT_MIF, 0, S2MPG11_IRQ_PIF_TIMEOUT_MIF_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PIF_TIMEOUTS, 0, S2MPG11_IRQ_PIF_TIMEOUTS_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_WTSR, 0, S2MPG11_IRQ_WTSR_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_SPD_ABNORMAL_STOP, 0, S2MPG11_IRQ_SPD_ABNORMAL_STOP_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_SPD_PARITY_ERR, 0, S2MPG11_IRQ_SPD_PARITY_ERR_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_140C, 1, S2MPG11_IRQ_INT140C_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_120C, 1, S2MPG11_IRQ_INT120C_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_TSD, 1, S2MPG11_IRQ_TSD_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_WRST, 1, S2MPG11_IRQ_WRST_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_CYCLE_DONE, 1, S2MPG11_IRQ_NTC_CYCLE_DONE_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PMETER_OVERF, 1, S2MPG11_IRQ_PMETER_OVERF_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B1S, 2, S2MPG11_IRQ_OCP_B1S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B2S, 2, S2MPG11_IRQ_OCP_B2S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B3S, 2, S2MPG11_IRQ_OCP_B3S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B4S, 2, S2MPG11_IRQ_OCP_B4S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B5S, 2, S2MPG11_IRQ_OCP_B5S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B6S, 2, S2MPG11_IRQ_OCP_B6S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B7S, 2, S2MPG11_IRQ_OCP_B7S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B8S, 2, S2MPG11_IRQ_OCP_B8S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B9S, 3, S2MPG11_IRQ_OCP_B9S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_B10S, 3, S2MPG11_IRQ_OCP_B10S_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_BDS, 3, S2MPG11_IRQ_OCP_BDS_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_BAS, 3, S2MPG11_IRQ_OCP_BAS_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_OCP_BBS, 3, S2MPG11_IRQ_OCP_BBS_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_WLWP_ACC, 3, S2MPG11_IRQ_WLWP_ACC_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_SPD_SRP_PKT_RST, 3, S2MPG11_IRQ_SPD_SRP_PKT_RST_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWR_WARN_CH0, 4, S2MPG11_IRQ_PWR_WARN_CH0_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWR_WARN_CH1, 4, S2MPG11_IRQ_PWR_WARN_CH1_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWR_WARN_CH2, 4, S2MPG11_IRQ_PWR_WARN_CH2_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWR_WARN_CH3, 4, S2MPG11_IRQ_PWR_WARN_CH3_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWR_WARN_CH4, 4, S2MPG11_IRQ_PWR_WARN_CH4_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWR_WARN_CH5, 4, S2MPG11_IRQ_PWR_WARN_CH5_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWR_WARN_CH6, 4, S2MPG11_IRQ_PWR_WARN_CH6_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_PWR_WARN_CH7, 4, S2MPG11_IRQ_PWR_WARN_CH7_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_WARN_CH0, 5, S2MPG11_IRQ_NTC_WARN_CH0_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_WARN_CH1, 5, S2MPG11_IRQ_NTC_WARN_CH1_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_WARN_CH2, 5, S2MPG11_IRQ_NTC_WARN_CH2_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_WARN_CH3, 5, S2MPG11_IRQ_NTC_WARN_CH3_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_WARN_CH4, 5, S2MPG11_IRQ_NTC_WARN_CH4_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_WARN_CH5, 5, S2MPG11_IRQ_NTC_WARN_CH5_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_WARN_CH6, 5, S2MPG11_IRQ_NTC_WARN_CH6_MASK),
REGMAP_IRQ_REG(S2MPG11_IRQ_NTC_WARN_CH7, 5, S2MPG11_IRQ_NTC_WARN_CH7_MASK),
};
static const struct regmap_irq s2mps11_irqs[] = {
REGMAP_IRQ_REG(S2MPS11_IRQ_PWRONF, 0, S2MPS11_IRQ_PWRONF_MASK),
REGMAP_IRQ_REG(S2MPS11_IRQ_PWRONR, 0, S2MPS11_IRQ_PWRONR_MASK),
@@ -186,7 +245,7 @@ static const struct regmap_irq s5m8767_irqs[] = {
REGMAP_IRQ_REG(S5M8767_IRQ_WTSR, 2, S5M8767_IRQ_WTSR_MASK),
};
/* All S2MPG10 interrupt sources are read-only and don't require clearing */
/* All S2MPG1x interrupt sources are read-only and don't require clearing */
static const struct regmap_irq_chip s2mpg10_irq_chip = {
.name = "s2mpg10",
.status_base = S2MPG10_COMMON_INT,
@@ -205,6 +264,25 @@ static const struct regmap_irq_chip s2mpg10_irq_chip_pmic = {
.num_irqs = ARRAY_SIZE(s2mpg10_pmic_irqs),
};
static const struct regmap_irq_chip s2mpg11_irq_chip = {
.name = "s2mpg11",
.status_base = S2MPG11_COMMON_INT,
.mask_base = S2MPG11_COMMON_INT_MASK,
.num_regs = 1,
.irqs = s2mpg11_irqs,
.num_irqs = ARRAY_SIZE(s2mpg11_irqs),
};
static const struct regmap_irq_chip s2mpg11_irq_chip_pmic = {
.name = "s2mpg11-pmic",
.domain_suffix = "pmic",
.status_base = S2MPG11_PMIC_INT1,
.mask_base = S2MPG11_PMIC_INT1M,
.num_regs = 6,
.irqs = s2mpg11_pmic_irqs,
.num_irqs = ARRAY_SIZE(s2mpg11_pmic_irqs),
};
static const struct regmap_irq_chip s2mps11_irq_chip = {
.name = "s2mps11",
.irqs = s2mps11_irqs,
@@ -268,26 +346,28 @@ static const struct regmap_irq_chip s5m8767_irq_chip = {
.ack_base = S5M8767_REG_INT1,
};
static int s2mpg1x_add_chained_irq_chip(struct device *dev, struct regmap *regmap, int pirq,
struct regmap_irq_chip_data *parent,
const struct regmap_irq_chip *chip,
struct regmap_irq_chip_data **data)
static struct regmap_irq_chip_data *
s2mpg1x_add_chained_pmic(struct sec_pmic_dev *sec_pmic, int pirq,
struct regmap_irq_chip_data *parent, const struct regmap_irq_chip *chip)
{
struct device *dev = sec_pmic->dev;
struct regmap_irq_chip_data *data;
int irq, ret;
irq = regmap_irq_get_virq(parent, pirq);
if (irq < 0)
return dev_err_probe(dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n", pirq,
chip->name);
return dev_err_ptr_probe(dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n",
pirq, chip->name);
ret = devm_regmap_add_irq_chip(dev, regmap, irq, IRQF_ONESHOT | IRQF_SHARED, 0, chip, data);
ret = devm_regmap_add_irq_chip(dev, sec_pmic->regmap_pmic, irq,
IRQF_ONESHOT | IRQF_SHARED, 0, chip, &data);
if (ret)
return dev_err_probe(dev, ret, "Failed to add %s IRQ chip\n", chip->name);
return dev_err_ptr_probe(dev, ret, "Failed to add %s IRQ chip\n", chip->name);
return 0;
return data;
}
static int sec_irq_init_s2mpg1x(struct sec_pmic_dev *sec_pmic)
static struct regmap_irq_chip_data *sec_irq_init_s2mpg1x(struct sec_pmic_dev *sec_pmic)
{
const struct regmap_irq_chip *irq_chip, *chained_irq_chip;
struct regmap_irq_chip_data *irq_data;
@@ -301,28 +381,33 @@ static int sec_irq_init_s2mpg1x(struct sec_pmic_dev *sec_pmic)
chained_irq_chip = &s2mpg10_irq_chip_pmic;
chained_pirq = S2MPG10_COMMON_IRQ_PMIC;
break;
case S2MPG11:
irq_chip = &s2mpg11_irq_chip;
chained_irq_chip = &s2mpg11_irq_chip_pmic;
chained_pirq = S2MPG11_COMMON_IRQ_PMIC;
break;
default:
return dev_err_probe(sec_pmic->dev, -EINVAL, "Unsupported device type %d\n",
sec_pmic->device_type);
return dev_err_ptr_probe(sec_pmic->dev, -EINVAL, "Unsupported device type %d\n",
sec_pmic->device_type);
}
regmap_common = dev_get_regmap(sec_pmic->dev, "common");
if (!regmap_common)
return dev_err_probe(sec_pmic->dev, -EINVAL, "No 'common' regmap %d\n",
sec_pmic->device_type);
return dev_err_ptr_probe(sec_pmic->dev, -EINVAL, "No 'common' regmap %d\n",
sec_pmic->device_type);
ret = devm_regmap_add_irq_chip(sec_pmic->dev, regmap_common, sec_pmic->irq, IRQF_ONESHOT, 0,
irq_chip, &irq_data);
if (ret)
return dev_err_probe(sec_pmic->dev, ret, "Failed to add %s IRQ chip\n",
irq_chip->name);
return dev_err_ptr_probe(sec_pmic->dev, ret, "Failed to add %s IRQ chip\n",
irq_chip->name);
return s2mpg1x_add_chained_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic, chained_pirq,
irq_data, chained_irq_chip, &sec_pmic->irq_data);
return s2mpg1x_add_chained_pmic(sec_pmic, chained_pirq, irq_data, chained_irq_chip);
}
int sec_irq_init(struct sec_pmic_dev *sec_pmic)
struct regmap_irq_chip_data *sec_irq_init(struct sec_pmic_dev *sec_pmic)
{
struct regmap_irq_chip_data *sec_irq_chip_data;
const struct regmap_irq_chip *sec_irq_chip;
int ret;
@@ -331,11 +416,12 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
sec_irq_chip = &s5m8767_irq_chip;
break;
case S2DOS05:
return 0;
return NULL;
case S2MPA01:
sec_irq_chip = &s2mps14_irq_chip;
break;
case S2MPG10:
case S2MPG11:
return sec_irq_init_s2mpg1x(sec_pmic);
case S2MPS11X:
sec_irq_chip = &s2mps11_irq_chip;
@@ -356,30 +442,22 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
sec_irq_chip = &s2mpu05_irq_chip;
break;
default:
return dev_err_probe(sec_pmic->dev, -EINVAL,
"Unsupported device type %d\n",
sec_pmic->device_type);
return dev_err_ptr_probe(sec_pmic->dev, -EINVAL, "Unsupported device type %d\n",
sec_pmic->device_type);
}
if (!sec_pmic->irq) {
dev_warn(sec_pmic->dev,
"No interrupt specified, no interrupts\n");
return 0;
return NULL;
}
ret = devm_regmap_add_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic,
sec_pmic->irq, IRQF_ONESHOT,
0, sec_irq_chip, &sec_pmic->irq_data);
0, sec_irq_chip, &sec_irq_chip_data);
if (ret)
return dev_err_probe(sec_pmic->dev, ret,
"Failed to add %s IRQ chip\n",
sec_irq_chip->name);
return dev_err_ptr_probe(sec_pmic->dev, ret, "Failed to add %s IRQ chip\n",
sec_irq_chip->name);
/*
* The rtc-s5m driver requests S2MPS14_IRQ_RTCA0 also for S2MPS11
* so the interrupt number must be consistent.
*/
BUILD_BUG_ON(((enum s2mps14_irq)S2MPS11_IRQ_RTCA0) != S2MPS14_IRQ_RTCA0);
return 0;
return sec_irq_chip_data;
}
+29
View File
@@ -659,6 +659,15 @@ config REGULATOR_MAX77650
Semiconductor. This device has a SIMO with three independent
power rails and an LDO.
config REGULATOR_MAX77675
tristate "Maxim MAX77675 regulator driver"
depends on I2C && OF
select REGMAP_I2C
help
This driver controls the Maxim MAX77675 power regulator via I2C.
It supports four programmable buck-boost outputs.
Say Y here to enable the regulator driver
config REGULATOR_MAX77857
tristate "ADI MAX77857/MAX77831 regulator support"
depends on I2C
@@ -1394,6 +1403,15 @@ config REGULATOR_RT6245
It can support up to 14A output current and adjustable output voltage
from 0.4375V to 1.3875V, per step 12.5mV.
config REGULATOR_RT8092
tristate "Richtek RT8092 voltage regulator"
depends on I2C
select REGMAP_I2C
help
The RT8092 is a peak-current mode PWM step-down DC/DC converter with
I2C control interface. It is capable of delivering 4A continuing
current over a wide input range from 2.5V to 5.5V.
config REGULATOR_RTQ2134
tristate "Richtek RTQ2134 SubPMIC Regulator"
depends on I2C
@@ -1690,6 +1708,17 @@ config REGULATOR_TPS65132
This driver supports TPS65132 single inductor - dual output
power supply specifically designed for display panels.
config REGULATOR_TPS65185
tristate "TI TPS65185 EPD regulator"
depends on I2C
select REGMAP_I2C
help
This driver supports the TPS65185 voltage regulator chip
which is used to provide power to Electronic Paper Displays
so it is found in E-Book readers.
If HWWON is enabled, it also provides temperature measurement.
config REGULATOR_TPS65217
tristate "TI TPS65217 Power regulators"
depends on MFD_TPS65217
+3
View File
@@ -79,6 +79,7 @@ obj-$(CONFIG_REGULATOR_MAX77503) += max77503-regulator.o
obj-$(CONFIG_REGULATOR_MAX77541) += max77541-regulator.o
obj-$(CONFIG_REGULATOR_MAX77620) += max77620-regulator.o
obj-$(CONFIG_REGULATOR_MAX77650) += max77650-regulator.o
obj-$(CONFIG_REGULATOR_MAX77675) += max77675-regulator.o
obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o
obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o
obj-$(CONFIG_REGULATOR_MAX8893) += max8893.o
@@ -161,6 +162,7 @@ obj-$(CONFIG_REGULATOR_RT5759) += rt5759-regulator.o
obj-$(CONFIG_REGULATOR_RT6160) += rt6160-regulator.o
obj-$(CONFIG_REGULATOR_RT6190) += rt6190-regulator.o
obj-$(CONFIG_REGULATOR_RT6245) += rt6245-regulator.o
obj-$(CONFIG_REGULATOR_RT8092) += rt8092.o
obj-$(CONFIG_REGULATOR_RTMV20) += rtmv20-regulator.o
obj-$(CONFIG_REGULATOR_RTQ2134) += rtq2134-regulator.o
obj-$(CONFIG_REGULATOR_RTQ6752) += rtq6752-regulator.o
@@ -192,6 +194,7 @@ obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o
obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o
obj-$(CONFIG_REGULATOR_TPS65086) += tps65086-regulator.o
obj-$(CONFIG_REGULATOR_TPS65090) += tps65090-regulator.o
obj-$(CONFIG_REGULATOR_TPS65185) += tps65185.o
obj-$(CONFIG_REGULATOR_TPS65217) += tps65217-regulator.o
obj-$(CONFIG_REGULATOR_TPS65218) += tps65218-regulator.o
obj-$(CONFIG_REGULATOR_TPS65219) += tps65219-regulator.o
+256 -103
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More