From 4105944c6014e8735d3139c2e3e4091e969a9fa8 Mon Sep 17 00:00:00 2001 From: Markinus Date: Sat, 18 Sep 2010 22:16:00 +0200 Subject: [PATCH] htcleo: add BT address config --- arch/arm/mach-msm/Makefile | 4 ++-- arch/arm/mach-msm/board-htcleo-bt.c | 8 ++++++-- arch/arm/mach-msm/board-htcleo.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile index 6a43e039..5fc5e2c3 100644 --- a/arch/arm/mach-msm/Makefile +++ b/arch/arm/mach-msm/Makefile @@ -18,9 +18,9 @@ obj-$(CONFIG_ARCH_MSM_SCORPION) += idle-v7.o obj-y += gpio.o generic_gpio.o obj-y += nand_partitions.o obj-y += drv_callback.o -obj-$(CONFIG_ARCH_QSD8X50) += pmic.o htc_bluetooth.o +obj-$(CONFIG_ARCH_QSD8X50) += pmic.o ifndef CONFIG_MACH_HTCLEO -obj-$(CONFIG_ARCH_QSD8X50) += htc_wifi_nvs.o +obj-$(CONFIG_ARCH_QSD8X50) += htc_wifi_nvs.o htc_bluetooth.o else obj-$(CONFIG_ARCH_QSD8X50) += board-htcleo-wifi-nvs.o endif diff --git a/arch/arm/mach-msm/board-htcleo-bt.c b/arch/arm/mach-msm/board-htcleo-bt.c index 97ac8d4c..b578c693 100644 --- a/arch/arm/mach-msm/board-htcleo-bt.c +++ b/arch/arm/mach-msm/board-htcleo-bt.c @@ -38,8 +38,8 @@ #include "dex_comm.h" #include "gpio_chip.h" - - +#define MAX_BT_SIZE 0x6U +static unsigned char bt_bd_ram[MAX_BT_SIZE] = {0x50,0xC3,0x00,0x00,0x00,0x00}; /////////////////////////////////////////////////////////////////////////////////////// @@ -47,6 +47,10 @@ static struct rfkill *bt_rfk; static const char bt_name[] = "bcm4329"; +unsigned char *get_bt_bd_ram(void) +{ + return (bt_bd_ram); +} static int bluetooth_set_power(void *data, bool blocked) { diff --git a/arch/arm/mach-msm/board-htcleo.c b/arch/arm/mach-msm/board-htcleo.c index 59a024e0..5a4cb7a2 100644 --- a/arch/arm/mach-msm/board-htcleo.c +++ b/arch/arm/mach-msm/board-htcleo.c @@ -62,6 +62,7 @@ extern int __init htcleo_init_mmc(unsigned debug_uart); extern void __init htcleo_audio_init(void); +extern unsigned char *get_bt_bd_ram(void); /////////////////////////////////////////////////////////////////////// // SPI @@ -459,6 +460,18 @@ static struct platform_device msm_camera_sensor_s5k3e2fx = /////////////////////////////////////////////////////////////////////// // bluetooth /////////////////////////////////////////////////////////////////////// +static char bdaddress[20]; +static void bt_export_bd_address(void) + { + unsigned char cTemp[6]; + + memcpy(cTemp, get_bt_bd_ram(), 6); + sprintf(bdaddress, "%02x:%02x:%02x:%02x:%02x:%02x", cTemp[0], cTemp[1], cTemp[2], cTemp[3], cTemp[4], cTemp[5]); + pr_info("BD_ADDRESS=%s\n", bdaddress); +} + +module_param_string(bdaddress, bdaddress, sizeof(bdaddress), S_IWUSR | S_IRUGO); +MODULE_PARM_DESC(bdaddress, "BT MAC ADDRESS"); static uint32_t bt_gpio_table[] = { @@ -794,6 +807,7 @@ static void __init htcleo_init(void) htcleo_init_mmc(0); platform_device_register(&htcleo_timed_gpios); + bt_export_bd_address(); htcleo_bt_init(); htcleo_audio_init();