diff mbox

[Xenial,master-next] UBUNTU: SAUCE: Bluetooth: Use host bridge subsystem IDs to identify Edge Gateways

Message ID 1472206774-22000-1-git-send-email-jesse.sung@canonical.com
State New
Headers show

Commit Message

Wen-chien Jesse Sung Aug. 26, 2016, 10:19 a.m. UTC
BugLink: https://launchpad.net/bugs/1512999

Since DMI IDs may be different between models while subsystem IDs of
host bridge will stay the same, use pci_get_subsys() instead of
dmi_match() to identify Edge Gateways.

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 drivers/bluetooth/btusb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Tim Gardner Aug. 26, 2016, 1:05 p.m. UTC | #1
On 08/26/2016 04:19 AM, Wen-chien Jesse Sung wrote:
> BugLink: https://launchpad.net/bugs/1512999
> 
> Since DMI IDs may be different between models while subsystem IDs of
> host bridge will stay the same, use pci_get_subsys() instead of
> dmi_match() to identify Edge Gateways.
> 
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> ---
>  drivers/bluetooth/btusb.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 5d0c92e..00c251c 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -24,7 +24,7 @@
>  #include <linux/module.h>
>  #include <linux/usb.h>
>  #include <linux/firmware.h>
> -#include <linux/dmi.h>
> +#include <linux/pci.h>
>  #include <asm/unaligned.h>
>  
>  #include <net/bluetooth/bluetooth.h>
> @@ -2975,8 +2975,8 @@ static int btusb_probe(struct usb_interface *intf,
>  
>  	if (id->driver_info & BTUSB_MARVELL) {
>  		hdev->set_bdaddr = btusb_set_bdaddr_marvell;
> -		if (dmi_match(DMI_PRODUCT_NAME, "Edge Gateway 5000") ||
> -			dmi_match(DMI_PRODUCT_NAME, "Edge Gateway 5100")) {
> +		if (pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, 0x1028, 0x0720, NULL) ||
> +			pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, 0x1028, 0x0733, NULL)) {
>  			hdev->post_open = btusb_edge_post_open;
>  			hdev->shutdown = btusb_edge_shutdown;
>  		}
> 

Is this destined for upstream ? Should it also be applied to Yakkety ?
Mario Limonciello Aug. 26, 2016, 1:55 p.m. UTC | #2
> -----Original Message-----
> From: Wen-chien Jesse Sung [mailto:jesse.sung@canonical.com]
> Sent: Friday, August 26, 2016 5:20 AM
> To: kernel-team@lists.ubuntu.com
> Cc: Kabir, Rezwanul <Rezwanul_Kabir@Dell.com>; Limonciello, Mario
> <Mario_Limonciello@Dell.com>
> Subject: [Xenial master-next][PATCH] UBUNTU: SAUCE: Bluetooth: Use host
> bridge subsystem IDs to identify Edge Gateways
> 
> BugLink: https://launchpad.net/bugs/1512999
> 
> Since DMI IDs may be different between models while subsystem IDs of
> host bridge will stay the same, use pci_get_subsys() instead of
> dmi_match() to identify Edge Gateways.
> 
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> ---
>  drivers/bluetooth/btusb.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 5d0c92e..00c251c 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -24,7 +24,7 @@
>  #include <linux/module.h>
>  #include <linux/usb.h>
>  #include <linux/firmware.h>
> -#include <linux/dmi.h>
> +#include <linux/pci.h>
>  #include <asm/unaligned.h>
> 
>  #include <net/bluetooth/bluetooth.h>
> @@ -2975,8 +2975,8 @@ static int btusb_probe(struct usb_interface *intf,
> 
>  	if (id->driver_info & BTUSB_MARVELL) {
>  		hdev->set_bdaddr = btusb_set_bdaddr_marvell;
> -		if (dmi_match(DMI_PRODUCT_NAME, "Edge Gateway 5000")
> ||
> -			dmi_match(DMI_PRODUCT_NAME, "Edge Gateway
> 5100")) {
> +		if (pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, 0x1028, 0x0720,
> NULL) ||
> +			pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, 0x1028,
> 0x0733, NULL)) {
>  			hdev->post_open = btusb_edge_post_open;
>  			hdev->shutdown = btusb_edge_shutdown;
>  		}
> --
> 2.7.4

LGTM.
Brad Figg Aug. 26, 2016, 2:48 p.m. UTC | #3

Tim Gardner Aug. 26, 2016, 3:38 p.m. UTC | #4

diff mbox

Patch

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 5d0c92e..00c251c 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -24,7 +24,7 @@ 
 #include <linux/module.h>
 #include <linux/usb.h>
 #include <linux/firmware.h>
-#include <linux/dmi.h>
+#include <linux/pci.h>
 #include <asm/unaligned.h>
 
 #include <net/bluetooth/bluetooth.h>
@@ -2975,8 +2975,8 @@  static int btusb_probe(struct usb_interface *intf,
 
 	if (id->driver_info & BTUSB_MARVELL) {
 		hdev->set_bdaddr = btusb_set_bdaddr_marvell;
-		if (dmi_match(DMI_PRODUCT_NAME, "Edge Gateway 5000") ||
-			dmi_match(DMI_PRODUCT_NAME, "Edge Gateway 5100")) {
+		if (pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, 0x1028, 0x0720, NULL) ||
+			pci_get_subsys(PCI_ANY_ID, PCI_ANY_ID, 0x1028, 0x0733, NULL)) {
 			hdev->post_open = btusb_edge_post_open;
 			hdev->shutdown = btusb_edge_shutdown;
 		}