|
From: <mar...@us...> - 2007-05-05 12:51:50
|
Revision: 971
http://svn.sourceforge.net/hackndev/?rev=971&view=rev
Author: marex_z71
Date: 2007-05-05 05:51:48 -0700 (Sat, 05 May 2007)
Log Message:
-----------
PalmLD: added bluetooth stuff
Modified Paths:
--------------
linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h
Modified: linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c
===================================================================
--- linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-05-04 17:18:21 UTC (rev 970)
+++ linux4palm/linux/trunk/arch/arm/mach-pxa/palmld/palmld.c 2007-05-05 12:51:48 UTC (rev 971)
@@ -31,6 +31,7 @@
#include <asm/arch/pxapwm-bl.h>
#include <asm/arch/pxa-pm_ll.h>
#include <asm/arch/sx2.h>
+#include <asm/arch/serial.h>
#include <sound/driver.h>
#include <sound/core.h>
@@ -97,7 +98,54 @@
};
+/* Bluetooth */
+void bcm2035_bt_reset(int on)
+{
+ printk(KERN_NOTICE "Switch BT reset %d\n", on);
+ if (on)
+ SET_PALMLD_GPIO( BT_RESET, 1 );
+ else
+ SET_PALMLD_GPIO( BT_RESET, 0 );
+}
+EXPORT_SYMBOL(bcm2035_bt_reset);
+
+void bcm2035_bt_power(int on)
+{
+ printk(KERN_NOTICE "Switch BT power %d\n", on);
+ if (on)
+ SET_PALMLD_GPIO( BT_POWER, 1 );
+ else
+ SET_PALMLD_GPIO( BT_POWER, 0 );
+}
+EXPORT_SYMBOL(bcm2035_bt_power);
+
+
+struct bcm2035_bt_funcs {
+ void (*configure) ( int state );
+};
+
+static struct bcm2035_bt_funcs bt_funcs;
+
+static void
+bcm2035_bt_configure( int state )
+{
+ if (bt_funcs.configure != NULL)
+ bt_funcs.configure( state );
+}
+
+static struct platform_pxa_serial_funcs bcm2035_pxa_bt_funcs = {
+ .configure = bcm2035_bt_configure,
+};
+
+static struct platform_device bcm2035_bt = {
+ .name = "bcm2035-bt",
+ .id = -1,
+ .dev = {
+ .platform_data = &bt_funcs,
+ },
+};
+
/**
* AC97 audio controller
*/
@@ -283,7 +331,7 @@
static struct platform_device *devices[] __initdata = {
&palmld_kbd, &palmld_ac97, &palmld_ide, &palmld_backlight,
- &palmldled_device, &palmldusb2_device, &palmld_pm,
+ &palmldled_device, &palmldusb2_device, &palmld_pm, &bcm2035_bt,
};
/*********************************************************
@@ -375,6 +423,7 @@
pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
set_pxa_fb_info( &palmld_lcd_screen );
+ pxa_set_btuart_info(&bcm2035_pxa_bt_funcs);
pxa_set_mci_info( &palmld_mci_platform_data );
platform_add_devices( devices, ARRAY_SIZE(devices) );
pxa_set_ficp_info( &palmld_ficp_platform_data );
Modified: linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h
===================================================================
--- linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-05-04 17:18:21 UTC (rev 970)
+++ linux4palm/linux/trunk/include/asm-arm/arch-pxa/palmld-gpio.h 2007-05-05 12:51:48 UTC (rev 971)
@@ -80,6 +80,19 @@
#define GPIO_NR_PALMLD_USB_INT 106
#define GPIO_NR_PALMLD_USB_POWER 118
+/* Bluetooth */
+#define GPIO_NR_PALMLD_BT_POWER 17
+#define GPIO_NR_PALMLD_BT_RXD 42
+#define GPIO_NR_PALMLD_BT_TXD 43
+#define GPIO_NR_PALMLD_BT_CTS 44
+#define GPIO_NR_PALMLD_BT_RTS 45
+#define GPIO_NR_PALMLD_BT_RESET 83
+
+#define GPIO_NR_PALMLD_BT_RXD_MD (GPIO_NR_PALMLD_BT_RXD | GPIO_ALT_FN_1_IN)
+#define GPIO_NR_PALMLD_BT_TXD_MD (GPIO_NR_PALMLD_BT_TXD | GPIO_ALT_FN_2_OUT)
+#define GPIO_NR_PALMLD_BT_UART_CTS_MD (GPIO_NR_PALMLD_BT_CTS | GPIO_ALT_FN_1_IN)
+#define GPIO_NR_PALMLD_BT_UART_RTS_MD (GPIO_NR_PALMLD_BT_RTS | GPIO_ALT_FN_2_OUT)
+
/* Utility macros */
#define GET_PALMLD_GPIO(gpio) \
(GPLR(GPIO_NR_PALMLD_ ## gpio) & GPIO_bit(GPIO_NR_PALMLD_ ## gpio))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|