业界动态
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/ , 查看更多   
最新文章
来七星关,慢享生活“森”呼吸~
四月的杨家湾宛如一幅清新淡雅的水墨画满山的樱桃树繁花凋谢后枝头挂满了青绿的嫩果在阳光的轻抚下闪烁着生机与希望清风悠悠拂过
侠盗飞车罪恶都市破解版罪恶都市手机版「侠盗飞车罪恶都市破解版」
侠盗飞车罪恶都市破解版是一款非常热血的犯罪动作类游戏,游戏中拥有高自由度的玩法,玩家将在都市里尽情冒险挑战,剧情丰富,玩
破纪录!中兴红牛17秒售罄 一加惨被汪峰手机新「破纪录!中兴红牛17秒售罄 一加惨被汪峰」
  【PConline北京站 行情】虽然在4月初,三星和HTC都带来了他们的全新旗舰智能手机GALAXY S5和HTC One M8在国内开始销售,并在
江苏苏宁官方宣布拉米雷斯加盟手机加盟「江苏苏宁官方宣布拉米雷斯加盟」
iPhone 6 Plus","userInfo":{"user_id":1915964974,"user_pic":"https://tvax4.sinaimg.cn/crop.68.66.675.675.50/72334e2ely8gn
小蜜蜂手机价格怎么样【详细介绍】小蜜蜂手机「小蜜蜂手机价格怎么样【详细介绍】」
  导语:现在的数码市场,手机永远是一个热 门 产品,在更新换代中产品是在不断的更新。又有 苹果 这样的代表,一年一部的架势
焕然始发|优诺上新希腊酸奶冰淇淋,开启健康美味新体验
  希腊酸奶是目前全球市场体量最大的低温酸奶品类细分品类,而它的增长曲线也堪称奇迹,在美国市场,从2007年市占率不到1%的小
手机支架拆解全攻略:从清洁到重组的必备技巧手机螺丝刀「手机支架拆解全攻略:从清洁到重组的必备技巧」
在现代科技生活中,手机支架已成为人们不可或缺的生活助手。无论是在办公室、家中还是旅行途中,手机支架不仅提高了使用手机的便
晨读·百年工运故事|攻坚:职工技术协作共克时艰
攻坚:职工技术协作共克时艰20世纪50年代末60年代初,新中国遭遇三年自然灾害,农业大面积减产减收,国民经济遭遇较大困难,举国
瞭望 | 上海:项目经理人“链手”总调度科创资源
  上海通过赋予项目经理人“链手”总调度权责,打破传统科技管理模式,先行聚焦脑机接口、量子计算、绿色燃料等六大未来产业,