Revert "[Feature][ZK-15][audio] Set the PA's volume gain level"
This reverts commit b046a42eb9ed370eac2bfc327955eeb6dbd5f992.
Reason for revert: <INSERT REASONING HERE>
Change-Id: I67cd18e45dd53980de4b96bf41b2fac376e0fad7
diff --git a/src/lynq/lib/liblynq-media/include/liblynq-media/lynq_medial.h b/src/lynq/lib/liblynq-media/include/liblynq-media/lynq_medial.h
index 7028a8a..1777bd6 100755
--- a/src/lynq/lib/liblynq-media/include/liblynq-media/lynq_medial.h
+++ b/src/lynq/lib/liblynq-media/include/liblynq-media/lynq_medial.h
@@ -28,10 +28,7 @@
int lynq_set_spk_volume(const int volume);
int lynq_get_mic_volume(int* volume);
int lynq_set_mic_volume(const int volume);
-#ifdef ZK_RIL_CFG
-int lynq_get_pa_volume(int* volume);
-int lynq_set_pa_volume(const int volume);
-#endif
+
int lynq_media_play_audio(const char *path);
void lynq_media_stop_audio();
#endif //__LYNQ_MEDIA_H__
diff --git a/src/lynq/lib/liblynq-media/liblynq-media/media_control.c b/src/lynq/lib/liblynq-media/liblynq-media/media_control.c
index 817be17..9f6f500 100755
--- a/src/lynq/lib/liblynq-media/liblynq-media/media_control.c
+++ b/src/lynq/lib/liblynq-media/liblynq-media/media_control.c
@@ -7,12 +7,6 @@
#include <cutils/properties.h>
//#include "modem_afe_ctrl.h"
#include <log/log.h>
-#ifdef ZK_RIL_CFG
-#include <fcntl.h>
-#include <linux/i2c-dev.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#endif
#define LOG_TAG "MEDIA_API"
#define NV_VOLUME_NAME "ro.spk.volume.level"
#define NV_MIC_VOLUME_NAME "ro.mic.volume.level"
@@ -178,117 +172,6 @@
system(cmd);
return 0;
}
-
-#ifdef ZK_RIL_CFG
-int lynq_set_pa_volume(const int volume)
-{
- int file;
- char *filename = "/dev/i2c-0";
- int addr = 0x6c;
- char buf[2];
-
- if (volume < 1 || volume > 4)
- {
- RLOGE("Invalid volume specified\n");
- return -1;
- }
-
- if ((file = open(filename, O_RDWR)) < 0)
- {
- RLOGE("Failed to open i2c bus\n");
- return -1;
- }
-
- if (ioctl(file, I2C_SLAVE, addr) < 0)
- {
- RLOGE("Failed to acquire bus access and/or talk to slave\n");
- close(file);
- return -1;
- }
-
- switch (volume) {
- case 1:
- buf[0] = 0x03;
- buf[1] = 0x00; //Gain set to 20 dB
- break;
- case 2:
- buf[0] = 0x03;
- buf[1] = 0x78; //Gain set to 26 dB
- break;
- case 3:
- buf[0] = 0x03;
- buf[1] = 0x80; //Gain set to 32 dB
- break;
- case 4:
- buf[0] = 0x03;
- buf[1] = 0xc0; //Gain set to 36 dB
- break;
- }
-
- if (write(file, buf, 2) != 2)
- {
- RLOGE("Failed to write to the i2c bus\n");
- close(file);
- return -1;
- }
-
- RLOGE("Set the 0x%02x register value to 0x%02x\n", buf[0], buf[1]);
-
- close(file);
-
- return 0;
-}
-
-int lynq_get_pa_volume(int* volume)
-{
- int file;
- char *filename = "/dev/i2c-0";
- int addr = 0x6c;
- char buf[2];
-
- if(volume == NULL)
- {
- RLOGE("lynq_get_pa_volume Invalid pointer to volume\n");
- return -1;
- }
-
- if ((file = open(filename, O_RDWR)) < 0)
- {
- RLOGE("Failed to open i2c bus\n");
- return -1;
- }
-
- if (ioctl(file, I2C_SLAVE, addr) < 0)
- {
- RLOGE("Failed to acquire bus access and/or talk to slave\n");
- close(file);
- return -1;
- }
-
- buf[0] = 0x03;
-
- if (write(file, buf, 1) != 1)
- {
- RLOGE("Failed to write to the i2c bus\n");
- close(file);
- return -1;
- }
-
- if (read(file, buf, 1) != 1)
- {
- RLOGE("Failed to read from the i2c bus\n");
- close(file);
- return -1;
- }
-
- close(file);
-
- *volume = (buf[0] >> 6) + 1;
-
- return 0;
-}
-#endif
-
static int get_spk_real_volume(const int volume_levle)
{
int real_volume;