From 7bf409edb0e3d78eaaab972467298a2cf4ee116c Mon Sep 17 00:00:00 2001 From: "Christopher N. Hesse" Date: Fri, 26 Jun 2015 14:53:56 +0200 Subject: [PATCH] libril: Add support for ST-Ericsson Thor M7450 modems The M7450 modem used in the Galaxy Note 4 (N910C variant) uses a libril implementation similar to the one employed for Intel XMM* modems by Samsung. This probably needs future adjustments, but so far fixes basic call functions and signal strength is displayed correctly. Change-Id: I2d070102ad11746902527da3c2c7f49485c7d7f1 --- ril/Android.mk | 2 +- ril/libril/Android.mk | 3 +++ ril/libril/ril.cpp | 14 +++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ril/Android.mk b/ril/Android.mk index 2aa2119..8008ace 100644 --- a/ril/Android.mk +++ b/ril/Android.mk @@ -20,7 +20,7 @@ ifeq ($(BOARD_VENDOR),samsung) # libril ifeq ($(BOARD_PROVIDES_LIBRIL),true) -ifneq ($(filter xmm6260 xmm6262 xmm6360 xmm7260,$(BOARD_MODEM_TYPE)),) +ifneq ($(filter xmm6260 xmm6262 xmm6360 xmm7260 m7450,$(BOARD_MODEM_TYPE)),) include $(RIL_PATH)/libril/Android.mk endif endif diff --git a/ril/libril/Android.mk b/ril/libril/Android.mk index 49f718c..71278b0 100644 --- a/ril/libril/Android.mk +++ b/ril/libril/Android.mk @@ -26,6 +26,9 @@ endif ifeq ($(BOARD_MODEM_TYPE),xmm7260) LOCAL_CFLAGS := -DMODEM_TYPE_XMM7260 endif +ifeq ($(BOARD_MODEM_TYPE),m7450) +LOCAL_CFLAGS := -DMODEM_TYPE_M7450 +endif LOCAL_MODULE:= libril diff --git a/ril/libril/ril.cpp b/ril/libril/ril.cpp index c7da4da..890e738 100644 --- a/ril/libril/ril.cpp +++ b/ril/libril/ril.cpp @@ -791,7 +791,7 @@ dispatchDial (Parcel &p, RequestInfo *pRI) { int32_t sizeOfDial; int32_t t; int32_t uusPresent; -#ifdef MODEM_TYPE_XMM7260 +#if defined(MODEM_TYPE_XMM7260) || defined(MODEM_TYPE_M7450) char *csv; #endif status_t status; @@ -807,7 +807,7 @@ dispatchDial (Parcel &p, RequestInfo *pRI) { goto invalid; } -#ifdef MODEM_TYPE_XMM7260 +#if defined(MODEM_TYPE_XMM7260) || defined(MODEM_TYPE_M7450) /* CallDetails.call_type */ status = p.readInt32(&t); if (status != NO_ERROR) { @@ -837,7 +837,7 @@ dispatchDial (Parcel &p, RequestInfo *pRI) { } if (uusPresent == 0) { -#if defined(MODEM_TYPE_XMM6262) || defined(MODEM_TYPE_XMM7260) +#if defined(MODEM_TYPE_XMM6262) || defined(MODEM_TYPE_XMM7260) || defined(MODEM_TYPE_M7450) dial.uusInfo = NULL; #elif defined(MODEM_TYPE_XMM6260) /* Samsung hack */ @@ -2368,7 +2368,7 @@ static int responseCallList(Parcel &p, void *response, size_t responselen) { p.writeInt32(p_cur->als); p.writeInt32(p_cur->isVoice); -#ifdef MODEM_TYPE_XMM7260 +#if defined(MODEM_TYPE_XMM7260) || defined(MODEM_TYPE_M7450) p.writeInt32(p_cur->isVideo); /* Pass CallDetails */ @@ -2405,7 +2405,7 @@ static int responseCallList(Parcel &p, void *response, size_t responselen) { p_cur->als, (p_cur->isVoice)?"voc":"nonvoc", (p_cur->isVoicePrivacy)?"evp":"noevp"); -#ifdef MODEM_TYPE_XMM7260 +#if defined(MODEM_TYPE_XMM7260) || defined(MODEM_TYPE_M7450) appendPrintBuf("%s,%s,", printBuf, (p_cur->isVideo) ? "vid" : "novid"); @@ -3008,7 +3008,7 @@ static int responseRilSignalStrength(Parcel &p, p.writeInt32(p_cur->GW_SignalStrength.bitErrorRate); -#if defined(MODEM_TYPE_XMM6262) || defined(MODEM_TYPE_XMM7260) +#if defined(MODEM_TYPE_XMM6262) || defined(MODEM_TYPE_XMM7260) || defined(MODEM_TYPE_M7450) cdmaDbm = p_cur->CDMA_SignalStrength.dbm & 0xFF; if (cdmaDbm < 0) { cdmaDbm = 99; @@ -3021,7 +3021,7 @@ static int responseRilSignalStrength(Parcel &p, p.writeInt32(cdmaDbm); p.writeInt32(p_cur->CDMA_SignalStrength.ecio); -#if defined(MODEM_TYPE_XMM6262) || defined(MODEM_TYPE_XMM7260) +#if defined(MODEM_TYPE_XMM6262) || defined(MODEM_TYPE_XMM7260) || defined(MODEM_TYPE_M7450) evdoDbm = p_cur->EVDO_SignalStrength.dbm & 0xFF; if (evdoDbm < 0) { evdoDbm = 99; -- 2.20.1