From 6336681f2b16b3bb88388bb3d3f78ef83b5efc2c Mon Sep 17 00:00:00 2001 From: "K. Cotulla Ivan" Date: Mon, 27 Sep 2010 00:46:10 +0200 Subject: [PATCH] htcleo: add switchable RPC init --- arch/arm/mach-msm/smd_rpcrouter.c | 47 +++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-msm/smd_rpcrouter.c b/arch/arm/mach-msm/smd_rpcrouter.c index dd70ea0c..28771d10 100644 --- a/arch/arm/mach-msm/smd_rpcrouter.c +++ b/arch/arm/mach-msm/smd_rpcrouter.c @@ -44,6 +44,10 @@ #include #include "smd_rpcrouter.h" +#if defined(CONFIG_MACH_HTCLEO) +#include "board-htcleo.h" +#endif + #define TRACE_R2R_MSG 0 #define TRACE_R2R_RAW 0 #define TRACE_RPC_MSG 0 @@ -139,15 +143,19 @@ static int rpcrouter_send_control_msg(union rr_control_msg *msg) RR("send control message cmd=%d srv.cmd=%d prog=%08x:%x id=%d:%08x\n", msg->cmd, msg->srv.cmd, msg->srv.prog, msg->srv.vers, msg->srv.pid, msg->srv.cid); - if (!(msg->cmd == RPCROUTER_CTRL_CMD_HELLO -#if defined(CONFIG_MACH_HTCLEO) - || msg->cmd == RPCROUTER_CTRL_CMD_BYE -#endif - ) && !initialized) { + if (!(msg->cmd == RPCROUTER_CTRL_CMD_HELLO) && !initialized) { printk(KERN_ERR "rpcrouter_send_control_msg(): Warning, " "router not initialized\n"); return -EINVAL; } +#if defined(CONFIG_MACH_HTCLEO) + if ((msg->cmd == RPCROUTER_CTRL_CMD_BYE) && !initialized && !htcleo_is_nand_boot()) + { + printk(KERN_ERR "rpcrouter_send_control_msg(): Warning, " + "router not initialized\n"); + return -EINVAL; + } +#endif hdr.version = RPCROUTER_VERSION; hdr.type = msg->cmd; @@ -400,7 +408,13 @@ static int process_control_msg(union rr_control_msg *msg, int len) RR("x HELLO\n"); memset(&ctl, 0, sizeof(ctl)); -#if !defined(CONFIG_MACH_HTCLEO) +#if defined(CONFIG_MACH_HTCLEO) + if (htcleo_is_nand_boot()) + { + ctl.cmd = RPCROUTER_CTRL_CMD_HELLO; + rpcrouter_send_control_msg(&ctl); + } +#else ctl.cmd = RPCROUTER_CTRL_CMD_HELLO; rpcrouter_send_control_msg(&ctl); #endif @@ -1286,18 +1300,21 @@ static int msm_rpcrouter_probe(struct platform_device *pdev) queue_work(rpcrouter_workqueue, &work_read_data); #if defined(CONFIG_MACH_HTCLEO) - msg.cmd = RPCROUTER_CTRL_CMD_BYE; - rpcrouter_send_control_msg(&msg); - msleep(50); + if (!htcleo_is_nand_boot()) + { + msg.cmd = RPCROUTER_CTRL_CMD_BYE; + rpcrouter_send_control_msg(&msg); + msleep(50); - /* wince rpc init */ - msg.cmd = RPCROUTER_CTRL_CMD_HELLO; - rpcrouter_send_control_msg(&msg); - msleep(50); + /* wince rpc init */ + msg.cmd = RPCROUTER_CTRL_CMD_HELLO; + rpcrouter_send_control_msg(&msg); + msleep(50); - process_control_msg(&msg, sizeof(msg)); - msleep(100); + process_control_msg(&msg, sizeof(msg)); + msleep(100); + } #endif return 0;