add gps of a22
authorlinjh <linjh@rock-chips.com>
Mon, 18 Apr 2011 10:05:16 +0000 (18:05 +0800)
committerlinjh <linjh@rock-chips.com>
Mon, 18 Apr 2011 10:05:16 +0000 (18:05 +0800)
arch/arm/configs/rk29_a22_defconfig
arch/arm/mach-rk29/board-rk29-a22.c

index 70193e881a65cbc2d61731a4cc791b065a6b573f..0ac34d320d6711a06eaea642a07e0607886305cf 100755 (executable)
@@ -642,7 +642,8 @@ CONFIG_APANIC_PLABEL="kpanic"
 # CONFIG_EEPROM_MAX6875 is not set
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_RK29_SUPPORT_MODEM is not set
-# CONFIG_RK29_GPS is not set
+CONFIG_RK29_GPS=y
+CONFIG_GPS_GNS7560=y
 
 #
 # Motion Sensors Support
@@ -926,7 +927,7 @@ CONFIG_UART0_CTS_RTS_RK29=y
 CONFIG_UART1_RK29=y
 CONFIG_UART2_RK29=y
 CONFIG_UART2_CTS_RTS_RK29=y
-# CONFIG_UART3_RK29 is not set
+CONFIG_UART3_RK29=y
 CONFIG_SERIAL_RK29_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
index 14c72ef985fa72e6188e3686f80ba42c8334ed95..6c15a30e7e156b362a8dc4d23c156536b98013e2 100755 (executable)
@@ -1230,41 +1230,42 @@ struct wm831x_pdata wm831x_platdata = {
 #define        RK29_GPS_POWER_PIN              RK29_PIN6_PB2
 #define        RK29_GPS_RESET_PIN              RK29_PIN6_PC1
 
-static int gps_open =0;
-
 int rk29_gps_power_up(void)
 {      
-       gps_open = 1;   
        printk("%s \n", __FUNCTION__);  
-       gpio_request(RK29_GPS_POWER_PIN, NULL);    
+
+    gpio_request(RK29_GPS_POWER_PIN, NULL);    
        gpio_direction_output(RK29_GPS_POWER_PIN, GPIO_HIGH);   
-       gpio_request(RK29_GPS_RESET_PIN, NULL);        
-       gpio_direction_output(RK29_GPS_RESET_PIN, GPIO_LOW);      
-       rk29_mux_api_set(GPIO2B3_UART3SOUT_NAME, GPIO2L_UART3_SOUT);
-       rk29_mux_api_set(GPIO2B2_UART3SIN_NAME, GPIO2L_UART3_SIN);      
-       mdelay(100);    
-       gpio_direction_output(RK29_GPS_RESET_PIN, GPIO_HIGH);           
+
        return 0;
 }
 
 int rk29_gps_power_down(void)
 {      
-       gps_open =0;    
        printk("%s \n", __FUNCTION__);  
+
        gpio_direction_output(RK29_GPS_POWER_PIN, GPIO_LOW);            
-       mdelay(100);      
-       gpio_direction_output(RK29_GPS_RESET_PIN, GPIO_LOW);    //uart1 
+
        return 0;
 }
 
+int rk29_gps_reset_set(int level)
+{
+       gpio_request(RK29_GPS_RESET_PIN, NULL);
+       if (level)
+               gpio_direction_output(RK29_GPS_RESET_PIN, GPIO_HIGH);
+       else
+               gpio_direction_output(RK29_GPS_RESET_PIN, GPIO_LOW);
+
+       return 0;
+}
 
 struct rk29_gps_data rk29_gps_info = { 
        .power_up = rk29_gps_power_up,  
        .power_down = rk29_gps_power_down,      
+       .reset = rk29_gps_reset_set,
        .uart_id = 3,
-       .powerpin = RK29_GPS_POWER_PIN,
-       .powerflag = 1,
-       };
+};
 
 struct platform_device rk29_device_gps = {
        .name = "rk29_gps",
@@ -2614,6 +2615,9 @@ static struct platform_device *devices[] __initdata = {
 #ifdef CONFIG_RK_HEADSET_DET
     &rk28_device_headset,
 #endif
+#ifdef CONFIG_RK29_GPS
+       &rk29_device_gps,
+#endif
 };
 
 #ifdef CONFIG_RK29_VMAC