业界动态
gps.zip_android gps驱动_slowdrq_北斗 GPS_北斗 手机GPS手机「gps.zip_android gps驱动_slowdrq_北斗 GPS_北斗 手机」
2025-01-12 11:44
#ifdef MTK_GPS_SUPPORT #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/wait.h> #include <linux/slab.h> #include <linux/fs.h> #include <linux/sched.h> #include <linux/poll.h> #include <linux/device.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/platform_device.h> #include <linux/cdev.h> #include <linux/errno.h> #include <asm/io.h> #include <asm/uaccess.h> #include <linux/xlog.h> #include <linux/semaphore.h> #include <linux/version.h> #include <mach/devs.h> #include <mach/mt_typedefs.h> //#define FAKE_DATA #define GPS_SUSPEND_RESUME #define GPS_CONFIGURABLE_RESET_DELAY #define GPS_DEVNAME "mt3326-gps" #define GPS_DBG_NONE(fmt, arg...) do {} while (0) #define GPS_DBG_FUNC(fmt, arg...) xlog_printk(ANDROID_LOG_DEBUG, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define GPS_ERR(fmt, arg...) xlog_printk(ANDROID_LOG_ERROR, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define GPS_WARN(fmt, arg...) xlog_printk(ANDROID_LOG_WARN, PFX, "%s" fmt, __FUNCTION__ ,##arg) #define GPS_NOTICE(fmt, arg...) xlog_printk(ANDROID_LOG_INFO, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define GPS_INFO(fmt, arg...) xlog_printk(ANDROID_LOG_INFO, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define GPS_TRC_FUNC(f) xlog_printk(ANDROID_LOG_INFO, PFX, "<%s> ", __FUNCTION__); #define GPS_TRC_VERBOSE(fmt, arg...) xlog_printk(ANDROID_LOG_VERBOSE, PFX, "%s: " fmt, __FUNCTION__ ,##arg) #define PFX "GPS: " #define GPS_DBG GPS_DBG_FUNC #define GPS_TRC GPS_DBG_NONE //GPS_TRC_FUNC #define GPS_VER GPS_DBG_NONE //GPS_TRC_VERBOSE #define IH_DBG GPS_DBG_NONE enum { GPS_PWRCTL_UNSUPPORTED = 0xFF, GPS_PWRCTL_OFF = 0x00, GPS_PWRCTL_ON = 0x01, GPS_PWRCTL_RST = 0x02, GPS_PWRCTL_OFF_FORCE = 0x03, GPS_PWRCTL_RST_FORCE = 0x04, GPS_PWRCTL_MAX = 0x05, }; enum { GPS_PWR_UNSUPPORTED = 0xFF, GPS_PWR_RESUME = 0x00, GPS_PWR_SUSPEND = 0x01, GPS_PWR_MAX = 0x02, }; enum { GPS_STATE_UNSUPPORTED = 0xFF, GPS_STATE_OFF = 0x00, GPS_STATE_INIT = 0x01, GPS_STATE_START = 0x02, GPS_STATE_STOP = 0x03, GPS_STATE_DEC_FREQ = 0x04, GPS_STATE_SLEEP = 0x05, GPS_STATE_MAX = 0x06, }; enum { GPS_PWRSAVE_UNSUPPORTED = 0xFF, GPS_PWRSAVE_DEC_FREQ = 0x00, GPS_PWRSAVE_SLEEP = 0x01, GPS_PWRSAVE_OFF = 0x02, GPS_PWRSAVE_MAX = 0x03, }; struct gps_data{ int dat_len; int dat_pos; char dat_buf[4096]; spinlock_t lock; wait_queue_head_t read_wait; struct semaphore sem; }; struct gps_sta_itm { unsigned char year; unsigned char month; unsigned char day; unsigned char hour; unsigned char minute; unsigned char sec; unsigned char count; unsigned char reason; }; struct gps_sta_obj { int index; struct gps_sta_itm items[32]; }; struct gps_drv_obj { unsigned char pwrctl; unsigned char suspend; unsigned char state; unsigned char pwrsave; int rdelay; struct kobject *kobj; struct mutex sem; struct gps_sta_obj status; struct mt3326_gps_hardware *hw; }; struct gps_dev_obj { struct class *cls; struct device *dev; dev_t devno; struct cdev chdev; struct mt3326_gps_hardware *hw; }; static struct gps_data gps_private= {0}; #if defined(FAKE_DATA) static char fake_data[] = { "$GPGGA,135036.000,2446.3713,N,12101.3605,E,1,5,1.61,191.1,M,15.1,M,,*51 " "$GPGSA,A,3,22,18,14,30,31,,,,,,,,1.88,1.61,0.98*09 " "$GPGSV,2,1,6,18,83,106,32,22,58,324,35,30,45,157,35,14,28,308,32*44 " "$GPGSV,2,2,6,40,21,254,,31,17,237,29*42 " "$GPRMC,135036.000,A,2446.37125,N,12101.36054,E,0.243,56.48,140109,,A*46 " "$GPVTG,56.48,T,,M,0.243,N,0.451,K,A*07 " }; #endif //FAKE_DATA static char *str_reason[] = {"none", "init", "monitor", "wakeup", "TTFF", "force", "unknown"}; static inline void mt3326_gps_power(struct mt3326_gps_hardware *hw, unsigned int on, unsigned int force) { static unsigned int power_on = 1; int err; GPS_DBG("Switching GPS device %s ", on ? "on" : "off"); if (!hw) { GPS_ERR("null pointer!! "); return; } if (power_on == on) { GPS_DBG("ignore power control: %d ", on); } else if (on) { if (hw->ext_power_on) { err = hw->ext_power_on(0); if (err) GPS_ERR("ext_power_on fail "); } #if 0 #ifndef MTK_MT6620 if (!hwPowerOn(MT6516_POWER_V3GTX, VOL_2800,"MT3326")) { GPS_ERR("power on fails!! "); return; } #endif #endif if (hw->ext_power_on) { err = hw->ext_power_on(1); if (err) GPS_ERR("ext_power_on fail
    以上就是本篇文章【gps.zip_android gps驱动_slowdrq_北斗 GPS_北斗 手机GPS手机「gps.zip_android gps驱动_slowdrq_北斗 GPS_北斗 手机」】的全部内容了,欢迎阅览 ! 文章地址:http://www78564.xrbh.cn/news/32539.html 
     文章      相关文章      动态      同类文章      热门文章      栏目首页      网站地图      返回首页 迅博思语移动站 http://www78564.xrbh.cn/mobile/ , 查看更多   
