Broadcom Bluetooth UART device driver
Subsystems (2)
v4 cover Broadcom Bluetooth UART device driver
v4 - Make idle-timeout the device tree parameter
Keep speeds both in the line discipline and in the protocol Remove unnecessary checks and traces
v3 - Renamed brcm device into bcm.
Allowed for the Broadcom protocol running without Broadcom device
at the request of Loic Poulain.
Introduced structure definitions for vendor specific commands. Transferred init-speed and oper-speed from protocol into the
line discipline as they are configurable.
Introduced hci_uart_init_tty function.
Removed driver specific Kconfig menu option. Introduced protocol timer helper function.
Converted single driver control dispatch routine into individual
action routines & removed interface versioning.
Eliminated specific firmware file name.
Removed excessive tracing.
Took care of numerous other comments from Marcel.
v2 - Release upon the acceptance of Fred's updates, updated as per
the latest comments from Marcel.
v1 - Original release against the Fred Danis' updates.
Ilya Faenson (4):
Broadcom Bluetooth UART Device Tree bindings
hci_uart: line discipline enhancements
btbcm_uart: Broadcom UART Platform Driver
hci_bcm: Broadcom UART protocol enhancements
.../devicetree/bindings/net/bluetooth/btbcm.txt | 86 ++++ drivers/bluetooth/Makefile | 1 + drivers/bluetooth/btbcm_uart.c | 538 +++++++++++++++++++++ drivers/bluetooth/btbcm_uart.h | 74 +++ drivers/bluetooth/hci_bcm.c | 340 ++++++++++++- drivers/bluetooth/hci_ldisc.c | 106 +++- drivers/bluetooth/hci_uart.h | 7 + 7 files changed, 1137 insertions(+), 15 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/bluetooth/btbcm.txt create mode 100644 drivers/bluetooth/btbcm_uart.c create mode 100644 drivers/bluetooth/btbcm_uart.h
Signature · 1 line
1.9.1
PATCH v4 1/4 Broadcom Bluetooth UART Device Tree bindings
Device Tree bindings to configure the Broadcom Bluetooth UART device.
--- .../devicetree/bindings/net/bluetooth/btbcm.txt | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/bluetooth/btbcm.txt
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +86 -0
@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart". + - tty : tty device connected to this Bluetooth device. + +Optional properties: + + - bt-host-wake-gpios : bt-host-wake input GPIO to be used as an interrupt. + + - bt-wake-gpios : bt-wake output GPIO to be used to suspend / resume device. + + - bt-reg-on-gpios : reg-on output GPIO to be used to power device on/off. + + - oper-speed : Bluetooth device operational baud rate. + Default: 3000000. + + - manual-fc : flow control UART in suspend / resume scenarios. + Default: 0. + + - configure-sleep : configure suspend / resume flag. + Default: false. + + - idle-timeout : Number of seconds of inactivity before suspending. + Default: 5. + + - configure-audio : configure platform PCM SCO flag. + Default: false. + + - pcm-clockmode : PCM clock mode. 0-slave, 1-master. + Default: 0. + + - pcm-fillmethod : PCM fill method. 0 to 3. + Default: 2. + + - pcm-fillnum : PCM number of fill bits. 0 to 3. + Default: 0. + + - pcm-fillvalue : PCM fill value. 0 to 7. + Default: 3. + + - pcm-incallbitclock : PCM interface rate. 0-128Kbps, 1-256Kbps, 2-512Kbps, + 3-1024Kbps, 4-2048Kbps. + Default: 0. + + - pcm-lsbfirst : PCM LSB first. 0 or 1. + Default: 0. + + - pcm-rightjustify : PCM Justify. 0-left, 1-right. + Default: 0. + + - pcm-routing : PCM routing. 0-PCM, 1-SCO over HCI. + Default: 0. + + - pcm-shortframesync : PCM sync. 0-short, 1-long. + Default: 0. + + - pcm-syncmode : PCM sync mode. 0-slave, 1-master. + Default: 0. + + +Example: + + bcm4354_bt_uart: bcm4354-bt-uart { + compatible = "brcm,brcm-bt-uart"; + bt-wake-gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>; + bt-host-wake-gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>; + tty = "ttyS0"; + oper-speed = <3000000>; + configure-sleep; + idle-timeout = <5>; + configure-audio; + pcm-clockmode = <0>; + pcm-fillmethod = <2>; + pcm-fillnum = <0>; + pcm-fillvalue = <3>; + pcm-incallbitclock = <0>; + pcm-lsbfirst = <0>; + pcm-rightjustify = <0>; + pcm-routing = <0>; + pcm-shortframesync = <0>; + pcm-syncmode = <0>; + }; +
Signature · 1 line
1.9.1
Re: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
Quoted 1 line · Ilya Faenson
Device Tree bindings to configure the Broadcom Bluetooth UART device.
As Marcel mentioned we really want DT people to Ack this one so better Cc: DT mailing list.
Regards,
Arend
Quoted 98 lines
Signed-off-by Ilya Faenson<[email protected]>--- .../devicetree/bindings/net/bluetooth/btbcm.txt | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+)create mode 100644
Documentation/devicetree/bindings/net/bluetooth/btbcm.txtDocumentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +86
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart". + - tty : tty device connected to this Bluetooth device. + +Optional properties: + + - bt-host-wake-gpios : bt-host-wake input GPIO to be used as an interrupt. + + - bt-wake-gpios : bt-wake output GPIO to be used to suspend / resume device. + + - bt-reg-on-gpios : reg-on output GPIO to be used to power device on/off. + + - oper-speed : Bluetooth device operational baud rate. + Default: 3000000. + + - manual-fc : flow control UART in suspend / resume scenarios. + Default: 0. + + - configure-sleep : configure suspend / resume flag. + Default: false. + + - idle-timeout : Number of seconds of inactivity before suspending. + Default: 5. + + - configure-audio : configure platform PCM SCO flag. + Default: false. + + - pcm-clockmode : PCM clock mode. 0-slave, 1-master. + Default: 0. + + - pcm-fillmethod : PCM fill method. 0 to 3. + Default: 2. + + - pcm-fillnum : PCM number of fill bits. 0 to 3. + Default: 0. + + - pcm-fillvalue : PCM fill value. 0 to 7. + Default: 3. + + - pcm-incallbitclock : PCM interface rate. 0-128Kbps, 1-256Kbps, 2-512Kbps, + 3-1024Kbps, 4-2048Kbps. + Default: 0. + + - pcm-lsbfirst : PCM LSB first. 0 or 1. + Default: 0. + + - pcm-rightjustify : PCM Justify. 0-left, 1-right. + Default: 0. + + - pcm-routing : PCM routing. 0-PCM, 1-SCO over HCI. + Default: 0. + + - pcm-shortframesync : PCM sync. 0-short, 1-long. + Default: 0. + + - pcm-syncmode : PCM sync mode. 0-slave, 1-master. + Default: 0. + + +Example: + + bcm4354_bt_uart: bcm4354-bt-uart { + compatible = "brcm,brcm-bt-uart"; + bt-wake-gpios =<&gpio4 30 GPIO_ACTIVE_HIGH>; + bt-host-wake-gpios =<&gpio4 31 GPIO_ACTIVE_HIGH>; + tty = "ttyS0"; + oper-speed =<3000000>; + configure-sleep; + idle-timeout =<5>; + configure-audio; + pcm-clockmode =<0>; + pcm-fillmethod =<2>; + pcm-fillnum =<0>; + pcm-fillvalue =<3>; + pcm-incallbitclock =<0>; + pcm-lsbfirst =<0>; + pcm-rightjustify =<0>; + pcm-routing =<0>; + pcm-shortframesync =<0>; + pcm-syncmode =<0>; + }; +
A message that is not in the archive (sent off-list or not yet received): 1434576658-20730-2-git-send-email-ifaenson-dY08KVG/lbpWk0Htik3J/[email protected]
PATCH v4 1/4 Broadcom Bluetooth UART Device Tree bindings
+ devicetree lists
-----Original Message-----
From: Ilya Faenson [mailto:ifaenson-dY08KVG/lbpWk0Htik3J/[email protected]]
Sent: Wednesday, June 17, 2015 5:31 PM
To: Marcel Holtmann
Cc: [email protected]; Arend Van Spriel; Ilya Faenson
Subject: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
Device Tree bindings to configure the Broadcom Bluetooth UART device.
--- .../devicetree/bindings/net/bluetooth/btbcm.txt | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/bluetooth/btbcm.txt
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +86 -0
@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart". + - tty : tty device connected to this Bluetooth device. + +Optional properties: + + - bt-host-wake-gpios : bt-host-wake input GPIO to be used as an interrupt. + + - bt-wake-gpios : bt-wake output GPIO to be used to suspend / resume device. + + - bt-reg-on-gpios : reg-on output GPIO to be used to power device on/off. + + - oper-speed : Bluetooth device operational baud rate. + Default: 3000000. + + - manual-fc : flow control UART in suspend / resume scenarios. + Default: 0. + + - configure-sleep : configure suspend / resume flag. + Default: false. + + - idle-timeout : Number of seconds of inactivity before suspending. + Default: 5. + + - configure-audio : configure platform PCM SCO flag. + Default: false. + + - pcm-clockmode : PCM clock mode. 0-slave, 1-master. + Default: 0. + + - pcm-fillmethod : PCM fill method. 0 to 3. + Default: 2. + + - pcm-fillnum : PCM number of fill bits. 0 to 3. + Default: 0. + + - pcm-fillvalue : PCM fill value. 0 to 7. + Default: 3. + + - pcm-incallbitclock : PCM interface rate. 0-128Kbps, 1-256Kbps, 2-512Kbps, + 3-1024Kbps, 4-2048Kbps. + Default: 0. + + - pcm-lsbfirst : PCM LSB first. 0 or 1. + Default: 0. + + - pcm-rightjustify : PCM Justify. 0-left, 1-right. + Default: 0. + + - pcm-routing : PCM routing. 0-PCM, 1-SCO over HCI. + Default: 0. + + - pcm-shortframesync : PCM sync. 0-short, 1-long. + Default: 0. + + - pcm-syncmode : PCM sync mode. 0-slave, 1-master. + Default: 0. + + +Example: + + bcm4354_bt_uart: bcm4354-bt-uart { + compatible = "brcm,brcm-bt-uart"; + bt-wake-gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>; + bt-host-wake-gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>; + tty = "ttyS0"; + oper-speed = <3000000>; + configure-sleep; + idle-timeout = <5>; + configure-audio; + pcm-clockmode = <0>; + pcm-fillmethod = <2>; + pcm-fillnum = <0>; + pcm-fillvalue = <3>; + pcm-incallbitclock = <0>; + pcm-lsbfirst = <0>; + pcm-rightjustify = <0>; + pcm-routing = <0>; + pcm-shortframesync = <0>; + pcm-syncmode = <0>; + }; +
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
Quoted 1 line · Ilya Faenson
+ devicetree lists
Please use get_maintainers.pl.
Quoted 11 lines
-----Original Message-----
From: Ilya Faenson [mailto:[email protected]]
Sent: Wednesday, June 17, 2015 5:31 PM
To: Marcel Holtmann
Cc: [email protected]; Arend Van Spriel; Ilya Faenson
Subject: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsDevice Tree bindings to configure the Broadcom Bluetooth UART device.
Signed-off-by Ilya Faenson <[email protected]>---
Change history from the last v4 version?
Quoted 10 lines
.../devicetree/bindings/net/bluetooth/btbcm.txt | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/bluetooth/btbcm.txtDocumentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +0
-0
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 6
Quoted 6 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart".
You need to describe the chip, not the interface.
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 7
Quoted 1 line
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +1
-0+ - tty : tty device connected to this Bluetooth device.
"tty" is a bit of a Linuxism and "ttyS0" certainly is. Further, there is no guarantee which uart is assigned ttyS0.
This should be a phandle to the connected uart if not a sub node of the uart. This is complicated since these chips have multiple host connections. It needs to go under either uart or SDIO host and have a reference back to the one it is not under. Given the SDIO interface is discoverable (although sideband gpios and regulators are not), I would put this under the uart node as that is never discoverable.
As I've mentioned previously, there's several cases of bindings for UART slave devices being posted. This all needs to be coordinated to use a common structure.
Quoted 4 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +4
-0+ +Optional properties: + + - bt-host-wake-gpios : bt-host-wake input GPIO to be used as an interrupt.
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 21
Quoted 10 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +10
-0+ + - bt-wake-gpios : bt-wake output GPIO to be used to suspend / resume device. + + - bt-reg-on-gpios : reg-on output GPIO to be used to power device on/off. + + - oper-speed : Bluetooth device operational baud rate. + Default: 3000000. + + - manual-fc : flow control UART in suspend / resume scenarios. + Default: 0.
Can be boolean?
I don't really follow the description.
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 24
Quoted 3 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +3
-0+ + - configure-sleep : configure suspend / resume flag. + Default: false.
Please describe better what this does. Perhaps "idle-sleep-en" would be better.
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 26
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +2
-0+ + - idle-timeout : Number of seconds of inactivity before suspending.
idle-timeout-sec
Is this only applicable when configure-sleep is set?
You mix the terms sleep and suspend a lot. Can you be more consistent.
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 30
Quoted 4 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +4
-0+ Default: 5. + + - configure-audio : configure platform PCM SCO flag. + Default: false.
So ignore the rest of the settings if not set? Perhaps combine with pcm-routing:
<blank> - no audio
audio-mode = "pcm";
audio-mode = "hci"; (or "sco-hci"?)
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 33
Quoted 3 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +3
-0+ + - pcm-clockmode : PCM clock mode. 0-slave, 1-master. + Default: 0.
Can be boolean (property present or not): pcm-clock-mode-master
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 35
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +2
-0+ + - pcm-fillmethod : PCM fill method. 0 to 3.
pcm-fill-method
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 39
Quoted 4 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +4
-0+ Default: 2. + + - pcm-fillnum : PCM number of fill bits. 0 to 3. + Default: 0.
pcm-fill-bits
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 42
Quoted 3 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +3
-0+ + - pcm-fillvalue : PCM fill value. 0 to 7. + Default: 3.
pcm-fill-value
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 45
Quoted 3 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +3
-0+ + - pcm-incallbitclock : PCM interface rate. 0-128Kbps, 1-256Kbps, 2-512Kbps, + 3-1024Kbps, 4-2048Kbps.
pcm-incall-bitclock-hz
Use the actual rate rather than an enumeration. It is a simple div by 128k and log2 to convert in the driver. This makes the property more compatible with other chips.
What does incall mean? What is the bit rate when not in a call?
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 49
Quoted 4 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +4
-0+ Default: 0. + + - pcm-lsbfirst : PCM LSB first. 0 or 1. + Default: 0.
Can be boolean
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 52
Quoted 3 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +3
-0+ + - pcm-rightjustify : PCM Justify. 0-left, 1-right. + Default: 0.
Can be boolean
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 54
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +2
-0+ - pcm-routing : PCM routing. 0-PCM, 1-SCO over HCI. + Default: 0.
Can be boolean: pcm-routing-hci
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 58
Quoted 3 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +3
-0+ + - pcm-shortframesync : PCM sync. 0-short, 1-long. + Default: 0.
Can be boolean
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 61
Quoted 3 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +3
-0+ + - pcm-syncmode : PCM sync mode. 0-slave, 1-master. + Default: 0.
Can be boolean: pcm-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SBw Y20tc2hvcnRmcmFtZXN5bmMgOiBQQ00gc3luYy4gMC1zaG9ydCwgMS1sb25nLg0KPiArICAgIERl ZmF1bHQ6IDAuDQoNCkNhbiBiZSBib29sZWFuDQoNCklGOiBPa2F5Lg0KDQo+ICsNCj4gKyAgLSBw Y20tc3luY21vZGUgOiBQQ00gc3luYyBtb2RlLiAwLXNsYXZlLCAxLW1hc3Rlci4NCj4gKyAgICBE ZWZhdWx0OiAwLg0KDQpDYW4gYmUgYm9vbGVhbjogcGNtLXN5bmMtbW9kZS1tYXN0ZXINCg0KSUY6 IE9rYXkuDQoNClJvYg0K
Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
On Thu, Jun 18, 2015 at 1:54 PM, Ilya Faenson <[email protected]> wrote= :
Quoted 1 line
Hi Rob,
Your emails are base64 encoded. They should be plain text for the list.
Quoted 5 lines
-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: Thursday, June 18, 2015 11:03 AM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; li=
Quoted 1 line
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindi=
ngs
Quoted 2 lines
On Wed, Jun 17, 2015 at 6:11 PM, Ilya Faenson <[email protected]> wro=
te:
Quoted 1 line
Quoted 1 line
+ devicetree lists
[...]
Quoted 1 line
b=
Quoted 1 line
b= renamed from Documentation/devicetree/bindings/net/bluetooth/btbcm.txt +0
-0
/Documentation/devicetree/bindings/net/bluetooth/btbcm.txt
Quoted 14 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 6
Quoted 11 lines
new file mode 100644
index 0000000..5dbcd57Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart".You need to describe the chip, not the interface.
Quoted 1 line
IF: This driver is for all Broadcom Bluetooth UART based chips.
BT only chips? Most/many Broadcom chips are combo chips. I understand the driver for BT is *mostly* separate from other chip functions like WiFi, GPS and NFC, but the h/w is a single chip. I say most because likely there are some parts shared: a voltage rail, reset line, or power down line. I think some can do BT over the SDIO interface too, so the interface may be shared. The DT is a description of the h/w (i.e. what part # for a chip) and not a driver data structure. You need to describe the whole chip in the binding. It is a Linux problem if there needs to be multiple separate drivers.
Quoted 13 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 7
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +1
-0+ - tty : tty device connected to this Bluetooth device."tty" is a bit of a Linuxism and "ttyS0" certainly is. Further, there is no guarantee which uart is assigned ttyS0.
This should be a phandle to the connected uart if not a sub node of the uart. This is complicated since these chips have multiple host connections. It needs to go under either uart or SDIO host and have a reference back to the one it is not under. Given the SDIO interface is discoverable (although sideband gpios and regulators are not), I would put this under the uart node as that is never discoverable.
Quoted 5 lines
As I've mentioned previously, there's several cases of bindings for UART slave devices being posted. This all needs to be coordinated to use a common structure.
IF: This driver does not really access the UART. If just needs to have a =
string of some sort to map instances of the BlueZ protocol into platform de= vices to employ the right GPIOs and interrupts. I could use anything you re= commend available through the tty_struct coming to the protocol from the Bl= ueZ line discipline. Moreover, every end user platform I've ever dealt with=
in 16 years of working with Bluetooth had a single BT UART device. So thes=
e are really rare (typically test platforms) cases only. The mapping is not=
needed for most platforms at all. I suspect the right thing to do would be= to make this parameter optional. The mapping would be done only if the par=
ameter is present. I will use anything tty_struct derived you specify. Make= s sense?
You've missed my point. I'm not talking about connecting multiple devices to a UART at once. There are several instances of people trying to add UART connected devices into DT[1][2]. My point is these devices all need to have the DT binding done in a common way across different platforms. Otherwise, we can not have common code to parse the DT and find devices attached to a UART.
Quoted 5 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt
Quoted 5 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +4
-0+ +Optional properties: + + - bt-host-wake-gpios : bt-host-wake input GPIO to be used as an inter=
rupt.
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 13
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +2
-0+ + - bt-wake-gpios : bt-wake output GPIO to be used to suspend / resume =
device.
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 15
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +2
-0+ + - bt-reg-on-gpios : reg-on output GPIO to be used to power device on/=
off.
Quoted 9 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 21
Quoted 6 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0+ + - oper-speed : Bluetooth device operational baud rate. + Default: 3000000. + + - manual-fc : flow control UART in suspend / resume scenarios. + Default: 0.Can be boolean?
Quoted 3 lines
I don't really follow the description.
IF: Okay, I will make it boolean. To clarify the description, it controls=
whether the BlueZ protocol needs to flow control the UART when the BT devi=
ce is suspended and un-flow control it when the device is resumed.
Okay. Discussion of BlueZ is not relevant to bindings. I would say something like "The hardware requires the host UART flow-control to be de-asserted during suspend."
[...]
Quoted 4 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 30
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +2
-0+ - configure-audio : configure platform PCM SCO flag. + Default: false.So ignore the rest of the settings if not set? Perhaps combine with pcm-r=
outing:
Quoted 6 lines
<blank> - no audio
audio-mode =3D "pcm";
audio-mode =3D "hci"; (or "sco-hci"?)IF: That's right: the rest of the parameters are not needed if configure-=
audio is false. Talking about your suggestions, this driver does nothing if=
the audio is either sent inbound or not used at all. Would you agree to so=
mething like the configure-pcm-audio flag?
So why not combine with pcm-routing?
[...]
Quoted 5 lines
Use the actual rate rather than an enumeration. It is a simple div by 128k and log2 to convert in the driver. This makes the property more compatible with other chips.
IF: These rates are subject to change in future chips with no guarantees =
of the pattern holding. I would prefer to use the actual value expected by = the firmware if you don't mind to avoid maintaining the extra driver code.
Exactly my point. If the next chip has 0-64k, 1-256k, 2-2048k, your binding is broken. Just put the bit rate in the binding and do the mapping to register value in the driver.
Quoted 3 lines
What does incall mean? What is the bit rate when not in a call?
IF: That's the name given to me by the hardware guys. What do you think a=
bout the "pcm-interface-rate" instead?
That's somewhat ambiguous. Is that the clock, sample rate, or bit rate (sample rate * sample size * channels).
Rob
[1] https://lwn.net/Articles/643878/
[2] http://www.spinics.net/lists/devicetree/msg83596.html
RE: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
SGkgUm9iLg0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogbGludXgtYmx1ZXRv b3RoLW93bmVyQHZnZXIua2VybmVsLm9yZyBbbWFpbHRvOmxpbnV4LWJsdWV0b290aC1vd25lckB2 Z2VyLmtlcm5lbC5vcmddIE9uIEJlaGFsZiBPZiBSb2IgSGVycmluZw0KU2VudDogVGh1cnNkYXks IEp1bmUgMTgsIDIwMTUgMzo0MSBQTQ0KVG86IElseWEgRmFlbnNvbg0KQ2M6IG1hcmNlbEBob2x0 bWFubi5vcmc7IEFyZW5kIFZhbiBTcHJpZWw7IGRldmljZXRyZWVAdmdlci5rZXJuZWwub3JnOyBs aW51eC1ibHVldG9vdGhAdmdlci5rZXJuZWwub3JnDQpTdWJqZWN0OiBSZTogRlc6IFtQQVRDSCB2 NCAxLzRdIEJyb2FkY29tIEJsdWV0b290aCBVQVJUIERldmljZSBUcmVlIGJpbmRpbmdzDQoNCk9u IFRodSwgSnVuIDE4LCAyMDE1IGF0IDE6NTQgUE0sIElseWEgRmFlbnNvbiA8aWZhZW5zb25AYnJv YWRjb20uY29tPiB3cm90ZToNCj4gSGkgUm9iLA0KDQpZb3VyIGVtYWlscyBhcmUgYmFzZTY0IGVu Y29kZWQuIFRoZXkgc2hvdWxkIGJlIHBsYWluIHRleHQgZm9yIHRoZSBsaXN0Lg0KDQpJRjogVGhl IE91dGxvb2sgaXMgY29uZmlndXJlZCB0byByZXNw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2hhdCBpcyB0aGUgYml0IHJhdGUgd2hlbiBub3QgaW4gYSBjYWxsPw0KPg0KPiBJRjog VGhhdCdzIHRoZSBuYW1lIGdpdmVuIHRvIG1lIGJ5IHRoZSBoYXJkd2FyZSBndXlzLiBXaGF0IGRv IHlvdSB0aGluayBhYm91dCB0aGUgInBjbS1pbnRlcmZhY2UtcmF0ZSIgaW5zdGVhZD8NCg0KVGhh dCdzIHNvbWV3aGF0IGFtYmlndW91cy4gSXMgdGhhdCB0aGUgY2xvY2ssIHNhbXBsZSByYXRlLCBv ciBiaXQgcmF0ZQ0KKHNhbXBsZSByYXRlICogc2FtcGxlIHNpemUgKiBjaGFubmVscykuDQoNCklG OiBPa2F5LCB3aWxsIHVzZSB0aGUgb3JpZ2luYWwgbmFtZS4NCg0KUm9iDQoNClsxXSBodHRwczov L2x3bi5uZXQvQXJ0aWNsZXMvNjQzODc4Lw0KWzJdIGh0dHA6Ly93d3cuc3Bpbmljcy5uZXQvbGlz dHMvZGV2aWNldHJlZS9tc2c4MzU5Ni5odG1sDQotLQ0KVG8gdW5zdWJzY3JpYmUgZnJvbSB0aGlz IGxpc3Q6IHNlbmQgdGhlIGxpbmUgInVuc3Vic2NyaWJlIGxpbnV4LWJsdWV0b290aCIgaW4NCnRo ZSBib2R5IG9mIGEgbWVzc2FnZSB0byBtYWpvcmRvbW9Admdlci5rZXJuZWwub3JnDQpNb3JlIG1h am9yZG9tbyBpbmZvIGF0ICBodHRwOi8vdmdlci5rZXJuZWwub3JnL21ham9yZG9tby1pbmZvLmh0 bWwNCg==
Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
On Thu, Jun 18, 2015 at 3:37 PM, Ilya Faenson <[email protected]> wrote= :
Quoted 4 lines
Hi Rob.
-----Original Message-----
From: [email protected] [mailto:linux-bluetooth-owner=
@vger.kernel.org] On Behalf Of Rob Herring
Quoted 3 lines
Sent: Thursday, June 18, 2015 3:41 PM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; li=
Quoted 1 line
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindi=
ngs
Quoted 2 lines
On Thu, Jun 18, 2015 at 1:54 PM, Ilya Faenson <[email protected]> wro=
te:
Quoted 5 lines
Quoted 1 line
Hi Rob,
Your emails are base64 encoded. They should be plain text for the list.
IF: The Outlook is configured to respond in the sender's format. I theref=
ore respond in the encoding you've used.
I assure you that that is not the case or I would be banished from lists by now. Outlook is generally incapable of correctly sending mails to lists. The reply header above is one aspect of that. The other problem is your replies don't get wrapped and prefixed properly. That could be my client I guess, but *all* other mails are fine.
My sent mails have:
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: quoted-printable
Quoted 5 lines
Quoted 5 lines
-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: Thursday, June 18, 2015 11:03 AM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; l=
Quoted 1 line
Quoted 1 line
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bind=
ings
Quoted 2 lines
Quoted 2 lines
On Wed, Jun 17, 2015 at 6:11 PM, Ilya Faenson <[email protected]> wr=
ote:
Quoted 5 lines
Quoted 1 line
Quoted 1 line
+ devicetree lists
[...]
Quoted 1 line
=
Quoted 1 line
= renamed from Documentation/devicetree/bindings/net/bluetooth/btbcm.txt +0
-0
b/Documentation/devicetree/bindings/net/bluetooth/btbcm.txt
Quoted 26 lines
Quoted 14 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 6
Quoted 11 lines
new file mode 100644
index 0000000..5dbcd57Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart".You need to describe the chip, not the interface.
Quoted 1 line
IF: This driver is for all Broadcom Bluetooth UART based chips.
BT only chips? Most/many Broadcom chips are combo chips. I understand the driver for BT is *mostly* separate from other chip functions like WiFi, GPS and NFC, but the h/w is a single chip. I say most because likely there are some parts shared: a voltage rail, reset line, or power down line. I think some can do BT over the SDIO interface too, so the interface may be shared. The DT is a description of the h/w (i.e. what part # for a chip) and not a driver data structure. You need to describe the whole chip in the binding. It is a Linux problem if there needs to be multiple separate drivers.
Quoted 1 line
IF: Defining complete DT description for the Broadcom combo chips for mul=
tiple interfaces is well beyond the scope of what I am doing. I just need t=
o define a DT node for the input and output GPIOs connected to the BT UART = chip. BT may or may not be part of the combo chip: it does not really matte= r for this exercise. I thought I would take this opportunity to place some = BT device parameters into that node as well. If you're not comfortable with= this, I could just call it a "GPIO set" to avoid mentioning BT and UART at= all but it would make little sense. Still, I could consider it. Would you =
have "GPIO set" recommendations? Alternatively, NFC Marvell code you're ref= erring to has parameters configured as Linux module parameters. I could do = the same too, avoiding this device tree discussion. Let me know.
Quoted 1 line
I don't completely follow what you mean by "GPIO set", but I'm guessing that is not the right path.
Quoted 1 line
Generally speaking (pontification hat on :-)), what you're trying to do (=
description of the whole chip) is well beyond what say ACPI has done (I was=
involved some in the BT ACPI exercise a few years ago). BT UART interface =
is described in ACPI independently of other parts of the same combo chip. R= equirements like that slow down the DT development in my opinion as compani= es are understandably reluctant to work with unrealistic goals. End of pont= ification. :-)
Quoted 1 line
ACPI and DT are very different models in terms of abstraction and governance. I'm not going to hash through all the details.
I'm not necessarily saying we have to have a single node, but that is my default position. You have convince me that the functions are completely independent and I cannot judge that if you are completely ignoring the WiFi part. From Broadcom chips I've worked with, the supplies at least are shared (something ACPI does not expose). Perhaps we could fudge that and just require the same supply has to be connected to each half. I still worry there could be other internal inter-dependencies. Perhaps BT requires the SDIO clock to be active or something like that. Maybe not on Broadcom chips, but on other vendors and I have to care about them all.
Let's step back to what I'm asking for:
- A more specific compatible string. This should include the chip name/number. You may not need it today, but it is insurance in case you do find differences latter. The only impact is the match table in your driver. You can also have a less specific compatible string if you want that the driver can match on.
- Changing the location of the node. The node hierarchy implicitly defines connections. You have a connection from the host UART to the BT device. This needs to be described. Whether splitting BT and WiFi nodes or not, I've already said it probably makes the most sense to put this under the host uart node.
- Splitting the nodes. Here we are looking at doing either:
serial@1234 {
compatible =3D "some-soc-uart";
brcm43340 {
compatible =3D "brcm,brcm43340";
sdio-host =3D <&soc-sdhost>;
// BT props
// WiFi props };
};
Or:
serial@1234 {
compatible =3D "some-soc-uart";
brcm43340 {
compatible =3D "brcm,brcm43340-bt";
// BT props };
};
mmc@5678 {
compatible =3D "some-soc-sdhci";
brcm43340@0 {
reg =3D <0>;
compatible =3D "brcm,brcm43340-wifi";
// WiFi props };
};
Or maybe it is the latter example but we just add phandle links between the 2 nodes.
We haven't even considered what happens when a chip also has FM, NFC, and/or GPS. Nor have we considered how to describe the audio connection to the host processor, but we've got nothing common and that can probably come latter.
We need to agree figuring all this out is needed. Otherwise, this whole conversation is a waste of time.
Quoted 13 lines
Quoted 13 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 7
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +1
-0+ - tty : tty device connected to this Bluetooth device."tty" is a bit of a Linuxism and "ttyS0" certainly is. Further, there is no guarantee which uart is assigned ttyS0.
This should be a phandle to the connected uart if not a sub node of the uart. This is complicated since these chips have multiple host connections. It needs to go under either uart or SDIO host and have a reference back to the one it is not under. Given the SDIO interface is discoverable (although sideband gpios and regulators are not), I would put this under the uart node as that is never discoverable.
Quoted 5 lines
Quoted 5 lines
As I've mentioned previously, there's several cases of bindings for UART slave devices being posted. This all needs to be coordinated to use a common structure.
IF: This driver does not really access the UART. If just needs to have a=
string of some sort to map instances of the BlueZ protocol into platform d=
evices to employ the right GPIOs and interrupts. I could use anything you r= ecommend available through the tty_struct coming to the protocol from the B= lueZ line discipline. Moreover, every end user platform I've ever dealt wit= h in 16 years of working with Bluetooth had a single BT UART device. So the= se are really rare (typically test platforms) cases only. The mapping is no= t needed for most platforms at all. I suspect the right thing to do would b= e to make this parameter optional. The mapping would be done only if the pa= rameter is present. I will use anything tty_struct derived you specify. Mak= es sense?
Quoted 10 lines
You've missed my point. I'm not talking about connecting multiple devices to a UART at once. There are several instances of people trying to add UART connected devices into DT[1][2]. My point is these devices all need to have the DT binding done in a common way across different platforms. Otherwise, we can not have common code to parse the DT and find devices attached to a UART.
IF: Chances are I was not clear enough. I was not talking about connectin=
g multiple devices to a UART. I was talking about connecting one Broadcom B= T device to one serial port and another Broadcom BT device to another seria= l port (rare enough setup). I do understand your goals though. I would be h= appy to participate in that exercise (subject to the management approval) o= nce DT has published the UART device parameters and the Linux bluetooth-nex= t has support for DT enumerated devices. I don=E2=80=99t see it happening s= oon though. Marvell example you've referred me to has nothing of the sort. = What do you think of allowing us something to ship now with an understandin= g that we would support your UART enumerated devices once they are publishe= d?
Okay. Several people want to describe a connection between a host uart and a device connected to the uart (BT, NFC, GPS, etc.). You are doing this with your "tty" property. My goal and requirement is that this connection be described in DT in the same way regardless of the device attached. Just like all I2C device connections are described by being child nodes under the I2C host regardless of the type of I2C device attached.
Rob
Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
Quoted 80 lines · Rob Herring
Quoted 9 lines · Ilya Faenson
Hi Rob.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rob Herring
Sent: Thursday, June 18, 2015 3:41 PM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 6 lines
Quoted 1 line · Ilya Faenson
Hi Rob,
Your emails are base64 encoded. They should be plain text for the list.
IF: The Outlook is configured to respond in the sender's format. I therefore respond in the encoding you've used.
I assure you that that is not the case or I would be banished from lists by now. Outlook is generally incapable of correctly sending mails to lists. The reply header above is one aspect of that. The other problem is your replies don't get wrapped and prefixed properly. That could be my client I guess, but *all* other mails are fine.
My sent mails have:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printableQuoted 39 lines
Quoted 9 lines
-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: Thursday, June 18, 2015 11:03 AM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 1 line · Ilya Faenson
+ devicetree lists
[...]
Quoted 15 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 6
Quoted 12 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart".You need to describe the chip, not the interface.
Quoted 1 line
IF: This driver is for all Broadcom Bluetooth UART based chips.
BT only chips? Most/many Broadcom chips are combo chips. I understand the driver for BT is *mostly* separate from other chip functions like WiFi, GPS and NFC, but the h/w is a single chip. I say most because likely there are some parts shared: a voltage rail, reset line, or power down line. I think some can do BT over the SDIO interface too, so the interface may be shared. The DT is a description of the h/w (i.e. what part # for a chip) and not a driver data structure. You need to describe the whole chip in the binding. It is a Linux problem if there needs to be multiple separate drivers.
Quoted 2 lines
IF: Defining complete DT description for the Broadcom combo chips for multiple interfaces is well beyond the scope of what I am doing. I just need to define a DT node for the input and output GPIOs connected to the BT UART chip. BT may or may not be part of the combo chip: it does not really matter for this exercise. I thought I would take this opportunity to place some BT device parameters into that node as well. If you're not comfortable with this, I could just call it a "GPIO set" to avoid mentioning BT and UART at all but it would make little sense. Still, I could consider it. Would you have "GPIO set" recommendations? Alternatively, NFC Marvell code you're referring to has parameters configured as Linux module parameters. I could do the same too, avoiding this device tree discussion. Let me know.
I don't completely follow what you mean by "GPIO set", but I'm guessing that is not the right path.
Quoted 2 lines
Generally speaking (pontification hat on :-)), what you're trying to do (description of the whole chip) is well beyond what say ACPI has done (I was involved some in the BT ACPI exercise a few years ago). BT UART interface is described in ACPI independently of other parts of the same combo chip. Requirements like that slow down the DT development in my opinion as companies are understandably reluctant to work with unrealistic goals. End of pontification. :-)
ACPI and DT are very different models in terms of abstraction and governance. I'm not going to hash through all the details.
Quoted 10 lines
I'm not necessarily saying we have to have a single node, but that is my default position. You have convince me that the functions are completely independent and I cannot judge that if you are completely ignoring the WiFi part. From Broadcom chips I've worked with, the supplies at least are shared (something ACPI does not expose). Perhaps we could fudge that and just require the same supply has to be connected to each half. I still worry there could be other internal inter-dependencies. Perhaps BT requires the SDIO clock to be active or something like that. Maybe not on Broadcom chips, but on other vendors and I have to care about them all.
All Broadcom combo chips that I know of have separate supplies, ie. wl-reg-on and bt-reg-on. There already is a binding present for the wifi part. Not extending that may seem ignorant, but as wifi and bt can have a separate interface to the host (admittedly they could share SDIO interface, but they would be exposed as a separate SDIO function) I did not see a reason to object against a separate binding for BT. Whether wifi and bt are on the same device does not seem like something that must be expressed in DT. The physical state may help in determining DT bindings, but it should not be mandatory in my opinion.
Quoted 38 lines
Let's step back to what I'm asking for:
- A more specific compatible string. This should include the chip name/number. You may not need it today, but it is insurance in case you do find differences latter. The only impact is the match table in your driver. You can also have a less specific compatible string if you want that the driver can match on.
- Changing the location of the node. The node hierarchy implicitly defines connections. You have a connection from the host UART to the BT device. This needs to be described. Whether splitting BT and WiFi nodes or not, I've already said it probably makes the most sense to put this under the host uart node.
- Splitting the nodes. Here we are looking at doing either:
serial@1234 { compatible = "some-soc-uart"; brcm43340 { compatible = "brcm,brcm43340"; sdio-host =<&soc-sdhost>; // BT props // WiFi props }; };Or:
serial@1234 { compatible = "some-soc-uart"; brcm43340 { compatible = "brcm,brcm43340-bt"; // BT props }; };
Quoted 9 lines
mmc@5678 {
compatible = "some-soc-sdhci";
brcm43340@0 {
reg =<0>;
compatible = "brcm,brcm43340-wifi";
// WiFi props
};
};This is more or less what is in the wifi binding today. See bindings/net/wireless/brcm,bcm43xx-fmac.txt.
Regards,
Arend
Quoted 49 lines
Or maybe it is the latter example but we just add phandle links between the 2 nodes.
We haven't even considered what happens when a chip also has FM, NFC, and/or GPS. Nor have we considered how to describe the audio connection to the host processor, but we've got nothing common and that can probably come latter.
We need to agree figuring all this out is needed. Otherwise, this whole conversation is a waste of time.
Quoted 20 lines
Quoted 13 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 7
Quoted 2 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +1
-0+ - tty : tty device connected to this Bluetooth device."tty" is a bit of a Linuxism and "ttyS0" certainly is. Further, there is no guarantee which uart is assigned ttyS0.
This should be a phandle to the connected uart if not a sub node of the uart. This is complicated since these chips have multiple host connections. It needs to go under either uart or SDIO host and have a reference back to the one it is not under. Given the SDIO interface is discoverable (although sideband gpios and regulators are not), I would put this under the uart node as that is never discoverable.
Quoted 5 lines
As I've mentioned previously, there's several cases of bindings for UART slave devices being posted. This all needs to be coordinated to use a common structure.
IF: This driver does not really access the UART. If just needs to have a string of some sort to map instances of the BlueZ protocol into platform devices to employ the right GPIOs and interrupts. I could use anything you recommend available through the
tty_structcoming to the protocol from the BlueZ line discipline. Moreover, every end user platform I've ever dealt with in 16 years of working with Bluetooth had a single BT UART device. So these are really rare (typically test platforms) cases only. The mapping is not needed for most platforms at all. I suspect the right thing to do would be to make this parameter optional. The mapping would be done only if the parameter is present. I will use anythingtty_structderived you specify. Makes sense?Quoted 8 lines
You've missed my point. I'm not talking about connecting multiple devices to a UART at once. There are several instances of people trying to add UART connected devices into DT[1][2]. My point is these devices all need to have the DT binding done in a common way across different platforms. Otherwise, we can not have common code to parse the DT and find devices attached to a UART.
IF: Chances are I was not clear enough. I was not talking about connecting multiple devices to a UART. I was talking about connecting one Broadcom BT device to one serial port and another Broadcom BT device to another serial port (rare enough setup). I do understand your goals though. I would be happy to participate in that exercise (subject to the management approval) once DT has published the UART device parameters and the Linux bluetooth-next has support for DT enumerated devices. I don’t see it happening soon though. Marvell example you've referred me to has nothing of the sort. What do you think of allowing us something to ship now with an understanding that we would support your UART enumerated devices once they are published?
Okay. Several people want to describe a connection between a host uart and a device connected to the uart (BT, NFC, GPS, etc.). You are doing this with your "tty" property. My goal and requirement is that this connection be described in DT in the same way regardless of the device attached. Just like all I2C device connections are described by being child nodes under the I2C host regardless of the type of I2C device attached.
Rob
Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
Quoted 128 lines · Arend van Spriel
Quoted 115 lines · Rob Herring
Quoted 16 lines · Ilya Faenson
Hi Rob.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rob Herring
Sent: Thursday, June 18, 2015 3:41 PM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 1 line · Ilya Faenson
Quoted 7 lines
Quoted 1 line
Hi Rob,
Your emails are base64 encoded. They should be plain text for the list.
IF: The Outlook is configured to respond in the sender's format. I therefore respond in the encoding you've used.
I assure you that that is not the case or I would be banished from lists by now. Outlook is generally incapable of correctly sending mails to lists. The reply header above is one aspect of that. The other problem is your replies don't get wrapped and prefixed properly. That could be my client I guess, but *all* other mails are fine.
My sent mails have:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printableQuoted 47 lines
Quoted 13 lines
-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: Thursday, June 18, 2015 11:03 AM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 2 lines · Ilya Faenson
+ devicetree lists
[...]
Quoted 17 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 6
Quoted 13 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart".You need to describe the chip, not the interface.
Quoted 1 line
IF: This driver is for all Broadcom Bluetooth UART based chips.
BT only chips? Most/many Broadcom chips are combo chips. I understand the driver for BT is *mostly* separate from other chip functions like WiFi, GPS and NFC, but the h/w is a single chip. I say most because likely there are some parts shared: a voltage rail, reset line, or power down line. I think some can do BT over the SDIO interface too, so the interface may be shared. The DT is a description of the h/w (i.e. what part # for a chip) and not a driver data structure. You need to describe the whole chip in the binding. It is a Linux problem if there needs to be multiple separate drivers.
Quoted 12 lines
IF: Defining complete DT description for the Broadcom combo chips for multiple interfaces is well beyond the scope of what I am doing. I just need to define a DT node for the input and output GPIOs connected to the BT UART chip. BT may or may not be part of the combo chip: it does not really matter for this exercise. I thought I would take this opportunity to place some BT device parameters into that node as well. If you're not comfortable with this, I could just call it a "GPIO set" to avoid mentioning BT and UART at all but it would make little sense. Still, I could consider it. Would you have "GPIO set" recommendations? Alternatively, NFC Marvell code you're referring to has parameters configured as Linux module parameters. I could do the same too, avoiding this device tree discussion. Let me know.
I don't completely follow what you mean by "GPIO set", but I'm guessing that is not the right path.
Quoted 8 lines
Generally speaking (pontification hat on :-)), what you're trying to do (description of the whole chip) is well beyond what say ACPI has done (I was involved some in the BT ACPI exercise a few years ago). BT UART interface is described in ACPI independently of other parts of the same combo chip. Requirements like that slow down the DT development in my opinion as companies are understandably reluctant to work with unrealistic goals. End of pontification. :-)
ACPI and DT are very different models in terms of abstraction and governance. I'm not going to hash through all the details.
Quoted 10 lines
I'm not necessarily saying we have to have a single node, but that is my default position. You have convince me that the functions are completely independent and I cannot judge that if you are completely ignoring the WiFi part. From Broadcom chips I've worked with, the supplies at least are shared (something ACPI does not expose). Perhaps we could fudge that and just require the same supply has to be connected to each half. I still worry there could be other internal inter-dependencies. Perhaps BT requires the SDIO clock to be active or something like that. Maybe not on Broadcom chips, but on other vendors and I have to care about them all.
Quoted 2 lines
All Broadcom combo chips that I know of have separate supplies, ie. wl-reg-on and bt-reg-on. There already is a binding present for the wifi
GPIOs are not supplies. For the module I'm working with (43340 based) there is a single VDDIO and VBAT supplies which are shared. Now whether the module or the chip are tying things together, I don't know. There is also a 32kHz clock input. Is that part of WiFi or BT?
Quoted 7 lines
part. Not extending that may seem ignorant, but as wifi and bt can have a separate interface to the host (admittedly they could share SDIO interface, but they would be exposed as a separate SDIO function) I did not see a reason to object against a separate binding for BT. Whether wifi and bt are on the same device does not seem like something that must be expressed in DT. The physical state may help in determining DT bindings, but it should not be mandatory in my opinion.
We don't need it in DT until we do. Soon as there is some some interdependence, something in DT will be needed.
Rob
Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
Quoted 129 lines · Rob Herring
Quoted 128 lines · Arend van Spriel
Quoted 125 lines · Rob Herring
Quoted 16 lines · Ilya Faenson
Hi Rob.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rob Herring
Sent: Thursday, June 18, 2015 3:41 PM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 1 line · Ilya Faenson
Quoted 7 lines
Quoted 1 line
Hi Rob,
Your emails are base64 encoded. They should be plain text for the list.
IF: The Outlook is configured to respond in the sender's format. I therefore respond in the encoding you've used.
I assure you that that is not the case or I would be banished from lists by now. Outlook is generally incapable of correctly sending mails to lists. The reply header above is one aspect of that. The other problem is your replies don't get wrapped and prefixed properly. That could be my client I guess, but *all* other mails are fine.
My sent mails have:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printableQuoted 47 lines
Quoted 13 lines
-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: Thursday, June 18, 2015 11:03 AM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 2 lines · Ilya Faenson
+ devicetree lists
[...]
Quoted 17 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 6
Quoted 13 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart".You need to describe the chip, not the interface.
Quoted 1 line
IF: This driver is for all Broadcom Bluetooth UART based chips.
BT only chips? Most/many Broadcom chips are combo chips. I understand the driver for BT is *mostly* separate from other chip functions like WiFi, GPS and NFC, but the h/w is a single chip. I say most because likely there are some parts shared: a voltage rail, reset line, or power down line. I think some can do BT over the SDIO interface too, so the interface may be shared. The DT is a description of the h/w (i.e. what part # for a chip) and not a driver data structure. You need to describe the whole chip in the binding. It is a Linux problem if there needs to be multiple separate drivers.
Quoted 12 lines
IF: Defining complete DT description for the Broadcom combo chips for multiple interfaces is well beyond the scope of what I am doing. I just need to define a DT node for the input and output GPIOs connected to the BT UART chip. BT may or may not be part of the combo chip: it does not really matter for this exercise. I thought I would take this opportunity to place some BT device parameters into that node as well. If you're not comfortable with this, I could just call it a "GPIO set" to avoid mentioning BT and UART at all but it would make little sense. Still, I could consider it. Would you have "GPIO set" recommendations? Alternatively, NFC Marvell code you're referring to has parameters configured as Linux module parameters. I could do the same too, avoiding this device tree discussion. Let me know.
I don't completely follow what you mean by "GPIO set", but I'm guessing that is not the right path.
Quoted 8 lines
Generally speaking (pontification hat on :-)), what you're trying to do (description of the whole chip) is well beyond what say ACPI has done (I was involved some in the BT ACPI exercise a few years ago). BT UART interface is described in ACPI independently of other parts of the same combo chip. Requirements like that slow down the DT development in my opinion as companies are understandably reluctant to work with unrealistic goals. End of pontification. :-)
ACPI and DT are very different models in terms of abstraction and governance. I'm not going to hash through all the details.
I'm not necessarily saying we have to have a single node, but that is my default position. You have convince me that the functions are completely independent and I cannot judge that if you are completely ignoring the WiFi part. From Broadcom chips I've worked with, the supplies at least are shared (something ACPI does not expose). Perhaps we could fudge that and just require the same supply has to be connected to each half. I still worry there could be other internal inter-dependencies. Perhaps BT requires the SDIO clock to be active or something like that. Maybe not on Broadcom chips, but on other vendors and I have to care about them all.
Quoted 7 lines
Quoted 2 lines
All Broadcom combo chips that I know of have separate supplies, ie. wl-reg-on and bt-reg-on. There already is a binding present for the wifi
GPIOs are not supplies. For the module I'm working with (43340 based) there is a single VDDIO and VBAT supplies which are shared. Now whether the module or the chip are tying things together, I don't know. There is also a 32kHz clock input. Is that part of WiFi or BT?
True and I see where you are going here. The 32kHz clock is input for low-power oscillator in the chip. That LPO provides clock for the interconnect in the chip so it is not part of wifi nor bt.
Quoted 10 lines
Quoted 7 lines
part. Not extending that may seem ignorant, but as wifi and bt can have a separate interface to the host (admittedly they could share SDIO interface, but they would be exposed as a separate SDIO function) I did not see a reason to object against a separate binding for BT. Whether wifi and bt are on the same device does not seem like something that must be expressed in DT. The physical state may help in determining DT bindings, but it should not be mandatory in my opinion.
We don't need it in DT until we do. Soon as there is some some interdependence, something in DT will be needed.
Agree.
Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
Quoted 151 lines · Arend van Spriel
Quoted 150 lines · Rob Herring
Quoted 147 lines · Arend van Spriel
Quoted 132 lines · Rob Herring
Quoted 17 lines · Ilya Faenson
Hi Rob.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rob Herring
Sent: Thursday, June 18, 2015 3:41 PM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 1 line · Ilya Faenson
Quoted 8 lines
Quoted 1 line
Hi Rob,
Your emails are base64 encoded. They should be plain text for the list.
IF: The Outlook is configured to respond in the sender's format. I therefore respond in the encoding you've used.
I assure you that that is not the case or I would be banished from lists by now. Outlook is generally incapable of correctly sending mails to lists. The reply header above is one aspect of that. The other problem is your replies don't get wrapped and prefixed properly. That could be my client I guess, but *all* other mails are fine.
My sent mails have:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printableQuoted 61 lines
Quoted 14 lines
-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: Thursday, June 18, 2015 11:03 AM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 2 lines · Ilya Faenson
+ devicetree lists
[...]
Quoted 18 lines
Quoted 8 lines
diff --git
a/Documentation/devicetree/bindings/net/bluetooth/btbcm.txtb/Documentation/devicetree/bindings/net/bluetooth/btbcm.txtnew file mode 100644
index 0000000..5dbcd57Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 6
Quoted 6 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart".You need to describe the chip, not the interface.
Quoted 1 line
IF: This driver is for all Broadcom Bluetooth UART based chips.
BT only chips? Most/many Broadcom chips are combo chips. I understand the driver for BT is *mostly* separate from other chip functions like WiFi, GPS and NFC, but the h/w is a single chip. I say most because likely there are some parts shared: a voltage rail, reset line, or power down line. I think some can do BT over the SDIO interface too, so the interface may be shared. The DT is a description of the h/w (i.e. what part # for a chip) and not a driver data structure. You need to describe the whole chip in the binding. It is a Linux problem if there needs to be multiple separate drivers.
IF: Defining complete DT description for the Broadcom combo chips for multiple interfaces is well beyond the scope of what I am doing. I just need
to define a DT node for the input and output GPIOs connected to the BT UART
chip. BT may or may not be part of the combo chip: it does not really matter
for this exercise. I thought I would take this opportunity to place some BT
device parameters into that node as well. If you're not comfortable with
this, I could just call it a "GPIO set" to avoid mentioning BT andQuoted 9 lines
UART at
all but it would make little sense. Still, I could consider it. Would you
have "GPIO set" recommendations? Alternatively, NFC Marvell code you're
referring to has parameters configured as Linux module parameters. I could
do the same too, avoiding this device tree discussion. Let me know.I don't completely follow what you mean by "GPIO set", but I'm guessing that is not the right path.
Quoted 12 lines
Generally speaking (pontification hat on :-)), what you're trying to do
(description of the whole chip) is well beyond what say ACPI has done (I was
involved some in the BT ACPI exercise a few years ago). BT UART interface is
described in ACPI independently of other parts of the same combo chip. Requirements like that slow down the DT development in my opinion as companies are understandably reluctant to work with unrealistic goals. End
of pontification. :-)ACPI and DT are very different models in terms of abstraction and governance. I'm not going to hash through all the details.
Quoted 10 lines
I'm not necessarily saying we have to have a single node, but that is my default position. You have convince me that the functions are completely independent and I cannot judge that if you are completely ignoring the WiFi part. From Broadcom chips I've worked with, the supplies at least are shared (something ACPI does not expose). Perhaps we could fudge that and just require the same supply has to be connected to each half. I still worry there could be other internal inter-dependencies. Perhaps BT requires the SDIO clock to be active or something like that. Maybe not on Broadcom chips, but on other vendors and I have to care about them all.
All Broadcom combo chips that I know of have separate supplies, ie. wl-reg-on and bt-reg-on. There already is a binding present for the wifi
Quoted 8 lines
Quoted 4 lines
GPIOs are not supplies. For the module I'm working with (43340 based) there is a single VDDIO and VBAT supplies which are shared. Now whether the module or the chip are tying things together, I don't know. There is also a 32kHz clock input. Is that part of WiFi or BT?
True and I see where you are going here. The 32kHz clock is input for low-power oscillator in the chip. That LPO provides clock for the interconnect in the chip so it is not part of wifi nor bt.
Hi Rob,
Haven't seen much follow up so how to move forward here. We could go for a devicetree node covering all functional entities on the device. However, we are making the chipset and users more often as not end up with a module that some manufacturer cooked up. So whether signals are optional or not is hard to say for us. Making them optional by default seems safest.
So could something like below work? Just wanted to know your opinion before moving in that direction.
bcm43341: {
compatible: 'brcm,bcm43340';
brcm,lpo-clock: <&32khz_clk>;
:
brcm_wifi: {
compatible: "brcm,bcm4329-fmac";
wifi-port: <&mmc3>;
:
}
brcm_bt: {
compatible: "brcm,bcm43xx-bt-uart";
bt-port: <&uart1>;
:
}
brcm_nfc: {
compatible: "brcm,bcm43340-nfc";
nfc-port: <&uart2>;
:
}
}Regards,
Arend
Quoted 23 lines
Quoted 13 lines
Quoted 4 lines
part. Not extending that may seem ignorant, but as wifi and bt can have a
separate interface to the host (admittedly they could share SDIO interface,Quoted 8 lines
but they would be exposed as a separate SDIO function) I did not see a reason to object against a separate binding for BT. Whether wifi and bt are
on the same device does not seem like something that must be expressed in
DT. The physical state may help in determining DT bindings, but it should
not be mandatory in my opinion.Quoted 2 lines
We don't need it in DT until we do. Soon as there is some some interdependence, something in DT will be needed.
Agree.
Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
+ a few more DT maintainers (and frequent reviewers) as this is a common issue only affecting every single mobile platform.
Quoted 172 lines · Arend van Spriel
Quoted 171 lines · Arend van Spriel
Quoted 167 lines · Rob Herring
Quoted 156 lines · Arend van Spriel
Quoted 141 lines · Rob Herring
Quoted 23 lines · Ilya Faenson
Hi Rob.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rob Herring
Sent: Thursday, June 18, 2015 3:41 PM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 3 lines · Ilya Faenson
Hi Rob,
Quoted 5 lines
Your emails are base64 encoded. They should be plain text for the list.
IF: The Outlook is configured to respond in the sender's format. I therefore respond in the encoding you've used.
I assure you that that is not the case or I would be banished from lists by now. Outlook is generally incapable of correctly sending mails to lists. The reply header above is one aspect of that. The other problem is your replies don't get wrapped and prefixed properly. That could be my client I guess, but *all* other mails are fine.
My sent mails have:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printableQuoted 65 lines
Quoted 15 lines
-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: Thursday, June 18, 2015 11:03 AM
To: Ilya Faenson
Cc: [email protected]; Arend Van Spriel; [email protected]; [email protected]
Subject: Re: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindingsQuoted 3 lines · Ilya Faenson
+ devicetree lists
[...]
Quoted 19 lines
Quoted 8 lines
diff --git
a/Documentation/devicetree/bindings/net/bluetooth/btbcm.txtb/Documentation/devicetree/bindings/net/bluetooth/btbcm.txtnew file mode 100644
index 0000000..5dbcd57Documentation/devicetree/bindings/net/bluetooth/btbcm.txt line 6
Quoted 6 lines
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +6
-0@@ -0,0 +1,86 @@ +btbcm +------ + +Required properties: + + - compatible : must be "brcm,brcm-bt-uart".You need to describe the chip, not the interface.
Quoted 1 line
IF: This driver is for all Broadcom Bluetooth UART based chips.
BT only chips? Most/many Broadcom chips are combo chips. I understand the driver for BT is *mostly* separate from other chip functions like WiFi, GPS and NFC, but the h/w is a single chip. I say most because likely there are some parts shared: a voltage rail, reset line, or power down line. I think some can do BT over the SDIO interface too, so the interface may be shared. The DT is a description of the h/w (i.e. what part # for a chip) and not a driver data structure. You need to describe the whole chip in the binding. It is a Linux problem if there needs to be multiple separate drivers.
IF: Defining complete DT description for the Broadcom combo chips for multiple interfaces is well beyond the scope of what I am doing. I just need
to define a DT node for the input and output GPIOs connected to the BT UART
chip. BT may or may not be part of the combo chip: it does not really matter
for this exercise. I thought I would take this opportunity to place some BT
device parameters into that node as well. If you're not comfortable with
this, I could just call it a "GPIO set" to avoid mentioning BT andQuoted 9 lines
UART at
all but it would make little sense. Still, I could consider it. Would you
have "GPIO set" recommendations? Alternatively, NFC Marvell code you're
referring to has parameters configured as Linux module parameters. I could
do the same too, avoiding this device tree discussion. Let me know.I don't completely follow what you mean by "GPIO set", but I'm guessing that is not the right path.
Quoted 12 lines
Generally speaking (pontification hat on :-)), what you're trying to do
(description of the whole chip) is well beyond what say ACPI has done (I was
involved some in the BT ACPI exercise a few years ago). BT UART interface is
described in ACPI independently of other parts of the same combo chip. Requirements like that slow down the DT development in my opinion as companies are understandably reluctant to work with unrealistic goals. End
of pontification. :-)ACPI and DT are very different models in terms of abstraction and governance. I'm not going to hash through all the details.
Quoted 10 lines
I'm not necessarily saying we have to have a single node, but that is my default position. You have convince me that the functions are completely independent and I cannot judge that if you are completely ignoring the WiFi part. From Broadcom chips I've worked with, the supplies at least are shared (something ACPI does not expose). Perhaps we could fudge that and just require the same supply has to be connected to each half. I still worry there could be other internal inter-dependencies. Perhaps BT requires the SDIO clock to be active or something like that. Maybe not on Broadcom chips, but on other vendors and I have to care about them all.
Quoted 2 lines
All Broadcom combo chips that I know of have separate supplies, ie. wl-reg-on and bt-reg-on. There already is a binding present for the wifi
GPIOs are not supplies. For the module I'm working with (43340 based) there is a single VDDIO and VBAT supplies which are shared. Now whether the module or the chip are tying things together, I don't know. There is also a 32kHz clock input. Is that part of WiFi or BT?
Quoted 3 lines
Quoted 3 lines
True and I see where you are going here. The 32kHz clock is input for low-power oscillator in the chip. That LPO provides clock for the interconnect in the chip so it is not part of wifi nor bt.
We could handle this by routing clocks and regulators to every sub node. A device with a shared GPIO (or any resource without refcounting) would be a problem. Perhaps this is good enough. This seemed to be the conclusion on earlier discussions[1].
Primarily, I just want to see the whole chip considered and thought around any complications from shared resources. We can't just do the easy part now and ignore the hard parts that cause changes later.
I'm not sure how we would handle a shared reset line. Perhaps the first one to claim it wins control.
Quoted 3 lines
Hi Rob,
Haven't seen much follow up so how to move forward here.
Sorry, been (and still am) out on vacation.
Quoted 8 lines
We could go for a
devicetree node covering all functional entities on the device. However, we are making the chipset and users more often as not end up with a module that some manufacturer cooked up. So whether signals are optional or not is hard to say for us. Making them optional by default seems safest.So could something like below work? Just wanted to know your opinion before moving in that direction.
It does have the advantage of having the full chip described in one place, but there are some issues.
Quoted 3 lines
bcm43341: {
compatible: 'brcm,bcm43340';
brcm,lpo-clock: <&32khz_clk>;What driver would handle this and instantiate the sub devices? An MFD driver?
If we place all the child nodes under their respective hosts and had a chip/module level node separately, we would then potentially have probe ordering issues (probably solvable though).
Quoted 4 lines
:
brcm_wifi: {
compatible: "brcm,bcm4329-fmac";
wifi-port: <&mmc3>;This should be something generic like "mmc-parent".
This is a departure from how the wifi part is currently done. We could take the stance that since there are no dts files actually using the binding, we can change it breaking compatibility (if not upstream it doesn't exist). Or we need to maintain both. Other combo chips such as TI have the WiFi portion under SDIO host node.
The other issue potentially is does the SDIO host need to be able to find the children easily. I think the power on the chip first so the SDIO host can detect it issue is one example. We also have no way to define which SDIO function this is. Putting the reg property here would not make sense. So perhaps the phandle needs to go the other way around having an mmc sub-node point to here.
So I think we need to keep the SDIO child node.
Quoted 5 lines
:
}
brcm_bt: {
compatible: "brcm,bcm43xx-bt-uart";
bt-port: <&uart1>;This should also be a generic name such as "uart". This needs to be settled at wider scope of how we describe UART slave devices. It seems to be a popular topic recently with yet another posting in the last few days[2].
Thinking about different potential options now for a few hours, I think we should just continue with having separate nodes for each function under the respective host interface. The complicated cases may just have to be solved with code rather than DT bindings.
Rob
Quoted 9 lines
:
}
brcm_nfc: {
compatible: "brcm,bcm43340-nfc";
nfc-port: <&uart2>;
:
}
}[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-January/226343.html
[2] http://www.spinics.net/lists/linux-serial/msg18034.html
RE: FW: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
In reply to Rob HerringSGkgUm9iLA0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogUm9iIEhlcnJpbmcg W21haWx0bzpyb2JoZXJyaW5nMkBnbWFpbC5jb21dIA0KU2VudDogRnJpZGF5LCBKdW5lIDE5LCAy MDE1IDExOjQ4IEFNDQpUbzogSWx5YSBGYWVuc29uDQpDYzogbWFyY2VsQGhvbHRtYW5uLm9yZzsg QXJlbmQgVmFuIFNwcmllbDsgZGV2aWNldHJlZUB2Z2VyLmtlcm5lbC5vcmc7IGxpbnV4LWJsdWV0 b290aEB2Z2VyLmtlcm5lbC5vcmcNClN1YmplY3Q6IFJlOiBGVzogW1BBVENIIHY0IDEvNF0gQnJv YWRjb20gQmx1ZXRvb3RoIFVBUlQgRGV2aWNlIFRyZWUgYmluZGluZ3MNCg0KT24gVGh1LCBKdW4g MTgsIDIwMTUgYXQgMzozNyBQTSwgSWx5YSBGYWVuc29uIDxpZmFlbnNvbkBicm9hZGNvbS5jb20+ IHdyb3RlOg0KPiBIaSBSb2IuDQo+DQo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mUgYSBjb25uZWN0aW9uIGJldHdlZW4gYSBob3N0IHVhcnQNCmFu ZCBhIGRldmljZSBjb25uZWN0ZWQgdG8gdGhlIHVhcnQgKEJULCBORkMsIEdQUywgZXRjLikuIFlv dSBhcmUgZG9pbmcNCnRoaXMgd2l0aCB5b3VyICJ0dHkiIHByb3BlcnR5LiBNeSBnb2FsIGFuZCBy ZXF1aXJlbWVudCBpcyB0aGF0IHRoaXMNCmNvbm5lY3Rpb24gYmUgZGVzY3JpYmVkIGluIERUIGlu IHRoZSBzYW1lIHdheSByZWdhcmRsZXNzIG9mIHRoZSBkZXZpY2UNCmF0dGFjaGVkLiBKdXN0IGxp a2UgYWxsIEkyQyBkZXZpY2UgY29ubmVjdGlvbnMgYXJlIGRlc2NyaWJlZCBieSBiZWluZw0KY2hp bGQgbm9kZXMgdW5kZXIgdGhlIEkyQyBob3N0IHJlZ2FyZGxlc3Mgb2YgdGhlIHR5cGUgb2YgSTJD IGRldmljZQ0KYXR0YWNoZWQuDQoNCklGOiBBbGwgZ29vZCBwb2ludHMsIFJvYi4gSSB3aWxsIGNl cnRhaW5seSBnZXQgcmlkIG9mIHRoZSB0dHkgcHJvcGVydHkgaWYgSSBjYW4gbWFrZSB0aGUgY2hp bGQgZGV2aWNlIGlkZWEgd29yay4gTXkgY29tcGxpY2F0aW9uIGlzIGluIHRoZSBuZWVkIHRvIG1h cCBzYXkgdGhlIERUIGRldmljZSBwYXJlbnQgKFVBUlQpIGludG8gdGhlIHR0eV9zdHJ1Y3QgdXNl ZCBieSB0aGUgTGludXggQmx1ZVogcHJvdG9jb2wuIEFueSBpZGVhcyBvbiBob3cgdG8gaW1wbGVt ZW50IHRoYXQgPyBNYW55IHRoYW5rcyENCg0KUm9iDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
Re: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
In reply to Ilya FaensonDocumentation/devicetree/bindings/net/bluetooth/btbcm.txt line 15
Quoted 7 lines · Ilya Faenson
Documentation/devicetree/bindings/net/bluetooth/btbcm.txt new file +7
-0+Optional properties: + + - bt-host-wake-gpios : bt-host-wake input GPIO to be used as an interrupt. + + - bt-wake-gpios : bt-wake output GPIO to be used to suspend / resume device. + + - bt-reg-on-gpios : reg-on output GPIO to be used to power device on/off.
Shouldn't this be modelled as a regulator instead? What if the board drives a PMIC output to provide power to the BT interface?
RE: [PATCH v4 1/4] Broadcom Bluetooth UART Device Tree bindings
SGkgRmFiaW8sDQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiBGYWJpbyBFc3Rl dmFtIFttYWlsdG86ZmVzdGV2YW1AZ21haWwuY29tXSANClNlbnQ6IEZyaWRheSwgSnVuZSAxOSwg MjAxNSAzOjIzIFBNDQpUbzogSWx5YSBGYWVuc29uDQpDYzogTWFyY2VsIEhvbHRtYW5uOyBsaW51 eC1ibHVldG9vdGhAdmdlci5rZXJuZWwub3JnOyBBcmVuZCBWYW4gU3ByaWVsDQpTdWJqZWN0OiBS ZTogW1BBVENIIHY0IDEvNF0gQnJvYWRjb20gQmx1ZXRvb3RoIFVBUlQgRGV2aWNlIFRyZWUgYmlu ZGluZ3MNCg0KT24gV2VkLCBKdW4gMTcsIDIwMTUgYXQgNjozMCBQTSwgSWx5YSBGYWVuc29uIDxp ZmFlbnNvbkBicm9hZGNvbS5jb20+IHdyb3RlOg0KDQo+ICtPcHRpb25hbCBwcm9wZXJ0aWVzOg0K PiArDQo+ICsgIC0gYnQtaG9zdC13YWtlLWdwaW9zIDogYnQtaG9zdC13YWtlIGlucHV0IEdQSU8g dG8gYmUgdXNlZCBhcyBhbiBpbnRlcnJ1cHQuDQo+ICsNCj4gKyAgLSBidC13YWtlLWdwaW9zIDog YnQtd2FrZSBvdXRwdXQgR1BJTyB0byBiZSB1c2VkIHRvIHN1c3BlbmQgLyByZXN1bWUgZGV2aWNl Lg0KPiArDQo+ICsgIC0gYnQtcmVnLW9uLWdwaW9zIDogcmVnLW9uIG91dHB1dCBHUElPIHRvIGJl IHVzZWQgdG8gcG93ZXIgZGV2aWNlIG9uL29mZi4NCg0KU2hvdWxkbid0IHRoaXMgYmUgbW9kZWxs ZWQgYXMgYSByZWd1bGF0b3IgaW5zdGVhZD8gV2hhdCBpZiB0aGUgYm9hcmQNCmRyaXZlcyBhIFBN SUMgb3V0cHV0IHRvIHByb3ZpZGUgcG93ZXIgdG8gdGhlIEJUIGludGVyZmFjZT8NCg0KSUY6IEkg dGhpbmsgdGhlIHJlZ3VsYXRvciB3b3VsZCBpbmRlZWQgYmUgYSBiZXR0ZXIgbmFtZSBmb3IgdGhl ICJHUElPIHNldCIgaWRlYSBJIG1lbnRpb25lZCBpbiBhIHNlcGFyYXRlIG1lc3NhZ2UgdG8gUm9i IEhlcnJpbmcuIDotKQ0KDQo=
PATCH v4 2/4 hci_uart: line discipline enhancements
In reply to Ilya FaensonAdded the ability to flow control the UART, improved the UART baud rate setting, transferred the speeds into line discipline from the protocol and introduced the tty init function.
--- drivers/bluetooth/hci_ldisc.c | 106 +++++++++++++++++++++++++++++++++++++++--- drivers/bluetooth/hci_uart.h | 7 +++ 2 files changed, 106 insertions(+), 7 deletions(-)
drivers/bluetooth/hci_ldisc.c +99 -7
@@ -266,6 +266,85 @@ static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb)return 0 ; } +/* Flow control or un-flow control the device */ +void hci_uart_set_flow_control (struct hci_uart *hu,bool enable) +{ +struct tty_struct *tty = hu->tty; +struct ktermios ktermios; +int status; +unsigned int set =0 ; +unsigned int clear =0 ; + +if (enable) { +/* Disable hardware flow control */ + ktermios = tty->termios; + ktermios.c_cflag &= ~CRTSCTS ; + status =tty_set_termios (tty, &ktermios); +BT_DBG ("Disabling hardware flow control: %s" , status ? +"failed" :"success" ); + +/* Clear RTS to prevent the device from sending */ +/* Most UARTs need OUT2 to enable interrupts */ + status = tty->driver->ops->tiocmget (tty); +BT_DBG ("Current tiocm 0x%x" , status); + + set &= ~(TIOCM_OUT2 |TIOCM_RTS ); + clear = ~set; + set &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + clear &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + status = tty->driver->ops->tiocmset (tty, set, clear); +BT_DBG ("Clearing RTS: %s" , status ?"failed" :"success" ); + }else { +/* Set RTS to allow the device to send again */ + status = tty->driver->ops->tiocmget (tty); +BT_DBG ("Current tiocm 0x%x" , status); + + set |= (TIOCM_OUT2 |TIOCM_RTS ); + clear = ~set; + set &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + clear &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + status = tty->driver->ops->tiocmset (tty, set, clear); +BT_DBG ("Setting RTS: %s" , status ?"failed" :"success" ); + +/* Re-enable hardware flow control */ + ktermios = tty->termios; + ktermios.c_cflag |=CRTSCTS ; + status =tty_set_termios (tty, &ktermios); +BT_DBG ("Enabling hardware flow control: %s" , status ? +"failed" :"success" ); + } +} + +void hci_uart_set_speeds (struct hci_uart *hu,unsigned int init_speed, +unsigned int oper_speed) +{ + hu->init_speed = init_speed; + hu->oper_speed = oper_speed; +} + +void hci_uart_init_tty (struct hci_uart *hu) +{ +struct tty_struct *tty = hu->tty; +struct ktermios ktermios; + +/* Bring the UART into a known 8 bits no parity hw fc state */ + ktermios = tty->termios; + ktermios.c_iflag &= ~(IGNBRK |BRKINT |PARMRK |ISTRIP + |INLCR |IGNCR |ICRNL |IXON ); + ktermios.c_oflag &= ~OPOST ; + ktermios.c_lflag &= ~(ECHO |ECHONL |ICANON |ISIG |IEXTEN ); + ktermios.c_cflag &= ~(CSIZE |PARENB ); + ktermios.c_cflag |=CS8 ; + ktermios.c_cflag |=CRTSCTS ; + +/* tty_set_termios() return not checked as it is always 0 */ +tty_set_termios (tty, &ktermios); +} +void hci_uart_set_baudrate (struct hci_uart *hu,unsigned int speed) {struct tty_struct *tty = hu->tty;
@@ -273,13 +352,13 @@ void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed) ktermios = tty->termios; ktermios.c_cflag &= ~CBAUD ; - ktermios.c_cflag |=BOTHER ;tty_termios_encode_baud_rate (&ktermios, speed, speed);/* tty_set_termios() return not checked as it is always 0 */ tty_set_termios (tty, &ktermios); -BT_DBG ("%s: New tty speed: %d" , hu->hdev->name, tty->termios.c_ispeed); +BT_DBG ("%s: New tty speeds: %d/%d" , hu->hdev->name, + tty->termios.c_ispeed, tty->termios.c_ospeed); }static int hci_uart_setup (struct hci_dev *hdev)
@@ -287,15 +366,28 @@ static int hci_uart_setup(struct hci_dev *hdev)struct hci_uart *hu =hci_get_drvdata (hdev);struct hci_rp_read_local_version *ver;struct sk_buff *skb; +unsigned int speed;int err; +/* Init speed if any */ + speed =0 ;if (hu->proto->init_speed) -hci_uart_set_baudrate (hu, hu->proto->init_speed); - -if (hu->proto->set_baudrate && hu->proto->oper_speed) { - err = hu->proto->set_baudrate (hu, hu->proto->oper_speed); + speed = hu->proto->init_speed; +else if (hu->init_speed) + speed = hu->init_speed; +if (speed) +hci_uart_set_baudrate (hu, speed); + +/* Operational speed if any */ + speed =0 ; +if (hu->proto->oper_speed) + speed = hu->proto->oper_speed; +else if (hu->oper_speed) + speed = hu->oper_speed; +if (hu->proto->set_baudrate && speed) { + err = hu->proto->set_baudrate (hu, speed);if (!err) -hci_uart_set_baudrate (hu, hu->proto->oper_speed); +hci_uart_set_baudrate (hu, speed); }if (hu->proto->setup)
drivers/bluetooth/hci_uart.h +7 -0
@@ -85,6 +85,9 @@ struct hci_uart {struct sk_buff *tx_skb;unsigned long tx_state;spinlock_t rx_lock; + +unsigned int init_speed; +unsigned int oper_speed; };/* HCI_UART proto flag bits */
@@ -99,7 +102,11 @@ 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_tx_wakeup (struct hci_uart *hu);int hci_uart_init_ready (struct hci_uart *hu); +void hci_uart_init_tty (struct hci_uart *hu);void hci_uart_set_baudrate (struct hci_uart *hu,unsigned int speed); +void hci_uart_set_flow_control (struct hci_uart *hu,bool enable); +void hci_uart_set_speeds (struct hci_uart *hu,unsigned int init_speed, +unsigned int oper_speed);#ifdef CONFIG_BT_HCIUART_H4 int h4_init (void );
Signature · 1 line
1.9.1
Marcel Holtmann
maintainerRe: [PATCH v4 2/4] hci_uart: line discipline enhancements
Hi Ilya,
Quoted 9 lines
Added the ability to flow control the UART, improved the UART baud rate setting, transferred the speeds into line discipline from the protocol and introduced the tty init function.
Signed-off-by Ilya Faenson <[email protected]>---
drivers/bluetooth/hci_ldisc.c| 106 +++++++++++++++++++++++++++++++++++++++---drivers/bluetooth/hci_uart.h| 7 +++2 files changed, 106 insertions(+), 7 deletions(-)
I applied this patch to bluetooth-next tree, but I had to amend it a little bit.
Please make sure the subject is prefixed with Bluetooth: all the time.
Quoted 14 lines
drivers/bluetooth/hci_ldisc.c +6
-0@@ -266,6 +266,85 @@ static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb)return 0 ; } +/* Flow control or un-flow control the device */ +void hci_uart_set_flow_control (struct hci_uart *hu,bool enable) +{ +struct tty_struct *tty = hu->tty; +struct ktermios ktermios; +int status;
drivers/bluetooth/hci_ldisc.c static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) · line 284
Quoted 10 lines
drivers/bluetooth/hci_ldisc.c +10
-0+unsigned int set =0 ; +unsigned int clear =0 ; + +if (enable) { +/* Disable hardware flow control */ + ktermios = tty->termios; + ktermios.c_cflag &= ~CRTSCTS ; + status =tty_set_termios (tty, &ktermios); +BT_DBG ("Disabling hardware flow control: %s" , status ? +"failed" :"success" );
I moved these into this
status ? "failed" : "success"
so that the conditional statement is on the same line.
Quoted 43 lines
drivers/bluetooth/hci_ldisc.c +43
-0+ +/* Clear RTS to prevent the device from sending */ +/* Most UARTs need OUT2 to enable interrupts */ + status = tty->driver->ops->tiocmget (tty); +BT_DBG ("Current tiocm 0x%x" , status); + + set &= ~(TIOCM_OUT2 |TIOCM_RTS ); + clear = ~set; + set &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + clear &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + status = tty->driver->ops->tiocmset (tty, set, clear); +BT_DBG ("Clearing RTS: %s" , status ?"failed" :"success" ); + }else { +/* Set RTS to allow the device to send again */ + status = tty->driver->ops->tiocmget (tty); +BT_DBG ("Current tiocm 0x%x" , status); + + set |= (TIOCM_OUT2 |TIOCM_RTS ); + clear = ~set; + set &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + clear &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + status = tty->driver->ops->tiocmset (tty, set, clear); +BT_DBG ("Setting RTS: %s" , status ?"failed" :"success" ); + +/* Re-enable hardware flow control */ + ktermios = tty->termios; + ktermios.c_cflag |=CRTSCTS ; + status =tty_set_termios (tty, &ktermios); +BT_DBG ("Enabling hardware flow control: %s" , status ? +"failed" :"success" ); + } +} + +void hci_uart_set_speeds (struct hci_uart *hu,unsigned int init_speed, +unsigned int oper_speed) +{ + hu->init_speed = init_speed; + hu->oper_speed = oper_speed; +}
drivers/bluetooth/hci_ldisc.c static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) · line 337
Quoted 10 lines
drivers/bluetooth/hci_ldisc.c +10
-0+ +void hci_uart_init_tty (struct hci_uart *hu) +{ +struct tty_struct *tty = hu->tty; +struct ktermios ktermios; + +/* Bring the UART into a known 8 bits no parity hw fc state */ + ktermios = tty->termios; + ktermios.c_iflag &= ~(IGNBRK |BRKINT |PARMRK |ISTRIP + |INLCR |IGNCR |ICRNL |IXON );
I fixed this up to have the | on the previous line and then INCLR line up with IGNBRK.
Quoted 36 lines
drivers/bluetooth/hci_ldisc.c +13
-2+ ktermios.c_oflag &= ~OPOST ; + ktermios.c_lflag &= ~(ECHO |ECHONL |ICANON |ISIG |IEXTEN ); + ktermios.c_cflag &= ~(CSIZE |PARENB ); + ktermios.c_cflag |=CS8 ; + ktermios.c_cflag |=CRTSCTS ; + +/* tty_set_termios() return not checked as it is always 0 */ +tty_set_termios (tty, &ktermios); +} +void hci_uart_set_baudrate (struct hci_uart *hu,unsigned int speed) {struct tty_struct *tty = hu->tty;@@ -273,13 +352,13 @@ void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed) ktermios = tty->termios; ktermios.c_cflag &= ~CBAUD ; - ktermios.c_cflag |=BOTHER ;tty_termios_encode_baud_rate (&ktermios, speed, speed);/* tty_set_termios() return not checked as it is always 0 */ tty_set_termios (tty, &ktermios); -BT_DBG ("%s: New tty speed: %d" , hu->hdev->name, tty->termios.c_ispeed); +BT_DBG ("%s: New tty speeds: %d/%d" , hu->hdev->name, + tty->termios.c_ispeed, tty->termios.c_ospeed); }static int hci_uart_setup (struct hci_dev *hdev)@@ -287,15 +366,28 @@ static int hci_uart_setup(struct hci_dev *hdev)struct hci_uart *hu =hci_get_drvdata (hdev);struct hci_rp_read_local_version *ver;struct sk_buff *skb; +unsigned int speed;int err;
drivers/bluetooth/hci_ldisc.c static int hci_uart_setup(struct hci_dev *hdev) · line 377
Quoted 10 lines
drivers/bluetooth/hci_ldisc.c +5
-4+/* Init speed if any */ + speed =0 ;if (hu->proto->init_speed) -hci_uart_set_baudrate (hu, hu->proto->init_speed); - -if (hu->proto->set_baudrate && hu->proto->oper_speed) { - err = hu->proto->set_baudrate (hu, hu->proto->oper_speed); + speed = hu->proto->init_speed; +else if (hu->init_speed) + speed = hu->init_speed;
I added the speed assignment as else statement
else speed = 0;
Quoted 22 lines
drivers/bluetooth/hci_ldisc.c +12
-1+if (speed) +hci_uart_set_baudrate (hu, speed); + +/* Operational speed if any */ + speed =0 ; +if (hu->proto->oper_speed) + speed = hu->proto->oper_speed; +else if (hu->oper_speed) + speed = hu->oper_speed; +if (hu->proto->set_baudrate && speed) { + err = hu->proto->set_baudrate (hu, speed);if (!err) -hci_uart_set_baudrate (hu, hu->proto->oper_speed); +hci_uart_set_baudrate (hu, speed); }if (hu->proto->setup)drivers/bluetooth/hci_uart.h +0
-0
drivers/bluetooth/hci_uart.h struct hci_uart { · line 92
Quoted 8 lines
drivers/bluetooth/hci_uart.h +3
-0@@ -85,6 +85,9 @@ struct hci_uart {struct sk_buff *tx_skb;unsigned long tx_state;spinlock_t rx_lock; + +unsigned int init_speed; +unsigned int oper_speed; };
Regards
Marcel
RE: [PATCH v4 2/4] hci_uart: line discipline enhancements
Thanks a lot, Marcel.
-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: Wednesday, June 17, 2015 5:51 PM
To: Ilya Faenson
Cc: BlueZ development; Arend Van Spriel
Subject: Re: [PATCH v4 2/4] hci_uart: line discipline enhancements
Hi Ilya,
Quoted 9 lines
Added the ability to flow control the UART, improved the UART baud rate setting, transferred the speeds into line discipline from the protocol and introduced the tty init function.
Signed-off-by Ilya Faenson <[email protected]>---
drivers/bluetooth/hci_ldisc.c| 106 +++++++++++++++++++++++++++++++++++++++---drivers/bluetooth/hci_uart.h| 7 +++2 files changed, 106 insertions(+), 7 deletions(-)
I applied this patch to bluetooth-next tree, but I had to amend it a little bit.
Please make sure the subject is prefixed with Bluetooth: all the time.
Quoted 14 lines
drivers/bluetooth/hci_ldisc.c +6
-0@@ -266,6 +266,85 @@ static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb)return 0 ; } +/* Flow control or un-flow control the device */ +void hci_uart_set_flow_control (struct hci_uart *hu,bool enable) +{ +struct tty_struct *tty = hu->tty; +struct ktermios ktermios; +int status;
drivers/bluetooth/hci_ldisc.c static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) · line 284
Quoted 10 lines
drivers/bluetooth/hci_ldisc.c +10
-0+unsigned int set =0 ; +unsigned int clear =0 ; + +if (enable) { +/* Disable hardware flow control */ + ktermios = tty->termios; + ktermios.c_cflag &= ~CRTSCTS ; + status =tty_set_termios (tty, &ktermios); +BT_DBG ("Disabling hardware flow control: %s" , status ? +"failed" :"success" );
I moved these into this
status ? "failed" : "success"
so that the conditional statement is on the same line.
Quoted 43 lines
drivers/bluetooth/hci_ldisc.c +43
-0+ +/* Clear RTS to prevent the device from sending */ +/* Most UARTs need OUT2 to enable interrupts */ + status = tty->driver->ops->tiocmget (tty); +BT_DBG ("Current tiocm 0x%x" , status); + + set &= ~(TIOCM_OUT2 |TIOCM_RTS ); + clear = ~set; + set &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + clear &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + status = tty->driver->ops->tiocmset (tty, set, clear); +BT_DBG ("Clearing RTS: %s" , status ?"failed" :"success" ); + }else { +/* Set RTS to allow the device to send again */ + status = tty->driver->ops->tiocmget (tty); +BT_DBG ("Current tiocm 0x%x" , status); + + set |= (TIOCM_OUT2 |TIOCM_RTS ); + clear = ~set; + set &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + clear &=TIOCM_DTR |TIOCM_RTS |TIOCM_OUT1 | +TIOCM_OUT2 |TIOCM_LOOP ; + status = tty->driver->ops->tiocmset (tty, set, clear); +BT_DBG ("Setting RTS: %s" , status ?"failed" :"success" ); + +/* Re-enable hardware flow control */ + ktermios = tty->termios; + ktermios.c_cflag |=CRTSCTS ; + status =tty_set_termios (tty, &ktermios); +BT_DBG ("Enabling hardware flow control: %s" , status ? +"failed" :"success" ); + } +} + +void hci_uart_set_speeds (struct hci_uart *hu,unsigned int init_speed, +unsigned int oper_speed) +{ + hu->init_speed = init_speed; + hu->oper_speed = oper_speed; +}
drivers/bluetooth/hci_ldisc.c static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) · line 337
Quoted 10 lines
drivers/bluetooth/hci_ldisc.c +10
-0+ +void hci_uart_init_tty (struct hci_uart *hu) +{ +struct tty_struct *tty = hu->tty; +struct ktermios ktermios; + +/* Bring the UART into a known 8 bits no parity hw fc state */ + ktermios = tty->termios; + ktermios.c_iflag &= ~(IGNBRK |BRKINT |PARMRK |ISTRIP + |INLCR |IGNCR |ICRNL |IXON );
I fixed this up to have the | on the previous line and then INCLR line up with IGNBRK.
Quoted 36 lines
drivers/bluetooth/hci_ldisc.c +13
-2+ ktermios.c_oflag &= ~OPOST ; + ktermios.c_lflag &= ~(ECHO |ECHONL |ICANON |ISIG |IEXTEN ); + ktermios.c_cflag &= ~(CSIZE |PARENB ); + ktermios.c_cflag |=CS8 ; + ktermios.c_cflag |=CRTSCTS ; + +/* tty_set_termios() return not checked as it is always 0 */ +tty_set_termios (tty, &ktermios); +} +void hci_uart_set_baudrate (struct hci_uart *hu,unsigned int speed) {struct tty_struct *tty = hu->tty;@@ -273,13 +352,13 @@ void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed) ktermios = tty->termios; ktermios.c_cflag &= ~CBAUD ; - ktermios.c_cflag |=BOTHER ;tty_termios_encode_baud_rate (&ktermios, speed, speed);/* tty_set_termios() return not checked as it is always 0 */ tty_set_termios (tty, &ktermios); -BT_DBG ("%s: New tty speed: %d" , hu->hdev->name, tty->termios.c_ispeed); +BT_DBG ("%s: New tty speeds: %d/%d" , hu->hdev->name, + tty->termios.c_ispeed, tty->termios.c_ospeed); }static int hci_uart_setup (struct hci_dev *hdev)@@ -287,15 +366,28 @@ static int hci_uart_setup(struct hci_dev *hdev)struct hci_uart *hu =hci_get_drvdata (hdev);struct hci_rp_read_local_version *ver;struct sk_buff *skb; +unsigned int speed;int err;
drivers/bluetooth/hci_ldisc.c static int hci_uart_setup(struct hci_dev *hdev) · line 377
Quoted 10 lines
drivers/bluetooth/hci_ldisc.c +5
-4+/* Init speed if any */ + speed =0 ;if (hu->proto->init_speed) -hci_uart_set_baudrate (hu, hu->proto->init_speed); - -if (hu->proto->set_baudrate && hu->proto->oper_speed) { - err = hu->proto->set_baudrate (hu, hu->proto->oper_speed); + speed = hu->proto->init_speed; +else if (hu->init_speed) + speed = hu->init_speed;
I added the speed assignment as else statement
else speed = 0;
Quoted 22 lines
drivers/bluetooth/hci_ldisc.c +12
-1+if (speed) +hci_uart_set_baudrate (hu, speed); + +/* Operational speed if any */ + speed =0 ; +if (hu->proto->oper_speed) + speed = hu->proto->oper_speed; +else if (hu->oper_speed) + speed = hu->oper_speed; +if (hu->proto->set_baudrate && speed) { + err = hu->proto->set_baudrate (hu, speed);if (!err) -hci_uart_set_baudrate (hu, hu->proto->oper_speed); +hci_uart_set_baudrate (hu, speed); }if (hu->proto->setup)drivers/bluetooth/hci_uart.h +0
-0
drivers/bluetooth/hci_uart.h struct hci_uart { · line 92
Quoted 8 lines
drivers/bluetooth/hci_uart.h +3
-0@@ -85,6 +85,9 @@ struct hci_uart {struct sk_buff *tx_skb;unsigned long tx_state;spinlock_t rx_lock; + +unsigned int init_speed; +unsigned int oper_speed; };
Regards
Marcel
Re: [PATCH v4 2/4] hci_uart: line discipline enhancements
Hello Marcel and Ilya,
Quoted 10 lines · Ilya Faenson
Thanks a lot, Marcel.
-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: Wednesday, June 17, 2015 5:51 PM
To: Ilya Faenson
Cc: BlueZ development; Arend Van Spriel
Subject: Re: [PATCH v4 2/4]hci_uart: line discipline enhancementsHi Ilya,
<snip>
Quoted 20 lines
Quoted 7 lines
drivers/bluetooth/hci_ldisc.c +1
-0@@ -287,15 +366,28 @@ static int hci_uart_setup(struct hci_dev *hdev)struct hci_uart *hu =hci_get_drvdata (hdev);struct hci_rp_read_local_version *ver;struct sk_buff *skb; +unsigned int speed;int err;drivers/bluetooth/hci_ldisc.c static int hci_uart_setup(struct hci_dev *hdev) · line 377
Quoted 10 lines
drivers/bluetooth/hci_ldisc.c +5
-4+/* Init speed if any */ + speed =0 ;if (hu->proto->init_speed) -hci_uart_set_baudrate (hu, hu->proto->init_speed); - -if (hu->proto->set_baudrate && hu->proto->oper_speed) { - err = hu->proto->set_baudrate (hu, hu->proto->oper_speed); + speed = hu->proto->init_speed; +else if (hu->init_speed) + speed = hu->init_speed;I added the speed assignment as else statement
Quoted 2 lines
else speed = 0;
Afaiu, with this change hu->proto->*speed will always be used for all bcm device. I think hu->*speed should be used if exist or hu->proto->*speed, so the test should be swapped.
The equivalent change is needed in bcm_setup() of hci_bcm.c.
Ilya, do you want to do it or should I send a patch ?
Regards
Fred
Marcel Holtmann
maintainerRe: [PATCH v4 2/4] hci_uart: line discipline enhancements
Hi Fred,
Quoted 24 lines
<snip>
Quoted 20 lines
Quoted 7 lines
drivers/bluetooth/hci_ldisc.c +1
-0@@ -287,15 +366,28 @@ static int hci_uart_setup(struct hci_dev *hdev)struct hci_uart *hu =hci_get_drvdata (hdev);struct hci_rp_read_local_version *ver;struct sk_buff *skb; +unsigned int speed;int err;drivers/bluetooth/hci_ldisc.c static int hci_uart_setup(struct hci_dev *hdev) · line 377
Quoted 10 lines
drivers/bluetooth/hci_ldisc.c +5
-4+/* Init speed if any */ + speed =0 ;if (hu->proto->init_speed) -hci_uart_set_baudrate (hu, hu->proto->init_speed); - -if (hu->proto->set_baudrate && hu->proto->oper_speed) { - err = hu->proto->set_baudrate (hu, hu->proto->oper_speed); + speed = hu->proto->init_speed; +else if (hu->init_speed) + speed = hu->init_speed;I added the speed assignment as else statement
Quoted 2 lines
else speed = 0;
Quoted 6 lines
Afaiu, with this change hu->proto->*speed will always be used for all bcm device. I think hu->*speed should be used if exist or hu->proto->*speed, so the test should be swapped.
The equivalent change is needed in
bcm_setup()ofhci_bcm.c.Ilya, do you want to do it or should I send a patch ?
if I screwed this up, then please send a patch right away.
Regards
Marcel
PATCH v4 3/4 btbcm_uart: Broadcom UART Platform Driver
In reply to Ilya FaensonIntroduce the device tree enumerated Broadcom Bluetooth UART driver:
Retrieves the device parameters from the node Manages the device's power on/off and suspend/resume GPIOs Processes wakeup interrupts
Maintains the list of bluetooth UART devices
Maps device instances to BlueZ protocol instances Manages the device upon platform suspend/resume actions Provides the interface for the BlueZ protocol actions
--- drivers/bluetooth/Makefile | 1 + drivers/bluetooth/btbcm_uart.c | 538 +++++++++++++++++++++++++++++++++++++++++ drivers/bluetooth/btbcm_uart.h | 74 ++++++ 3 files changed, 613 insertions(+) create mode 100644 drivers/bluetooth/btbcm_uart.c create mode 100644 drivers/bluetooth/btbcm_uart.h
drivers/bluetooth/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-$(CONFIG_BT_MRVL) += btmrvl.o obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o obj-$(CONFIG_BT_WILINK) += btwilink.o obj-$(CONFIG_BT_BCM) += btbcm.o +obj-$(CONFIG_BT_BCM) += btbcm_uart.o obj-$(CONFIG_BT_RTL) += btrtl.o btmrvl-y := btmrvl_main.o
drivers/bluetooth/btbcm_uart.c new file +538 -0
538 lines not on this page · raw message
drivers/bluetooth/btbcm_uart.h new file +74 -0
74 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 4/4 hci_bcm: Broadcom UART protocol enhancements
In reply to Ilya FaensonMerge Broadcom protocol with the existing implementation, providing:
UART setup
Idle suspend
Suspend/resume upon platform suspend/resume Integration with the Broadcom platform device
PCM configuration
--- drivers/bluetooth/hci_bcm.c | 340 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 332 insertions(+), 8 deletions(-)
drivers/bluetooth/hci_bcm.c +332 -8
@@ -3,6 +3,7 @@* Bluetooth HCI UART driver for Broadcom devices * * Copyright (C) 2015 Intel Corporation +* Copyright (C) 2015 Broadcom Corporation * * * This program is free software; you can redistribute it and/or modify
@@ -24,6 +25,7 @@#include <linux/kernel.h> #include <linux/errno.h> #include <linux/skbuff.h> +#include <linux/tty.h> #include <linux/firmware.h> #include <net/bluetooth/bluetooth.h>
@@ -31,12 +33,161 @@#include "btbcm.h" #include "hci_uart.h" +#include "btbcm_uart.h" struct bcm_data {struct sk_buff *rx_skb;struct sk_buff_head txq; +struct hci_uart *hu; + +bool is_suspended;/* suspend/resume flag */ + +struct timer_list timer;/* idle timer */ + +struct btbcm_uart_params params;/* device parameters */ +void *device_context;/* ACPI/DT device context */ }; +/* Suspend/resume synchronization mutex */ +static DEFINE_MUTEX (power_lock); + +/* Useful timer restart helper */ +static void restart_idle_timer (struct hci_uart *hu) +{ +struct bcm_data *h4 = hu->priv; + +mod_timer (&h4->timer, jiffies + +msecs_to_jiffies (h4->params.idle_timeout_in_secs *1000 )); +} + +/* Callbacks from the BCMBT_UART device +*/ + +/* The platform is suspending. Stop UART activity */ +static void suspend_notification (void *context) +{ +struct hci_uart *hu = (struct hci_uart *)context; +struct bcm_data *h4 = hu->priv; + +BT_DBG ("suspend: is_suspended %d" , h4->is_suspended); + +if (!h4->params.configure_sleep) +return ; + +if (!h4->is_suspended) { +if (h4->params.manual_fc) +hci_uart_set_flow_control (hu, true); + +/* Once this callback returns, driver suspends BT via GPIO */ + h4->is_suspended = true; + } +} + +/* +* The platform is resuming. Resume UART activity. +*/ +static void resume_notification (void *context) +{ +struct hci_uart *hu = (struct hci_uart *)context; +struct bcm_data *h4 = hu->priv; + +BT_DBG ("resume: is_suspended %d" , h4->is_suspended); + +if (!h4->params.configure_sleep) +return ; + +/* When this callback executes, the device has woken up already */ +if (h4->is_suspended) { + h4->is_suspended = false; + +if (h4->params.manual_fc) +hci_uart_set_flow_control (hu, false); + } + +/* If we're resumed, the idle timer must be running */ +restart_idle_timer (hu); +} + +/* +* The BT device is resuming. Resume UART activity if suspended +*/ +static void wakeup_notification (void *context) +{ +struct hci_uart *hu = (struct hci_uart *)context; +struct bcm_data *h4 = hu->priv; + +BT_DBG ("wakeup: is_suspended %d" , h4->is_suspended); + +if (!h4->params.configure_sleep) +return ; + +if (h4->is_suspended) { +if (h4->params.manual_fc) +hci_uart_set_flow_control (hu, false); + + h4->is_suspended = false; + } + +/* If we're resumed, the idle timer must be running */ +restart_idle_timer (hu); +} + +/* +* Make sure we're awake +* (called when the resumed state is required) +*/ +static void bcm_ensure_wakeup (struct hci_uart *hu) +{ +struct bcm_data *h4 = hu->priv; + +if (!h4->params.configure_sleep) +return ; + +/* Suspend/resume operations are serialized */ +mutex_lock (&power_lock); + +/* Nothing to do if resumed already */ +if (!h4->is_suspended) { +mutex_unlock (&power_lock); + +/* Just reset the timer */ +restart_idle_timer (hu); +return ; + } + +/* Wakeup the device */ +btbcm_uart_resume (h4->device_context); + +/* Unflow control the port if configured */ +resume_notification (hu); + +mutex_unlock (&power_lock); +} + +/* +* Idle timer callback +*/ +static void bcm_idle_timeout (unsigned long arg) +{ +struct hci_uart *hu = (struct hci_uart *)arg; +struct bcm_data *h4 = hu->priv; + +BT_DBG ("idle_timeout: hu %p" , hu); + +/* Suspend/resume operations are serialized */ +mutex_lock (&power_lock); + +if (!h4->is_suspended) { +/* Flow control the port if configured */ +suspend_notification (hu); + +/* Suspend the device */ +btbcm_uart_suspend (h4->device_context); + } + +mutex_unlock (&power_lock); +} +static int bcm_set_baudrate (struct hci_uart *hu,unsigned int speed) {struct hci_dev *hdev = hu->hdev;
@@ -89,6 +240,8 @@ static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)static int bcm_open (struct hci_uart *hu) {struct bcm_data *bcm; +struct btbcm_uart_callbacks callbacks; +struct tty_struct *tty = hu->tty;BT_DBG ("hu %p" , hu);
@@ -99,6 +252,48 @@ static int bcm_open(struct hci_uart *hu)skb_queue_head_init (&bcm->txq); hu->priv = bcm; + bcm->hu = hu; + bcm->is_suspended = false; +memset (&bcm->params,0 ,sizeof (bcm->params)); + +/* Reset UART to a default state */ +hci_uart_init_tty (hu); + +/* Configure callbacks on the driver */ + callbacks.context = hu; +strcpy (callbacks.name, tty->name); + callbacks.suspend = suspend_notification; + callbacks.resume = resume_notification; + callbacks.wakeup = wakeup_notification; + bcm->device_context =btbcm_uart_set_callbacks (&callbacks); +if (!bcm->device_context) { +/* That is likely an indication of no bcm driver present */ +BT_DBG ("Callback set failure (no driver present)" ); + +/* Using speed defaults */ +hci_uart_set_speeds (hu,115200 ,3000000 ); +return 0 ; + } + +/* Retrieve device parameters */ +btbcm_uart_get_params (bcm->device_context, &bcm->params); +BT_DBG ("Context %p conf_sleep %d dev_actlow %d bt_actlow %d idle_t %d" , + bcm->device_context, bcm->params.configure_sleep, + bcm->params.dev_wake_active_low, bcm->params.bt_wake_active_low, + bcm->params.idle_timeout_in_secs); +hci_uart_set_speeds (hu,115200 , bcm->params.oper_speed); + +/* Cycle power to make sure the device is in the known state */ +btbcm_uart_poweroff (bcm->device_context); +btbcm_uart_poweron (bcm->device_context); + +/* Start the idle timer */ +if (bcm->params.configure_sleep) { +setup_timer (&bcm->timer, bcm_idle_timeout, (unsigned long )hu); +if (bcm->params.configure_sleep) +restart_idle_timer (hu); + } +return 0 ; }
@@ -108,6 +303,31 @@ static int bcm_close(struct hci_uart *hu)BT_DBG ("hu %p" , hu); +/* If we're being closed, we must suspend */ +if (bcm->params.configure_sleep) { +mutex_lock (&power_lock); + +if (!bcm->is_suspended) { +/* Flow control the port */ +suspend_notification (hu); + +/* Suspend the device */ +btbcm_uart_suspend (bcm->device_context); + } + +mutex_unlock (&power_lock); + +del_timer_sync (&bcm->timer); + } + +/* Power off the device if possible */ +if (bcm->device_context) { +btbcm_uart_poweroff (bcm->device_context); + +/* de-configure callbacks on the driver */ +btbcm_uart_reset_callbacks (bcm->device_context); + } +skb_queue_purge (&bcm->txq);kfree_skb (bcm->rx_skb);kfree (bcm);
@@ -129,9 +349,12 @@ static int bcm_flush(struct hci_uart *hu)static int bcm_setup (struct hci_uart *hu) { -char fw_name[64 ]; +char fw_name[128 ];const struct firmware *fw;int err; +struct sk_buff *skb; +struct bcm_data *h4 = hu->priv; +unsigned char time_slot_number =0 ;BT_DBG ("hu %p" , hu);
@@ -153,13 +376,110 @@ static int bcm_setup(struct hci_uart *hu) goto finalize; } -if (hu->proto->init_speed) -hci_uart_set_baudrate (hu, hu->proto->init_speed); +if (hu->init_speed) +hci_uart_set_baudrate (hu, hu->init_speed); -if (hu->proto->oper_speed) { - err =bcm_set_baudrate (hu, hu->proto->oper_speed); +if (hu->oper_speed) { + err =bcm_set_baudrate (hu, hu->oper_speed);if (!err) -hci_uart_set_baudrate (hu, hu->proto->oper_speed); +hci_uart_set_baudrate (hu, hu->oper_speed); + } + +/* Configure SCO PCM parameters */ +if (h4->params.configure_audio) { +struct bcm_set_pcm_int_params pcm_int_params; +struct bcm_set_pcm_format_params pcm_format_params; + +/* 0=PCM routing, 1=SCO over HCI */ + pcm_int_params.routing = h4->params.pcm_routing; +/* 0=128Kbps,1=256Kbps,2=512Kbps,3=1024Kbps,4=2048Kbps */ + pcm_int_params.rate = h4->params.pcm_incallbitclock; +/* short frame sync 0=short, 1=long */ + pcm_int_params.frame_sync = h4->params.pcm_shortframesync; +/* sync mode 0=slave, 1=master */ + pcm_int_params.sync_mode = h4->params.pcm_syncmode; +/* clock mode 0=slave, 1=master */ + pcm_int_params.clock_mode = h4->params.pcm_clockmode; + + skb =__hci_cmd_sync (hu->hdev,0xfc1c ,sizeof (pcm_int_params), + &pcm_int_params,HCI_INIT_TIMEOUT ); +if (IS_ERR (skb)) { + err =PTR_ERR (skb); +BT_ERR ("bcm_setup PCM INT VSC failed (%d)" , err); + goto finalize; + } +kfree_skb (skb); +BT_DBG ("bcm_setup PCM INT Parameters VSC succeeded" ); + +/* LSB_First 1=TRUE, 0=FALSE */ + pcm_format_params.lsb_first = h4->params.pcm_lsbfirst; +/* Fill_Value (use 0-7 for fill bits value) */ + pcm_format_params.fill_value = h4->params.pcm_fillvalue; +/* Fill_Method (2=sign extended) */ + pcm_format_params.fill_method = h4->params.pcm_fillmethod; +/* Fill_Num # of fill bits 0-3) */ + pcm_format_params.fill_num = h4->params.pcm_fillnum; +/* Right_Justify 1=TRUE, 0=FALSE */ + pcm_format_params.right_justify = h4->params.pcm_rightjustify; + + skb =__hci_cmd_sync (hu->hdev,0xfc1e , +sizeof (pcm_format_params), + &pcm_format_params,HCI_INIT_TIMEOUT ); +if (IS_ERR (skb)) { + err =PTR_ERR (skb); +BT_ERR ("bcm_setup PCM Format VSC failed (%d)" , + err); + goto finalize; + } +kfree_skb (skb); +BT_DBG ("bcm_setup PCM Format VSC succeeded" ); + + skb =__hci_cmd_sync (hu->hdev,0xfc22 ,sizeof (time_slot_number), + &time_slot_number,HCI_INIT_TIMEOUT ); +if (IS_ERR (skb)) { + err =PTR_ERR (skb); +BT_ERR ("bcm_setup SCO Time Slot VSC failed (%d)" , + err); + goto finalize; + } +kfree_skb (skb); +BT_DBG ("bcm_setup SCO Time Slot VSC succeeded" ); + } + +/* Configure device's suspend/resume operation */ +if (h4->params.configure_sleep) { +struct bcm_set_sleep_mode sleep_params; + + sleep_params.sleep_mode =1 ;/* UART */ + sleep_params.idle_host =2 ;/* idle threshold HOST, in 300ms */ + sleep_params.idle_dev =2 ;/* idle threshold device, in 300ms */ +/* BT_WAKE active mode - 1=active high, 0 = active low */ + sleep_params.bt_wake_active = (unsigned char ) + !h4->params.bt_wake_active_low; +/* HOST_WAKE active mode - 1=active high, 0 = active low */ + sleep_params.host_wake_active = (unsigned char ) + !h4->params.dev_wake_active_low; +/* Allow host sleep in SCO flag */ + sleep_params.allow_host_sleep =1 ; +/* Combine sleep and LPM flag */ + sleep_params.combine_modes =1 ; +/** Allow tristate control of UART tx flag */ + sleep_params.tristate_control =0 ; +/* Irrelevant USB flags */ + sleep_params.usb_auto_sleep =0 ; + sleep_params.usb_resume_timeout =0 ; + sleep_params.pulsed_host_wake =0 ; + sleep_params.break_to_host =0 ; + + skb =__hci_cmd_sync (hu->hdev,0xfc27 ,sizeof (sleep_params), + &sleep_params,HCI_INIT_TIMEOUT ); +if (IS_ERR (skb)) { + err =PTR_ERR (skb); +BT_ERR ("bcm_setup Sleep VSC failed (%d)" , err); + goto finalize; + } +kfree_skb (skb); +BT_DBG ("bcm_setup Set Sleep Parameters VSC succeeded" ); } finalize:
@@ -183,6 +503,9 @@ static int bcm_recv(struct hci_uart *hu, const void *data, int count)if (!test_bit (HCI_UART_REGISTERED , &hu->flags))return -EUNATCH ; +/* Make sure we're resumed */ +bcm_ensure_wakeup (hu); + bcm->rx_skb =h4_recv_buf (hu->hdev, bcm->rx_skb, data, count, bcm_recv_pkts,ARRAY_SIZE (bcm_recv_pkts));if (IS_ERR (bcm->rx_skb)) {
@@ -201,6 +524,9 @@ static int bcm_enqueue(struct hci_uart *hu, struct sk_buff *skb)BT_DBG ("hu %p skb %p" , hu, skb); +/* Make sure we're resumed */ +bcm_ensure_wakeup (hu); +/* Prepend skb with frame type */ memcpy (skb_push (skb,1 ), &bt_cb (skb)->pkt_type,1 );skb_queue_tail (&bcm->txq, skb);
@@ -218,8 +544,6 @@ static struct sk_buff *bcm_dequeue(struct hci_uart *hu)static const struct hci_uart_proto bcm_proto = { .id =HCI_UART_BCM , .name ="BCM" , - .init_speed =115200 , - .oper_speed =4000000 , .open = bcm_open, .close = bcm_close, .flush = bcm_flush,
Signature · 1 line
1.9.1