amss: changed some procs to dynamic amss detection
This commit is contained in:
parent
4d382b4e95
commit
89b5ed23c3
@ -48,6 +48,8 @@ struct amss_value amss_def_para[] = {
|
||||
{RPC_DOG_KEEPALIVE_NULL, 0, ""},
|
||||
{RPC_DOG_KEEPALIVE_BEACON, 1, ""},
|
||||
{DOG_KEEPALIVE_VERS, 0, ""},
|
||||
{HTC_PROCEDURE_SET_VIB_ON_OFF, 21, ""},
|
||||
{APP_TIMEREMOTE_PDEV_NAME, 0, "rs30000048:0x00010001"},
|
||||
};
|
||||
|
||||
|
||||
@ -84,6 +86,7 @@ struct amss_value amss_6210_para[] = {
|
||||
{RPC_ADSP_RTOS_MODEM_TO_APP_PROC, 2, ""},
|
||||
{RPC_DOG_KEEPALIVE_BEACON, 1, ""},
|
||||
{DOG_KEEPALIVE_VERS, 0, ""},
|
||||
{APP_TIMEREMOTE_PDEV_NAME, 0, "rs30000048:0x00000000"},
|
||||
};
|
||||
|
||||
struct amss_value amss_6220_para[] = {
|
||||
@ -102,6 +105,7 @@ struct amss_value amss_6220_para[] = {
|
||||
{RPC_ADSP_RTOS_MODEM_TO_APP_PROC, 2, ""},
|
||||
{RPC_DOG_KEEPALIVE_BEACON, 2, ""},
|
||||
{DOG_KEEPALIVE_VERS, 0x731fa727, ""},
|
||||
{APP_TIMEREMOTE_PDEV_NAME, 0, "rs30000048:0da5b528"},
|
||||
};
|
||||
|
||||
|
||||
@ -124,7 +128,14 @@ struct amss_value amss_6150_para[] = {
|
||||
{RPC_ADSP_RTOS_ATOM_PROG_VERS, 0, "rs3000000a:00000000"},
|
||||
};
|
||||
|
||||
struct amss_value amss_1550_para[] = {};
|
||||
struct amss_value amss_1550_para[] = {
|
||||
{TIME_REMOTE_MTOA_VERS, 0x10002, ""},
|
||||
{HTC_PROCEDURE_SET_VIB_ON_OFF, 22, ""},
|
||||
{RPC_DOG_KEEPALIVE_BEACON, 2, ""},
|
||||
{DOG_KEEPALIVE_VERS, 0x10001, ""},
|
||||
{PM_LIBVERS, 0x30001, ""},
|
||||
{APP_TIMEREMOTE_PDEV_NAME, 0, "rs30000048:0x00010002"},
|
||||
};
|
||||
|
||||
// Get the short AMSS Version ( like 6120 )
|
||||
unsigned int get_amss_version(void)
|
||||
|
@ -46,6 +46,8 @@ enum amss_ids {
|
||||
RPC_DOG_KEEPALIVE_NULL,
|
||||
RPC_DOG_KEEPALIVE_BEACON,
|
||||
DOG_KEEPALIVE_VERS,
|
||||
HTC_PROCEDURE_SET_VIB_ON_OFF,
|
||||
APP_TIMEREMOTE_PDEV_NAME,
|
||||
};
|
||||
|
||||
extern uint32_t amss_get_num_value(int);
|
||||
|
@ -18,38 +18,34 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <mach/msm_rpcrouter.h>
|
||||
#include <mach/msm_rpc_version.h>
|
||||
#include <mach/amss_para.h>
|
||||
|
||||
/* dog_keepalive server definitions */
|
||||
|
||||
#define DOG_KEEPALIVE_PROG 0x30000015
|
||||
#define RPC_DOG_KEEPALIVE_NULL 0
|
||||
|
||||
|
||||
/* TODO: Remove server registration with _VERS when modem is upated with _COMP*/
|
||||
|
||||
static int handle_rpc_call(struct msm_rpc_server *server,
|
||||
struct rpc_request_hdr *req, unsigned len)
|
||||
{
|
||||
switch (req->procedure) {
|
||||
case RPC_DOG_KEEPALIVE_NULL:
|
||||
if (req->procedure==amss_get_num_value(RPC_DOG_KEEPALIVE_NULL))
|
||||
return 0;
|
||||
case RPC_DOG_KEEPALIVE_BEACON:
|
||||
//printk(KERN_INFO "DOG KEEPALIVE PING\n");
|
||||
else if (req->procedure==amss_get_num_value(RPC_DOG_KEEPALIVE_BEACON))
|
||||
return 0;
|
||||
default:
|
||||
else
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
static struct msm_rpc_server rpc_server = {
|
||||
.prog = DOG_KEEPALIVE_PROG,
|
||||
.vers = DOG_KEEPALIVE_VERS,
|
||||
.rpc_call = handle_rpc_call,
|
||||
};
|
||||
|
||||
static int __init rpc_server_init(void)
|
||||
{
|
||||
/* Dual server registration to support backwards compatibility vers */
|
||||
rpc_server.vers = amss_get_num_value(DOG_KEEPALIVE_VERS);
|
||||
return msm_rpc_create_server(&rpc_server);
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <mach/msm_rpcrouter.h>
|
||||
#include <mach/msm_rpc_version.h>
|
||||
#include <mach/amss_para.h>
|
||||
|
||||
/* time_remote_mtoa server definitions. */
|
||||
|
||||
#define TIME_REMOTE_MTOA_PROG 0x3000005d
|
||||
@ -54,13 +56,13 @@ static int handle_rpc_call(struct msm_rpc_server *server,
|
||||
|
||||
static struct msm_rpc_server rpc_server = {
|
||||
.prog = TIME_REMOTE_MTOA_PROG,
|
||||
.vers = TIME_REMOTE_MTOA_VERS,
|
||||
.rpc_call = handle_rpc_call,
|
||||
};
|
||||
|
||||
static int __init rpc_server_init(void)
|
||||
{
|
||||
/* Dual server registration to support backwards compatibility vers */
|
||||
rpc_server.vers = amss_get_num_value(TIME_REMOTE_MTOA_VERS);
|
||||
return msm_rpc_create_server(&rpc_server);
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include <mach/msm_rpcrouter.h>
|
||||
#include <mach/msm_rpc_version.h>
|
||||
#include <mach/amss_para.h>
|
||||
|
||||
#define RTC_DEBUG 0
|
||||
|
||||
@ -257,7 +258,6 @@ static struct platform_driver msmrtc_driver = {
|
||||
.suspend = msmrtc_suspend,
|
||||
.resume = msmrtc_resume,
|
||||
.driver = {
|
||||
.name = APP_TIMEREMOTE_PDEV_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
};
|
||||
@ -265,6 +265,21 @@ static struct platform_driver msmrtc_driver = {
|
||||
static int __init msmrtc_init(void)
|
||||
{
|
||||
rtcalarm_time = 0;
|
||||
switch(__amss_version) {
|
||||
case 6210:
|
||||
msmrtc_driver.driver.name="rs30000048:00000000";
|
||||
break;
|
||||
case 6220:
|
||||
case 6225:
|
||||
msmrtc_driver.driver.name="rs30000048:0da5b528";
|
||||
break;
|
||||
case 1550:
|
||||
msmrtc_driver.driver.name="rs30000048:00010002";
|
||||
break;
|
||||
default:
|
||||
msmrtc_driver.driver.name="rs30000048:00010001";
|
||||
break;
|
||||
}
|
||||
return platform_driver_register(&msmrtc_driver);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user