From: linjh Date: Mon, 18 Apr 2011 10:05:16 +0000 (+0800) Subject: add gps of a22 X-Git-Tag: firefly_0821_release~10460 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9b54151dafa87b76ea33dc16753aefb544e82d7f;p=firefly-linux-kernel-4.4.55.git add gps of a22 --- diff --git a/arch/arm/configs/rk29_a22_defconfig b/arch/arm/configs/rk29_a22_defconfig index 70193e881a65..0ac34d320d67 100755 --- a/arch/arm/configs/rk29_a22_defconfig +++ b/arch/arm/configs/rk29_a22_defconfig @@ -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 diff --git a/arch/arm/mach-rk29/board-rk29-a22.c b/arch/arm/mach-rk29/board-rk29-a22.c index 14c72ef985fa..6c15a30e7e15 100755 --- a/arch/arm/mach-rk29/board-rk29-a22.c +++ b/arch/arm/mach-rk29/board-rk29-a22.c @@ -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