diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-12-23 03:34:36 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2015-12-23 03:34:36 +0100 |
commit | cb1ef99cc1a4902a00eed54e3dfb6ea5df90ab6f (patch) | |
tree | 37d88ee5de08df68e9f26ac464ab12b3e340a1c8 | |
parent | 03b0ce0227a81087f00bb267edf2824eb34b139e (diff) | |
download | hardware_ril_samsung-ril-cb1ef99cc1a4902a00eed54e3dfb6ea5df90ab6f.zip hardware_ril_samsung-ril-cb1ef99cc1a4902a00eed54e3dfb6ea5df90ab6f.tar.gz hardware_ril_samsung-ril-cb1ef99cc1a4902a00eed54e3dfb6ea5df90ab6f.tar.bz2 |
samsung-ril-socket: mic mute implementation
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
-rw-r--r-- | include/samsung-ril-socket.h | 5 | ||||
-rw-r--r-- | samsung-ril.c | 4 | ||||
-rw-r--r-- | samsung-ril.h | 1 | ||||
-rw-r--r-- | sound.c | 21 | ||||
-rw-r--r-- | srs-client/srs-client.c | 2 | ||||
-rw-r--r-- | srs.c | 2 |
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); @@ -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; @@ -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: |