#if defined(CONFIG_SPIM_RK29)
#include "../../../drivers/spi/rk29_spim.h"
#endif
+#if defined(CONFIG_GPS_RK)
+#include "../../../drivers/misc/gps/rk_gps/rk_gps.h"
+#endif
+
#ifdef CONFIG_THREE_FB_BUFFER
#define RK30_FB0_MEM_SIZE 12*SZ_1M
};
#endif
+#if defined(CONFIG_GPS_RK)
+int rk_gps_io_init(void)
+{
+ printk("%s \n", __FUNCTION__);
+ rk30_mux_api_set(GPIO1B1_SPI_TXD_UART1_SOUT_NAME, GPIO1B_GPIO1B1);//VCC_EN
+ gpio_request(RK2928_PIN1_PB1, NULL);
+ gpio_direction_output(RK2928_PIN1_PB1, GPIO_LOW);
+
+ rk30_mux_api_set(GPIO1A2_I2S_LRCKRX_GPS_CLK_NAME, GPIO1A_GPS_CLK);//GPS_CLK
+ rk30_mux_api_set(GPIO1A4_I2S_SDO_GPS_MAG_NAME, GPIO1A_GPS_MAG);//GPS_MAG
+ rk30_mux_api_set(GPIO1A5_I2S_SDI_GPS_SIGN_NAME, GPIO1A_GPS_SIGN);//GPS_SIGN
+
+ rk30_mux_api_set(GPIO1B0_SPI_CLK_UART1_CTSN_NAME, GPIO1B_GPIO1B0);//SPI_CLK
+ gpio_request(RK2928_PIN1_PB0, NULL);
+ gpio_direction_output(RK2928_PIN1_PB0, GPIO_LOW);
+
+ rk30_mux_api_set(GPIO1B2_SPI_RXD_UART1_SIN_NAME, GPIO1B_GPIO1B2);//SPI_MOSI
+ gpio_request(RK2928_PIN1_PB2, NULL);
+ gpio_direction_output(RK2928_PIN1_PB2, GPIO_LOW);
+
+ rk30_mux_api_set(GPIO1B3_SPI_CSN0_UART1_RTSN_NAME, GPIO1B_GPIO1B3);//SPI_CS
+ gpio_request(RK2928_PIN1_PB3, NULL);
+ gpio_direction_output(RK2928_PIN1_PB3, GPIO_LOW);
+ return 0;
+}
+int rk_gps_power_up(void)
+{
+ printk("%s \n", __FUNCTION__);
+
+ return 0;
+}
+
+int rk_gps_power_down(void)
+{
+ printk("%s \n", __FUNCTION__);
+
+ return 0;
+}
+
+int rk_gps_reset_set(int level)
+{
+ return 0;
+}
+int rk_enable_hclk_gps(void)
+{
+ printk("%s \n", __FUNCTION__);
+ clk_enable(clk_get(NULL, "aclk_gps"));
+ return 0;
+}
+int rk_disable_hclk_gps(void)
+{
+ printk("%s \n", __FUNCTION__);
+ clk_disable(clk_get(NULL, "aclk_gps"));
+ return 0;
+}
+struct rk_gps_data rk_gps_info = {
+ .io_init = rk_gps_io_init,
+ .power_up = rk_gps_power_up,
+ .power_down = rk_gps_power_down,
+ .reset = rk_gps_reset_set,
+ .enable_hclk_gps = rk_enable_hclk_gps,
+ .disable_hclk_gps = rk_disable_hclk_gps,
+ .GpsSign = RK2928_PIN1_PA5,
+ .GpsMag = RK2928_PIN1_PA4, //GPIO index
+ .GpsClk = RK2928_PIN1_PA2, //GPIO index
+ .GpsVCCEn = RK2928_PIN1_PB1, //GPIO index
+ .GpsSpi_CSO = RK2928_PIN1_PB3, //GPIO index
+ .GpsSpiClk = RK2928_PIN1_PB0, //GPIO index
+ .GpsSpiMOSI = RK2928_PIN1_PB2, //GPIO index
+ .GpsIrq = IRQ_GPS,
+ .GpsSpiEn = 1,
+ .GpsAdcCh = 2,
+ .u32GpsPhyAddr = RK2928_GPS_PHYS,
+ .u32GpsPhySize = RK2928_GPS_SIZE,
+};
+
+struct platform_device rk_device_gps = {
+ .name = "gps_hv5820b",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk_gps_info,
+ }
+ };
+#endif
+
+
static struct platform_device *devices[] __initdata = {
#ifdef CONFIG_FB_ROCKCHIP
&device_fb,
#ifdef CONFIG_SND_SOC_RK2928
&device_acodec,
#endif
+#ifdef CONFIG_GPS_RK
+ &rk_device_gps,
+#endif
+
};
//i2c
#ifdef CONFIG_I2C0_RK30
#ifdef CONFIG_VIDEO_RK29
rk30_camera_request_reserve_mem();
#endif
+
+#ifdef CONFIG_GPS_RK
+ //it must be more than 8MB
+ rk_gps_info.u32MemoryPhyAddr = board_mem_reserve_add("gps", SZ_8M);
+#endif
+
board_mem_reserved();
}
/**
#if defined(CONFIG_SPIM_RK29)
#include "../../../drivers/spi/rk29_spim.h"
#endif
+#if defined(CONFIG_GPS_RK)
+#include "../../../drivers/misc/gps/rk_gps/rk_gps.h"
+#endif
+
#if defined(CONFIG_MU509)
#include <linux/mu509.h>
#endif
};
#endif
+#if defined(CONFIG_GPS_RK)
+int rk_gps_io_init(void)
+{
+ printk("%s \n", __FUNCTION__);
+
+ rk30_mux_api_set(GPIO1B5_UART3RTSN_NAME, GPIO1B_GPIO1B5);//VCC_EN
+ gpio_request(RK30_PIN1_PB5, NULL);
+ gpio_direction_output(RK30_PIN1_PB5, GPIO_LOW);
+
+ rk30_mux_api_set(GPIO1B4_UART3CTSN_GPSRFCLK_NAME, GPIO1B_GPSRFCLK);//GPS_CLK
+ rk30_mux_api_set(GPIO1B2_UART3SIN_GPSMAG_NAME, GPIO1B_GPSMAG);//GPS_MAG
+ rk30_mux_api_set(GPIO1B3_UART3SOUT_GPSSIG_NAME, GPIO1B_GPSSIG);//GPS_SIGN
+
+ rk30_mux_api_set(GPIO1A6_UART1CTSN_SPI0CLK_NAME, GPIO1A_GPIO1A6);//SPI_CLK
+ gpio_request(RK30_PIN1_PA6, NULL);
+ gpio_direction_output(RK30_PIN1_PA6, GPIO_LOW);
+
+ rk30_mux_api_set(GPIO1A5_UART1SOUT_SPI0TXD_NAME, GPIO1A_GPIO1A5);//SPI_MOSI
+ gpio_request(RK30_PIN1_PA5, NULL);
+ gpio_direction_output(RK30_PIN1_PA5, GPIO_LOW);
+
+ rk30_mux_api_set(GPIO1A7_UART1RTSN_SPI0CSN0_NAME, GPIO1A_GPIO1A7);//SPI_CS
+ gpio_request(RK30_PIN1_PA7, NULL);
+ gpio_direction_output(RK30_PIN1_PA7, GPIO_LOW);
+ return 0;
+}
+int rk_gps_power_up(void)
+{
+ printk("%s \n", __FUNCTION__);
+
+ return 0;
+}
+
+int rk_gps_power_down(void)
+{
+ printk("%s \n", __FUNCTION__);
+
+ return 0;
+}
+
+int rk_gps_reset_set(int level)
+{
+ return 0;
+}
+int rk_enable_hclk_gps(void)
+{
+ printk("%s \n", __FUNCTION__);
+ clk_enable(clk_get(NULL, "hclk_gps"));
+ return 0;
+}
+int rk_disable_hclk_gps(void)
+{
+ printk("%s \n", __FUNCTION__);
+ clk_disable(clk_get(NULL, "hclk_gps"));
+ return 0;
+}
+struct rk_gps_data rk_gps_info = {
+ .io_init = rk_gps_io_init,
+ .power_up = rk_gps_power_up,
+ .power_down = rk_gps_power_down,
+ .reset = rk_gps_reset_set,
+ .enable_hclk_gps = rk_enable_hclk_gps,
+ .disable_hclk_gps = rk_disable_hclk_gps,
+ .GpsSign = RK30_PIN1_PB3,
+ .GpsMag = RK30_PIN1_PB2, //GPIO index
+ .GpsClk = RK30_PIN1_PB4, //GPIO index
+ .GpsVCCEn = RK30_PIN1_PB5, //GPIO index
+ .GpsSpi_CSO = RK30_PIN1_PA4, //GPIO index
+ .GpsSpiClk = RK30_PIN1_PA5, //GPIO index
+ .GpsSpiMOSI = RK30_PIN1_PA7, //GPIO index
+ .GpsIrq = IRQ_GPS,
+ .GpsSpiEn = 0,
+ .GpsAdcCh = 2,
+ .u32GpsPhyAddr = RK30_GPS_PHYS,
+ .u32GpsPhySize = RK30_GPS_SIZE,
+};
+
+struct platform_device rk_device_gps = {
+ .name = "gps_hv5820b",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk_gps_info,
+ }
+ };
+#endif
+
+
static struct platform_device *devices[] __initdata = {
#ifdef CONFIG_FB_ROCKCHIP
&device_fb,
#ifdef CONFIG_RFKILL_RK
&device_rfkill_rk,
#endif
+#ifdef CONFIG_GPS_RK
+ &rk_device_gps,
+#endif
+
};
// i2c
#ifdef CONFIG_VIDEO_RK29
rk30_camera_request_reserve_mem();
#endif
+
+#ifdef CONFIG_GPS_RK
+ //it must be more than 8MB
+ rk_gps_info.u32MemoryPhyAddr = board_mem_reserve_add("gps", SZ_8M);
+#endif
board_mem_reserved();
}
obj-$(CONFIG_FM580X) += fm580x.o
obj-$(CONFIG_RK29_SUPPORT_MODEM) += rk29_modem/
obj-$(CONFIG_3G_MODULE) += 3g_module/
-obj-$(CONFIG_GPS_GNS7560) += gps/
+obj-$(CONFIG_GPS_DEVICES) += gps/
obj-y += inv_mpu/
obj-$(CONFIG_TDSC8800) += tdsc8800.o
obj-$(CONFIG_RK29_SC8800) += sc8800.o
# gps device configuration
#
-menuconfig RK29_GPS
- bool "RK29 support GPS"
+menuconfig GPS_DEVICES
+ bool "support GPS devices"
default n
---help---
- Say Y here if you have a support modem
+ Say Y here if you support gps
-if RK29_GPS
+if GPS_DEVICES
+
+source "drivers/misc/gps/rk_gps/Kconfig"
config GPS_GNS7560
bool "gns7560 support"
default n
+
endif # RK29_GPS
+obj-$(CONFIG_GPS_DEVICES) += rk_gps/
obj-$(CONFIG_GPS_GNS7560) += rk29_gps.o
-
-
--- /dev/null
+#
+# gps device configuration
+#
+
+
+
+config GPS_RK
+ tristate "rk gps support"
+ default M
+
+
+
+
--- /dev/null
+# All selected in one module named smsmdtv
+gps-objs := rk_gps_null.o
+obj-$(CONFIG_GPS_RK) += gps.o
+
--- /dev/null
+/*\r
+ 2012.07.25 lby@rock-chips.com\r
+*/\r
+\r
+#ifndef __RK_GPS_H__\r
+#define __RK_GPS_H__\r
+\r
+struct rk_gps_data {\r
+ int (*io_init)(void);\r
+ int (*power_up)(void);\r
+ int (*power_down)(void);\r
+ int (*reset)(int);\r
+ int (*enable_hclk_gps)(void);\r
+ int (*disable_hclk_gps)(void);\r
+ int GpsSign;\r
+ int GpsMag; //GPIO index\r
+ int GpsClk; //GPIO index\r
+ int GpsVCCEn; //GPIO index\r
+ int GpsSpi_CSO; //GPIO index\r
+ int GpsSpiClk; //GPIO index\r
+ int GpsSpiMOSI; //GPIO index\r
+ int GpsSpiEn; //USE SPI\r
+ int GpsAdcCh; //ADC CHANNEL\r
+ int GpsIrq;\r
+ \r
+ unsigned long u32GpsPhyAddr;\r
+ int u32GpsPhySize;\r
+ unsigned long u32MemoryPhyAddr; //must reserved 8MB memory for GPS\r
+ unsigned long u32MemoryVirAddr;\r
+ unsigned long u32GpsRegBase; //GPS register base virtual address\r
+\r
+};\r
+\r
+#endif\r
--- /dev/null
+//for rk_gps building