Skip to contentSkip to conversation

btsdio: Do not bind to non-removable BCM43430

PATCH Superseded Cho, Yu-Chen 2 participants 5 messages Sep 27, 2018 – Oct 3, 2018 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btsdio: Do not bind to non-removable BCM43430

BCM43430 devices soldered onto the PCB (non-removable) use an UART connection for bluetooth.
But also advertise btsdio support on their 3th sdio function.

---
 drivers/bluetooth/btsdio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bluetooth/btsdio.c +2 -1
index 20142bc77554..84d23d786ce5 100644
@@ -297,7 +297,8 @@ static int btsdio_probe(struct sdio_func *func,
 	 * uart connection for bluetooth, ignore the BT SDIO interface.
 	 */
 	if (func->vendor == SDIO_VENDOR_ID_BROADCOM &&
-	    func->device == SDIO_DEVICE_ID_BROADCOM_43341 &&
+	    (func->device == SDIO_DEVICE_ID_BROADCOM_43341 ||
+	    func->device == SDIO_DEVICE_ID_BROADCOM_43430) &&
 	    !mmc_card_is_removable(func->card->host))
 		return -ENODEV;
 
Signature · 1 line
2.18.0
maintainer
#1 lore raw

Hi Yu-Chen,

Quoted 14 lines

BCM43430 devices soldered onto the PCB (non-removable) use an UART connection for bluetooth.
But also advertise btsdio support on their 3th sdio function.

---
drivers/bluetooth/btsdio.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bluetooth/btsdio.c +0 -0
index 20142bc77554..84d23d786ce5 100644

drivers/bluetooth/btsdio.c static int btsdio_probe(struct sdio_func *func, · line 303

Quoted 8 lines
drivers/bluetooth/btsdio.c +2 -1
@@ -297,7 +297,8 @@ static int btsdio_probe(struct sdio_func *func,
 	 * uart connection for bluetooth, ignore the BT SDIO interface.
 	 */
 	if (func->vendor == SDIO_VENDOR_ID_BROADCOM &&
-	    func->device == SDIO_DEVICE_ID_BROADCOM_43341 &&
+	    (func->device == SDIO_DEVICE_ID_BROADCOM_43341 ||
+	    func->device == SDIO_DEVICE_ID_BROADCOM_43430) &&
 	    !mmc_card_is_removable(func->card->host))
 		return -ENODEV;

This will turn quickly unreadable. Can we turn the func->device test into a switch statement.

	if (!mmc_card_is_rem.. && func->vendor == SDIO_ID..) {
		switch (func->device) {
		case SDIO_DEV..
			return -ENODEV;
	}

Regards

Marcel

#2 lore raw

PATCH v2 1/1 btsdio: Do not bind to non-removable BCM43430

BCM43430 devices soldered onto the PCB (non-removable) use an UART connection for bluetooth.
But also advertise btsdio support on their 3th sdio function.

---
 drivers/bluetooth/btsdio.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/bluetooth/btsdio.c +9 -3
index 20142bc77554..a0a6d555901c 100644
@@ -297,9 +297,15 @@ static int btsdio_probe(struct sdio_func *func,
 	 * uart connection for bluetooth, ignore the BT SDIO interface.
 	 */
 	if (func->vendor == SDIO_VENDOR_ID_BROADCOM &&
-	    func->device == SDIO_DEVICE_ID_BROADCOM_43341 &&
-	    !mmc_card_is_removable(func->card->host))
-		return -ENODEV;
+	    !mmc_card_is_removable(func->card->host)) {
+		switch(func->device) {
+			case SDIO_DEVICE_ID_BROADCOM_43341:
+			case SDIO_DEVICE_ID_BROADCOM_43430:
+				return -ENODEV;
+			default:
+				break;
+		}
+	}
 
 	data = devm_kzalloc(&func->dev, sizeof(*data), GFP_KERNEL);
 	if (!data)
Signature · 1 line
2.18.0
#3 lore raw

PATCH v2 1/1 btsdio: Do not bind to non-removable BCM43430

In reply to Marcel Holtmann

BCM43430 devices soldered onto the PCB (non-removable) use an UART connection for bluetooth.
But also advertise btsdio support on their 3th sdio function.

---
 drivers/bluetooth/btsdio.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/bluetooth/btsdio.c +9 -3
index 20142bc77554..b5c54053cb0f 100644
@@ -297,9 +297,15 @@ static int btsdio_probe(struct sdio_func *func,
 	 * uart connection for bluetooth, ignore the BT SDIO interface.
 	 */
 	if (func->vendor == SDIO_VENDOR_ID_BROADCOM &&
-	    func->device == SDIO_DEVICE_ID_BROADCOM_43341 &&
-	    !mmc_card_is_removable(func->card->host))
-		return -ENODEV;
+	    !mmc_card_is_removable(func->card->host)) {
+		switch (func->device) {
+		case SDIO_DEVICE_ID_BROADCOM_43341:
+		case SDIO_DEVICE_ID_BROADCOM_43430:
+			return -ENODEV;
+		default:
+			break;
+		}
+	}
 
 	data = devm_kzalloc(&func->dev, sizeof(*data), GFP_KERNEL);
 	if (!data)
Signature · 1 line
2.18.0
maintainer
#4 lore raw

Hi Yu-Chen,

Quoted 8 lines

BCM43430 devices soldered onto the PCB (non-removable) use an UART connection for bluetooth.
But also advertise btsdio support on their 3th sdio function.

---
drivers/bluetooth/btsdio.c | 12 +++++++++---

1 file changed, 9 insertions(+), 3 deletions(-)

patch (with slight modifications) has been applied to bluetooth-next tree.

Regards

Marcel