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>
13 #include <linux/leds.h>
15 #include <asm/hardware.h>
16 #include <asm/arch/serial.h>
17 #include <asm/arch/hx4700-gpio.h>
18 #include <asm/arch/hx4700-core.h>
20 #include "hx4700_bt.h"
23 hx4700_bt_configure( int state
)
27 // printk( KERN_NOTICE "hx4700 configure bluetooth: %d\n", state );
30 case PXA_UART_CFG_PRE_STARTUP
:
33 case PXA_UART_CFG_POST_STARTUP
:
34 /* pre-serial-up hardware configuration */
35 hx4700_egpio_enable( EGPIO5_BT_3V3_ON
);
36 SET_HX4700_GPIO( CPU_BT_RESET_N
, 0 );
38 SET_HX4700_GPIO( CPU_BT_RESET_N
, 1 );
41 * BRF6150's RTS goes low when firmware is ready
42 * so check for CTS=1 (nCTS=0 -> CTS=1). Typical 150ms
47 } while ((BTMSR
& MSR_CTS
) == 0 && tries
++ < 50);
48 led_trigger_event_shared(hx4700_radio_trig
, LED_FULL
);
51 case PXA_UART_CFG_PRE_SHUTDOWN
:
52 hx4700_egpio_disable( EGPIO5_BT_3V3_ON
);
54 led_trigger_event_shared(hx4700_radio_trig
, LED_OFF
);
64 hx4700_bt_probe( struct platform_device
*pdev
)
66 struct hx4700_bt_funcs
*funcs
= pdev
->dev
.platform_data
;
68 /* configure bluetooth UART */
69 pxa_gpio_mode( GPIO_NR_HX4700_BT_RXD_MD
);
70 pxa_gpio_mode( GPIO_NR_HX4700_BT_TXD_MD
);
71 pxa_gpio_mode( GPIO_NR_HX4700_BT_UART_CTS_MD
);
72 pxa_gpio_mode( GPIO_NR_HX4700_BT_UART_RTS_MD
);
74 funcs
->configure
= hx4700_bt_configure
;
80 hx4700_bt_remove( struct platform_device
*pdev
)
82 struct hx4700_bt_funcs
*funcs
= pdev
->dev
.platform_data
;
84 funcs
->configure
= NULL
;
89 static struct platform_driver bt_driver
= {
93 .probe
= hx4700_bt_probe
,
94 .remove
= hx4700_bt_remove
,
98 hx4700_bt_init( void )
100 printk(KERN_NOTICE
"hx4700 Bluetooth Driver\n");
101 return platform_driver_register( &bt_driver
);
105 hx4700_bt_exit( void )
107 platform_driver_unregister( &bt_driver
);
110 module_init( hx4700_bt_init
);
111 module_exit( hx4700_bt_exit
);
113 MODULE_AUTHOR("Todd Blumer, SDG Systems, LLC");
114 MODULE_DESCRIPTION("hx4700 Bluetooth Support Driver");
115 MODULE_LICENSE("GPL");
117 /* vim600: set noexpandtab sw=8 ts=8 :*/