summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-07-03 20:24:27 +0200
committerPaul Kocialkowski <contact@paulk.fr>2013-07-03 20:24:27 +0200
commitca37b5182b6a9a19d2fbaaf46ece99f57cc44384 (patch)
treecf1474be3118cafe6a0a6ff21f7e80e8f85ab6e5
parentcc62ac0184430edbb8719f8817c726196cf18944 (diff)
downloaddevice_samsung_i9300-ca37b5182b6a9a19d2fbaaf46ece99f57cc44384.zip
device_samsung_i9300-ca37b5182b6a9a19d2fbaaf46ece99f57cc44384.tar.gz
device_samsung_i9300-ca37b5182b6a9a19d2fbaaf46ece99f57cc44384.tar.bz2
Use Samsung-RIL and Audio-RIL-Interface
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--audio-ril-interface/Android.mk35
-rw-r--r--audio-ril-interface/audio-ril-interface.c200
-rwxr-xr-xaudio/ril_interface.h2
-rw-r--r--galaxys3_base.mk6
-rwxr-xr-xinit.smdk4x12.rc2
-rw-r--r--system.prop2
6 files changed, 244 insertions, 3 deletions
diff --git a/audio-ril-interface/Android.mk b/audio-ril-interface/Android.mk
new file mode 100644
index 0000000..0876c43
--- /dev/null
+++ b/audio-ril-interface/Android.mk
@@ -0,0 +1,35 @@
+#
+# Copyright (C) 2013 Paul Kocialkowski
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := audio-ril-interface.c
+
+LOCAL_C_INCLUDES := \
+ hardware/ril/samsung-ril/include \
+ hardware/ril/samsung-ril/srs-client/include \
+ device/samsung/i9300/audio/
+
+LOCAL_SHARED_LIBRARIES := liblog libcutils libsrs-client
+LOCAL_PRELINK_MODULE := false
+
+LOCAL_MODULE := libaudio-ril-interface
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/audio-ril-interface/audio-ril-interface.c b/audio-ril-interface/audio-ril-interface.c
new file mode 100644
index 0000000..ea53a2d
--- /dev/null
+++ b/audio-ril-interface/audio-ril-interface.c
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2013 Paul Kocialkowski
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+
+#define LOG_TAG "Audio-RIL-Interface"
+#include <cutils/log.h>
+
+#include <ril_interface.h>
+
+#include <samsung-ril-socket.h>
+#include <srs-client.h>
+
+void *OpenClient_RILD(void)
+{
+ struct srs_client *client = NULL;
+
+ LOGE("%s()", __func__);
+
+ signal(SIGPIPE, SIG_IGN);
+
+ srs_client_create(&client);
+
+ return (void *) client;
+}
+
+int Connect_RILD(void *data)
+{
+ struct srs_client *client;
+ int rc;
+
+ LOGE("%s(%p)", __func__, data);
+
+ if (data == NULL)
+ return RIL_CLIENT_ERR_INVAL;
+
+ client = (struct srs_client *) data;
+
+ rc = srs_client_open(client);
+ if (rc < 0) {
+ LOGE("%s: Failed to open SRS client", __func__);
+ return RIL_CLIENT_ERR_CONNECT;
+ }
+
+ rc = srs_client_ping(client);
+ if (rc < 0) {
+ LOGE("%s: Failed to ping SRS client", __func__);
+ return RIL_CLIENT_ERR_UNKNOWN;
+ }
+
+ return RIL_CLIENT_ERR_SUCCESS;
+}
+
+int Disconnect_RILD(void *data)
+{
+ struct srs_client *client;
+ int rc;
+
+ LOGE("%s(%p)", __func__, data);
+
+ if (data == NULL)
+ return RIL_CLIENT_ERR_INVAL;
+
+ client = (struct srs_client *) data;
+
+ rc = srs_client_close(client);
+ if (rc < 0) {
+ LOGE("%s: Failed to close SRS client", __func__);
+ return RIL_CLIENT_ERR_INVAL;
+ }
+
+ return RIL_CLIENT_ERR_SUCCESS;
+}
+
+int CloseClient_RILD(void *data)
+{
+ struct srs_client *client;
+ int rc;
+
+ LOGE("%s(%p)", __func__, data);
+
+ if (data == NULL)
+ return RIL_CLIENT_ERR_INVAL;
+
+ client = (struct srs_client *) data;
+
+ srs_client_destroy(client);
+
+ return RIL_CLIENT_ERR_SUCCESS;
+}
+
+int isConnected_RILD(void *data)
+{
+ struct srs_client *client;
+ int rc;
+
+ LOGE("%s(%p)", __func__, data);
+
+ if (data == NULL)
+ return RIL_CLIENT_ERR_INVAL;
+
+ client = (struct srs_client *) data;
+
+ rc = srs_client_ping(client);
+ if (rc < 0) {
+ LOGE("%s: Failed to ping SRS client", __func__);
+ return 0;
+ }
+
+ return 1;
+}
+
+int SetCallVolume(void *data, enum ril_sound_type type, int level)
+{
+ struct srs_client *client;
+ struct srs_snd_call_volume call_volume;
+ int rc;
+
+ LOGE("%s(%p, %d, %d)", __func__, data, type, level);
+
+ if (data == NULL)
+ return RIL_CLIENT_ERR_INVAL;
+
+ client = (struct srs_client *) data;
+
+ call_volume.type = (enum srs_snd_type) type;
+ call_volume.volume = level;
+
+ rc = srs_client_send(client, SRS_SND_SET_CALL_VOLUME, &call_volume, sizeof(call_volume));
+ if (rc < 0)
+ return RIL_CLIENT_ERR_UNKNOWN;
+
+ return RIL_CLIENT_ERR_SUCCESS;
+}
+
+
+int SetCallAudioPath(void *data, enum ril_audio_path path)
+{
+ struct srs_client *client;
+ struct srs_snd_call_audio_path call_audio_path;
+ int rc;
+
+ LOGE("%s(%p, %d)", __func__, data, path);
+
+ if (data == NULL)
+ return RIL_CLIENT_ERR_INVAL;
+
+ client = (struct srs_client *) data;
+
+ call_audio_path.path = path;
+
+ rc = srs_client_send(client, SRS_SND_SET_CALL_AUDIO_PATH, &call_audio_path, sizeof(call_audio_path));
+ if (rc < 0)
+ return RIL_CLIENT_ERR_UNKNOWN;
+
+ return RIL_CLIENT_ERR_SUCCESS;
+}
+
+int SetCallClockSync(void *data, enum ril_clock_state condition)
+{
+ struct srs_client *client;
+ struct srs_snd_call_clock_sync call_clock_sync;
+ int rc;
+
+ LOGE("%s(%p, %d)", __func__, data, condition);
+
+ if (data == NULL)
+ return RIL_CLIENT_ERR_INVAL;
+
+ client = (struct srs_client *) data;
+
+ call_clock_sync.sync = condition;
+
+ rc = srs_client_send(client, SRS_SND_SET_CALL_CLOCK_SYNC, &call_clock_sync, sizeof(call_clock_sync));
+ if (rc < 0)
+ return RIL_CLIENT_ERR_UNKNOWN;
+
+ return RIL_CLIENT_ERR_SUCCESS;
+}
+
+int RegisterUnsolicitedHandler(void *data, int command, void *callback)
+{
+ LOGE("%s(%p, %d, %p)", __func__, data, command, callback);
+
+ return RIL_CLIENT_ERR_SUCCESS;
+}
diff --git a/audio/ril_interface.h b/audio/ril_interface.h
index 676772c..76e25d8 100755
--- a/audio/ril_interface.h
+++ b/audio/ril_interface.h
@@ -17,7 +17,7 @@
#ifndef RIL_INTERFACE_H
#define RIL_INTERFACE_H
-#define RIL_CLIENT_LIBPATH "libsecril-client.so"
+#define RIL_CLIENT_LIBPATH "libaudio-ril-interface.so"
#define RIL_CLIENT_ERR_SUCCESS 0
#define RIL_CLIENT_ERR_AGAIN 1
diff --git a/galaxys3_base.mk b/galaxys3_base.mk
index ff13e45..27c3ce7 100644
--- a/galaxys3_base.mk
+++ b/galaxys3_base.mk
@@ -70,6 +70,7 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES := \
audio.primary.exynos4 \
audio.a2dp.default \
+ libaudio-ril-interface \
camera.exynos4 \
Camera \
macloader \
@@ -145,8 +146,11 @@ PRODUCT_COPY_FILES += \
device/samsung/i9300/configs/media_profiles.xml:system/etc/media_profiles.xml
# RIL
+PRODUCT_PACKAGES += \
+ libsamsung-ril \
+ ipc-modemctrl
+
PRODUCT_PROPERTY_OVERRIDES += \
- ro.telephony.ril_class=Smdk4210RIL \
mobiledata.interfaces=pdp0,wlan0,gprs,ppp0
# Filesystem management tools
diff --git a/init.smdk4x12.rc b/init.smdk4x12.rc
index 0d9051d..64cb9ae 100755
--- a/init.smdk4x12.rc
+++ b/init.smdk4x12.rc
@@ -159,6 +159,8 @@ on post-fs-data
chown radio system /sys/devices/system/cpu/cpufreq/pegasusq/hotplug_lock
chown radio system /sys/devices/system/cpu/busfreq/curr_freq
chown radio system /sys/module/mali/parameters/mali_dvfs_control
+ chown radio system /sys/devices/platform/s5p-ehci/ehci_power
+ chown radio system /sys/devices/platform/s5p-ohci/ohci_power
chown system radio /sys/bus/platform/devices/s5p-tmu/lot_id
chmod 0660 /sys/power/state
chmod 0660 /sys/power/wake_lock
diff --git a/system.prop b/system.prop
index bc66739..82db9de 100644
--- a/system.prop
+++ b/system.prop
@@ -2,7 +2,7 @@
# system.prop for smdk4x12
#
-rild.libpath=/system/lib/libsec-ril.so
+rild.libpath=/system/lib/libsamsung-ril.so
rild.libargs=-d /dev/ttyS0
ro.sf.lcd_density=320
ro.lcd_min_brightness=20