summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/samsung-ril-socket.h5
-rw-r--r--samsung-ril.c4
-rw-r--r--samsung-ril.h1
-rw-r--r--sound.c21
-rw-r--r--srs-client/srs-client.c2
-rw-r--r--srs.c2
6 files changed, 35 insertions, 0 deletions
diff --git a/include/samsung-ril-socket.h b/include/samsung-ril-socket.h
index 8282727..a21b3a9 100644
--- a/include/samsung-ril-socket.h
+++ b/include/samsung-ril-socket.h
@@ -39,6 +39,7 @@
#define SRS_SND_SET_CALL_VOLUME 0x0201
#define SRS_SND_SET_CALL_AUDIO_PATH 0x0202
#define SRS_SND_SET_CALL_CLOCK_SYNC 0x0203
+#define SRS_SND_SET_MIC_MUTE 0x0204
#define SRS_TEST_SET_RADIO_STATE 0x0301
@@ -113,6 +114,10 @@ struct srs_snd_call_clock_sync_data {
unsigned char sync;
} __attribute__((__packed__));
+struct srs_snd_mic_mute_data {
+ int mute;
+} __attribute__((__packed__));
+
struct srs_test_set_radio_state_data {
int state;
} __attribute__((__packed__));
diff --git a/samsung-ril.c b/samsung-ril.c
index 8174e72..bcfb7ff 100644
--- a/samsung-ril.c
+++ b/samsung-ril.c
@@ -238,6 +238,10 @@ struct srs_dispatch_handler srs_dispatch_handlers[] = {
.handler = srs_snd_set_call_clock_sync,
},
{
+ .command = SRS_SND_SET_MIC_MUTE,
+ .handler = srs_snd_set_mic_mute,
+ },
+ {
.command = SRS_TEST_SET_RADIO_STATE,
.handler = srs_test_set_radio_state,
},
diff --git a/samsung-ril.h b/samsung-ril.h
index 7c60449..497e72c 100644
--- a/samsung-ril.h
+++ b/samsung-ril.h
@@ -347,6 +347,7 @@ int ril_request_set_preferred_network_type(void *data, size_t size,
int srs_snd_set_call_volume(struct srs_message *message);
int ril_request_set_mute(void *data, size_t size, RIL_Token token);
+int srs_snd_set_mic_mute(struct srs_message *message);
int srs_snd_set_call_audio_path(struct srs_message *message);
int srs_snd_set_call_clock_sync(struct srs_message *message);
diff --git a/sound.c b/sound.c
index 22601b3..5c23023 100644
--- a/sound.c
+++ b/sound.c
@@ -116,6 +116,27 @@ complete:
return rc;
}
+int srs_snd_set_mic_mute(struct srs_message *message)
+{
+ struct ipc_snd_mic_mute_ctrl_data request_data;
+ struct srs_snd_mic_mute_data *data;
+ int rc;
+
+ if (message == NULL || message->data == NULL || message->size < sizeof(struct srs_snd_mic_mute_data))
+ return -1;
+
+ data = (struct srs_snd_mic_mute_data *) message->data;
+
+ memset(&request_data, 0, sizeof(request_data));
+ request_data.mute = !!(data->mute);
+
+ rc = ipc_fmt_send(ipc_fmt_seq(), IPC_SND_MIC_MUTE_CTRL, IPC_TYPE_SET, (void *) &request_data, sizeof(request_data));
+ if (rc < 0)
+ return 0;
+
+ return 0;
+}
+
int srs_snd_set_call_audio_path(struct srs_message *message)
{
struct ipc_snd_audio_path_ctrl_data request_data;
diff --git a/srs-client/srs-client.c b/srs-client/srs-client.c
index 2e1c75d..d16c597 100644
--- a/srs-client/srs-client.c
+++ b/srs-client/srs-client.c
@@ -56,6 +56,8 @@ const char *srs_command_string(unsigned short command)
return "SRS_SND_SET_CALL_AUDIO_PATH";
case SRS_SND_SET_CALL_CLOCK_SYNC:
return "SRS_SND_SET_CALL_CLOCK_SYNC";
+ case SRS_SND_SET_MIC_MUTE:
+ return "SRS_SND_SET_MIC_MUTE";
default:
snprintf((char *) &command_string, sizeof(command_string), "0x%04x", command);
return command_string;
diff --git a/srs.c b/srs.c
index 38427a2..8353de8 100644
--- a/srs.c
+++ b/srs.c
@@ -55,6 +55,8 @@ const char *srs_command_string(unsigned short command)
return "SRS_SND_SET_CALL_AUDIO_PATH";
case SRS_SND_SET_CALL_CLOCK_SYNC:
return "SRS_SND_SET_CALL_CLOCK_SYNC";
+ case SRS_SND_SET_MIC_MUTE:
+ return "SRS_SND_SET_MIC_MUTE";
case SRS_TEST_SET_RADIO_STATE:
return "SRS_TEST_SET_RADIO_STATE";
default: