mbox series

[v2,0/5] Minor device-tree additions for C.H.I.P

Message ID cover.1683719613.git.noodles@earth.li
Headers show
Series Minor device-tree additions for C.H.I.P | expand

Message

Jonathan McDowell May 10, 2023, noon UTC
This small patch series adds some improvements for the C.H.I.P DTS,
enabling bluetooth, exporting the PMIC temperature details via iio-hwmon
and finally adding the appropriate base pinmux info for an external MMC
card. As a pre-requisite for the Bluetooth it also adds support to the
AXP209 driver for GPIO3, which is the Bluetooth device wakeup line.

v2:
- Fix missing ; on bluetooth stanza in DTS
- Add device/host wake GPIOs for Bluetooth device
- Add omit-if-no-ref on the port E pinmux stanza
- Rename axp20x_temp to pmic-temp
- Add AXP209 GPIO3 support

Jonathan McDowell (5):
  dt-bindings: gpio: Add GPIO3 for AXP209 GPIO binding schema
  pinctrl: axp209: Add support for GPIO3 on the AXP209
  ARM: dts: sun5i: chip: Enable bluetooth
  ARM: dts: sun5i: Add port E pinmux settings for mmc2
  ARM: dts: axp209: Add iio-hwmon node for internal temperature

 .../bindings/gpio/x-powers,axp209-gpio.yaml   |  1 +
 arch/arm/boot/dts/axp209.dtsi                 |  7 ++++
 arch/arm/boot/dts/sun5i-r8-chip.dts           |  6 +++
 arch/arm/boot/dts/sun5i.dtsi                  |  9 ++++
 drivers/pinctrl/pinctrl-axp209.c              | 42 +++++++++++++++++++
 5 files changed, 65 insertions(+)

Comments

Jernej Škrabec May 11, 2023, 3:41 p.m. UTC | #1
Dne sreda, 10. maj 2023 ob 14:01:12 CEST je Jonathan McDowell napisal(a):
> The AXP209 has a 4th GPIO, so add it in preparation for support in the
> driver.
> 
> Signed-off-by: Jonathan McDowell <noodles@earth.li>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej
Jernej Škrabec May 11, 2023, 4:11 p.m. UTC | #2
Dne sreda, 10. maj 2023 ob 14:02:28 CEST je Jonathan McDowell napisal(a):
> This adds a DT node to hook up the internal temperature ADC to the
> iio-hwmon driver. The various voltage + current ADCs are consumed and
> exposed by their respective drivers, but this is not and is always
> available. Naming chosen to match the axp20x_ prefix the power sensors
> use.

Sorry for maybe obvious thing, but where are other ADC channels exposed?

Best regards,
Jernej

