mbox series

[v2,0/5] Add bluetooth, gps and accelerometer to TBS A711

Message ID 20190401115616.21337-1-megous@megous.com
Headers show
Series Add bluetooth, gps and accelerometer to TBS A711 | expand

Message

Ondřej Jirman April 1, 2019, 11:56 a.m. UTC
From: Ondrej Jirman <megous@megous.com>

This series enables some peripherals on TBS A711 tablet that already
have mainline drivers:

- GPS u-blox neo-6m (via gnss u-blox driver)
- Bluetooth (via recently added OF support in the Broadcom
  bluetooth driver)
- Accelermomter BMA-250 (hooked to the I2C bus)

It also modifies A83T DTSI and adds missing UART interfaces.

I've added additional compatible to the gnss/u-blox driver for NEO-6M,
because this board uses this module, and I don't think I can use
the existing compatible for u-blox,neo-m8, even as a fallback.

Please take a look, and apply the patches if you have no objections.

Many of the patches will go through the sunxi tree, but I'm not
sure who will want to take the GPS patches.

regards,
  Ondrej Jirman


Changes in v2:
- dropped already applied patches from the series (bluetooth,
  a83t uarts)
- added /omit-if-no-ref/ to "uart2-pb-pins"
- renamed node "bma250" to "accelerometer"
- removed pinctrl properties that are already in base dtsi
  (i2c1_pins)

Ondrej Jirman (5):
  ARM: dts: sun8i: tbs-a711: Add node for BMA250 accelerometer
  ARM: dts: sun8i: a83t: Add UART2 PB pins
  gnss: Add u-blox,neo-6m compatible
  dt-bindings: gnss: Add u-blox,neo-6m compatible
  ARM: dts: sun8i: tbs-a711: Enable UART2 (for NEO-6M GPS module)

 .../devicetree/bindings/gnss/u-blox.txt       |  1 +
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts     | 34 +++++++++++++++++++
 arch/arm/boot/dts/sun8i-a83t.dtsi             |  6 ++++
 drivers/gnss/ubx.c                            |  1 +
 4 files changed, 42 insertions(+)

Comments

Maxime Ripard April 1, 2019, 12:53 p.m. UTC | #1
On Mon, Apr 01, 2019 at 01:56:13PM +0200, megous@megous.com wrote:
> From: Ondrej Jirman <megous@megous.com>
>
> Add pin definitions for UART2 PB pins. These are used on TBS-A711
> tablet.
>
> Signed-off-by: Ondrej Jirman <megous@megous.com>

Applied, thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Maxime Ripard April 1, 2019, 12:54 p.m. UTC | #2
Hi,

On Mon, Apr 01, 2019 at 01:56:12PM +0200, megous@megous.com wrote:
> From: Ondrej Jirman <megous@megous.com>
>
> A711 tablet has BMA250 accelerometer connected to I2C1 bus. Enable
> both the I2C1 bus and add the accelerometer device to it.
>
> Signed-off-by: Ondrej Jirman <megous@megous.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> index 1e840ab5a541..d70fe04b66f0 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> @@ -156,6 +156,19 @@
>  	status = "okay";
>  };
>
> +&i2c1 {
> +	clock-frequency = <400000>;
> +	status = "okay";
> +
> +	/* Accelerometer */
> +	accelerometer@18 {
> +		compatible = "bosch,bma250";
> +		reg = <0x18>;
> +		interrupt-parent = <&pio>;
> +		interrupts = <7 10 IRQ_TYPE_EDGE_RISING>; /* PH10 / EINT10 */
> +	};
> +};

I've dropped the comment, since it's pretty obvious now, and applied, thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Johan Hovold April 2, 2019, 8:28 a.m. UTC | #3
On Mon, Apr 01, 2019 at 01:56:11PM +0200, megous@megous.com wrote:
> From: Ondrej Jirman <megous@megous.com>
> 
> This series enables some peripherals on TBS A711 tablet that already
> have mainline drivers:
> 
> - GPS u-blox neo-6m (via gnss u-blox driver)
> - Bluetooth (via recently added OF support in the Broadcom
>   bluetooth driver)
> - Accelermomter BMA-250 (hooked to the I2C bus)
> 
> It also modifies A83T DTSI and adds missing UART interfaces.
> 
> I've added additional compatible to the gnss/u-blox driver for NEO-6M,
> because this board uses this module, and I don't think I can use
> the existing compatible for u-blox,neo-m8, even as a fallback.
> 
> Please take a look, and apply the patches if you have no objections.
> 
> Many of the patches will go through the sunxi tree, but I'm not
> sure who will want to take the GPS patches.

I'll take the GPS patches through my tree once I've had a chance to
review them. Perhaps easiest to resend the corresponding dts change once
that is done.

Johan
Ondřej Jirman April 4, 2019, 12:43 p.m. UTC | #4
Hello Maxime,

On Mon, Apr 01, 2019 at 01:56:16PM +0200, megous via linux-sunxi wrote:
> From: Ondrej Jirman <megous@megous.com>
> 
> TBS A711 tablet contains u-blox NEO-6M module connected to UART2.
> Enable UART2 to gain access to the module from userspace.

Other GPS bits are now applied (thank you, Johan), so if this last bit
can go in too via a sunxi tree, the series will be complete.

thank you,
  Ondrej

> Signed-off-by: Ondrej Jirman <megous@megous.com>
> ---
>  arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> index d70fe04b66f0..fd170bc45927 100644
> --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
> @@ -98,6 +98,13 @@
>  		};
>  	};
>  
> +	reg_gps: reg-gps {
> +		compatible = "regulator-fixed";
> +		regulator-name = "gps";
> +		regulator-min-microvolt = <3000000>;
> +		regulator-max-microvolt = <3000000>;
> +	};
> +
>  	reg_vbat: reg-vbat {
>  		compatible = "regulator-fixed";
>  		regulator-name = "vbat";
> @@ -422,6 +429,20 @@
>  	status = "okay";
>  };
>  
> +&uart2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart2_pb_pins>;
> +	status = "okay";
> +
> +	gnss {
> +		compatible = "u-blox,neo-6m";
> +
> +		v-bckp-supply = <&reg_rtc_ldo>;
> +		vcc-supply = <&reg_gps>;
> +		current-speed = <9600>;
> +	};
> +};
> +
>  &usb_otg {
>  	dr_mode = "otg";
>  	status = "okay";
> -- 
> 2.21.0
> 
> -- 
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Maxime Ripard April 5, 2019, 3:07 p.m. UTC | #5
On Thu, Apr 04, 2019 at 02:43:22PM +0200, Ondřej Jirman wrote:
> Hello Maxime,
>
> On Mon, Apr 01, 2019 at 01:56:16PM +0200, megous via linux-sunxi wrote:
> > From: Ondrej Jirman <megous@megous.com>
> >
> > TBS A711 tablet contains u-blox NEO-6M module connected to UART2.
> > Enable UART2 to gain access to the module from userspace.
>
> Other GPS bits are now applied (thank you, Johan), so if this last bit
> can go in too via a sunxi tree, the series will be complete.

Applied, thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com