summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2014-12-15 10:51:42 -0800
committerKevin Tang <zhikait@codeaurora.org>2014-12-15 21:21:16 -0800
commitf014665a5299f281695c8d098f7444afbf623057 (patch)
tree41e24d1249b7a8456f89c9be9377a05faee628fa
parent3aa99e9fc58817356ef6fb184e5339d5a2667222 (diff)
downloadgps-f014665a5299f281695c8d098f7444afbf623057.tar.gz
Enable "auto" target for APQ8960 Automotive ADP platform
APQ8960 Automotive platforms use "auto" as a target name for ro.baseband property. Appropriate GPS driver changes were, 1. define GNSS_AUTO enum constant 2. Enable GNSS drivers for "auto" target. Change-Id: I463db7ac1c3e2dd6101e457ad723bb16adf5aacb CRs-Fixed: 771597
-rw-r--r--loc_api/libloc_api_50001/loc.cpp1
-rw-r--r--utils/loc_log.cpp1
-rw-r--r--utils/loc_target.cpp6
-rw-r--r--utils/loc_target.h2
4 files changed, 10 insertions, 0 deletions
diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp
index 2bcfc7b..158176f 100644
--- a/loc_api/libloc_api_50001/loc.cpp
+++ b/loc_api/libloc_api_50001/loc.cpp
@@ -247,6 +247,7 @@ extern "C" const GpsInterface* get_gps_interface()
switch (gnssType)
{
case GNSS_GSS:
+ case GNSS_AUTO:
//APQ8064
gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB);
gss_fd = open("/dev/gss", O_RDONLY);
diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp
index 392966e..18182b7 100644
--- a/utils/loc_log.cpp
+++ b/utils/loc_log.cpp
@@ -113,6 +113,7 @@ loc_name_val_s_type target_name[] =
NAME_VAL(GNSS_GSS),
NAME_VAL(GNSS_MDM),
NAME_VAL(GNSS_QCA1530),
+ NAME_VAL(GNSS_AUTO),
NAME_VAL(GNSS_UNKNOWN)
};
diff --git a/utils/loc_target.cpp b/utils/loc_target.cpp
index 8dbe885..080e576 100644
--- a/utils/loc_target.cpp
+++ b/utils/loc_target.cpp
@@ -53,6 +53,7 @@
#define STR_SURF "Surf"
#define STR_MTP "MTP"
#define STR_APQ "apq"
+#define STR_AUTO "auto"
#define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r')
#define LENGTH(s) (sizeof(s) - 1)
#define GPS_CHECK_NO_ERROR 0
@@ -207,6 +208,11 @@ unsigned int loc_get_target(void)
} else {
read_a_line(id_dep, rd_id, LINE_LEN);
}
+ if( !memcmp(baseband, STR_AUTO, LENGTH(STR_AUTO)) )
+ {
+ gTarget = TARGET_AUTO;
+ goto detected;
+ }
if( !memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP)) ){
if( !memcmp(rd_id, PDS_ID_1, LENGTH(PDS_ID_1))
&& IS_STR_END(rd_id[LENGTH(PDS_ID_1)]) )
diff --git a/utils/loc_target.h b/utils/loc_target.h
index 208a34c..d7364e9 100644
--- a/utils/loc_target.h
+++ b/utils/loc_target.h
@@ -36,6 +36,7 @@
#define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC)
#define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC)
#define TARGET_PDS TARGET_SET(GNSS_PDS, NO_SSC)
+#define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC)
#define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC)
#define getTargetGnssType(target) (target>>1)
@@ -62,6 +63,7 @@ typedef enum {
GNSS_MDM,
GNSS_QCA1530,
GNSS_PDS,
+ GNSS_AUTO,
GNSS_UNKNOWN
}GNSS_TARGET;