Skip to contentSkip to conversation

Add bluetooth, gps and accelerometer to TBS A711

PATCH Applied [email protected] 3 participants 13 messages Apr 1, 2019 – Apr 5, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Add bluetooth, gps and accelerometer to TBS A711

From: Ondrej Jirman <megous-5qf/[email protected]>

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(+)
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/5 ARM: dts: sun8i: tbs-a711: Add node for BMA250 accelerometer

From: Ondrej Jirman <[email protected]>

A711 tablet has BMA250 accelerometer connected to I2C1 bus. Enable both the I2C1 bus and add the accelerometer device to it.

---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts +13 -0
index 1e840ab5a541..d70fe04b66f0 100644
@@ -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 */
+	};
+};
+
 &mmc0 {
 	vmmc-supply = <&reg_dcdc1>;
 	pinctrl-names = "default";
Signature · 1 line
2.21.0
#2 lore raw

Re: [PATCH v2 1/5] ARM: dts: sun8i: tbs-a711: Add node for BMA250 accelerometer

Hi,

Quoted 20 lines · On Mon, Apr 01, 2019 at 01:56:12PM +0200…

From: Ondrej Jirman <megous-5qf/[email protected]>

A711 tablet has BMA250 accelerometer connected to I2C1 bus. Enable both the I2C1 bus and add the accelerometer device to it.

---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts +2 -0
index 1e840ab5a541..d70fe04b66f0 100644
@@ -156,6 +156,19 @@
 	status = "okay";
 };
 
+&i2c1 {
+	clock-frequency = <400000>;

arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts line 170

Quoted 10 lines
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts +10 -0
+	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

#3 lore raw

PATCH v2 2/5 ARM: dts: sun8i: a83t: Add UART2 PB pins

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

Add pin definitions for UART2 PB pins. These are used on TBS-A711 tablet.

---
 arch/arm/boot/dts/sun8i-a83t.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +6 -0
index fcb7ef5ce2df..0176049d9815 100644
@@ -768,6 +768,12 @@
 				pins = "PG8", "PG9";
 				function = "uart1";
 			};
+
+			/omit-if-no-ref/
+			uart2_pb_pins: uart2-pb-pins {
+				pins = "PB0", "PB1";
+				function = "uart2";
+			};
 		};
 
 		timer@1c20c00 {
Signature · 1 line
2.21.0
#5 lore raw

PATCH v2 3/5 gnss: Add u-blox,neo-6m compatible

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

Add compatible for u-blox NEO-6M GPS module.

---
 drivers/gnss/ubx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gnss/ubx.c +1 -0
index 12568aebb7f6..1ada2fad1d4e 100644
@@ -132,6 +132,7 @@ static void ubx_remove(struct serdev_device *serdev)
 static const struct of_device_id ubx_of_match[] = {
 	{ .compatible = "u-blox,neo-8" },
 	{ .compatible = "u-blox,neo-m8" },
+	{ .compatible = "u-blox,neo-6m" },
 	{},
 };
 MODULE_DEVICE_TABLE(of, ubx_of_match);
Signature · 1 line
2.21.0
#6 lore raw

PATCH v2 4/5 dt-bindings: gnss: Add u-blox,neo-6m compatible

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

Add compatible for u-blox NEO-6M GPS module.

---
 Documentation/devicetree/bindings/gnss/u-blox.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/gnss/u-blox.txt +1 -0
index e475659cb85f..7cdefd058fe0 100644
@@ -9,6 +9,7 @@ Required properties:
 
 - compatible	: Must be one of
 
+			"u-blox,neo-6m"
 			"u-blox,neo-8"
 			"u-blox,neo-m8"
 
Signature · 1 line
2.21.0
author Reviewed-by Rob Herring on v2 4/5
#7 lore raw

Re: [linux-sunxi] [PATCH v2 4/5] dt-bindings: gnss: Add u-blox,neo-6m compatible

Quoted 5 lines · megous via linux-sunxi

From: Ondrej Jirman <megous-5qf/[email protected]>

Add compatible for u-blox NEO-6M GPS module.

Ouch, I forgot to add:

I'll do v3 if necessary, for this.

regards,
Ondrej

Quoted 23 lines
---
 Documentation/devicetree/bindings/gnss/u-blox.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/gnss/u-blox.txt +1 -0
index e475659cb85f..7cdefd058fe0 100644
@@ -9,6 +9,7 @@ Required properties:
 
 - compatible	: Must be one of
 
+			"u-blox,neo-6m"
 			"u-blox,neo-8"
 			"u-blox,neo-m8"
 
Signature · 6 lines
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-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
maintainer
#8 lore raw

Re: [linux-sunxi] [PATCH v2 4/5] dt-bindings: gnss: Add u-blox,neo-6m compatible

Quoted 5 lines · Ondřej Jirman
Quoted 4 lines · megous via linux-sunxi

From: Ondrej Jirman <[email protected]>

Add compatible for u-blox NEO-6M GPS module.

Quoted 7 lines
Quoted 1 line

Ouch, I forgot to add:

I'll do v3 if necessary, for this.

Looks good to me too.

Now applied with Robs ack along with the ubx-driver patch.

Thanks,
Johan

#9 lore raw

PATCH v2 5/5 ARM: dts: sun8i: tbs-a711: Enable UART2 (for NEO-6M GPS module)

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

TBS A711 tablet contains u-blox NEO-6M module connected to UART2. Enable UART2 to gain access to the module from userspace.

---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts +21 -0
index d70fe04b66f0..fd170bc45927 100644
@@ -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";
Signature · 1 line
2.21.0
#10 lore raw

Re: [linux-sunxi] [PATCH v2 5/5] ARM: dts: sun8i: tbs-a711: Enable UART2 (for NEO-6M GPS module)

Hello Maxime,

Quoted 4 lines · megous via linux-sunxi

From: Ondrej Jirman <megous-5qf/[email protected]>

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

Quoted 51 lines
---
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts +21 -0
index d70fe04b66f0..fd170bc45927 100644
@@ -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";
Signature · 6 lines
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-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
#11 lore raw

Re: [linux-sunxi] [PATCH v2 5/5] ARM: dts: sun8i: tbs-a711: Enable UART2 (for NEO-6M GPS module)

Quoted 10 lines · Ondřej Jirman

Hello Maxime,

Quoted 4 lines · megous via linux-sunxi

From: Ondrej Jirman <megous-5qf/[email protected]>

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

Signature · 3 lines
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-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
maintainer
#12 lore raw
In reply to [email protected]
Quoted 12 lines · On Mon, Apr 01, 2019 at 01:56:11PM +0200, [email protected] wrote:

From: Ondrej Jirman <[email protected]>

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.

Quoted 8 lines

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