Re: [PATCH 3/8] mfd: Support for ROHM BD73800 PMIC core
From: Lee Jones
Date: Thu Jul 09 2026 - 07:13:38 EST
/* Sashiko Automation: Reviewed (0 Findings) */
On Wed, 01 Jul 2026, Matti Vaittinen wrote:
> From: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
>
> The BD73800 integrates regulators, ADC (intended for accumulating current /
> voltage / power values), a real-time clock (RTC), clock gate and GPIOs.
>
> Add core support for ROHM BD73800 Power Management IC.
>
> Signed-off-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
> ---
> drivers/mfd/Kconfig | 15 +-
> drivers/mfd/rohm-bd71828.c | 145 ++++++++++++++-
> include/linux/mfd/rohm-bd73800.h | 307 +++++++++++++++++++++++++++++++
> include/linux/mfd/rohm-generic.h | 1 +
> 4 files changed, 461 insertions(+), 7 deletions(-)
> create mode 100644 include/linux/mfd/rohm-bd73800.h
>
> diff --git a/drivers/mfd/rohm-bd71828.c b/drivers/mfd/rohm-bd71828.c
> index a79f354bf5cb..31637777b627 100644
> --- a/drivers/mfd/rohm-bd71828.c
> +++ b/drivers/mfd/rohm-bd71828.c
> @@ -2,7 +2,7 @@
> /*
> * Copyright (C) 2019 ROHM Semiconductors
> *
You should consider updating this.
> - * ROHM BD718[15/28/79] and BD72720 PMIC driver
> + * ROHM BD718[15/28/79], BD72720 and BD73[8/9]00 PMIC driver
> */
>
> #include <linux/gpio_keys.h>
> @@ -249,6 +256,17 @@ static const struct mfd_cell bd72720_mfd_cells[] = {
> },
> };
>
> +static const struct mfd_cell bd73800_mfd_cells[] = {
> + { .name = "bd73800-pmic", },
> + { .name = "bd73800-clk", },
> + { .name = "bd73800-gpio", },
> + {
> + .name = "bd73800-rtc",
> + .num_resources = ARRAY_SIZE(bd73800_rtc_irqs),
> + .resources = &bd73800_rtc_irqs[0],
> + },
> +};
'bd73800_rtc_irqs'?
> +
> static const struct regmap_range bd71815_volatile_ranges[] = {
> regmap_reg_range(BD71815_REG_SEC, BD71815_REG_YEAR),
> regmap_reg_range(BD71815_REG_CONF, BD71815_REG_BAT_TEMP),
> @@ -383,6 +412,24 @@ static const struct regmap_access_table bd72720_volatile_regs_4c = {
> .n_yes_ranges = ARRAY_SIZE(bd72720_volatile_ranges_4c),
> };
>
> +static const struct regmap_access_table bd73800_volatile_regs = {
> + .yes_ranges = &bd73800_volatile_ranges[0],
'bd73800_volatile_ranges'?
> + .n_yes_ranges = ARRAY_SIZE(bd73800_volatile_ranges),
> +};
> +
> +static const struct regmap_range bd73800_read_only_ranges[] = {
> + regmap_reg_range(BD73800_REG_PRODUCT_ID, BD73800_REG_NVMVERSION),
> + regmap_reg_range(BD73800_REG_POW_STATE, BD73800_REG_POW_STATE),
> + regmap_reg_range(BD73800_REG_ADC_ACCUM_CNT2, BD73800_REG_ADC_TEMP_VAL0),
> + regmap_reg_range(BD73800_REG_INT_MAIN_STAT, BD73800_REG_INT_MAIN_STAT),
> + regmap_reg_range(BD73800_REG_INT_MAIN_SRC, BD73800_REG_INT_5_SRC),
> +};
> +
> +static const struct regmap_access_table bd73800_ro_regs = {
> + .no_ranges = &bd73800_read_only_ranges[0],
Etc.
> + .n_no_ranges = ARRAY_SIZE(bd73800_read_only_ranges),
> +};
> +
> static const struct regmap_config bd71815_regmap = {
> .reg_bits = 8,
> .val_bits = 8,
> @@ -852,6 +962,25 @@ static const struct regmap_irq_chip bd72720_irq_chip = {
> .irq_reg_stride = 1,
> };
>
> +static const struct regmap_irq_chip bd73800_irq_chip = {
> + .name = "bd73800_irq",
> + .main_status = BD73800_REG_INT_MAIN_STAT,
> + .irqs = &bd73800_irqs[0],
Here too.
> + .num_irqs = ARRAY_SIZE(bd73800_irqs),
> + .status_base = BD73800_REG_INT_1_STAT,
> + .unmask_base = BD73800_REG_INT_1_EN,
> + .ack_base = BD73800_REG_INT_1_STAT,
> + .init_ack_masked = true,
> + .num_regs = 5,
> + .num_main_regs = 1,
> + /*
> + * Ignore mirrored bits [7:5]. They are handled as part of normal INT_4
> + * handling.
> + */
> + .num_main_status_bits = 5,
> + .irq_reg_stride = 1,
> +};
> +
> static int set_clk_mode(struct device *dev, struct regmap *regmap,
> int clkmode_reg)
> {
> diff --git a/include/linux/mfd/rohm-bd73800.h b/include/linux/mfd/rohm-bd73800.h
> new file mode 100644
> index 000000000000..4bceb20ac6b1
> --- /dev/null
> +++ b/include/linux/mfd/rohm-bd73800.h
> @@ -0,0 +1,307 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copyright 2024 ROHM Semiconductors.
> + *
This is new to use. Please update this too.
> + * Author: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>
> + */
> +
> +#ifndef _MFD_BD73800_H
> +#define _MFD_BD73800_H
> +
> +#include <linux/regmap.h>
> +