Nokia H4+ support
Subsystems (5)
v3 cover Nokia H4+ support
Hi,
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
The patchset is based upon 4.11-rc1 and is also available from the following branch:
https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-n900.git/log/?h=nokia-bt-serdev-v3
-- Sebastian
Rob Herring (1):
Bluetooth: hci_uart: add serdev driver support library
Sebastian Reichel (9):
tty: serial: omap: add UPF_BOOT_AUTOCONF flag for DT init
serdev: add serdev_device_wait_until_sent
serdev: implement get/set tiocm
serdev: add helpers for cts and rts handling
Bluetooth: hci_uart: add support for word alignment
Bluetooth: hci_serdev: do not open device in hci open
Bluetooth: hci_serdev: allow modular drivers
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 | 3 + drivers/bluetooth/hci_h4.c | 17 + drivers/bluetooth/hci_ldisc.c | 5 + drivers/bluetooth/hci_nokia.c | 819 +++++++++++++++++++++ drivers/bluetooth/hci_serdev.c | 356 +++++++++ drivers/bluetooth/hci_uart.h | 7 + drivers/tty/serdev/core.c | 33 + drivers/tty/serdev/serdev-ttyport.c | 42 +- drivers/tty/serial/omap-serial.c | 3 + include/linux/serdev.h | 47 ++ 12 files changed, 1391 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/nokia-bluetooth.txt create mode 100644 drivers/bluetooth/hci_nokia.c create mode 100644 drivers/bluetooth/hci_serdev.c
Signature · 1 line
2.11.0
PATCH v3 1/10 tty: serial: omap: add UPF_BOOT_AUTOCONF flag for DT init
The UPF_BOOT_AUTOCONF flag is needed for proper
flow control support.
---
Hi,
This patch can be queued independently - there is no compile time dependency regarding nokia-bluetooth. Also 8250_omap.c can be used with nokia-bluetooth (I use this driver nowadays), which does flow control right already.
-- Sebastian
--- drivers/tty/serial/omap-serial.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/omap-serial.c +3 -0
@@ -1597,6 +1597,9 @@ static struct omap_uart_port_info *of_get_uart_port_info(struct device *dev)of_property_read_u32 (dev->of_node,"clock-frequency" , &omap_up_info->uartclk); + + omap_up_info->flags =UPF_BOOT_AUTOCONF ; +return omap_up_info; }
Signature · 1 line
2.11.0
PATCH v3 2/10 serdev: add serdev_device_wait_until_sent
In reply to Sebastian ReichelAdd method, which waits until the transmission buffer has been sent. Note, that the change in ttyport_write_wakeup is related, since tty_wait_until_sent will hang without that change.
---
Changes since PATCHv2:
* Avoid goto in ttyport_write_wakeup
--- drivers/tty/serdev/core.c | 11 +++++++++++ drivers/tty/serdev/serdev-ttyport.c | 18 ++++++++++++++---- include/linux/serdev.h | 3 +++ 3 files changed, 28 insertions(+), 4 deletions(-)
drivers/tty/serdev/core.c +11 -0
@@ -173,6 +173,17 @@ void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) }EXPORT_SYMBOL_GPL (serdev_device_set_flow_control); +void serdev_device_wait_until_sent (struct serdev_device *serdev,long timeout) +{ +struct serdev_controller *ctrl = serdev->ctrl; + +if (!ctrl || !ctrl->ops->wait_until_sent) +return ; + + ctrl->ops->wait_until_sent (ctrl, timeout); +} +EXPORT_SYMBOL_GPL (serdev_device_wait_until_sent); +static int serdev_drv_probe (struct device *dev) {const struct serdev_device_driver *sdrv =to_serdev_device_driver (dev->driver);
drivers/tty/serdev/serdev-ttyport.c +14 -4
@@ -14,6 +14,7 @@#include <linux/serdev.h> #include <linux/tty.h> #include <linux/tty_driver.h> +#include <linux/poll.h> #define SERPORT_ACTIVE 1
@@ -46,11 +47,11 @@ static void ttyport_write_wakeup(struct tty_port *port)struct serdev_controller *ctrl = port->client_data;struct serport *serport =serdev_controller_get_drvdata (ctrl); -if (!test_and_clear_bit (TTY_DO_WRITE_WAKEUP , &port->tty->flags)) -return ; - -if (test_bit (SERPORT_ACTIVE , &serport->flags)) +if (test_and_clear_bit (TTY_DO_WRITE_WAKEUP , &port->tty->flags) && +test_bit (SERPORT_ACTIVE , &serport->flags))serdev_controller_write_wakeup (ctrl); + +wake_up_interruptible_poll (&port->tty->write_wait,POLLOUT ); }static const struct tty_port_client_operations client_ops = {
@@ -167,6 +168,14 @@ static void ttyport_set_flow_control(struct serdev_controller *ctrl, bool enabletty_set_termios (tty, &ktermios); } +static void ttyport_wait_until_sent (struct serdev_controller *ctrl,long timeout) +{ +struct serport *serport =serdev_controller_get_drvdata (ctrl); +struct tty_struct *tty = serport->tty; + +tty_wait_until_sent (tty, timeout); +} +static const struct serdev_controller_ops ctrl_ops = { .write_buf = ttyport_write_buf, .write_flush = ttyport_write_flush,
@@ -175,6 +184,7 @@ static const struct serdev_controller_ops ctrl_ops = { .close = ttyport_close, .set_flow_control = ttyport_set_flow_control, .set_baudrate = ttyport_set_baudrate, + .wait_until_sent = ttyport_wait_until_sent, }; struct device *serdev_tty_port_register(struct tty_port *port,
include/linux/serdev.h +3 -0
@@ -81,6 +81,7 @@ struct serdev_controller_ops {void (*close)(struct serdev_controller *);void (*set_flow_control)(struct serdev_controller *,bool );unsigned int (*set_baudrate)(struct serdev_controller *,unsigned int ); +void (*wait_until_sent)(struct serdev_controller *,long ); };/**
@@ -186,6 +187,7 @@ int serdev_device_open(struct serdev_device *);void serdev_device_close (struct serdev_device *);unsigned int serdev_device_set_baudrate (struct serdev_device *,unsigned int );void serdev_device_set_flow_control (struct serdev_device *,bool ); +void serdev_device_wait_until_sent (struct serdev_device *,long );int serdev_device_write_buf (struct serdev_device *,const unsigned char *,size_t );void serdev_device_write_flush (struct serdev_device *);int serdev_device_write_room (struct serdev_device *);
@@ -223,6 +225,7 @@ static inline unsigned int serdev_device_set_baudrate(struct serdev_device *sdevreturn 0 ; }static inline void serdev_device_set_flow_control (struct serdev_device *sdev,bool enable) {} +static inline void serdev_device_wait_until_sent (struct serdev_device *sdev,long timeout) {}static inline int serdev_device_write_buf (struct serdev_device *sdev,const unsigned char *buf,size_t count) {return -ENODEV ;
Signature · 1 line
2.11.0
PATCH v3 3/10 serdev: implement get/set tiocm
In reply to Sebastian ReichelAdd method for getting and setting tiocm.
--- drivers/tty/serdev/core.c | 22 ++++++++++++++++++++++ drivers/tty/serdev/serdev-ttyport.c | 24 ++++++++++++++++++++++++ include/linux/serdev.h | 13 +++++++++++++ 3 files changed, 59 insertions(+)
drivers/tty/serdev/core.c +22 -0
@@ -184,6 +184,28 @@ void serdev_device_wait_until_sent(struct serdev_device *serdev, long timeout) }EXPORT_SYMBOL_GPL (serdev_device_wait_until_sent); +int serdev_device_get_tiocm (struct serdev_device *serdev) +{ +struct serdev_controller *ctrl = serdev->ctrl; + +if (!ctrl || !ctrl->ops->get_tiocm) +return -ENOTSUPP ; + +return ctrl->ops->get_tiocm (ctrl); +} +EXPORT_SYMBOL_GPL (serdev_device_get_tiocm); + +int serdev_device_set_tiocm (struct serdev_device *serdev,int set,int clear) +{ +struct serdev_controller *ctrl = serdev->ctrl; + +if (!ctrl || !ctrl->ops->set_tiocm) +return -ENOTSUPP ; + +return ctrl->ops->set_tiocm (ctrl, set, clear); +} +EXPORT_SYMBOL_GPL (serdev_device_set_tiocm); +static int serdev_drv_probe (struct device *dev) {const struct serdev_device_driver *sdrv =to_serdev_device_driver (dev->driver);
drivers/tty/serdev/serdev-ttyport.c +24 -0
@@ -176,6 +176,28 @@ static void ttyport_wait_until_sent(struct serdev_controller *ctrl, long timeouttty_wait_until_sent (tty, timeout); } +static int ttyport_get_tiocm (struct serdev_controller *ctrl) +{ +struct serport *serport =serdev_controller_get_drvdata (ctrl); +struct tty_struct *tty = serport->tty; + +if (!tty->ops->tiocmget) +return -ENOTSUPP ; + +return tty->driver->ops->tiocmget (tty); +} + +static int ttyport_set_tiocm (struct serdev_controller *ctrl,unsigned int set,unsigned int clear) +{ +struct serport *serport =serdev_controller_get_drvdata (ctrl); +struct tty_struct *tty = serport->tty; + +if (!tty->ops->tiocmset) +return -ENOTSUPP ; + +return tty->driver->ops->tiocmset (tty, set, clear); +} +static const struct serdev_controller_ops ctrl_ops = { .write_buf = ttyport_write_buf, .write_flush = ttyport_write_flush,
@@ -185,6 +207,8 @@ static const struct serdev_controller_ops ctrl_ops = { .set_flow_control = ttyport_set_flow_control, .set_baudrate = ttyport_set_baudrate, .wait_until_sent = ttyport_wait_until_sent, + .get_tiocm = ttyport_get_tiocm, + .set_tiocm = ttyport_set_tiocm, }; struct device *serdev_tty_port_register(struct tty_port *port,
include/linux/serdev.h +13 -0
@@ -15,6 +15,7 @@#include <linux/types.h> #include <linux/device.h> +#include <linux/termios.h> struct serdev_controller ;struct serdev_device ;
@@ -82,6 +83,8 @@ struct serdev_controller_ops {void (*set_flow_control)(struct serdev_controller *,bool );unsigned int (*set_baudrate)(struct serdev_controller *,unsigned int );void (*wait_until_sent)(struct serdev_controller *,long ); +int (*get_tiocm)(struct serdev_controller *); +int (*set_tiocm)(struct serdev_controller *,unsigned int ,unsigned int ); };/**
@@ -188,6 +191,8 @@ void serdev_device_close(struct serdev_device *);unsigned int serdev_device_set_baudrate (struct serdev_device *,unsigned int );void serdev_device_set_flow_control (struct serdev_device *,bool );void serdev_device_wait_until_sent (struct serdev_device *,long ); +int serdev_device_get_tiocm (struct serdev_device *); +int serdev_device_set_tiocm (struct serdev_device *,int ,int );int serdev_device_write_buf (struct serdev_device *,const unsigned char *,size_t );void serdev_device_write_flush (struct serdev_device *);int serdev_device_write_room (struct serdev_device *);
@@ -226,6 +231,14 @@ static inline unsigned int serdev_device_set_baudrate(struct serdev_device *sdev }static inline void serdev_device_set_flow_control (struct serdev_device *sdev,bool enable) {}static inline void serdev_device_wait_until_sent (struct serdev_device *sdev,long timeout) {} +static inline int serdev_device_get_tiocm (struct serdev_device *serdev) +{ +return -ENOTSUPP ; +} +static inline int serdev_device_set_tiocm (struct serdev_device *serdev,int set,int clear) +{ +return -ENOTSUPP ; +}static inline int serdev_device_write_buf (struct serdev_device *sdev,const unsigned char *buf,size_t count) {return -ENODEV ;
Signature · 1 line
2.11.0
PATCH v3 4/10 serdev: add helpers for cts and rts handling
In reply to Sebastian ReichelAdd serdev helper functions for handling of cts and rts lines using the serdev's tiocm functions.
---
Changes since PATCHv2:
* use time_is_after_jiffies(xyz) instead of !time_after(jiffies, xyz)
* drop OUT2 handling in rts function
--- include/linux/serdev.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
include/linux/serdev.h +31 -0
@@ -16,6 +16,7 @@#include <linux/types.h> #include <linux/device.h> #include <linux/termios.h> +#include <linux/delay.h> struct serdev_controller ;struct serdev_device ;
@@ -254,6 +255,36 @@ static inline int serdev_device_write_room(struct serdev_device *sdev)#endif /* CONFIG_SERIAL_DEV_BUS */ +static inline bool serdev_device_get_cts (struct serdev_device *serdev) +{ +int status =serdev_device_get_tiocm (serdev); +return !!(status &TIOCM_CTS ); +} + +static inline int serdev_device_wait_for_cts (struct serdev_device *serdev,bool state,int timeout_ms) +{ +unsigned long timeout; +bool signal; + + timeout = jiffies +msecs_to_jiffies (timeout_ms); +while (time_is_after_jiffies (timeout)) { + signal =serdev_device_get_cts (serdev); +if (signal == state) +return 0 ; +usleep_range (1000 ,2000 ); + } + +return -ETIMEDOUT ; +} + +static inline int serdev_device_set_rts (struct serdev_device *serdev,bool enable) +{ +if (enable) +return serdev_device_set_tiocm (serdev,TIOCM_RTS ,0 ); +else +return serdev_device_set_tiocm (serdev,0 ,TIOCM_RTS ); +} +/* * serdev hooks into TTY core */
Signature · 1 line
2.11.0
PATCH v3 5/10 Bluetooth: hci_uart: add support for word alignment
In reply to Sebastian ReichelThis will be used by Nokia's H4+ protocol, which
uses 2-byte aligned packets.
---
Changes since PATCHv1:
* use u8 instead of uint8_t
--- drivers/bluetooth/hci_h4.c | 17 +++++++++++++++++ drivers/bluetooth/hci_ldisc.c | 4 ++++ drivers/bluetooth/hci_uart.h | 3 +++ 3 files changed, 24 insertions(+)
drivers/bluetooth/hci_h4.c +17 -0
@@ -171,9 +171,20 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, const unsigned char *buffer, int count, const struct h4_recv_pkt *pkts, int pkts_count) { + struct hci_uart *hu = hci_get_drvdata(hdev); +u8 alignment = hu->alignment; +while (count) {int i, len; +/* remove padding bytes from buffer */ +for (; hu->padding && count >0 ; hu->padding--) { + count--; + buffer++; + } +if (!count) +break ; +if (!skb) {for (i =0 ; i < pkts_count; i++) {if (buffer[0 ] != (&pkts[i])->type)
@@ -253,11 +264,17 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb, }if (!dlen) { + hu->padding = (skb->len -1 ) % alignment; + hu->padding = (alignment - hu->padding) % alignment; +/* No more data, complete frame */ (&pkts[i])->recv (hdev, skb); skb =NULL ; } }else { + hu->padding = (skb->len -1 ) % alignment; + hu->padding = (alignment - hu->padding) % alignment; +/* Complete frame */ (&pkts[i])->recv (hdev, skb); skb =NULL ;
drivers/bluetooth/hci_ldisc.c +4 -0
@@ -459,6 +459,10 @@ static int hci_uart_tty_open(struct tty_struct *tty) hu->tty = tty; tty->receive_room =65536 ; +/* disable alignment support by default */ + hu->alignment =1 ; + hu->padding =0 ; +INIT_WORK (&hu->init_ready, hci_uart_init_work);INIT_WORK (&hu->write_work, hci_uart_write_work);
drivers/bluetooth/hci_uart.h +3 -0
@@ -92,6 +92,9 @@ struct hci_uart {unsigned int init_speed;unsigned int oper_speed; + +u8 alignment; +u8 padding; };/* HCI_UART proto flag bits */
Signature · 1 line
2.11.0
PATCH v3 6/10 Bluetooth: hci_uart: add serdev driver support library
In reply to Sebastian ReichelFrom: Rob Herring <[email protected]>
This adds library functions for serdev based BT drivers. This is largely copied from hci_ldisc.c and modified to use serdev calls. There's a little bit of duplication, but I avoided intermixing this as the ldisc code should eventually go away.
---
Changes since PATCHv1:
* Drop FSF address from license section
* Add error message if hu->proto->set_baudrate fails
* Remove useless label/goto in hci_uart_setup
* Use proper kerneldoc for hci_uart_write_wakeup
* Use proper kerneldoc for hci_uart_receive_buf
* Wrap hci_uart_register_device define to get < 80 chars
* Use do..while instead of goto restart in hci_uart_write_work
* The file checkpatch clean now
--- drivers/bluetooth/Makefile | 1 + drivers/bluetooth/hci_serdev.c | 361 +++++++++++++++++++++++++++++++++++++++++ drivers/bluetooth/hci_uart.h | 4 + 3 files changed, 366 insertions(+) create mode 100644 drivers/bluetooth/hci_serdev.c
drivers/bluetooth/Makefile +1 -0
@@ -29,6 +29,7 @@ btmrvl-y := btmrvl_main.o btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o hci_uart-y := hci_ldisc.o +hci_uart-$(CONFIG_SERIAL_DEV_BUS) += hci_serdev.o hci_uart-$(CONFIG_BT_HCIUART_H4) += hci_h4.o hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o hci_uart-$(CONFIG_BT_HCIUART_LL) += hci_ll.o
drivers/bluetooth/hci_serdev.c new file +361 -0
361 lines not on this page · raw message
drivers/bluetooth/hci_uart.h +4 -0
@@ -58,6 +58,7 @@#define HCI_UART_VND_DETECT 5struct hci_uart ; +struct serdev_device ;struct hci_uart_proto {unsigned int id;
@@ -77,6 +78,7 @@ struct hci_uart_proto {struct hci_uart {struct tty_struct *tty; +struct serdev_device *serdev;struct hci_dev *hdev;unsigned long flags;unsigned long hdev_flags;
@@ -108,6 +110,8 @@ struct hci_uart {int hci_uart_register_proto (const struct hci_uart_proto *p);int hci_uart_unregister_proto (const struct hci_uart_proto *p); +int hci_uart_register_device (struct hci_uart *hu,const struct hci_uart_proto *p); +int hci_uart_tx_wakeup (struct hci_uart *hu);int hci_uart_init_ready (struct hci_uart *hu);void hci_uart_init_tty (struct hci_uart *hu);
Signature · 1 line
2.11.0
PATCH v3 7/10 Bluetooth: hci_serdev: do not open device in hci open
In reply to Sebastian ReichelThe device driver may need to communicate with the UART device while the Bluetooth device is closed (e.g. due to interrupts).
--- drivers/bluetooth/hci_serdev.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/bluetooth/hci_serdev.c +3 -9
@@ -104,13 +104,9 @@ static void hci_uart_write_work(struct work_struct *work)/* Initialize device */ static int hci_uart_open (struct hci_dev *hdev) { -struct hci_uart *hu =hci_get_drvdata (hdev); -BT_DBG ("%s %p" , hdev->name, hdev); -serdev_device_set_client_ops (hu->serdev, &hci_serdev_client_ops); - -return serdev_device_open (hu->serdev); +return 0 ; }/* Reset device */
@@ -136,15 +132,11 @@ static int hci_uart_flush(struct hci_dev *hdev)/* Close device */ static int hci_uart_close (struct hci_dev *hdev) { -struct hci_uart *hu =hci_get_drvdata (hdev); -BT_DBG ("hdev %p" , hdev);hci_uart_flush (hdev); hdev->flush =NULL ; -serdev_device_close (hu->serdev); -return 0 ; }
@@ -289,6 +281,8 @@ int hci_uart_register_device(struct hci_uart *hu,BT_DBG ("" ); +serdev_device_set_client_ops (hu->serdev, &hci_serdev_client_ops); + err = p->open (hu);if (err)return err;
Signature · 1 line
2.11.0
PATCH v3 8/10 Bluetooth: hci_serdev: allow modular drivers
In reply to Sebastian ReichelFor bluetooth protocol driver only supporting serdev it makes sense to follow common practice and built them into their own module.
Such modules need access to hci_uart_register_device and hci_uart_tx_wakeup for using the common protocol helpers.
---
New patch since patchset v2.
--- drivers/bluetooth/hci_ldisc.c | 1 + drivers/bluetooth/hci_serdev.c | 1 + 2 files changed, 2 insertions(+)
drivers/bluetooth/hci_ldisc.c +1 -0
@@ -134,6 +134,7 @@ int hci_uart_tx_wakeup(struct hci_uart *hu)return 0 ; } +EXPORT_SYMBOL_GPL (hci_uart_tx_wakeup);static void hci_uart_write_work (struct work_struct *work) {
drivers/bluetooth/hci_serdev.c +1 -0
@@ -353,3 +353,4 @@ int hci_uart_register_device(struct hci_uart *hu, p->close (hu);return err; } +EXPORT_SYMBOL_GPL (hci_uart_register_device);
Signature · 1 line
2.11.0
PATCH v3 9/10 dt-bindings: net: bluetooth: Add nokia-bluetooth
In reply to Sebastian ReichelAdd 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
@@ -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
PATCH v3 10/10 Bluetooth: add nokia driver
In reply to Sebastian ReichelThis 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
--- drivers/bluetooth/Kconfig | 12 + drivers/bluetooth/Makefile | 2 + drivers/bluetooth/hci_nokia.c | 819 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 833 insertions(+) create mode 100644 drivers/bluetooth/hci_nokia.c
drivers/bluetooth/Kconfig +12 -0
@@ -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
@@ -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 +819 -0
819 lines not on this page · raw message
Signature · 1 line
2.11.0
Quoted 8 lines · Sebastian Reichel
Hi,
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
Rob
Marcel Holtmann
maintainerHi Rob,
Quoted 9 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
Regards
Marcel
Greg Kroah-Hartman
maintainerQuoted 9 lines · Marcel Holtmann
Hi Rob,
Quoted 7 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Quoted 6 lines
Quoted 2 lines
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
I don't really care where it goes. I can take the whole thing in my tty/serial tree now if no one objects and I get an ack from the relevant maintainers {hint...}
thanks,
greg k-h
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Marcel Holtmann
Hi Rob,
Quoted 9 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
Quoted 7 lines
Quoted 3 lines
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
I don't really care where it goes. I can take the whole thing in my tty/serial tree now if no one objects and I get an ack from the relevant maintainers {hint...}
I think it is better if it goes thru BT tree. I have another driver converted that is dependent on this series. There's a couple other serdev changes on the list too, but this shouldn't depend on them.
Rob
Quoted 19 lines · Rob Herring
Quoted 17 lines · Greg Kroah-Hartman
Quoted 15 lines · Marcel Holtmann
Hi Rob,
Quoted 9 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
Quoted 7 lines
Quoted 3 lines
I don't really care where it goes. I can take the whole thing in my tty/serial tree now if no one objects and I get an ack from the relevant maintainers {hint...}
I think it is better if it goes thru BT tree. I have another driver converted that is dependent on this series. There's a couple other serdev changes on the list too, but this shouldn't depend on them.
I believe BT tree makes sense. Still it would be nice to get Greg's ACK ...?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Greg Kroah-Hartman
maintainerRe: [PATCHv3 02/10] serdev: add serdev_device_wait_until_sent
In reply to Sebastian ReichelQuoted 24 lines · Sebastian Reichel
Add method, which waits until the transmission buffer has been sent. Note, that the change in
ttyport_write_wakeupis related, sincetty_wait_until_sentwill hang without that change.Acked-by Rob Herring <[email protected]>Acked-by Pavel Machek <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>---
Changes since PATCHv2:
* Avoid goto inttyport_write_wakeup--- drivers/tty/serdev/core.c | 11 +++++++++++ drivers/tty/serdev/serdev-ttyport.c | 18 ++++++++++++++---- include/linux/serdev.h | 3 +++ 3 files changed, 28 insertions(+), 4 deletions(-)drivers/tty/serdev/core.c +0
-0@@ -173,6 +173,17 @@ void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) }EXPORT_SYMBOL_GPL (serdev_device_set_flow_control);
drivers/tty/serdev/core.c void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) · line 185
Quoted 10 lines
drivers/tty/serdev/core.c +10
-0+void serdev_device_wait_until_sent (struct serdev_device *serdev,long timeout) +{ +struct serdev_controller *ctrl = serdev->ctrl; + +if (!ctrl || !ctrl->ops->wait_until_sent) +return ; + + ctrl->ops->wait_until_sent (ctrl, timeout); +} +EXPORT_SYMBOL_GPL (serdev_device_wait_until_sent);
Is this still needed now that we have serdev_device_write() with an unlimited timeout available?
thanks,
greg k-h
Re: [PATCHv3 02/10] serdev: add serdev_device_wait_until_sent
Quoted 25 lines · Greg Kroah-Hartman
Quoted 24 lines · Sebastian Reichel
Add method, which waits until the transmission buffer has been sent. Note, that the change in
ttyport_write_wakeupis related, sincetty_wait_until_sentwill hang without that change.Acked-by Rob Herring <[email protected]>Acked-by Pavel Machek <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>---
Changes since PATCHv2:
* Avoid goto inttyport_write_wakeup--- drivers/tty/serdev/core.c | 11 +++++++++++ drivers/tty/serdev/serdev-ttyport.c | 18 ++++++++++++++---- include/linux/serdev.h | 3 +++ 3 files changed, 28 insertions(+), 4 deletions(-)drivers/tty/serdev/core.c +0
-0@@ -173,6 +173,17 @@ void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) }EXPORT_SYMBOL_GPL (serdev_device_set_flow_control);
Quoted 13 lines
drivers/tty/serdev/core.c void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) · line 185
Quoted 10 lines
drivers/tty/serdev/core.c +10
-0+void serdev_device_wait_until_sent (struct serdev_device *serdev,long timeout) +{ +struct serdev_controller *ctrl = serdev->ctrl; + +if (!ctrl || !ctrl->ops->wait_until_sent) +return ; + + ctrl->ops->wait_until_sent (ctrl, timeout); +} +EXPORT_SYMBOL_GPL (serdev_device_wait_until_sent);Is this still needed now that we have
serdev_device_write()with an unlimited timeout available?
Yes, because only this waits until the data is on the wire.
Rob
Greg Kroah-Hartman
maintainerRe: [PATCHv3 02/10] serdev: add serdev_device_wait_until_sent
Quoted 41 lines · Rob Herring
Quoted 25 lines · Greg Kroah-Hartman
Quoted 24 lines · Sebastian Reichel
Add method, which waits until the transmission buffer has been sent. Note, that the change in
ttyport_write_wakeupis related, sincetty_wait_until_sentwill hang without that change.Acked-by Rob Herring <[email protected]>Acked-by Pavel Machek <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>---
Changes since PATCHv2:
* Avoid goto inttyport_write_wakeup--- drivers/tty/serdev/core.c | 11 +++++++++++ drivers/tty/serdev/serdev-ttyport.c | 18 ++++++++++++++---- include/linux/serdev.h | 3 +++ 3 files changed, 28 insertions(+), 4 deletions(-)drivers/tty/serdev/core.c +0
-0@@ -173,6 +173,17 @@ void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) }EXPORT_SYMBOL_GPL (serdev_device_set_flow_control);Quoted 13 lines
drivers/tty/serdev/core.c void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) · line 185
Quoted 10 lines
drivers/tty/serdev/core.c +10
-0+void serdev_device_wait_until_sent (struct serdev_device *serdev,long timeout) +{ +struct serdev_controller *ctrl = serdev->ctrl; + +if (!ctrl || !ctrl->ops->wait_until_sent) +return ; + + ctrl->ops->wait_until_sent (ctrl, timeout); +} +EXPORT_SYMBOL_GPL (serdev_device_wait_until_sent);Is this still needed now that we have
serdev_device_write()with an unlimited timeout available?
Quoted 1 line
Yes, because only this waits until the data is on the wire.
What "wire" is that? The serial wire? How do you know this? Many usb to serial devices have no way to determine this, given that there is another uart hanging off of the end of a USB connection.
Doesn't serdev_device_write() return when the write is finished? I think we need some good documentation here for all of the different variants of how to send data, as I'm sure confused...
thanks,
greg k-h
Re: [PATCHv3 02/10] serdev: add serdev_device_wait_until_sent
+ Andrey
Quoted 42 lines · Greg Kroah-Hartman
Quoted 41 lines · Rob Herring
Quoted 38 lines · Greg Kroah-Hartman
Quoted 24 lines · Sebastian Reichel
Add method, which waits until the transmission buffer has been sent. Note, that the change in
ttyport_write_wakeupis related, sincetty_wait_until_sentwill hang without that change.Acked-by Rob Herring <[email protected]>Acked-by Pavel Machek <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>---
Changes since PATCHv2:
* Avoid goto inttyport_write_wakeup--- drivers/tty/serdev/core.c | 11 +++++++++++ drivers/tty/serdev/serdev-ttyport.c | 18 ++++++++++++++---- include/linux/serdev.h | 3 +++ 3 files changed, 28 insertions(+), 4 deletions(-)drivers/tty/serdev/core.c +0
-0@@ -173,6 +173,17 @@ void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) }EXPORT_SYMBOL_GPL (serdev_device_set_flow_control);drivers/tty/serdev/core.c void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) · line 185
Quoted 10 lines
drivers/tty/serdev/core.c +10
-0+void serdev_device_wait_until_sent (struct serdev_device *serdev,long timeout) +{ +struct serdev_controller *ctrl = serdev->ctrl; + +if (!ctrl || !ctrl->ops->wait_until_sent) +return ; + + ctrl->ops->wait_until_sent (ctrl, timeout); +} +EXPORT_SYMBOL_GPL (serdev_device_wait_until_sent);Is this still needed now that we have
serdev_device_write()with an unlimited timeout available?
Quoted 5 lines
Quoted 1 line
Yes, because only this waits until the data is on the wire.
What "wire" is that? The serial wire? How do you know this? Many usb to serial devices have no way to determine this, given that there is another uart hanging off of the end of a USB connection.
Okay, maybe it's just out of linux s/w buffers for h/w which you don't know. It is the same semantics as tty_wait_until_sent which is documented as: "Wait for characters pending in a tty driver to hit the wire, or for a timeout to occur (eg due to flow control)"
Quoted 1 line
Doesn't
serdev_device_write()return when the write is finished?
No, it returns when data is accepted by the tty layer (as serdev has no buffering of its own).
Quoted 3 lines
I
think we need some good documentation here for all of the different variants of how to send data, as I'm sure confused...
Fair enough. However, I think that's somewhat orthogonal to this function.
There's 2 modes of sending data which are basically sync and async operation.
- serdev_device_write_buf - Only sends what can be immediately accepted by lower layers. Caller should provide write_wakeup callback to be notified.
- serdev_device_write - Sleeps until all data is accepted by lower layers or a timeout occurs.
It's valid to call serdev_device_wait_until_sent in either case.
Yes, the naming is not the best, but we kept serdev_device_write_buf to avoid any cross tree merges. We can remove or rename later as it is just a wrapper now for serdev_device_write.
Rob
Re: [PATCHv3 02/10] serdev: add serdev_device_wait_until_sent
Hi,
Quoted 46 lines · Rob Herring
Quoted 44 lines · Greg Kroah-Hartman
Quoted 42 lines · Rob Herring
Quoted 25 lines · Greg Kroah-Hartman
Quoted 24 lines · Sebastian Reichel
Add method, which waits until the transmission buffer has been sent. Note, that the change in
ttyport_write_wakeupis related, sincetty_wait_until_sentwill hang without that change.Acked-by Rob Herring <[email protected]>Acked-by Pavel Machek <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>---
Changes since PATCHv2:
* Avoid goto inttyport_write_wakeup--- drivers/tty/serdev/core.c | 11 +++++++++++ drivers/tty/serdev/serdev-ttyport.c | 18 ++++++++++++++---- include/linux/serdev.h | 3 +++ 3 files changed, 28 insertions(+), 4 deletions(-)drivers/tty/serdev/core.c +0
-0@@ -173,6 +173,17 @@ void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) }EXPORT_SYMBOL_GPL (serdev_device_set_flow_control);Quoted 13 lines
drivers/tty/serdev/core.c void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable) · line 185
Quoted 10 lines
drivers/tty/serdev/core.c +10
-0+void serdev_device_wait_until_sent (struct serdev_device *serdev,long timeout) +{ +struct serdev_controller *ctrl = serdev->ctrl; + +if (!ctrl || !ctrl->ops->wait_until_sent) +return ; + + ctrl->ops->wait_until_sent (ctrl, timeout); +} +EXPORT_SYMBOL_GPL (serdev_device_wait_until_sent);Is this still needed now that we have
serdev_device_write()with an unlimited timeout available?Yes, because only this waits until the data is on the wire.
Quoted 8 lines
Quoted 3 lines
What "wire" is that? The serial wire? How do you know this? Many usb to serial devices have no way to determine this, given that there is another uart hanging off of the end of a USB connection.
Okay, maybe it's just out of linux s/w buffers for h/w which you don't know. It is the same semantics as
tty_wait_until_sentwhich is documented as: "Wait for characters pending in a tty driver to hit the wire, or for a timeout to occur (eg due to flow control)"
For embedded h/w it usually means the serial wire. tty_wait_until_sent() first waits for the tty buffer to be empty and then calls wait_until_sent() in the driver providing the tty. In case of serial-core that is implemented by uart_wait_until_sent(), which waits for the serial driver's tx_empty() operation becoming true (grepping for ".tx_empty" returned 81 hits for me). Also at least some of the usb to serial adapters seem to support this using usb_serial_generic_wait_until_sent() and ".tx_empty":
$ git grep "\.tx_empty" cp210x.c: .tx_empty = cp210x_tx_empty, f81534.c: .tx_empty = f81534_tx_empty, ftdi_sio.c: .tx_empty = ftdi_tx_empty, io_ti.c: .tx_empty = edge_tx_empty, io_ti.c: .tx_empty = edge_tx_empty, mxuport.c: .tx_empty = mxuport_tx_empty, ti_usb_3410_5052.c: .tx_empty = ti_tx_empty, ti_usb_3410_5052.c: .tx_empty = ti_tx_empty,
The other ones will only wait for empty s/w buffer, but that's already the case for tty_wait_until_sent(), so IMHO a different problem.
-- Sebastian
Hi,
Quoted 19 lines · Rob Herring
Quoted 17 lines · Greg Kroah-Hartman
Quoted 15 lines · Marcel Holtmann
Hi Rob,
Quoted 9 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
Quoted 7 lines
Quoted 3 lines
I don't really care where it goes. I can take the whole thing in my tty/serial tree now if no one objects and I get an ack from the relevant maintainers {hint...}
I think it is better if it goes thru BT tree. I have another driver converted that is dependent on this series. There's a couple other serdev changes on the list too, but this shouldn't depend on them.
Is this waiting for something, or could it be queued to bluetooth-next then? It would be nice to finally have this in 4.12 :)
-- Sebastian
Marcel Holtmann
maintainerHi Sebastian,
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Quoted 6 lines
Quoted 2 lines
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
I don't really care where it goes. I can take the whole thing in my tty/serial tree now if no one objects and I get an ack from the relevant maintainers {hint...}
Quoted 7 lines
Quoted 3 lines
I think it is better if it goes thru BT tree. I have another driver converted that is dependent on this series. There's a couple other serdev changes on the list too, but this shouldn't depend on them.
Is this waiting for something, or could it be queued to bluetooth-next then? It would be nice to finally have this in 4.12 :)
I would prefer if we can get an ACK from Greg. Then I merge it through the bluetooth-next tree.
Regards
Marcel
Quoted 24 lines · Marcel Holtmann
Hi Sebastian,
Quoted 22 lines
Quoted 21 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
Quoted 7 lines
Quoted 3 lines
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
I don't really care where it goes. I can take the whole thing in my tty/serial tree now if no one objects and I get an ack from the relevant maintainers {hint...}
I think it is better if it goes thru BT tree. I have another driver converted that is dependent on this series. There's a couple other serdev changes on the list too, but this shouldn't depend on them.
Quoted 5 lines
Quoted 3 lines
Is this waiting for something, or could it be queued to bluetooth-next then? It would be nice to finally have this in 4.12 :)
I would prefer if we can get an ACK from Greg. Then I merge it through the bluetooth-next tree.
Sorry thought this was coming through mine:
Merge away!
greg k-h
Marcel Holtmann
maintainerHi Sebastian,
Quoted 26 lines
Quoted 26 lines
Quoted 25 lines
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 9 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
Quoted 7 lines
Quoted 3 lines
I don't really care where it goes. I can take the whole thing in my tty/serial tree now if no one objects and I get an ack from the relevant maintainers {hint...}
I think it is better if it goes thru BT tree. I have another driver converted that is dependent on this series. There's a couple other serdev changes on the list too, but this shouldn't depend on them.
Is this waiting for something, or could it be queued to bluetooth-next then? It would be nice to finally have this in 4.12 :)
Quoted 6 lines
Quoted 1 line
I would prefer if we can get an ACK from Greg. Then I merge it through the bluetooth-next tree.
Sorry thought this was coming through mine:
Merge away!
so I have applied patches 1-8 to bluetooth-next tree.
The last 2 I left out since they do cause build issues on non-DT platforms. We need to be able to build the driver on all platforms so that sanity compile checks happen all the time.
CC drivers/bluetooth/hci_nokia.odrivers/bluetooth/hci_nokia.c:802:34: error: array type has incomplete element type ‘struct of_device_id’
static const struct of_device_id nokia_bluetooth_of_match[] = {
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/bluetooth/hci_nokia.c:803:4: error: field name not in record or union initializer
{ .compatible = "nokia,h4p-bluetooth", },
^
drivers/bluetooth/hci_nokia.c:803:4: note: (near initialization for ‘nokia_bluetooth_of_match’)
drivers/bluetooth/hci_nokia.c:815:21: error: implicit declaration of function ‘of_match_ptr’ [-Werror=implicit-function-declaration]
.of_match_table = of_match_ptr(nokia_bluetooth_of_match),
^~~~~~~~~~~~
drivers/bluetooth/hci_nokia.c:802:34: warning: ‘nokia_bluetooth_of_match’ defined but not used [-Wunused-variable]
static const struct of_device_id nokia_bluetooth_of_match[] = {
^~~~~~~~~~~~~~~~~~~~~~~~Regards
Marcel
Hi Marcel,
Quoted 43 lines · Marcel Holtmann
Hi Sebastian,
Quoted 26 lines
Quoted 26 lines
Quoted 25 lines
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 9 lines
Quoted 6 lines
Here is PATCHv3 for the Nokia bluetooth patchset. I addressed all comments from Rob and Pavel regarding the serdev patches and dropped the *.dts patches, since they were queued by Tony. I also changed the patch order, so that the serdev patches come first. All of them have Acked-by from Rob, so I think it makes sense to merge them to serdev subsystem (now) and provide an immutable branch for the bluetooth subsystem.
Greg doesn't read cover letters generally and since the serdev patches are Cc rather than To him, he's probably not planning to pick them up.
I wonder actually if we should merge all of these via bluetooth-next tree with proper Ack from Greg. However it would be good to also get buy in from Dave for merging this ultimately through net-next.
Quoted 7 lines
Quoted 3 lines
I don't really care where it goes. I can take the whole thing in my tty/serial tree now if no one objects and I get an ack from the relevant maintainers {hint...}
I think it is better if it goes thru BT tree. I have another driver converted that is dependent on this series. There's a couple other serdev changes on the list too, but this shouldn't depend on them.
Is this waiting for something, or could it be queued to bluetooth-next then? It would be nice to finally have this in 4.12 :)
Quoted 6 lines
Quoted 1 line
I would prefer if we can get an ACK from Greg. Then I merge it through the bluetooth-next tree.
Sorry thought this was coming through mine:
Merge away!
so I have applied patches 1-8 to bluetooth-next tree.
The last 2 I left out since they do cause build issues on non-DT platforms. We need to be able to build the driver on all platforms so that sanity compile checks happen all the time.
CC
drivers/bluetooth/hci_nokia.odrivers/bluetooth/hci_nokia.c:802:34: error: array type has incomplete element type ‘struct of_device_id’
Quoted 12 lines
static const struct of_device_id nokia_bluetooth_of_match[] = {
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/bluetooth/hci_nokia.c:803:4: error: field name not in record or union initializer
{ .compatible = "nokia,h4p-bluetooth", },
^
drivers/bluetooth/hci_nokia.c:803:4: note: (near initialization for ‘nokia_bluetooth_of_match’)
drivers/bluetooth/hci_nokia.c:815:21: error: implicit declaration of function ‘of_match_ptr’ [-Werror=implicit-function-declaration]
.of_match_table = of_match_ptr(nokia_bluetooth_of_match),
^~~~~~~~~~~~
drivers/bluetooth/hci_nokia.c:802:34: warning: ‘nokia_bluetooth_of_match’ defined but not used [-Wunused-variable]
static const struct of_device_id nokia_bluetooth_of_match[] = {
^~~~~~~~~~~~~~~~~~~~~~~~Building without CONFIG_OF should work already. Note, that its actually enabled in your build, since nokia_bluetooth_of_match is guarded by "#ifdef CONFIG_OF". The actual problem is, that <linux/of.h> is not included in your build. Looks like it was implicitly included in my configurations, so I didn't notice. I will send PATCHv4 with the added include and includes sorted alphabetically.
-- Sebastian