最新文章
中交地产1元“退房”:战略转型与债务困境下的断臂求生
中交地产的这次“断臂求生”,不仅是企业自救的手段,更是一种行业趋势的缩影。中房报记者 梁笑梅丨北京报道7月25日,深陷退市危
邛崃市2025年7月招聘信息第四期共30家企业
四川金忠食品股份有限公司(邛崃市新邛路517号)1.研发工艺员 1名要求:40岁以下,大专以上学历,食品类专业,具备食品(肉制品
浙江义乌“大企帮小店”探索共富新路径
方静“张大酥是专门经营养生糕点的店铺,今年初才进驻李祖。当时‘大企’主动帮我们设计了具有李祖特色的糕点套装,义乌市市场监
北京移动应急通信保障恢复怀柔区72座基站,抢通40个行政村
7月28日北京青年报记者从北京移动了解到,截至18时,北京移动已抢通怀柔区雁栖开发区至汤河口48芯光缆一条,恢复汤河口、宝山、
小猫看伤花5000元,宠主质疑:诊所每天对小猫进行抽血检查等诊疗行为属于“过度医疗”
近日,芜湖繁昌区法院参考专家辅助人的意见,引导双方申请司法鉴定。调解过程中,专家辅助人详细分析了小猫病历,明确指出检查报
克莱斯勒300C 2.7汽车配件前羊角轴头刹车盘
克莱斯勒300C/2.7三元催化器 峰哲汽车尾灯后保险杠 切诺基大灯 我公司是一家专业从事别克与克莱斯勒汽车配件销售与服务的汽配企
他们是CS上海Major的“幕后功臣”,完美电竞合作伙伴联盟成立
从2019年的第九届DOTA2国际邀请赛(TI9),到2020年的英雄联盟全球总决赛(S10)、2024年的反恐精英世界锦标赛(CS上海Major),
军事资讯AI速递:昨夜今晨军事热点一览 丨2025年8月21日
  军事领域动态复杂,事件可能迅速改变全球安全格局。我们整理了昨夜今晨最重要的军事新闻,包括关键行动和政策变化,让您清晰
刚出炉!上海崇明成功认证“国际湿地城市”,将迎来什么发展机遇?
《湿地公约》第十五届缔约方大会于7月23日至31日在津巴布韦维多利亚瀑布城举行。全球共16个国家31个城市获得第三批“国际湿地城
疑似OPPO Find X9 Pro核心硬件曝光:搭载天玑9500 主频突破4GHz
【TechWeb】去年10月,OPPO推出了OPPO Find X8 Pro,这是全球首款配备双潜望长焦的天玑旗舰,拥有一颗5000万像素3倍索尼LYT-600