diff mbox series

ARM: dts: alt: Add DA9063 PMIC node

Message ID 20190303190059.31155-1-marek.vasut@gmail.com (mailing list archive)
State Mainlined, archived
Commit a8d5fc0be537d49562f3d4b63390584e304ec8dc
Headers show
Series ARM: dts: alt: Add DA9063 PMIC node | expand

Commit Message

Marek Vasut March 3, 2019, 7 p.m. UTC
From: Marek Vasut <marek.vasut+renesas@gmail.com>

Add DA9063 PMIC node to the I2C bus.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: linux-renesas-soc@vger.kernel.org
To: linux-arm-kernel@lists.infradead.org
---
NOTE: R8A7794 Alt does not share the PMIC IRQ line with other PMICs,
      hence the regulator-quirk-rcar-gen2.c does not need a new entry.
---
 arch/arm/boot/dts/r8a7794-alt.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Geert Uytterhoeven March 4, 2019, 10:35 a.m. UTC | #1
Hi Marek,

On Sun, Mar 3, 2019 at 8:01 PM <marek.vasut@gmail.com> wrote:
> From: Marek Vasut <marek.vasut+renesas@gmail.com>
>
> Add DA9063 PMIC node to the I2C bus.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>

Thanks for your patch!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/arch/arm/boot/dts/r8a7794-alt.dts
> +++ b/arch/arm/boot/dts/r8a7794-alt.dts
> @@ -377,6 +377,27 @@
>         pinctrl-names = "i2c-exio4";
>  };
>
> +&i2c7 {
> +       status = "okay";
> +       clock-frequency = <100000>;

According to the DA9063 datasheet, the PMIC supports up to 400 kHz.
It looks like there are no other devices on the bus.

Wolfram, what's your stance on this?

> +
> +       pmic@58 {
> +               compatible = "dlg,da9063";
> +               reg = <0x58>;
> +               interrupt-parent = <&gpio3>;
> +               interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
> +               interrupt-controller;
> +
> +               rtc {
> +                       compatible = "dlg,da9063-rtc";
> +               };
> +
> +               wdt {
> +                       compatible = "dlg,da9063-watchdog";
> +               };
> +       };
> +};
> +

Gr{oetje,eeting}s,

                        Geert
Wolfram Sang March 4, 2019, 10:57 a.m. UTC | #2
> > Add DA9063 PMIC node to the I2C bus.
> >
> > Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> 
> Thanks for your patch!
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks for CCing me, I didn't get and missed the original patch.

