Skip to contentSkip to conversation

Nokia H4+ support

PATCH In review Sebastian Reichel 2 participants 5 messages Apr 13, 2017

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

v4 cover Nokia H4+ support

Hi,

Here is the fourth revision of the nokia bluetooth patchset. Compared to the previous one the following things have changed:

* Drop patch 1-8 (applied by Marcel) and update Cc/To for patchset
* Order includes in the driver alphabetically
* Explicitly include <linux/of.h> in the nokia bluetooth driver

-- Sebastian

Sebastian Reichel (2):
dt-bindings: net: bluetooth: Add nokia-bluetooth
Bluetooth: add nokia driver

 .../devicetree/bindings/net/nokia-bluetooth.txt    |  51 ++
 drivers/bluetooth/Kconfig                          |  12 +
 drivers/bluetooth/Makefile                         |   2 +
 drivers/bluetooth/hci_nokia.c                      | 820 +++++++++++++++++++++
 4 files changed, 885 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/nokia-bluetooth.txt
 create mode 100644 drivers/bluetooth/hci_nokia.c
Signature · 1 line
2.11.0
#1 lore raw

PATCH v4 1/2 dt-bindings: net: bluetooth: Add nokia-bluetooth

Add binding document for serial bluetooth chips using Nokia H4+ protocol.

---
Changes since PATCHv1:
* change compatible strings
* mention active high/low state for GPIOs

---
 .../devicetree/bindings/net/nokia-bluetooth.txt    | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/nokia-bluetooth.txt
Documentation/devicetree/bindings/net/nokia-bluetooth.txt new file +51 -0
new file mode 100644
index 000000000000..42be7dc9a70b
@@ -0,0 +1,51 @@
+Nokia Bluetooth Chips
+---------------------
+
+Nokia phones often come with UART connected bluetooth chips from different
+vendors and modified device API. Those devices speak a protocol named H4+
+(also known as h4p) by Nokia, which is similar to the H4 protocol from the
+Bluetooth standard. In addition to the H4 protocol it specifies two more
+UART status lines for wakeup of UART transceivers to improve power management
+and a few new packet types used to negotiate uart speed.
+
+Required properties:
+
+ - compatible: should contain "nokia,h4p-bluetooth" as well as one of the following:
+   * "brcm,bcm2048-nokia"
+   * "ti,wl1271-bluetooth-nokia"
+ - reset-gpios: GPIO specifier, used to reset the BT module (active low)
+ - bluetooth-wakeup-gpios: GPIO specifier, used to wakeup the BT module (active high)
+ - host-wakeup-gpios: GPIO specifier, used to wakeup the host processor (active high)
+ - clock-names: should be "sysclk"
+ - clocks: should contain a clock specifier for every name in clock-names
+
+Optional properties:
+
+ - None
+
+Example:
+
+/ {
+       /* controlled (enabled/disabled) directly by BT module */
+       bluetooth_clk: vctcxo {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <38400000>;
+       };
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins>;
+
+       bluetooth {
+               compatible = "ti,wl1271-bluetooth-nokia", "nokia,h4p-bluetooth";
+
+               reset-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>; /* gpio26 */
+               host-wakeup-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* gpio101 */
+               bluetooth-wakeup-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; /* gpio37 */
+
+               clocks = <&bluetooth_clk>;
+               clock-names = "sysclk";
+       };
+};
Signature · 1 line
2.11.0
#2 lore raw

PATCH v4 2/2 Bluetooth: add nokia driver

In reply to Sebastian Reichel

This adds a driver for the Nokia H4+ protocol, which is used at least on the Nokia N9, N900 & N950.

---
Changes since PATCHv1:
* replace __u8 and uint8_t with u8
* replace __u16 and uint16_t with u16
* drop BT_BAUDRATE_DIVIDER and use btdev->sysclk_speed * 10 instead
* fix wording of a sentence
* fix error path of negotation & alive package receive functions
* replaced nokia_wait_for_cts with newly introduced serdev function
* use "nokia,h4p-bluetooth" as compatible string

Changes since PATCHv3:
* order includes alphabetically
* explicitly include <linux/of.h>

---
 drivers/bluetooth/Kconfig     |  12 +
 drivers/bluetooth/Makefile    |   2 +
 drivers/bluetooth/hci_nokia.c | 820 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 834 insertions(+)
 create mode 100644 drivers/bluetooth/hci_nokia.c
drivers/bluetooth/Kconfig +12 -0
index c2c14a12713b..2e3e4d3547ad 100644
@@ -86,6 +86,18 @@ config BT_HCIUART_H4
 
 	  Say Y here to compile support for HCI UART (H4) protocol.
 
+config BT_HCIUART_NOKIA
+	tristate "UART Nokia H4+ protocol support"
+	depends on BT_HCIUART
+	depends on SERIAL_DEV_BUS
+	depends on PM
+	help
+	  Nokia H4+ is serial protocol for communication between Bluetooth
+	  device and host. This protocol is required for Bluetooth devices
+	  with UART interface in Nokia devices.
+
+	  Say Y here to compile support for Nokia's H4+ protocol.
+
 config BT_HCIUART_BCSP
 	bool "BCSP protocol support"
 	depends on BT_HCIUART
drivers/bluetooth/Makefile +2 -0
index fd571689eed6..a7f237320f4b 100644
@@ -25,6 +25,8 @@ obj-$(CONFIG_BT_BCM)		+= btbcm.o
 obj-$(CONFIG_BT_RTL)		+= btrtl.o
 obj-$(CONFIG_BT_QCA)		+= btqca.o
 
+obj-$(CONFIG_BT_HCIUART_NOKIA)	+= hci_nokia.o
+
 btmrvl-y			:= btmrvl_main.o
 btmrvl-$(CONFIG_DEBUG_FS)	+= btmrvl_debugfs.o
 
drivers/bluetooth/hci_nokia.c new file +820 -0

820 lines not on this page · raw message

Signature · 1 line
2.11.0
maintainer
#3 lore raw
In reply to Sebastian Reichel

Hi Sebastian,

Quoted 7 lines

Here is the fourth revision of the nokia bluetooth patchset. Compared to the previous one the following things have changed:

* Drop patch 1-8 (applied by Marcel) and update Cc/To for patchset
* Order includes in the driver alphabetically
* Explicitly include <linux/of.h> in the nokia bluetooth driver

Quoted 5 lines

-- Sebastian

Sebastian Reichel (2):
dt-bindings: net: bluetooth: Add nokia-bluetooth
Bluetooth: add nokia driver

both patches have been applied to bluetooth-next tree.

Regards

Marcel

#4 lore raw

Hi Marcel,

Quoted 7 lines · Marcel Holtmann
Quoted 7 lines

Here is the fourth revision of the nokia bluetooth patchset. Compared to the previous one the following things have changed:

* Drop patch 1-8 (applied by Marcel) and update Cc/To for patchset
* Order includes in the driver alphabetically
* Explicitly include <linux/of.h> in the nokia bluetooth driver

Quoted 7 lines
Quoted 5 lines

-- Sebastian

Sebastian Reichel (2):
dt-bindings: net: bluetooth: Add nokia-bluetooth
Bluetooth: add nokia driver

both patches have been applied to bluetooth-next tree.

Thanks.

-- Sebastian