> 
> Signed-off-by: Jonathan McDowell <noodles@earth.li>
> ---
>  arch/arm/boot/dts/axp209.dtsi | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi
> index ca240cd6f6c3..469d0f7d5185 100644
> --- a/arch/arm/boot/dts/axp209.dtsi
> +++ b/arch/arm/boot/dts/axp209.dtsi
> @@ -48,6 +48,13 @@
>   * http://dl.linux-sunxi.org/AXP/AXP209%20Datasheet%20v1.0_cn.pdf
>   */
> 
> +/ {
> +	pmic-temp {
> +		compatible = "iio-hwmon";
> +		io-channels = <&axp_adc 4>; /* Internal temperature */
> +	};
> +};
> +
>  &axp209 {
>  	compatible = "x-powers,axp209";
>  	interrupt-controller;
Conor Dooley May 11, 2023, 6:55 p.m. UTC | #3
On Wed, May 10, 2023 at 01:01:12PM +0100, Jonathan McDowell wrote:
> The AXP209 has a 4th GPIO, so add it in preparation for support in the
> driver.
> 
> Signed-off-by: Jonathan McDowell <noodles@earth.li>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.
Jonathan McDowell May 12, 2023, 10:30 a.m. UTC | #4
On Thu, May 11, 2023 at 06:11:49PM +0200, Jernej Škrabec wrote:
> Dne sreda, 10. maj 2023 ob 14:02:28 CEST je Jonathan McDowell napisal(a):
> > This adds a DT node to hook up the internal temperature ADC to the
> > iio-hwmon driver. The various voltage + current ADCs are consumed and
> > exposed by their respective drivers, but this is not and is always
> > available. Naming chosen to match the axp20x_ prefix the power sensors
> > use.
> 
> Sorry for maybe obvious thing, but where are other ADC channels exposed?

In the associated power drivers; e.g. axp20x_ac_power, axp20x_usb_power
+ axp20x_battery. The internal temperature is the only one that
logically belongs to the chip as a whole rather than one of the
subfunctions.

root@chip:~# sensors
axp20x_battery-isa-0000
Adapter: ISA adapter
in0:           0.00 V
curr1:         0.00 A

pmic_temp-isa-0000
Adapter: ISA adapter
temp1:        +42.5°C

axp20x_ac-isa-0000
Adapter: ISA adapter
in0:           0.00 V
curr1:         0.00 A

axp20x_usb-isa-0000
Adapter: ISA adapter
in0:           4.93 V  (min =  +4.00 V)
curr1:       330.00 mA (max =  +0.00 A)

> > Signed-off-by: Jonathan McDowell <noodles@earth.li>
> > ---
> >  arch/arm/boot/dts/axp209.dtsi | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi
> > index ca240cd6f6c3..469d0f7d5185 100644
> > --- a/arch/arm/boot/dts/axp209.dtsi
> > +++ b/arch/arm/boot/dts/axp209.dtsi
> > @@ -48,6 +48,13 @@
> >   * http://dl.linux-sunxi.org/AXP/AXP209%20Datasheet%20v1.0_cn.pdf
> >   */
> > 
> > +/ {
> > +	pmic-temp {
> > +		compatible = "iio-hwmon";
> > +		io-channels = <&axp_adc 4>; /* Internal temperature */
> > +	};
> > +};
> > +
> >  &axp209 {
> >  	compatible = "x-powers,axp209";
> >  	interrupt-controller;

J.
Jernej Škrabec May 12, 2023, 4:37 p.m. UTC | #5
Dne petek, 12. maj 2023 ob 12:30:32 CEST je Jonathan McDowell napisal(a):
> On Thu, May 11, 2023 at 06:11:49PM +0200, Jernej Škrabec wrote:
> > Dne sreda, 10. maj 2023 ob 14:02:28 CEST je Jonathan McDowell napisal(a):
> > > This adds a DT node to hook up the internal temperature ADC to the
> > > iio-hwmon driver. The various voltage + current ADCs are consumed and
> > > exposed by their respective drivers, but this is not and is always
> > > available. Naming chosen to match the axp20x_ prefix the power sensors
> > > use.
> > 
> > Sorry for maybe obvious thing, but where are other ADC channels exposed?
> 
> In the associated power drivers; e.g. axp20x_ac_power, axp20x_usb_power
> + axp20x_battery. The internal temperature is the only one that
> logically belongs to the chip as a whole rather than one of the
> subfunctions.
> 
> root@chip:~# sensors
> axp20x_battery-isa-0000
> Adapter: ISA adapter
> in0:           0.00 V
> curr1:         0.00 A
> 
> pmic_temp-isa-0000
> Adapter: ISA adapter
> temp1:        +42.5°C
> 
> axp20x_ac-isa-0000
> Adapter: ISA adapter
> in0:           0.00 V
> curr1:         0.00 A
> 
> axp20x_usb-isa-0000
> Adapter: ISA adapter
> in0:           4.93 V  (min =  +4.00 V)
> curr1:       330.00 mA (max =  +0.00 A)

Right.

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> 
> > > Signed-off-by: Jonathan McDowell <noodles@earth.li>
> > > ---
> > > 
> > >  arch/arm/boot/dts/axp209.dtsi | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > > 
> > > diff --git a/arch/arm/boot/dts/axp209.dtsi
> > > b/arch/arm/boot/dts/axp209.dtsi
> > > index ca240cd6f6c3..469d0f7d5185 100644
> > > --- a/arch/arm/boot/dts/axp209.dtsi
> > > +++ b/arch/arm/boot/dts/axp209.dtsi
> > > @@ -48,6 +48,13 @@
> > > 
> > >   * http://dl.linux-sunxi.org/AXP/AXP209%20Datasheet%20v1.0_cn.pdf
> > >   */
> > > 
> > > +/ {
> > > +	pmic-temp {
> > > +		compatible = "iio-hwmon";
> > > +		io-channels = <&axp_adc 4>; /* Internal temperature */
> > > +	};
> > > +};
> > > +
> > > 
> > >  &axp209 {
> > >  
> > >  	compatible = "x-powers,axp209";
> > >  	interrupt-controller;
> 
> J.
Jonathan McDowell June 1, 2023, 7:30 a.m. UTC | #6
On Mon, May 29, 2023 at 11:51:46AM +0200, Linus Walleij wrote:
> On Wed, May 10, 2023 at 2:01 PM Jonathan McDowell <noodles@earth.li> wrote:
> > The AXP209 device has a 4th GPIO which has a slightly different register
> > setup, where the control + status bits are held in a single register
> > rather than sharing AXP20X_GPIO20_SS with GPIOs 0-2.
> >
> > Signed-off-by: Jonathan McDowell <noodles@earth.li>
> 
> This patch 2/5 applied to the pinctrl tree.
> 
> I just assume it is fine to apply this one patch, Bartosz already
> applied the binding patch.
> 
> Tell me if this works.

Everything else seems to have been picked up, so that works for me.


J.