From 89b5ed23c315dcc95093d4792cee7c445a849b6b Mon Sep 17 00:00:00 2001 From: Markinus Date: Fri, 27 Aug 2010 23:25:59 +0200 Subject: [PATCH] amss: changed some procs to dynamic amss detection --- arch/arm/mach-msm/amss_para.c | 13 ++++++++++++- arch/arm/mach-msm/include/mach/amss_para.h | 2 ++ arch/arm/mach-msm/rpc_server_dog_keepalive.c | 14 +++++--------- arch/arm/mach-msm/rpc_server_time_remote.c | 4 +++- drivers/rtc/rtc-msm7x00a.c | 17 ++++++++++++++++- 5 files changed, 38 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-msm/amss_para.c b/arch/arm/mach-msm/amss_para.c index 1e3eaeca..5ecac6c3 100644 --- a/arch/arm/mach-msm/amss_para.c +++ b/arch/arm/mach-msm/amss_para.c @@ -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) diff --git a/arch/arm/mach-msm/include/mach/amss_para.h b/arch/arm/mach-msm/include/mach/amss_para.h index 7c6061ff..2a13c7ef 100644 --- a/arch/arm/mach-msm/include/mach/amss_para.h +++ b/arch/arm/mach-msm/include/mach/amss_para.h @@ -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); diff --git a/arch/arm/mach-msm/rpc_server_dog_keepalive.c b/arch/arm/mach-msm/rpc_server_dog_keepalive.c index 5e3aac6e..87e68a05 100644 --- a/arch/arm/mach-msm/rpc_server_dog_keepalive.c +++ b/arch/arm/mach-msm/rpc_server_dog_keepalive.c @@ -18,38 +18,34 @@ #include #include #include +#include /* 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); } diff --git a/arch/arm/mach-msm/rpc_server_time_remote.c b/arch/arm/mach-msm/rpc_server_time_remote.c index 8d76f049..54d9539c 100644 --- a/arch/arm/mach-msm/rpc_server_time_remote.c +++ b/arch/arm/mach-msm/rpc_server_time_remote.c @@ -18,6 +18,8 @@ #include #include #include +#include + /* 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); } diff --git a/drivers/rtc/rtc-msm7x00a.c b/drivers/rtc/rtc-msm7x00a.c index 2aff661e..2b448d29 100644 --- a/drivers/rtc/rtc-msm7x00a.c +++ b/drivers/rtc/rtc-msm7x00a.c @@ -26,6 +26,7 @@ #include #include +#include #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); }