> > +++ b/arch/arm/boot/dts/r8a7794-alt.dts
> > @@ -377,6 +377,27 @@
> >         pinctrl-names = "i2c-exio4";
> >  };
> >
> > +&i2c7 {
> > +       status = "okay";
> > +       clock-frequency = <100000>;
> 
> According to the DA9063 datasheet, the PMIC supports up to 400 kHz.
> It looks like there are no other devices on the bus.
> 
> Wolfram, what's your stance on this?

Yes, please. I thought this was standard on Gen2 IIC_DVFS busses, but
seems not. Probably it slipped through the cracks.
Marek Vasut March 4, 2019, 10:59 a.m. UTC | #3
On 3/4/19 11:57 AM, Wolfram Sang wrote:
> 
>>> Add DA9063 PMIC node to the I2C bus.
>>>
>>> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
>>
>> Thanks for your patch!
>>
>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Thanks for CCing me, I didn't get and missed the original patch.
> 
>>> +++ b/arch/arm/boot/dts/r8a7794-alt.dts
>>> @@ -377,6 +377,27 @@
>>>         pinctrl-names = "i2c-exio4";
>>>  };
>>>
>>> +&i2c7 {
>>> +       status = "okay";
>>> +       clock-frequency = <100000>;
>>
>> According to the DA9063 datasheet, the PMIC supports up to 400 kHz.
>> It looks like there are no other devices on the bus.
>>
>> Wolfram, what's your stance on this?
> 
> Yes, please. I thought this was standard on Gen2 IIC_DVFS busses, but
> seems not. Probably it slipped through the cracks.

Do we want to update all of the other boards too ?

I'd be cautious about the DVFS I2C, running faster while talking to the
PMIC and reading/writing a few registers brings little benefit, while
the signal integrity might be impacted.
Wolfram Sang March 4, 2019, 11:13 a.m. UTC | #4
On Mon, Mar 04, 2019 at 11:59:48AM +0100, Marek Vasut wrote:
> On 3/4/19 11:57 AM, Wolfram Sang wrote:
> > 
> >>> Add DA9063 PMIC node to the I2C bus.
> >>>
> >>> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> >>
> >> Thanks for your patch!
> >>
> >> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > 
> > Thanks for CCing me, I didn't get and missed the original patch.
> > 
> >>> +++ b/arch/arm/boot/dts/r8a7794-alt.dts
> >>> @@ -377,6 +377,27 @@
> >>>         pinctrl-names = "i2c-exio4";
> >>>  };
> >>>
> >>> +&i2c7 {
> >>> +       status = "okay";
> >>> +       clock-frequency = <100000>;
> >>
> >> According to the DA9063 datasheet, the PMIC supports up to 400 kHz.
> >> It looks like there are no other devices on the bus.
> >>
> >> Wolfram, what's your stance on this?
> > 
> > Yes, please. I thought this was standard on Gen2 IIC_DVFS busses, but
> > seems not. Probably it slipped through the cracks.
> 
> Do we want to update all of the other boards too ?
> 
> I'd be cautious about the DVFS I2C, running faster while talking to the
> PMIC and reading/writing a few registers brings little benefit, while
> the signal integrity might be impacted.

Can be argued. I think if we would apply some testing on top of this
change, we will find that it will work. But we would in deed need this
testing as verification, and this is not our top priority project. But
if someone feels like running some i2c dumping over night, well,
why not..
Simon Horman March 8, 2019, 1:40 p.m. UTC | #5
On Mon, Mar 04, 2019 at 12:13:49PM +0100, Wolfram Sang wrote:
> On Mon, Mar 04, 2019 at 11:59:48AM +0100, Marek Vasut wrote:
> > On 3/4/19 11:57 AM, Wolfram Sang wrote:
> > > 
> > >>> Add DA9063 PMIC node to the I2C bus.
> > >>>
> > >>> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> > >>
> > >> Thanks for your patch!
> > >>
> > >> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > 
> > > Thanks for CCing me, I didn't get and missed the original patch.
> > > 
> > >>> +++ b/arch/arm/boot/dts/r8a7794-alt.dts
> > >>> @@ -377,6 +377,27 @@
> > >>>         pinctrl-names = "i2c-exio4";
> > >>>  };
> > >>>
> > >>> +&i2c7 {
> > >>> +       status = "okay";
> > >>> +       clock-frequency = <100000>;
> > >>
> > >> According to the DA9063 datasheet, the PMIC supports up to 400 kHz.
> > >> It looks like there are no other devices on the bus.
> > >>
> > >> Wolfram, what's your stance on this?
> > > 
> > > Yes, please. I thought this was standard on Gen2 IIC_DVFS busses, but
> > > seems not. Probably it slipped through the cracks.
> > 
> > Do we want to update all of the other boards too ?
> > 
> > I'd be cautious about the DVFS I2C, running faster while talking to the
> > PMIC and reading/writing a few registers brings little benefit, while
> > the signal integrity might be impacted.
> 
> Can be argued. I think if we would apply some testing on top of this
> change, we will find that it will work. But we would in deed need this
> testing as verification, and this is not our top priority project. But
> if someone feels like running some i2c dumping over night, well,
> why not..

Thanks,

I've applied this patch for v5.2.
We can do a sweep of frequency updates as a follow-up if we decide
that is the right way to go.
Marek Vasut March 8, 2019, 1:52 p.m. UTC | #6
On 3/8/19 2:40 PM, Simon Horman wrote:
> On Mon, Mar 04, 2019 at 12:13:49PM +0100, Wolfram Sang wrote:
>> On Mon, Mar 04, 2019 at 11:59:48AM +0100, Marek Vasut wrote:
>>> On 3/4/19 11:57 AM, Wolfram Sang wrote:
>>>>
>>>>>> Add DA9063 PMIC node to the I2C bus.
>>>>>>
>>>>>> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
>>>>>
>>>>> Thanks for your patch!
>>>>>
>>>>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>>>
>>>> Thanks for CCing me, I didn't get and missed the original patch.
>>>>
>>>>>> +++ b/arch/arm/boot/dts/r8a7794-alt.dts
>>>>>> @@ -377,6 +377,27 @@
>>>>>>         pinctrl-names = "i2c-exio4";
>>>>>>  };
>>>>>>
>>>>>> +&i2c7 {
>>>>>> +       status = "okay";
>>>>>> +       clock-frequency = <100000>;
>>>>>
>>>>> According to the DA9063 datasheet, the PMIC supports up to 400 kHz.
>>>>> It looks like there are no other devices on the bus.
>>>>>
>>>>> Wolfram, what's your stance on this?
>>>>
>>>> Yes, please. I thought this was standard on Gen2 IIC_DVFS busses, but
>>>> seems not. Probably it slipped through the cracks.
>>>
>>> Do we want to update all of the other boards too ?
>>>
>>> I'd be cautious about the DVFS I2C, running faster while talking to the
>>> PMIC and reading/writing a few registers brings little benefit, while
>>> the signal integrity might be impacted.
>>
>> Can be argued. I think if we would apply some testing on top of this
>> change, we will find that it will work. But we would in deed need this
>> testing as verification, and this is not our top priority project. But
>> if someone feels like running some i2c dumping over night, well,
>> why not..
> 
> Thanks,
> 
> I've applied this patch for v5.2.
> We can do a sweep of frequency updates as a follow-up if we decide
> that is the right way to go.

Do we really want to speed up the PMIC I2C bus ? What are the pros
(none?) and cons (might be unstable) ?
Wolfram Sang March 8, 2019, 2:53 p.m. UTC | #7
> Do we really want to speed up the PMIC I2C bus ? What are the pros
> (none?) and cons (might be unstable) ?

Then let's go down to 10kHz instead? Even more stable.
Marek Vasut March 8, 2019, 5:46 p.m. UTC | #8
On 3/8/19 3:53 PM, Wolfram Sang wrote:
> 
>> Do we really want to speed up the PMIC I2C bus ? What are the pros
>> (none?) and cons (might be unstable) ?
> 
> Then let's go down to 10kHz instead? Even more stable.

100 kHz and 400 kHz seem to be the most often used I2C frequencies,
maybe we should stick to those, since I presume Dialog tested the PMIC
with at least those two.
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/r8a7794-alt.dts b/arch/arm/boot/dts/r8a7794-alt.dts
index ef7e2a837df6..e0500ec81569 100644
--- a/arch/arm/boot/dts/r8a7794-alt.dts
+++ b/arch/arm/boot/dts/r8a7794-alt.dts
@@ -377,6 +377,27 @@ 
 	pinctrl-names = "i2c-exio4";
 };
 
+&i2c7 {
+	status = "okay";
+	clock-frequency = <100000>;
+
+	pmic@58 {
+		compatible = "dlg,da9063";
+		reg = <0x58>;
+		interrupt-parent = <&gpio3>;
+		interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-controller;
+
+		rtc {
+			compatible = "dlg,da9063-rtc";
+		};
+
+		wdt {
+			compatible = "dlg,da9063-watchdog";
+		};
+	};
+};
+
 &vin0 {
 	status = "okay";
 	pinctrl-0 = <&vin0_pins>;