以上就是本篇文章【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/ , 查看更多
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
最新文章
颜霸邝玲玲,我的泰娱新老婆
看到邝玲玲的第一眼多数人就能明白为什么她可以在中国收获超高人气。中泰混血的她脸上没有泰系常见的钝感,五官流畅、大气、明艳
6G进入标准化元年 通信专家建议重点挖掘垂直行业需求
3月27日至31日,2025中关村论坛年会在京举行。期间,中国工程院院士张平,中关村泛联院院长、中国移动研究院院长黄宇红,中关村
三星手机重装系统攻略:五步轻松恢复出厂设置三星手机系统「三星手机重装系统攻略:五步轻松恢复出厂设置」
简介:在现代智能手机的使用中,重装系统或恢复出厂设置是解决许多软件问题的有效手段。对于三星手机用户,重装系统可以帮助清理
买全球吃全球 感受“舌尖上”的消博会
中国青年报客户端讯(中青校媒记者 田恒慧 中青报·中青网见习记者 戴瑶 记者 任明超)4月13日,第五届中国国际消费品博览会(简
仰天长叹,山东男篮0:2出局:落寞爆冷,克里斯成难掩的心痛短板
CBA季后赛12进8,首战失利的山东男篮,客场挑战北控男篮。对于山东男篮来说,球队已经没有任何的退路,如果再输,那么本赛季就提
新奥好彩免费资料大全-精选解释解析落实酷派5855手机「新奥好彩免费资料大全-精选解释解析落实」
新奥好彩是一款在中国颇受欢迎的彩票游戏,借助现代科技和大数据分析技术,为广大玩家提供了丰富的购彩体验与相应的策略指导。随
这家“药厂”,专治年轻人不开心
中国精酿啤酒市场,正经历舶来品的本土化蜕变。中国酒业协会数据显示,啤酒行业保持高增长,反弹性增长态势明显。《2024—2029年
理想星环OS开源,到底意味着什么?
3月27日,董事长兼CEO李想在2025中关村论坛年会上宣布开源理想汽车自研汽车操作系统——理想星环OS。上述消息在一定范围内引起热
春节送父母vivo Y200t:超高性价比手机只需873元,功能惊艳!vivo性价比最高的手机「春节送父母vivo Y200t:超高性价比手机只需873元,功能惊艳!」
春节来临,买新手机送父母成为不少子女的新年选择。在这个团圆的节日里,送一份陪伴和实用的礼物无疑能带来更多的幸福感。尤其是
爱高集团盘中最低价触及0.181港元,创近一年新低
截至4月16日收盘,(00328.HK)报0.192港元,较上个交易日下跌7.69%,当日盘中最低价触及0.181港元,创近一年新低。资金流向方面
相关文章
相关动态