htcleo: sent missing AT commands to fix RIL on NAND boot.

We cannot load ril wrapper library (libhtc_ril_wrapper.so) if we want to load GAN RIL (libganril.so) to support T-Mobile WiFi Calling (UMA).
So I fix RIL on NAND boot in kernel, not via ril wrapper library.
This commit is contained in:
tytung 2011-04-25 01:03:41 +08:00
parent d0fb339c5f
commit bdfeaacf04

View File

@ -27,6 +27,7 @@
#include <mach/msm_smd.h>
#include <mach/amss_para.h>
#include "board-htcleo.h"
#define MAX_SMD_TTYS 32
@ -205,6 +206,13 @@ static int smd_tty_write(struct tty_struct *tty,
struct smd_tty_info *info = tty->driver_data;
int avail;
int ret;
#ifdef CONFIG_MACH_HTCLEO
static int init=0;
const unsigned char* firstcall ="AT@BRIC=0\r";
const unsigned char* secondcall="AT+CFUN=0\r";
const unsigned char* thirdcall ="AT+COPS=2\r";
unsigned int call_len;
#endif
/* if we're writing to a packet channel we will
** never be able to write more data than there
@ -213,10 +221,37 @@ static int smd_tty_write(struct tty_struct *tty,
#ifndef CONFIG_MACH_HTCLEO
mutex_lock(&smd_tty_lock);
#endif
#ifdef CONFIG_MACH_HTCLEO
if(len>7 && !init && htcleo_is_nand_boot()) {
pr_info("NAND boot, writing additional init commands to /dev/smd0");
call_len = strlen(firstcall);
avail = smd_write_avail(info->ch);
if (call_len > avail)
call_len = avail;
ret = smd_write(info->ch, firstcall, call_len);
call_len = strlen(secondcall);
avail = smd_write_avail(info->ch);
if (call_len > avail)
call_len = avail;
ret = smd_write(info->ch, secondcall, call_len);
call_len = strlen(thirdcall);
avail = smd_write_avail(info->ch);
if (call_len > avail)
call_len = avail;
ret = smd_write(info->ch, thirdcall, call_len);
init=1;
}
avail = smd_write_avail(info->ch);
if (len > avail)
len = avail;
ret = smd_write(info->ch, buf, len);
#endif
#ifndef CONFIG_MACH_HTCLEO
mutex_unlock(&smd_tty_lock);
#endif