Commit 2a2ca717 authored by Lee Jones's avatar Lee Jones

Merge branch 'ib-mfd-regulator-watchdog-6.11' into ibs-for-mfd-merged

parents 04f38933 fcf1f960
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/rohm,bd96801-pmic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ROHM BD96801 Scalable Power Management Integrated Circuit
maintainers:
- Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
description:
BD96801 is an automotive grade single-chip power management IC.
It integrates 4 buck converters and 3 LDOs with safety features like
over-/under voltage and over current detection and a watchdog.
properties:
compatible:
const: rohm,bd96801
reg:
maxItems: 1
interrupts:
description:
The PMIC provides intb and errb IRQ lines. The errb IRQ line is used
for fatal IRQs which will cause the PMIC to shut down power outputs.
In many systems this will shut down the SoC contolling the PMIC and
connecting/handling the errb can be omitted. However, there are cases
where the SoC is not powered by the PMIC or has a short time backup
energy to handle shutdown of critical hardware. In that case it may be
useful to connect the errb and handle errb events.
minItems: 1
maxItems: 2
interrupt-names:
minItems: 1
items:
- enum: [intb, errb]
- const: errb
rohm,hw-timeout-ms:
description:
Watchdog timeout value(s). First walue is timeout limit. Second value is
optional value for 'too early' watchdog ping if window timeout mode is
to be used.
minItems: 1
maxItems: 2
rohm,wdg-action:
description:
Whether the watchdog failure must turn off the regulator power outputs or
just toggle the INTB line.
enum:
- prstb
- intb-only
timeout-sec:
maxItems: 2
regulators:
$ref: /schemas/regulator/rohm,bd96801-regulator.yaml
description:
List of child nodes that specify the regulators.
required:
- compatible
- reg
- interrupts
- interrupt-names
- regulators
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic: pmic@60 {
reg = <0x60>;
compatible = "rohm,bd96801";
interrupt-parent = <&gpio1>;
interrupts = <29 IRQ_TYPE_LEVEL_LOW>, <6 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "intb", "errb";
regulators {
buck1 {
regulator-name = "buck1";
regulator-ramp-delay = <1250>;
/* 0.5V min INITIAL - 150 mV tune */
regulator-min-microvolt = <350000>;
/* 3.3V + 150mV tune */
regulator-max-microvolt = <3450000>;
/* These can be set only when PMIC is in STBY */
rohm,initial-voltage-microvolt = <500000>;
regulator-ov-error-microvolt = <230000>;
regulator-uv-error-microvolt = <230000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <0>;
};
buck2 {
regulator-name = "buck2";
regulator-min-microvolt = <350000>;
regulator-max-microvolt = <3450000>;
rohm,initial-voltage-microvolt = <3000000>;
regulator-ov-error-microvolt = <18000>;
regulator-uv-error-microvolt = <18000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <1>;
};
buck3 {
regulator-name = "buck3";
regulator-min-microvolt = <350000>;
regulator-max-microvolt = <3450000>;
rohm,initial-voltage-microvolt = <600000>;
regulator-ov-warn-microvolt = <18000>;
regulator-uv-warn-microvolt = <18000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-error-kelvin = <0>;
};
buck4 {
regulator-name = "buck4";
regulator-min-microvolt = <350000>;
regulator-max-microvolt = <3450000>;
rohm,initial-voltage-microvolt = <600000>;
regulator-ov-warn-microvolt = <18000>;
regulator-uv-warn-microvolt = <18000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-error-kelvin = <0>;
};
ldo5 {
regulator-name = "ldo5";
regulator-min-microvolt = <300000>;
regulator-max-microvolt = <3300000>;
rohm,initial-voltage-microvolt = <500000>;
regulator-ov-error-microvolt = <36000>;
regulator-uv-error-microvolt = <34000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <0>;
};
ldo6 {
regulator-name = "ldo6";
regulator-min-microvolt = <300000>;
regulator-max-microvolt = <3300000>;
rohm,initial-voltage-microvolt = <300000>;
regulator-ov-error-microvolt = <36000>;
regulator-uv-error-microvolt = <34000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <0>;
};
ldo7 {
regulator-name = "ldo7";
regulator-min-microvolt = <300000>;
regulator-max-microvolt = <3300000>;
rohm,initial-voltage-microvolt = <500000>;
regulator-ov-error-microvolt = <36000>;
regulator-uv-error-microvolt = <34000>;
regulator-temp-protection-kelvin = <1>;
regulator-temp-warn-kelvin = <0>;
};
};
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/rohm,bd96801-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ROHM BD96801 Power Management Integrated Circuit regulators
maintainers:
- Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
description:
This module is part of the ROHM BD96801 MFD device. For more details
see Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml.
The regulator controller is represented as a sub-node of the PMIC node
on the device tree.
Regulator nodes should be named to buck_<number> and ldo_<number>.
The valid names for BD96801 regulator nodes are
buck1, buck2, buck3, buck4, ldo5, ldo6, ldo7
patternProperties:
"^ldo[5-7]$":
type: object
description:
Properties for single LDO regulator.
$ref: regulator.yaml#
properties:
rohm,initial-voltage-microvolt:
description:
Initial voltage for regulator. Voltage can be tuned +/-150 mV from
this value. NOTE, This can be modified via I2C only when PMIC is in
STBY state.
minimum: 300000
maximum: 3300000
unevaluatedProperties: false
"^buck[1-4]$":
type: object
description:
Properties for single BUCK regulator.
$ref: regulator.yaml#
properties:
rohm,initial-voltage-microvolt:
description:
Initial voltage for regulator. Voltage can be tuned +/-150 mV from
this value. NOTE, This can be modified via I2C only when PMIC is in
STBY state.
minimum: 500000
maximum: 3300000
rohm,keep-on-stby:
description:
Keep the regulator powered when PMIC transitions to STBY state.
type: boolean
unevaluatedProperties: false
additionalProperties: false
......@@ -19472,17 +19472,21 @@ F: drivers/gpio/gpio-bd71828.c
F: drivers/mfd/rohm-bd71828.c
F: drivers/mfd/rohm-bd718x7.c
F: drivers/mfd/rohm-bd9576.c
F: drivers/mfd/rohm-bd96801.c
F: drivers/regulator/bd71815-regulator.c
F: drivers/regulator/bd71828-regulator.c
F: drivers/regulator/bd718x7-regulator.c
F: drivers/regulator/bd9576-regulator.c
F: drivers/regulator/bd96801-regulator.c
F: drivers/regulator/rohm-regulator.c
F: drivers/rtc/rtc-bd70528.c
F: drivers/watchdog/bd9576_wdt.c
F: drivers/watchdog/bd96801_wdt.c
F: include/linux/mfd/rohm-bd71815.h
F: include/linux/mfd/rohm-bd71828.h
F: include/linux/mfd/rohm-bd718x7.h
F: include/linux/mfd/rohm-bd957x.h
F: include/linux/mfd/rohm-bd96801.h
F: include/linux/mfd/rohm-generic.h
F: include/linux/mfd/rohm-shared.h
......
......@@ -2101,6 +2101,19 @@ config MFD_ROHM_BD957XMUF
BD9573MUF Power Management ICs. BD9576 and BD9573 are primarily
designed to be used to power R-Car series processors.
config MFD_ROHM_BD96801
tristate "ROHM BD96801 Power Management IC"
depends on I2C=y
depends on OF
select REGMAP_I2C
select REGMAP_IRQ
select MFD_CORE
help
Select this option to get support for the ROHM BD96801 Power
Management IC. The ROHM BD96801 is a highly scalable Power Management
IC for industrial and automotive use. The BD96801 can be used as a
master PMIC in a chained PMIC solution with suitable companion PMICs.
config MFD_STM32_LPTIMER
tristate "Support for STM32 Low-Power Timer"
depends on (ARCH_STM32 && OF) || COMPILE_TEST
......
......@@ -269,6 +269,7 @@ obj-$(CONFIG_RAVE_SP_CORE) += rave-sp.o
obj-$(CONFIG_MFD_ROHM_BD71828) += rohm-bd71828.o
obj-$(CONFIG_MFD_ROHM_BD718XX) += rohm-bd718x7.o
obj-$(CONFIG_MFD_ROHM_BD957XMUF) += rohm-bd9576.o
obj-$(CONFIG_MFD_ROHM_BD96801) += rohm-bd96801.o
obj-$(CONFIG_MFD_STMFX) += stmfx.o
obj-$(CONFIG_MFD_KHADAS_MCU) += khadas-mcu.o
obj-$(CONFIG_MFD_ACER_A500_EC) += acer-ec-a500.o
......
This diff is collapsed.
......@@ -274,6 +274,18 @@ config REGULATOR_BD957XMUF
This driver can also be built as a module. If so, the module
will be called bd9576-regulator.
config REGULATOR_BD96801
tristate "ROHM BD96801 Power Regulator"
depends on MFD_ROHM_BD96801
select REGULATOR_ROHM
help
This driver supports voltage regulators on ROHM BD96801 PMIC.
This will enable support for the software controllable buck
and LDO regulators.
This driver can also be built as a module. If so, the module
will be called bd96801-regulator.
config REGULATOR_CPCAP
tristate "Motorola CPCAP regulator"
depends on MFD_CPCAP
......
......@@ -38,6 +38,7 @@ obj-$(CONFIG_REGULATOR_BD718XX) += bd718x7-regulator.o
obj-$(CONFIG_REGULATOR_BD9571MWV) += bd9571mwv-regulator.o
obj-$(CONFIG_REGULATOR_BD957XMUF) += bd9576-regulator.o
obj-$(CONFIG_REGULATOR_DA903X) += da903x-regulator.o
obj-$(CONFIG_REGULATOR_BD96801) += bd96801-regulator.o
obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
obj-$(CONFIG_REGULATOR_DA9055) += da9055-regulator.o
obj-$(CONFIG_REGULATOR_DA9062) += da9062-regulator.o
......
This diff is collapsed.
......@@ -181,6 +181,19 @@ config BD957XMUF_WATCHDOG
watchdog. Alternatively say M to compile the driver as a module,
which will be called bd9576_wdt.
config BD96801_WATCHDOG
tristate "ROHM BD96801 PMIC Watchdog"
depends on MFD_ROHM_BD96801
select WATCHDOG_CORE
help
Support for the watchdog in the ROHM BD96801 PMIC. Watchdog can be
configured to only generate IRQ or to trigger system reset via reset
pin.
Say Y here to include support for the ROHM BD96801 watchdog.
Alternatively say M to compile the driver as a module,
which will be called bd96801_wdt.
config CROS_EC_WATCHDOG
tristate "ChromeOS EC-based watchdog"
select WATCHDOG_CORE
......
......@@ -218,6 +218,7 @@ obj-$(CONFIG_XEN_WDT) += xen_wdt.o
# Architecture Independent
obj-$(CONFIG_BD957XMUF_WATCHDOG) += bd9576_wdt.o
obj-$(CONFIG_BD96801_WATCHDOG) += bd96801_wdt.o
obj-$(CONFIG_CROS_EC_WATCHDOG) += cros_ec_wdt.o
obj-$(CONFIG_DA9052_WATCHDOG) += da9052_wdt.o
obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o
......
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* Copyright (C) 2024 ROHM Semiconductors */
#ifndef __MFD_BD96801_H__
#define __MFD_BD96801_H__
#define BD96801_REG_SSCG_CTRL 0x09
#define BD96801_REG_SHD_INTB 0x20
#define BD96801_LDO5_VOL_LVL_REG 0x2c
#define BD96801_LDO6_VOL_LVL_REG 0x2d
#define BD96801_LDO7_VOL_LVL_REG 0x2e
#define BD96801_REG_BUCK_OVP 0x30
#define BD96801_REG_BUCK_OVD 0x35
#define BD96801_REG_LDO_OVP 0x31
#define BD96801_REG_LDO_OVD 0x36
#define BD96801_REG_BOOT_OVERTIME 0x3a
#define BD96801_REG_WD_TMO 0x40
#define BD96801_REG_WD_CONF 0x41
#define BD96801_REG_WD_FEED 0x42
#define BD96801_REG_WD_FAILCOUNT 0x43
#define BD96801_REG_WD_ASK 0x46
#define BD96801_REG_WD_STATUS 0x4a
#define BD96801_REG_PMIC_STATE 0x4f
#define BD96801_REG_EXT_STATE 0x50
#define BD96801_STATE_STBY 0x09
#define BD96801_LOCK_REG 0x04
#define BD96801_UNLOCK 0x9d
#define BD96801_LOCK 0x00
/* IRQ register area */
#define BD96801_REG_INT_MAIN 0x51
/*
* The BD96801 has two physical IRQ lines, INTB and ERRB.
*
* The 'main status register' is located at 0x51.
* The ERRB status registers are located at 0x52 ... 0x5B
* INTB status registers are at range 0x5c ... 0x63
*/
#define BD96801_REG_INT_SYS_ERRB1 0x52
#define BD96801_REG_INT_SYS_INTB 0x5c
#define BD96801_REG_INT_LDO7_INTB 0x63
/* MASK registers */
#define BD96801_REG_MASK_SYS_INTB 0x73
#define BD96801_REG_MASK_SYS_ERRB 0x69
#define BD96801_MAX_REGISTER 0x7a
#define BD96801_OTP_ERR_MASK BIT(0)
#define BD96801_DBIST_ERR_MASK BIT(1)
#define BD96801_EEP_ERR_MASK BIT(2)
#define BD96801_ABIST_ERR_MASK BIT(3)
#define BD96801_PRSTB_ERR_MASK BIT(4)
#define BD96801_DRMOS1_ERR_MASK BIT(5)
#define BD96801_DRMOS2_ERR_MASK BIT(6)
#define BD96801_SLAVE_ERR_MASK BIT(7)
#define BD96801_VREF_ERR_MASK BIT(0)
#define BD96801_TSD_ERR_MASK BIT(1)
#define BD96801_UVLO_ERR_MASK BIT(2)
#define BD96801_OVLO_ERR_MASK BIT(3)
#define BD96801_OSC_ERR_MASK BIT(4)
#define BD96801_PON_ERR_MASK BIT(5)
#define BD96801_POFF_ERR_MASK BIT(6)
#define BD96801_CMD_SHDN_ERR_MASK BIT(7)
#define BD96801_INT_PRSTB_WDT_ERR_MASK BIT(0)
#define BD96801_INT_CHIP_IF_ERR_MASK BIT(3)
#define BD96801_INT_SHDN_ERR_MASK BIT(7)
#define BD96801_OUT_PVIN_ERR_MASK BIT(0)
#define BD96801_OUT_OVP_ERR_MASK BIT(1)
#define BD96801_OUT_UVP_ERR_MASK BIT(2)
#define BD96801_OUT_SHDN_ERR_MASK BIT(7)
/* ERRB IRQs */
enum {
/* Reg 0x52, 0x53, 0x54 - ERRB system IRQs */
BD96801_OTP_ERR_STAT,
BD96801_DBIST_ERR_STAT,
BD96801_EEP_ERR_STAT,
BD96801_ABIST_ERR_STAT,
BD96801_PRSTB_ERR_STAT,
BD96801_DRMOS1_ERR_STAT,
BD96801_DRMOS2_ERR_STAT,
BD96801_SLAVE_ERR_STAT,
BD96801_VREF_ERR_STAT,
BD96801_TSD_ERR_STAT,
BD96801_UVLO_ERR_STAT,
BD96801_OVLO_ERR_STAT,
BD96801_OSC_ERR_STAT,
BD96801_PON_ERR_STAT,
BD96801_POFF_ERR_STAT,
BD96801_CMD_SHDN_ERR_STAT,
BD96801_INT_PRSTB_WDT_ERR,
BD96801_INT_CHIP_IF_ERR,
BD96801_INT_SHDN_ERR_STAT,
/* Reg 0x55 BUCK1 ERR IRQs */
BD96801_BUCK1_PVIN_ERR_STAT,
BD96801_BUCK1_OVP_ERR_STAT,
BD96801_BUCK1_UVP_ERR_STAT,
BD96801_BUCK1_SHDN_ERR_STAT,
/* Reg 0x56 BUCK2 ERR IRQs */
BD96801_BUCK2_PVIN_ERR_STAT,
BD96801_BUCK2_OVP_ERR_STAT,
BD96801_BUCK2_UVP_ERR_STAT,
BD96801_BUCK2_SHDN_ERR_STAT,
/* Reg 0x57 BUCK3 ERR IRQs */
BD96801_BUCK3_PVIN_ERR_STAT,
BD96801_BUCK3_OVP_ERR_STAT,
BD96801_BUCK3_UVP_ERR_STAT,
BD96801_BUCK3_SHDN_ERR_STAT,
/* Reg 0x58 BUCK4 ERR IRQs */
BD96801_BUCK4_PVIN_ERR_STAT,
BD96801_BUCK4_OVP_ERR_STAT,
BD96801_BUCK4_UVP_ERR_STAT,
BD96801_BUCK4_SHDN_ERR_STAT,
/* Reg 0x59 LDO5 ERR IRQs */
BD96801_LDO5_PVIN_ERR_STAT,
BD96801_LDO5_OVP_ERR_STAT,
BD96801_LDO5_UVP_ERR_STAT,
BD96801_LDO5_SHDN_ERR_STAT,
/* Reg 0x5a LDO6 ERR IRQs */
BD96801_LDO6_PVIN_ERR_STAT,
BD96801_LDO6_OVP_ERR_STAT,
BD96801_LDO6_UVP_ERR_STAT,
BD96801_LDO6_SHDN_ERR_STAT,
/* Reg 0x5b LDO7 ERR IRQs */
BD96801_LDO7_PVIN_ERR_STAT,
BD96801_LDO7_OVP_ERR_STAT,
BD96801_LDO7_UVP_ERR_STAT,
BD96801_LDO7_SHDN_ERR_STAT,
};
/* INTB IRQs */
enum {
/* Reg 0x5c (System INTB) */
BD96801_TW_STAT,
BD96801_WDT_ERR_STAT,
BD96801_I2C_ERR_STAT,
BD96801_CHIP_IF_ERR_STAT,
/* Reg 0x5d (BUCK1 INTB) */
BD96801_BUCK1_OCPH_STAT,
BD96801_BUCK1_OCPL_STAT,
BD96801_BUCK1_OCPN_STAT,
BD96801_BUCK1_OVD_STAT,
BD96801_BUCK1_UVD_STAT,
BD96801_BUCK1_TW_CH_STAT,
/* Reg 0x5e (BUCK2 INTB) */
BD96801_BUCK2_OCPH_STAT,
BD96801_BUCK2_OCPL_STAT,
BD96801_BUCK2_OCPN_STAT,
BD96801_BUCK2_OVD_STAT,
BD96801_BUCK2_UVD_STAT,
BD96801_BUCK2_TW_CH_STAT,
/* Reg 0x5f (BUCK3 INTB)*/
BD96801_BUCK3_OCPH_STAT,
BD96801_BUCK3_OCPL_STAT,
BD96801_BUCK3_OCPN_STAT,
BD96801_BUCK3_OVD_STAT,
BD96801_BUCK3_UVD_STAT,
BD96801_BUCK3_TW_CH_STAT,
/* Reg 0x60 (BUCK4 INTB)*/
BD96801_BUCK4_OCPH_STAT,
BD96801_BUCK4_OCPL_STAT,
BD96801_BUCK4_OCPN_STAT,
BD96801_BUCK4_OVD_STAT,
BD96801_BUCK4_UVD_STAT,
BD96801_BUCK4_TW_CH_STAT,
/* Reg 0x61 (LDO5 INTB) */
BD96801_LDO5_OCPH_STAT, /* bit [0] */
BD96801_LDO5_OVD_STAT, /* bit [3] */
BD96801_LDO5_UVD_STAT, /* bit [4] */
/* Reg 0x62 (LDO6 INTB) */
BD96801_LDO6_OCPH_STAT, /* bit [0] */
BD96801_LDO6_OVD_STAT, /* bit [3] */
BD96801_LDO6_UVD_STAT, /* bit [4] */
/* Reg 0x63 (LDO7 INTB) */
BD96801_LDO7_OCPH_STAT, /* bit [0] */
BD96801_LDO7_OVD_STAT, /* bit [3] */
BD96801_LDO7_UVD_STAT, /* bit [4] */
};
/* IRQ MASKs */
#define BD96801_TW_STAT_MASK BIT(0)
#define BD96801_WDT_ERR_STAT_MASK BIT(1)
#define BD96801_I2C_ERR_STAT_MASK BIT(2)
#define BD96801_CHIP_IF_ERR_STAT_MASK BIT(3)
#define BD96801_BUCK_OCPH_STAT_MASK BIT(0)
#define BD96801_BUCK_OCPL_STAT_MASK BIT(1)
#define BD96801_BUCK_OCPN_STAT_MASK BIT(2)
#define BD96801_BUCK_OVD_STAT_MASK BIT(3)
#define BD96801_BUCK_UVD_STAT_MASK BIT(4)
#define BD96801_BUCK_TW_CH_STAT_MASK BIT(5)
#define BD96801_LDO_OCPH_STAT_MASK BIT(0)
#define BD96801_LDO_OVD_STAT_MASK BIT(3)
#define BD96801_LDO_UVD_STAT_MASK BIT(4)
#endif
......@@ -16,6 +16,7 @@ enum rohm_chip_type {
ROHM_CHIP_TYPE_BD71828,
ROHM_CHIP_TYPE_BD71837,
ROHM_CHIP_TYPE_BD71847,
ROHM_CHIP_TYPE_BD96801,
ROHM_CHIP_TYPE_AMOUNT
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment