1 /* Bluetooth interface driver for TI BRF6150 on HX4700
3 * Copyright (c) 2005 SDG Systems, LLC
5 * 2005-04-21 Todd Blumer Created.
8 #include <linux/module.h>
9 #include <linux/kernel.h>
10 #include <linux/delay.h>
11 #include <linux/platform_device.h>
12 #include <linux/soc/asic3_base.h>
14 #include <asm/hardware.h>
15 #include <asm/arch/serial.h>
16 #include <asm/hardware/ipaq-asic3.h>
17 #include <asm/arch/htcsable-gpio.h>
18 #include <asm/arch/htcsable-asic.h>
20 #include "htcsable_bt.h"
22 extern struct platform_device htcsable_asic3
;
24 static uint use_led
=1;
27 htcsable_bt_configure( int state
)
31 printk( KERN_NOTICE
"htcsable configure bluetooth: %d\n", state
);
34 case PXA_UART_CFG_PRE_STARTUP
:
37 case PXA_UART_CFG_POST_STARTUP
:
38 /* pre-serial-up hardware configuration */
39 /*htcsable_egpio_enable(EGPIO6_BT_3V3_ON);*/
41 asic3_set_gpio_out_d(&htcsable_asic3
.dev
, 1<<GPIOD_BT_PWR_ON
, 1<<GPIOD_BT_PWR_ON
);
43 asic3_set_gpio_out_c(&htcsable_asic3
.dev
, 1<<GPIOC_BT_RESET
, 0);
45 asic3_set_gpio_out_c(&htcsable_asic3
.dev
, 1<<GPIOC_BT_RESET
, 1<<GPIOC_BT_RESET
);
49 * BRF6150's RTS goes low when firmware is ready
50 * so check for CTS=1 (nCTS=0 -> CTS=1). Typical 150ms
55 } while ((FFMSR
& MSR_CTS
) == 0 && tries
++ < 50);
57 // htcsable_set_led(2, 16, 16);
61 case PXA_UART_CFG_PRE_SHUTDOWN
:
62 /*htcsable_egpio_disable(EGPIO6_BT_3V3_ON );*/
64 // htcsable_clear_led(2);
65 asic3_set_gpio_out_d(&htcsable_asic3
.dev
, 1<<GPIOD_BT_PWR_ON
, 0);
67 asic3_set_gpio_out_c(&htcsable_asic3
.dev
, 1<<GPIOC_BT_RESET
, 0);
77 htcsable_bt_probe( struct device
*dev
)
79 struct htcsable_bt_funcs
*funcs
= (struct htcsable_bt_funcs
*) dev
->platform_data
;
81 /* configure bluetooth UART */
82 pxa_gpio_mode( GPIO_NR_HTCSABLE_BT_RXD_MD
);
83 pxa_gpio_mode( GPIO_NR_HTCSABLE_BT_TXD_MD
);
84 pxa_gpio_mode( GPIO_NR_HTCSABLE_BT_UART_CTS_MD
);
85 pxa_gpio_mode( GPIO_NR_HTCSABLE_BT_UART_RTS_MD
);
87 funcs
->configure
= htcsable_bt_configure
;
89 /* Make sure the LED is off */
90 // htcsable_clear_led(2);
96 htcsable_bt_remove( struct device
*dev
)
98 struct htcsable_bt_funcs
*funcs
= (struct htcsable_bt_funcs
*) dev
->platform_data
;
100 funcs
->configure
= NULL
;
102 /* Make sure the LED is off */
103 // htcsable_clear_led(2);
108 static struct device_driver bt_driver
= {
109 .name
= "htcsable_bt",
110 .bus
= &platform_bus_type
,
111 .probe
= htcsable_bt_probe
,
112 .remove
= htcsable_bt_remove
,
115 module_param(use_led
, uint
, 0);
118 htcsable_bt_init( void )
120 printk(KERN_NOTICE
"htcsable Bluetooth Driver\n");
121 return driver_register( &bt_driver
);
125 htcsable_bt_exit( void )
127 driver_unregister( &bt_driver
);
130 module_init( htcsable_bt_init
);
131 module_exit( htcsable_bt_exit
);
133 MODULE_AUTHOR("Todd Blumer, SDG Systems, LLC");
134 MODULE_DESCRIPTION("HTC Sable Bluetooth Support Driver");
135 MODULE_LICENSE("GPL");
137 /* vim600: set noexpandtab sw=8 ts=8 :*/