linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-power@fi.rohmeurope.com, linux-clk@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org
Subject: Re: [PATCH v2 09/17] mfd: Support for ROHM BD71815 PMIC core
Date: Mon, 25 Jan 2021 16:48:36 +0200	[thread overview]
Message-ID: <7a3d897d6af9f4310e5cc98ca74123192da49e27.camel@fi.rohmeurope.com> (raw)
In-Reply-To: <20210125141044.GZ4903@dell>

Hello Lee,

Thanks again for the review!

On Mon, 2021-01-25 at 14:10 +0000, Lee Jones wrote:
> On Tue, 19 Jan 2021, Matti Vaittinen wrote:
> 
> > Add core support for ROHM BD71815 Power Management IC.
> > 
> > The IC integrates regulators, a battery charger with a coulomb
> > counter,
> > a real-time clock (RTC), clock gate and general-purpose outputs
> > (GPO).
> > 
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> > ---
> > Changes since v1:
> >   - Used BIT() for better readability
> >   - removed some unused definitions
> > 
> >  drivers/mfd/Kconfig              |  15 +-
> >  drivers/mfd/rohm-bd71828.c       | 416 +++++++++++++++++++++--
> >  include/linux/mfd/rohm-bd71815.h | 561
> > +++++++++++++++++++++++++++++++
> >  include/linux/mfd/rohm-bd71828.h |   3 +
> >  4 files changed, 952 insertions(+), 43 deletions(-)
> >  create mode 100644 include/linux/mfd/rohm-bd71815.h
> > 
> > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> > index bdfce7b15621..59bfacb91898 100644
> > --- a/drivers/mfd/Kconfig
> > +++ b/drivers/mfd/Kconfig
> > @@ -1984,19 +1984,20 @@ config MFD_ROHM_BD70528
> >  	  charger.
> >  
> >  config MFD_ROHM_BD71828
> > -	tristate "ROHM BD71828 Power Management IC"
> > +	tristate "ROHM BD71828 and BD71815 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 BD71828 Power
> > -	  Management IC. BD71828GW is a single-chip power management IC
> > for
> > -	  battery-powered portable devices. The IC integrates 7 buck
> > -	  converters, 7 LDOs, and a 1500 mA single-cell linear charger.
> > -	  Also included is a Coulomb counter, a real-time clock (RTC),
> > and
> > -	  a 32.768 kHz clock gate.
> > +	  Select this option to get support for the ROHM BD71828 and
> > BD71815
> > +	  Power Management ICs. BD71828GW and BD71815AGW are single-
> > chip power
> > +	  management ICs mainly for battery-powered portable devices.
> > +	  The BD71828 integrates 7 buck converters and 7 LDOs. The
> > BD71815
> > +	  has 5 bucks, 7 LDOs, and a boost for driving LEDs. Both ICs
> > provide
> > +	  also a single-cell linear charger, a Coulomb counter, a real-
> > time
> > +	  clock (RTC), GPIOs and a 32.768 kHz clock gate.
> >  
> >  config MFD_STM32_LPTIMER
> >  	tristate "Support for STM32 Low-Power Timer"
> > diff --git a/drivers/mfd/rohm-bd71828.c b/drivers/mfd/rohm-
> > bd71828.c
> > index 210261d026f2..28b82477ce4c 100644
> > --- a/drivers/mfd/rohm-bd71828.c
> > +++ b/drivers/mfd/rohm-bd71828.c
> > @@ -2,7 +2,7 @@
> >  //
> >  // Copyright (C) 2019 ROHM Semiconductors
> >  //
> > -// ROHM BD71828 PMIC driver
> > +// ROHM BD71828/BD71815 PMIC driver
> >  
> >  #include <linux/gpio_keys.h>
> >  #include <linux/i2c.h>
> > @@ -11,7 +11,9 @@
> >  #include <linux/ioport.h>
> >  #include <linux/irq.h>
> >  #include <linux/mfd/core.h>
> > +#include <linux/mfd/rohm-bd71815.h>
> >  #include <linux/mfd/rohm-bd71828.h>
> > +#include <linux/mfd/rohm-generic.h>
> >  #include <linux/module.h>
> >  #include <linux/of_device.h>
> >  #include <linux/regmap.h>
> > @@ -29,12 +31,102 @@ static struct gpio_keys_platform_data
> > bd71828_powerkey_data = {
> >  	.name = "bd71828-pwrkey",
> >  };
> >  
> > -static const struct resource rtc_irqs[] = {
> > +static const struct resource bd71815_rtc_irqs[] = {
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC0, "bd71815-rtc-alm-0"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd71815-rtc-alm-1"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC2, "bd71815-rtc-alm-2"),
> > +};
> > +
> > +static const struct resource bd71828_rtc_irqs[] = {
> >  	DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC0, "bd71828-rtc-alm-0"),
> >  	DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC1, "bd71828-rtc-alm-1"),
> >  	DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC2, "bd71828-rtc-alm-2"),
> >  };
> >  
> > +static struct resource bd71815_power_irqs[] = {
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_RMV, "bd71815-dcin-rmv"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_CLPS_OUT, "bd71815-clps-out"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_CLPS_IN, "bd71815-clps-in"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_OVP_RES, "bd71815-dcin-
> > ovp-res"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_OVP_DET, "bd71815-dcin-
> > ovp-det"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_MON_RES, "bd71815-dcin-
> > mon-res"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_MON_DET, "bd71815-dcin-
> > mon-det"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_UV_RES, "bd71815-vsys-uv-
> > res"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_UV_DET, "bd71815-vsys-uv-
> > det"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_LOW_RES, "bd71815-vsys-
> > low-res"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_LOW_DET, "bd71815-vsys-
> > low-det"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_MON_RES, "bd71815-vsys-
> > mon-res"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_MON_RES, "bd71815-vsys-
> > mon-det"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_CHG_WDG_TEMP, "bd71815-chg-
> > wdg-temp"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_CHG_WDG_TIME, "bd71815-chg-
> > wdg"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_CHG_RECHARGE_RES, "bd71815-
> > rechg-res"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_CHG_RECHARGE_DET, "bd71815-
> > rechg-det"),
> > +	DEFINE_RES_IRQ_NAMED(BD71815_INT_CHG_RANGED_TEMP_TRANSITION,
> > +			     "bd71815-ranged-temp-transit"),
> 
> The new line limit is 100.  Feel free to run these out.

I learn new things every day it seems. This change is more than
welcome!

> > +	if (!strncmp(mode, "open-drain", 10)) {
> > +		dev_dbg(dev, "configuring clk32kout as open-drain");
> 
> Do you *really* need these?

No. development leftover. Thanks for pointing that.

> > 
> > +		button_irq = 0;
> > +		dev_info(&i2c->dev, "BD71815 found\n");
> 
> Again, are these *really* useful to you and/or your users?
> 
> Besides, this device not *found* i.e. scanned/read and instantiated,
> it has simply been matched from the local DTB.  It can still be
> wrong.  You can probably omit them.

You're right. One can check the DT contents from /proc if he wants to
check what IC compatible was used. Thanks.
> 
> [...]
> 
> > diff --git a/include/linux/mfd/rohm-bd71815.h
> > b/include/linux/mfd/rohm-bd71815.h
> > new file mode 100644
> > index 000000000000..8ee5874a5b73
> > --- /dev/null
> > +++ b/include/linux/mfd/rohm-bd71815.h
> > @@ -0,0 +1,561 @@
> > +/* SPDX-License-Identifier: GPL-2.0-or-later */
> > +/*
> > + * Copyright 2014 Embest Technology Co. Ltd. Inc.
> 
> Jeeze!  Is this for the Amiga?

Nah. Long live NXP SOCs! ;) I think BD71815 was _originally_ developed
for i.MX6.

> 
> > + * Author: yanglsh@embest-tech.com
> > + *
> > + * 2020, 2021 Heavily modified by:
> 
> You should probably add a proper copyright.
Ok. I guess I can do so. Thanks!

> > + *	 Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> > + */
> > +
> > +#ifndef _MFD_BD71815_H
> > +#define _MFD_BD71815_H
> > +
> > +#include <linux/regmap.h>

Best Regards
-- Matti Vaittinen


  reply	other threads:[~2021-01-26  6:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19  7:13 [PATCH v2 00/17] Support ROHM BD71815 PMIC Matti Vaittinen
2021-01-19  7:14 ` [PATCH v2 01/17] regulator: bd718x7, bd71828, Fix dvs voltage levels Matti Vaittinen
2021-01-19  7:14 ` [PATCH v2 02/17] rtc: bd70528: Do not require parent data Matti Vaittinen
2021-01-19 21:09   ` Alexandre Belloni
2021-01-20  6:37     ` Matti Vaittinen
2021-01-19  7:15 ` [PATCH v2 03/17] clk: BD718x7: Do not depend on parent driver data Matti Vaittinen
2021-01-19  7:15 ` [PATCH v2 04/17] mfd: bd718x7: simplify by cleaning unnecessary device data Matti Vaittinen
2021-01-25 13:56   ` Lee Jones
2021-01-19  7:16 ` [PATCH v2 05/17] dt_bindings: bd71828: Add clock output mode Matti Vaittinen
2021-02-09  2:22   ` Rob Herring
2021-01-19  7:17 ` [PATCH v2 06/17] dt_bindings: regulator: Add ROHM BD71815 PMIC regulators Matti Vaittinen
2021-02-09  2:24   ` Rob Herring
2021-02-09 13:10     ` Vaittinen, Matti
2021-02-09 13:50       ` Rob Herring
2021-01-19  7:21 ` [PATCH v2 07/17] dt_bindings: mfd: Add ROHM BD71815 PMIC Matti Vaittinen
2021-02-09  2:26   ` Rob Herring
2021-01-19  7:21 ` [PATCH v2 08/17] mfd: Add ROHM BD71815 ID Matti Vaittinen
2021-01-25 13:57   ` Lee Jones
2021-01-19  7:22 ` [PATCH v2 09/17] mfd: Support for ROHM BD71815 PMIC core Matti Vaittinen
2021-01-25 14:10   ` Lee Jones
2021-01-25 14:48     ` Matti Vaittinen [this message]
2021-01-26  8:29       ` Lee Jones
2021-01-19  7:23 ` [PATCH v2 10/17] gpio: support ROHM BD71815 GPOs Matti Vaittinen
2021-01-19 11:07   ` Bartosz Golaszewski
2021-01-19 13:01     ` Vaittinen, Matti
2021-03-23  9:57     ` Vaittinen, Matti
2021-03-26 14:44       ` Bartosz Golaszewski
2021-01-19  7:25 ` [PATCH v2 11/17] regulator: helpers: Export helper voltage listing Matti Vaittinen
2021-01-19  7:26 ` [PATCH v2 12/17] regulator: rohm-regulator: linear voltage support Matti Vaittinen
2021-01-19  7:27 ` [PATCH v2 13/17] regulator: rohm-regulator: Support SNVS HW state Matti Vaittinen
2021-01-19  7:29 ` [PATCH v2 14/17] regulator: Support ROHM BD71815 regulators Matti Vaittinen
2021-01-19  7:30 ` [PATCH v2 15/17] clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC Matti Vaittinen
2021-02-12  3:40   ` Stephen Boyd
2021-01-19  7:31 ` [PATCH v2 16/17] rtc: bd70528: Support RTC on ROHM BD71815 Matti Vaittinen
2021-01-19 21:10   ` Alexandre Belloni
2021-01-19  7:34 ` [PATCH v2 17/17] MAINTAINERS: Add ROHM BD71815AGW Matti Vaittinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a3d897d6af9f4310e5cc98ca74123192da49e27.camel@fi.rohmeurope.com \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).