[PATCH AUTOSEL for 4.14 01/67] Bluetooth: hci_qca: Avoid setup failure on missing rampatch

2018-03-07 Thread Sasha Levin
From: Loic Poulain 

[ Upstream commit ba8f3597900291a93604643017fff66a14546015 ]

Assuming that the original code idea was to enable in-band sleeping
only if the setup_rome method returns succes and run in 'standard'
mode otherwise, we should not return setup_rome return value which
makes qca_setup fail if no rampatch/nvm file found.

This fixes BT issue on the dragonboard-820C p4 which includes the
following QCA controller:
hci0: Product:0x0008
hci0: Patch  :0x0111
hci0: ROM:0x0302
hci0: SOC:0x0044

Since there is no rampatch for this controller revision, just make
it work as is.

Signed-off-by: Loic Poulain 
Signed-off-by: Marcel Holtmann 
Signed-off-by: Sasha Levin 
---
 drivers/bluetooth/hci_qca.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 392f412b4575..c9f0ac083a3e 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -933,6 +933,9 @@ static int qca_setup(struct hci_uart *hu)
if (!ret) {
set_bit(STATE_IN_BAND_SLEEP_ENABLED, >flags);
qca_debugfs_init(hdev);
+   } else if (ret == -ENOENT) {
+   /* No patch/nvm-config found, run with original fw/config */
+   ret = 0;
}
 
/* Setup bdaddr */
-- 
2.14.1


[PATCH AUTOSEL for 4.14 01/67] Bluetooth: hci_qca: Avoid setup failure on missing rampatch

2018-03-07 Thread Sasha Levin
From: Loic Poulain 

[ Upstream commit ba8f3597900291a93604643017fff66a14546015 ]

Assuming that the original code idea was to enable in-band sleeping
only if the setup_rome method returns succes and run in 'standard'
mode otherwise, we should not return setup_rome return value which
makes qca_setup fail if no rampatch/nvm file found.

This fixes BT issue on the dragonboard-820C p4 which includes the
following QCA controller:
hci0: Product:0x0008
hci0: Patch  :0x0111
hci0: ROM:0x0302
hci0: SOC:0x0044

Since there is no rampatch for this controller revision, just make
it work as is.

Signed-off-by: Loic Poulain 
Signed-off-by: Marcel Holtmann 
Signed-off-by: Sasha Levin 
---
 drivers/bluetooth/hci_qca.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 392f412b4575..c9f0ac083a3e 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -933,6 +933,9 @@ static int qca_setup(struct hci_uart *hu)
if (!ret) {
set_bit(STATE_IN_BAND_SLEEP_ENABLED, >flags);
qca_debugfs_init(hdev);
+   } else if (ret == -ENOENT) {
+   /* No patch/nvm-config found, run with original fw/config */
+   ret = 0;
}
 
/* Setup bdaddr */
-- 
2.14.1