linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btsdio: Do not bind to non-removable BCM43430
@ 2018-09-27  9:54 Cho, Yu-Chen
  2018-09-27  9:59 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Cho, Yu-Chen @ 2018-09-27  9:54 UTC (permalink / raw)
  To: linux-bluetooth, linux-kernel; +Cc: marcel, johan.hedberg, acho, jlee

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

Signed-off-by: Cho, Yu-Chen <acho@suse.com>
---
 drivers/bluetooth/btsdio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
index 20142bc77554..84d23d786ce5 100644
--- a/drivers/bluetooth/btsdio.c
+++ b/drivers/bluetooth/btsdio.c
@@ -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;
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] btsdio: Do not bind to non-removable BCM43430
  2018-09-27  9:54 [PATCH] btsdio: Do not bind to non-removable BCM43430 Cho, Yu-Chen
@ 2018-09-27  9:59 ` Marcel Holtmann
  2018-10-02  9:46   ` [PATCH v2] " Cho, Yu-Chen
  2018-10-02  9:57   ` Cho, Yu-Chen
  0 siblings, 2 replies; 5+ messages in thread
From: Marcel Holtmann @ 2018-09-27  9:59 UTC (permalink / raw)
  To: Cho, Yu-Chen; +Cc: linux-bluetooth, linux-kernel, Johan Hedberg, jlee

Hi Yu-Chen,

> BCM43430 devices soldered onto the PCB (non-removable)
> use an UART connection for bluetooth.
> But also advertise btsdio support on their 3th sdio function.
> 
> Signed-off-by: Cho, Yu-Chen <acho@suse.com>
> ---
> drivers/bluetooth/btsdio.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
> index 20142bc77554..84d23d786ce5 100644
> --- a/drivers/bluetooth/btsdio.c
> +++ b/drivers/bluetooth/btsdio.c
> @@ -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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] btsdio: Do not bind to non-removable BCM43430
  2018-09-27  9:59 ` Marcel Holtmann
@ 2018-10-02  9:46   ` Cho, Yu-Chen
  2018-10-02  9:57   ` Cho, Yu-Chen
  1 sibling, 0 replies; 5+ messages in thread
From: Cho, Yu-Chen @ 2018-10-02  9:46 UTC (permalink / raw)
  To: linux-bluetooth, linux-kernel; +Cc: marcel, johan.hedberg, acho, jlee

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

Signed-off-by: Cho, Yu-Chen <acho@suse.com>
---
 drivers/bluetooth/btsdio.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
index 20142bc77554..a0a6d555901c 100644
--- a/drivers/bluetooth/btsdio.c
+++ b/drivers/bluetooth/btsdio.c
@@ -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)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2] btsdio: Do not bind to non-removable BCM43430
  2018-09-27  9:59 ` Marcel Holtmann
  2018-10-02  9:46   ` [PATCH v2] " Cho, Yu-Chen
@ 2018-10-02  9:57   ` Cho, Yu-Chen
  2018-10-03  7:00     ` Marcel Holtmann
  1 sibling, 1 reply; 5+ messages in thread
From: Cho, Yu-Chen @ 2018-10-02  9:57 UTC (permalink / raw)
  To: linux-bluetooth, linux-kernel; +Cc: marcel, johan.hedberg, acho, jlee

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

Signed-off-by: Cho, Yu-Chen <acho@suse.com>
---
 drivers/bluetooth/btsdio.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
index 20142bc77554..b5c54053cb0f 100644
--- a/drivers/bluetooth/btsdio.c
+++ b/drivers/bluetooth/btsdio.c
@@ -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)
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] btsdio: Do not bind to non-removable BCM43430
  2018-10-02  9:57   ` Cho, Yu-Chen
@ 2018-10-03  7:00     ` Marcel Holtmann
  0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2018-10-03  7:00 UTC (permalink / raw)
  To: Cho, Yu-Chen
  Cc: Bluez mailing list, Linux Kernel Mailing List, Johan Hedberg, jlee

Hi Yu-Chen,

> BCM43430 devices soldered onto the PCB (non-removable)
> use an UART connection for bluetooth.
> But also advertise btsdio support on their 3th sdio function.
> 
> Signed-off-by: Cho, Yu-Chen <acho@suse.com>
> ---
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-03  7:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27  9:54 [PATCH] btsdio: Do not bind to non-removable BCM43430 Cho, Yu-Chen
2018-09-27  9:59 ` Marcel Holtmann
2018-10-02  9:46   ` [PATCH v2] " Cho, Yu-Chen
2018-10-02  9:57   ` Cho, Yu-Chen
2018-10-03  7:00     ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).