x86/platform/intel-mid: Enable bluetooth on Intel Edison
Subsystems (2)
PATCH 1/1 x86/platform/intel-mid: Enable bluetooth on Intel Edison
Intel Edison has Wi-Fi + BT module attached and, since it's an SFI-enumerated platform, needs a platform data. Here we add bits to enable bluetooth device.
--- arch/x86/platform/intel-mid/device_libs/Makefile | 3 +- .../platform/intel-mid/device_libs/platform_bt.c | 108 +++++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 arch/x86/platform/intel-mid/device_libs/platform_bt.c
arch/x86/platform/intel-mid/device_libs/Makefile +2 -1
@@ -2,8 +2,9 @@ obj-$(subst m,y,$(CONFIG_PINCTRL_MERRIFIELD)) += platform_mrfld_pinctrl.o # SDHCI Devices obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += platform_mrfld_sd.o -# WiFi +# WiFi + BT obj-$(subst m,y,$(CONFIG_BRCMFMAC_SDIO)) += platform_bcm43xx.o +obj-$(subst m,y,$(CONFIG_BT_HCIUART_BCM)) += platform_bt.o # IPC Devices obj-$(subst m,y,$(CONFIG_MFD_INTEL_MSIC)) += platform_msic.o obj-$(subst m,y,$(CONFIG_SND_MFLD_MACHINE)) += platform_msic_audio.o
arch/x86/platform/intel-mid/device_libs/platform_bt.c new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
2.11.0
Quoted 53 lines · Andy Shevchenko
Intel Edison has Wi-Fi + BT module attached and, since it's an SFI-enumerated platform, needs a platform data. Here we add bits to enable bluetooth device.
Signed-off-by Andy Shevchenko <[email protected]>--- arch/x86/platform/intel-mid/device_libs/Makefile | 3 +- .../platform/intel-mid/device_libs/platform_bt.c | 108 +++++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 arch/x86/platform/intel-mid/device_libs/platform_bt.carch/x86/platform/intel-mid/device_libs/Makefile +2
-1@@ -2,8 +2,9 @@ obj-$(subst m,y,$(CONFIG_PINCTRL_MERRIFIELD)) += platform_mrfld_pinctrl.o # SDHCI Devices obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += platform_mrfld_sd.o -# WiFi +# WiFi + BT obj-$(subst m,y,$(CONFIG_BRCMFMAC_SDIO)) += platform_bcm43xx.o +obj-$(subst m,y,$(CONFIG_BT_HCIUART_BCM)) += platform_bt.o # IPC Devices obj-$(subst m,y,$(CONFIG_MFD_INTEL_MSIC)) += platform_msic.o obj-$(subst m,y,$(CONFIG_SND_MFLD_MACHINE)) += platform_msic_audio.oarch/x86/platform/intel-mid/device_libs/platform_bt.c new file +22
-0@@ -0,0 +1,108 @@ +/* +* Bluetooth platform data initialization file +* +* (C) Copyright 2017 Intel Corporation +* Author: Andy Shevchenko <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; version 2 +* of the License. +*/ + +#include <linux/gpio/machine.h> +#include <linux/pci.h> +#include <linux/platform_device.h> + +#include <asm/cpu_device_id.h> +#include <asm/intel-family.h> +#include <asm/intel-mid.h> + +struct bt_sfi_data { +struct device *dev;
arch/x86/platform/intel-mid/device_libs/platform_bt.c line 32
Quoted 10 lines
arch/x86/platform/intel-mid/device_libs/platform_bt.c new file +10
-0+const char *name; +int (*setup)(struct bt_sfi_data *ddata); +}; + +static struct gpiod_lookup_table tng_bt_sfi_gpio_table = { + .dev_id ="hci_bcm" , + .table = { +GPIO_LOOKUP ("0000:00:0c.0" ,-1 ,"device-wakeup" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("0000:00:0c.0" ,-1 ,"shutdown" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("0000:00:0c.0" ,-1 ,"host-wakeup" ,GPIO_ACTIVE_HIGH ),
Minor nit: just out of general principle (because the rest of the code looks so nice) I'd properly tabulate the last column as well - something like:
GPIO_LOOKUP("0000:00:0c.0", -1, "device-wakeup", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("0000:00:0c.0", -1, "shutdown", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("0000:00:0c.0", -1, "host-wakeup", GPIO_ACTIVE_HIGH),Formatted that way the reviewer's eye can skip over those values in 100 milliseconds, determining that all 3 values are GPIO_ACTIVE_HIGH.
Thanks,
Ingo
Quoted 27 lines · Ingo Molnar
Quoted 14 lines · Andy Shevchenko
Intel Edison has Wi-Fi + BT module attached and, since it's an SFI- enumerated
platform, needs a platform data. Here we add bits to enable bluetooth device.arch/x86/platform/intel-mid/device_libs/platform_bt.c new file +5
-0+ +static struct gpiod_lookup_table tng_bt_sfi_gpio_table = { + .dev_id ="hci_bcm" , + .table = { + GPIO_LOOKUP("0000:00:0c.0", -1, "device-wakeup",
GPIO_ACTIVE_HIGH),(quoted diff) +1
-0+ GPIO_LOOKUP("0000:00:0c.0", -1, "shutdown",
GPIO_ACTIVE_HIGH),(quoted diff) +1
-0+ GPIO_LOOKUP("0000:00:0c.0", -1, "host-wakeup",Quoted 1 line
GPIO_ACTIVE_HIGH),Minor nit: just out of general principle (because the rest of the code looks so
nice) I'd properly tabulate the last column as well - something like:GPIO_LOOKUP("0000:00:0c.0", -1, "device-wakeup", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("0000:00:0c.0", -1, "shutdown", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("0000:00:0c.0", -1, "host-
Quoted 5 lines
wakeup", GPIO_ACTIVE_HIGH),
Formatted that way the reviewer's eye can skip over those values in 100
milliseconds, determining that all 3 values areGPIO_ACTIVE_HIGH.
Thanks for a hint.
Should I resend it?
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Quoted 30 lines · Andy Shevchenko
Quoted 29 lines · Ingo Molnar
Quoted 14 lines · Andy Shevchenko
Intel Edison has Wi-Fi + BT module attached and, since it's an SFI- enumerated
platform, needs a platform data. Here we add bits to enable bluetooth device.arch/x86/platform/intel-mid/device_libs/platform_bt.c new file +5
-0+ +static struct gpiod_lookup_table tng_bt_sfi_gpio_table = { + .dev_id ="hci_bcm" , + .table = { + GPIO_LOOKUP("0000:00:0c.0", -1, "device-wakeup",
GPIO_ACTIVE_HIGH),(quoted diff) +1
-0+ GPIO_LOOKUP("0000:00:0c.0", -1, "shutdown",
GPIO_ACTIVE_HIGH),(quoted diff) +1
-0+ GPIO_LOOKUP("0000:00:0c.0", -1, "host-wakeup",Quoted 1 line
GPIO_ACTIVE_HIGH),Minor nit: just out of general principle (because the rest of the code looks so
nice) I'd properly tabulate the last column as well - something like:GPIO_LOOKUP("0000:00:0c.0", -1, "device-wakeup", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("0000:00:0c.0", -1, "shutdown", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("0000:00:0c.0", -1, "host-wakeup", GPIO_ACTIVE_HIGH),
Quoted 6 lines
Quoted 3 lines
Formatted that way the reviewer's eye can skip over those values in 100
milliseconds, determining that all 3 values areGPIO_ACTIVE_HIGH.Thanks for a hint.
Should I resend it?
Yeah, please send a v2.
Thanks!
Ingo
Quoted 11 lines · Ingo Molnar
Quoted 11 lines
Quoted 11 lines
Minor nit: just out of general principle (because the rest of the code looks so
nice) I'd properly tabulate the last column as well - something like:GPIO_LOOKUP("0000:00:0c.0", -1, "device-wakeup", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("0000:00:0c.0", -1, "shutdown", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("0000:00:0c.0", -1, "host-wakeup",
GPIO_ACTIVE_HIGH),
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Formatted that way the reviewer's eye can skip over those values in 100
milliseconds, determining that all 3 values areGPIO_ACTIVE_HIGH.Thanks for a hint.
Should I resend it?Yeah, please send a v2.
Sent and just noticed I forgot to increase version number.
Signature · 2 lines
With Best Regards, Andy Shevchenko