rithchen, on May 19 2011, 02:35, said:
What clock rate are you use?
And did you use my fix2 kerenl to compare?
I raise the voltage to 1300mv at 883mhz.
If your crash situation(gunfabio's kernel) was above 768mhz, change the speed to 768mhz, and try again.
BTW, i still working on the voice issue on skype, and it's not about mic, it's about audio encoding in qualcomm's dsp.
I uploaded my voice iput fix, and here is what i have done.
fix vibrator problem
--- drivers/i2c/chips/avr.c 2011-05-21 21:26:04.918463238 -0700
+++ ../gnufabio-acer_liquid_chocolate-5318d09_ori/drivers/i2c/chips/avr.c 2011-05-21 21:25:24.766483670 -0700
@@ -74,21 +74,19 @@
#define AVR_KEYMASK_DIRECTION (AVR_KEY_UP|AVR_KEY_DOWN|AVR_KEY_LEFT|AVR_KEY_RIGHT)
-#define AVR_LED_DELAY_TIME 10000
+#define AVR_LED_DELAY_TIME 5000
#define BACKLIGHT_LEVEL_ON 0x8
/* AVR Sensitivity */
#define USE_FS 1
#define SENSITIVITY_REG 0x60
-#define SENSITIVITY 20
+#define SENSITIVITY 30
/* Vibrator */
-#define PM_LIBPROG 0x30000061
-#define PM_LIBVERS 0x10001
-#define ONCRPC_PM_VIB_MOT_SET_VOLT_PROC 22
-#define ONCRPC_PM_VIB_MOT_SET_MODE_PROC 23
-#define VIB_DELAY_TIME 30
+#define VIB_DELAY_TIME 35
+void pmic_vibrator_on(struct work_struct *work);
+void pmic_vibrator_off(struct work_struct *work);
static int __init avr_init(void);
static int avr_probe(struct i2c_client *client, const struct i2c_device_id *id);
@@ -108,6 +106,7 @@
static void low_power_mode(struct i2c_client *client, int mode);
static void key_clear(struct i2c_client *client);
static void avr_led_work_func(struct work_struct *work);
+static void avr_vib_work_func(struct work_struct *work);
#ifdef CONFIG_HAS_EARLYSUSPEND
static void avr_early_suspend(struct early_suspend *h);
static void avr_early_resume(struct early_suspend *h);
@@ -119,15 +118,16 @@
static bool kpd_pwr_key_check = false;
static struct mutex avr_mutex;
static struct delayed_work led_wq;
-static bool led_call = false;
+static struct delayed_work vib_wq;
+
+static int vibr=1;
+module_param(vibr, int, S_IRUGO | S_IWUSR | S_IWGRP);
static const struct i2c_device_id avr_id[] = {
{ AVR_DRIVER_NAME, 0 },
{ }
};
-
-
/* Data for I2C driver */
static struct avr_data {
struct i2c_client *client;
@@ -139,6 +139,7 @@
#endif
unsigned long last_jiffies;
int prekey;
+ int suspended;
} avr_data;
/*File operation of AVR device file */
@@ -223,20 +224,6 @@
#endif
-static int __init avr_init(void)
-{
- int res=0;
-
- res = i2c_add_driver(&avr_driver);
-
- if (res){
- pr_err("[AVR]i2c_add_driver failed! \n");
- return res;
- }
-
- return 0;
-}
-
static int avr_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
@@ -264,6 +251,7 @@
init_waitqueue_head(&avr_data.wait);
INIT_DELAYED_WORK(&led_wq, avr_led_work_func);
+ INIT_DELAYED_WORK(&vib_wq, avr_vib_work_func);
/* input register */
avr_data.input = input_allocate_device();
@@ -382,24 +370,26 @@
#ifdef CONFIG_HAS_EARLYSUSPEND
static void avr_early_suspend(struct early_suspend *h)
{
- pr_info("[AVR] %s ++ entering\n", __FUNCTION__);
+ pr_debug("[AVR] %s ++ entering\n", __FUNCTION__);
- led_call = false;
kpd_resume_check = false;
+ avr_data.suspended=1;
key_clear(avr_data.client);
+ led_off(avr_data.client);
disable_irq(avr_data.client->irq);
- low_power_mode(avr_data.client,1);
+ low_power_mode(avr_data.client, 1);
- pr_info("[AVR] %s -- leaving\n", __FUNCTION__);
+ pr_debug("[AVR] %s -- leaving\n", __FUNCTION__);
}
static void avr_early_resume(struct early_suspend *h)
{
- pr_info("[AVR] %s ++ entering\n", __FUNCTION__);
+ pr_debug("[AVR] %s ++ entering\n", __FUNCTION__);
low_power_mode(avr_data.client,0);
enable_irq(avr_data.client->irq);
+ avr_data.suspended=0;
kpd_resume_check = true;
if(kpd_pwr_key_check){
@@ -407,7 +397,7 @@
led_on(avr_data.client);
}
- pr_info("[AVR] %s -- leaving\n", __FUNCTION__);
+ pr_debug("[AVR] %s -- leaving\n", __FUNCTION__);
}
#endif
@@ -464,17 +454,17 @@
mutex_unlock(&avr_mutex);
return;
}
-
+
cancel_delayed_work(&led_wq);
- if ( key_st != 0)
- {
+ /* TODO: Check KPD LED Function */
+ if ( key_st != 0)
led_on(client);
- led_call = true;
- }
else
schedule_delayed_work(&led_wq, msecs_to_jiffies(AVR_LED_DELAY_TIME));
+
+
if(kpd_fw_check) {
switch(key_st){
case AVR_KEY_MENU:
@@ -526,6 +516,10 @@
/* Send key release if not equal to last key */
if( key_code != avr_data.prekey ){
input_report_key(avr_data.input, avr_data.prekey, 0);
+ if(vibr == 1 && key_code != 0) {
+ pmic_vibrator_on(NULL);
+ schedule_delayed_work(&vib_wq, msecs_to_jiffies(VIB_DELAY_TIME));
+ }
}
/* Send key press if key_code != 0 */
if( key_code ) {
@@ -589,14 +583,6 @@
return -ENOTTY;
}
- if(_IOC_DIR(cmd) & _IOC_READ)
- err = !access_ok(VERIFY_WRITE,(void __user*)arg, _IOC_SIZE(cmd));
- else if(_IOC_DIR(cmd) & _IOC_WRITE)
- err = !access_ok(VERIFY_READ, (void __user*)arg, _IOC_SIZE(cmd));
- if(err){
- pr_err("cmd access_ok error\n");
- return -EFAULT;
- }
if( client == NULL){
pr_err("I2C driver not install (AVR_ioctl)\n");
return -EFAULT;
@@ -613,11 +599,6 @@
pr_debug("[AVR] IOCTL_bSIMPLE_TEST_ON. \n");
break;
case IOCTL_SET_LED_ON:
- if(led_call){
- led_call = false;
- return 0;
- }
-
if(kpd_resume_check){
data_buf[0] = I2C_REG_LED_1;
data_buf[1] = AVR_LED_ON;
@@ -681,7 +662,7 @@
i2c_write(client, data_buf);
mutex_unlock(&avr_mutex);
- pr_debug("[AVR] IOCTL_SET_BL_LV, Set backlight 0x%02X. \n", data_buf[1]);
+ pr_debug("[AVR] IOCTL_SET_BL_LV, Set backlight 0x%02X (asked 0x%02X). \n", data_buf[1], arg);
return err;
case IOCTL_KEY_LOCK_TOGGLE:
data_buf[0] = I2C_REG_KEY_LOCK;
@@ -757,6 +738,8 @@
static void led_on(struct i2c_client *client){
uint8_t data_buf[2] = {0};
+ if(!client)
+ return;
data_buf[0] = I2C_REG_LED_1;
data_buf[1] = AVR_LED_ON;
i2c_write(client, data_buf);
@@ -809,10 +792,66 @@
pr_debug("[AVR] Clear Key Value.\n");
}
-static void avr_led_work_func(struct work_struct *work)
-{
+static void avr_led_work_func(struct work_struct *work) {
led_off(avr_data.client);
- led_call = false;
+ pr_debug("[AVR] Enter LED delay 5 Sec\n");
+}
+
+static void avr_vib_work_func(struct work_struct *work) {
+ pmic_vibrator_off(NULL);
+}
+
+//Blinking code
+
+static struct delayed_work blink_wq;
+static int status=0;
+
+void avr_blink(int value) {
+ status=0;
+ if(value) {
+ if(avr_data.suspended)
+ low_power_mode(avr_data.client, 0);
+ printk("Scheduling blinking\n");
+ schedule_delayed_work(&blink_wq, msecs_to_jiffies(30));
+ } else {
+ cancel_delayed_work(&blink_wq);
+ if(avr_data.suspended) {
+ low_power_mode(avr_data.client, 1);
+ } else {
+ led_on(avr_data.client);
+ printk("Scheduling 5s off\n");
+ schedule_delayed_work(&led_wq, msecs_to_jiffies(AVR_LED_DELAY_TIME));
+ }
+ }
+}
+
+static void blink_work_func(struct work_struct *work) {
+ status=!status;
+ if(status) {
+ printk("Blink turning on\n");
+ led_on(avr_data.client);
+ schedule_delayed_work(&blink_wq, msecs_to_jiffies(500));
+ } else {
+ printk("Blink turning off\n");
+ led_off(avr_data.client);
+ schedule_delayed_work(&blink_wq, msecs_to_jiffies(4500));
+ }
+}
+
+static int __init avr_init(void)
+{
+ int res=0;
+
+ INIT_DELAYED_WORK(&blink_wq, blink_work_func);
+ cancel_delayed_work(&blink_wq);
+ res = i2c_add_driver(&avr_driver);
+
+ if (res){
+ pr_err("[AVR]i2c_add_driver failed! \n");
+ return res;
+ }
+
+ return 0;
}
module_init(avr_init);
fix usb problem
--- arch/arm/mach-msm/board-qsd8x50.c 2011-05-21 22:28:35.256471390 -0700
+++ ../gnufabio-acer_liquid_chocolate-5318d09_ori/arch/arm/mach-msm/board-qsd8x50.c 2011-05-18 14:43:27.000000000 -0700
@@ -194,21 +194,12 @@
/* dynamic composition */
static struct usb_composition usb_func_composition[] = {
{
- .product_id = 0x3203,
- /* DIAG + ADB + GENERIC MODEM + GENERIC NMEA + MSC*/
- .functions = 0x2764,
- .adb_product_id = 0x3202,
- .adb_functions = 0x27614
- },
-#ifdef CONFIG_USB_ANDROID_RNDIS
- {
- /* RNDIS */
.product_id = 0x3223,
- .functions = 0x764A,
+ /* DIAG + ADB + GENERIC MODEM + GENERIC NMEA + MSC+ RNDIS*/
+ .functions = 0x2764A,
.adb_product_id = 0x3222,
- .adb_functions = 0x7614A,
+ .adb_functions = 0x27614A,
},
-#endif
};
#else
/* dynamic composition */
--- drivers/usb/gadget/android.c 2011-05-21 21:36:23.610461922 -0700
+++ ../gnufabio-acer_liquid_chocolate-5318d09_ori/drivers/usb/gadget/android.c 2011-05-18 14:43:27.000000000 -0700
@@ -68,7 +68,7 @@
MODULE_VERSION("1.0");
/* product id */
-static u16 product_id = 0x3203;
+static u16 product_id = 0x3223;
static int android_set_pid(const char *val, struct kernel_param *kp);
static int android_get_pid(char *buffer, struct kernel_param *kp);
module_param_call(product_id, android_set_pid, android_get_pid,
@@ -290,8 +290,6 @@
.label = "android",
.bind = android_bind_config,
.bConfigurationValue = 1,
- .bmAttributes = (USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER |
- USB_CONFIG_ATT_WAKEUP),
.bMaxPower = 0xFA, /* 500ma */
};
@@ -300,9 +298,7 @@
if (acm_func_cnt || gser_func_cnt)
gserial_cleanup();
#if defined(CONFIG_USB_ANDROID_CDC_ECM) || defined(CONFIG_USB_ANDROID_RNDIS)
-#ifndef CONFIG_MACH_ACER_A1
gether_cleanup();
-#endif //#ifndef CONFIG_MACH_ACER_A1f
#endif
return 0;
@@ -348,28 +344,16 @@
device_desc.idProduct = __constant_cpu_to_le16(product_id);
if (gadget->ops->wakeup)
android_config_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
-
+ if (dev->pdata->self_powered && !usb_gadget_set_selfpowered(gadget))
+ android_config_driver.bmAttributes |= USB_CONFIG_ATT_SELFPOWER;
dev->cdev = cdev;
dev->gadget = gadget;
#if defined(CONFIG_USB_ANDROID_CDC_ECM) || defined(CONFIG_USB_ANDROID_RNDIS)
/* set up network link layer */
-#ifdef CONFIG_MACH_ACER_A1
- {
- static int x=0;
- if(!x){
- x++;
- ret = gether_setup(cdev->gadget, hostaddr);
- if (ret < 0)
- return ret;
- }
- }
-#else
ret = gether_setup(cdev->gadget, hostaddr);
if (ret < 0)
return ret;
-#endif //CONFIG_MACH_ACER_A1
-
#endif
/* register our configuration */
@@ -395,7 +379,6 @@
device_desc.bcdDevice = __constant_cpu_to_le16(0x9999);
}
- usb_gadget_set_selfpowered(gadget);
num_ports = acm_func_cnt + gser_func_cnt;
if (acm_func_cnt || gser_func_cnt) {
ret = gserial_setup(cdev->gadget, num_ports);
@@ -708,11 +691,6 @@
static void __exit cleanup(void)
{
-#ifdef CONFIG_MACH_ACER_A1
-#if defined(CONFIG_USB_ANDROID_CDC_ECM) || defined(CONFIG_USB_ANDROID_RNDIS)
- gether_cleanup();
-#endif
-#endif //CONFIG_MACH_ACER_A1
usb_composite_unregister(&android_usb_driver);
misc_deregister(&adb_enable_device);
platform_driver_unregister(&android_platform_driver);
fix voice input
--- arch/arm/mach-msm/qdsp6/q6audio.c 2011-05-21 20:56:23.566463307 -0700
+++ ../gnufabio-acer_liquid_chocolate-5318d09_ori/arch/arm/mach-msm/qdsp6/q6audio.c 2011-05-18 14:43:27.000000000 -0700
@@ -80,28 +80,28 @@
#else
static struct q6_hw_info q6_audio_hw[Q6_HW_COUNT] = {
[Q6_HW_HANDSET] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -400,
+ .max_gain = 1100,
},
[Q6_HW_HEADSET] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -1100,
+ .max_gain = 400,
},
[Q6_HW_SPEAKER] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -1000,
+ .max_gain = 500,
},
[Q6_HW_TTY] = {
- .min_gain = -2000,
+ .min_gain = 0,
.max_gain = 0,
},
[Q6_HW_BT_SCO] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -1100,
+ .max_gain = 400,
},
[Q6_HW_BT_A2DP] = {
- .min_gain = -903,
- .max_gain = 602,
+ .min_gain = -1100,
+ .max_gain = 400,
},
};
#endif
@@ -149,54 +149,69 @@
analog_ops = ops;
}
-static struct q6_device_info *q6_lookup_device(uint32_t device_id)
+static struct q6_device_info *q6_lookup_device(uint32_t device_id,
+ uint32_t acdb_id)
{
struct q6_device_info *di = q6_audio_devices;
- for (;

{
- if (di->id == device_id)
- return di;
- if (di->id == 0) {
- pr_err("q6_lookup_device: bogus id 0x%08x\n",
- device_id);
- return di;
+
+ if (acdb_id) {
+ for (;

{
+ if (di->cad_id == acdb_id && di->id == device_id)
+ return di;
+ if (di->id == 0) {
+ pr_err("q6_lookup_device: bogus id 0x%08x\n",
+ device_id);
+ return di;
+ }
+ di++;
+ }
+ } else {
+ for (;

{
+ if (di->id == device_id)
+ return di;
+ if (di->id == 0) {
+ pr_err("q6_lookup_device: bogus id 0x%08x\n",
+ device_id);
+ return di;
+ }
+ di++;
}
- di++;
}
}
static uint32_t q6_device_to_codec(uint32_t device_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
return di->codec;
}
static uint32_t q6_device_to_dir(uint32_t device_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
return di->dir;
}
static uint32_t q6_device_to_cad_id(uint32_t device_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
return di->cad_id;
}
-static uint32_t q6_device_to_path(uint32_t device_id)
+static uint32_t q6_device_to_path(uint32_t device_id, uint32_t acdb_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, acdb_id);
return di->path;
}
static uint32_t q6_device_to_rate(uint32_t device_id)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
return di->rate;
}
int q6_device_volume(uint32_t device_id, int level)
{
- struct q6_device_info *di = q6_lookup_device(device_id);
+ struct q6_device_info *di = q6_lookup_device(device_id, 0);
struct q6_hw_info *hw;
hw = &q6_audio_hw[di->hw];
@@ -622,8 +637,14 @@
memset(&rpc, 0, sizeof(rpc));
rpc.hdr.opcode = ADSP_AUDIO_IOCTL_SET_DEVICE_CONFIG_TABLE;
- if (q6_device_to_dir(device_id) == Q6_TX)
- rpc.hdr.data = tx_clk_freq;
+ if (q6_device_to_dir(device_id) == Q6_TX) {
+ if (tx_clk_freq > 16000)
+ rpc.hdr.data = 48000;
+ else if (tx_clk_freq > 8000)
+ rpc.hdr.data = 16000;
+ else
+ rpc.hdr.data = 8000;
+ }
rpc.device_id = device_id;
rpc.phys_addr = audio_phys;
rpc.phys_size = size;
@@ -1072,21 +1093,28 @@
{
audio_tx_analog_enable(1);
- adie_enable();
- adie_set_path(adie, audio_tx_path_id, ADIE_PATH_TX);
+ if (audio_tx_path_id) {
+ adie_enable();
+ adie_set_path(adie, audio_tx_path_id, ADIE_PATH_TX);
- if (tx_clk_freq > 8000)
- adie_set_path_freq_plan(adie, ADIE_PATH_TX, 48000);
- else
- adie_set_path_freq_plan(adie, ADIE_PATH_TX, 8000);
+ if (tx_clk_freq > 16000)
+ adie_set_path_freq_plan(adie, ADIE_PATH_TX, 48000);
+ else if (tx_clk_freq > 8000)
+ adie_set_path_freq_plan(adie, ADIE_PATH_TX, 16000);
+ else
+ adie_set_path_freq_plan(adie, ADIE_PATH_TX, 8000);
- adie_proceed_to_stage(adie, ADIE_PATH_TX, ADIE_STAGE_DIGITAL_READY);
- adie_proceed_to_stage(adie, ADIE_PATH_TX, ADIE_STAGE_DIGITAL_ANALOG_READY);
+ adie_proceed_to_stage(adie, ADIE_PATH_TX,
+ ADIE_STAGE_DIGITAL_READY);
+ adie_proceed_to_stage(adie, ADIE_PATH_TX,
+ ADIE_STAGE_DIGITAL_ANALOG_READY);
+ }
audio_update_acdb(audio_tx_device_id, acdb_id);
if (!reconf)
- qdsp6_devchg_notify(ac_control, ADSP_AUDIO_TX_DEVICE, audio_tx_device_id);
+ qdsp6_devchg_notify(ac_control, ADSP_AUDIO_TX_DEVICE,
+ audio_tx_device_id);
qdsp6_standby(ac_control);
qdsp6_start(ac_control);
@@ -1097,18 +1125,26 @@
{
audio_rx_analog_enable(0);
- adie_proceed_to_stage(adie, ADIE_PATH_RX, ADIE_STAGE_ANALOG_OFF);
- adie_proceed_to_stage(adie, ADIE_PATH_RX, ADIE_STAGE_DIGITAL_OFF);
- adie_disable();
+ if (audio_rx_path_id) {
+ adie_proceed_to_stage(adie, ADIE_PATH_RX,
+ ADIE_STAGE_ANALOG_OFF);
+ adie_proceed_to_stage(adie, ADIE_PATH_RX,
+ ADIE_STAGE_DIGITAL_OFF);
+ adie_disable();
+ }
}
static void _audio_tx_path_disable(void)
{
audio_tx_analog_enable(0);
- adie_proceed_to_stage(adie, ADIE_PATH_TX, ADIE_STAGE_ANALOG_OFF);
- adie_proceed_to_stage(adie, ADIE_PATH_TX, ADIE_STAGE_DIGITAL_OFF);
- adie_disable();
+ if (audio_tx_path_id) {
+ adie_proceed_to_stage(adie, ADIE_PATH_TX,
+ ADIE_STAGE_ANALOG_OFF);
+ adie_proceed_to_stage(adie, ADIE_PATH_TX,
+ ADIE_STAGE_DIGITAL_OFF);
+ adie_disable();
+ }
}
static int icodec_rx_clk_refcount;
@@ -1151,12 +1187,20 @@
static void _audio_tx_clk_enable(void)
{
uint32_t device_group = q6_device_to_codec(audio_tx_device_id);
+ uint32_t icodec_tx_clk_rate;
switch (device_group) {
case Q6_ICODEC_TX:
icodec_tx_clk_refcount++;
if (icodec_tx_clk_refcount == 1) {
- clk_set_rate(icodec_tx_clk, tx_clk_freq * 256);
+ if (tx_clk_freq > 16000)
+ icodec_tx_clk_rate = 48000;
+ else if (tx_clk_freq > 8000)
+ icodec_tx_clk_rate = 16000;
+ else
+ icodec_tx_clk_rate = 8000;
+
+ clk_set_rate(icodec_tx_clk, icodec_tx_clk_rate * 256);
clk_enable(icodec_tx_clk);
}
break;
@@ -1243,7 +1287,7 @@
}
}
-static void _audio_rx_clk_reinit(uint32_t rx_device)
+static void _audio_rx_clk_reinit(uint32_t rx_device, uint32_t acdb_id)
{
uint32_t device_group = q6_device_to_codec(rx_device);
@@ -1251,14 +1295,14 @@
_audio_rx_clk_disable();
audio_rx_device_id = rx_device;
- audio_rx_path_id = q6_device_to_path(rx_device);
+ audio_rx_path_id = q6_device_to_path(rx_device, acdb_id);
if (device_group != audio_rx_device_group)
_audio_rx_clk_enable();
}
-static void _audio_tx_clk_reinit(uint32_t tx_device)
+static void _audio_tx_clk_reinit(uint32_t tx_device, uint32_t acdb_id)
{
uint32_t device_group = q6_device_to_codec(tx_device);
@@ -1266,7 +1310,7 @@
_audio_tx_clk_disable();
audio_tx_device_id = tx_device;
- audio_tx_path_id = q6_device_to_path(tx_device);
+ audio_tx_path_id = q6_device_to_path(tx_device, acdb_id);
if (device_group != audio_tx_device_group)
_audio_tx_clk_enable();
@@ -1404,7 +1448,7 @@
static void do_rx_routing(uint32_t device_id, uint32_t acdb_id)
{
if (device_id == audio_rx_device_id &&
- audio_rx_path_id == q6_device_to_path(device_id)) {
+ audio_rx_path_id == q6_device_to_path(device_id, acdb_id)) {
if (acdb_id != rx_acdb) {
audio_update_acdb(device_id, acdb_id);
qdsp6_devchg_notify(ac_control, ADSP_AUDIO_RX_DEVICE, device_id);
@@ -1417,18 +1461,18 @@
if (audio_rx_path_refcount > 0) {
qdsp6_devchg_notify(ac_control, ADSP_AUDIO_RX_DEVICE, device_id);
_audio_rx_path_disable();
- _audio_rx_clk_reinit(device_id);
+ _audio_rx_clk_reinit(device_id, acdb_id);
_audio_rx_path_enable(1, acdb_id);
} else {
audio_rx_device_id = device_id;
- audio_rx_path_id = q6_device_to_path(device_id);
+ audio_rx_path_id = q6_device_to_path(device_id, acdb_id);
}
}
static void do_tx_routing(uint32_t device_id, uint32_t acdb_id)
{
if (device_id == audio_tx_device_id &&
- audio_tx_path_id == q6_device_to_path(device_id)) {
+ audio_tx_path_id == q6_device_to_path(device_id, acdb_id)) {
if (acdb_id != tx_acdb) {
audio_update_acdb(device_id, acdb_id);
qdsp6_devchg_notify(ac_control, ADSP_AUDIO_TX_DEVICE, device_id);
@@ -1441,11 +1485,12 @@
if (audio_tx_path_refcount > 0) {
qdsp6_devchg_notify(ac_control, ADSP_AUDIO_TX_DEVICE, device_id);
_audio_tx_path_disable();
- _audio_tx_clk_reinit(device_id);
+ _audio_tx_clk_reinit(device_id, acdb_id);
_audio_tx_path_enable(1, acdb_id);
} else {
audio_tx_device_id = device_id;
- audio_tx_path_id = q6_device_to_path(device_id);
+ audio_tx_path_id = q6_device_to_path(device_id, acdb_id);
+ tx_acdb = acdb_id;
}
}
@@ -1559,9 +1604,9 @@
}
} else {
/* TODO: consider concurrency with voice call */
- tx_clk_freq = rate;
audio_tx_path_refcount++;
if (audio_tx_path_refcount == 1) {
+ tx_clk_freq = rate;
_audio_tx_clk_enable();
_audio_tx_path_enable(0, acdb_id);
}
@@ -1632,10 +1677,11 @@
ac->flags = flags;
if (ac->flags & AUDIO_FLAG_WRITE)
- audio_rx_path_enable(1, 0);
+ audio_rx_path_enable(1, rx_acdb);
else {
- tx_clk_freq = 8000;
- audio_tx_path_enable(1, 0);
+ if (!audio_tx_path_refcount)
+ tx_clk_freq = 8000;
+ audio_tx_path_enable(1, tx_acdb);
}
return ac;
@@ -1754,7 +1800,8 @@
if (ac->flags & AUDIO_FLAG_WRITE)
audio_rx_path_enable(1, acdb_id);
else{
- tx_clk_freq = 48000;
+ if (!audio_tx_path_refcount)
+ tx_clk_freq = 48000;
audio_tx_path_enable(1, acdb_id);
}
@@ -1793,7 +1840,8 @@
if (ac->flags & AUDIO_FLAG_WRITE)
audio_rx_path_enable(1, acdb_id);
else{
- tx_clk_freq = 8000;
+ if (!audio_tx_path_refcount)
+ tx_clk_freq = 8000;
audio_tx_path_enable(1, acdb_id);
}
@@ -1829,7 +1877,8 @@
if (ac->flags & AUDIO_FLAG_WRITE)
audio_rx_path_enable(1, acdb_id);
else{
- tx_clk_freq = 8000;
+ if (!audio_tx_path_refcount)
+ tx_clk_freq = 8000;
audio_tx_path_enable(1, acdb_id);
}