.speaker_incall_vol = 0,
.speaker_incall_mic_vol = -9,
- .speaker_normal_vol = -26,
+ .speaker_normal_vol = -10,
.earpiece_incall_vol = 0,
.headset_incall_vol = 6,
.headset_incall_mic_vol = -6,
#include <asm/mach-types.h>
#include "rk_headset.h"
#include <linux/earlysuspend.h>
+#include <linux/gpio.h>
+#include <mach/board.h>
/* Debug */
#if 1
DBG("---- ERROR: on headset headset_in_type error -----\n");
break;
}
-
+ rk28_send_wakeup_key();
switch_set_state(&headset_info->sdev, headset_info->cur_headset_status);
DBG("headset_info->cur_headset_status = %d\n",headset_info->cur_headset_status);
RE_ERROR:
{
int i,level = 0;
struct rk_headset_pdata *pdata = headset_info->pdata;
- static unsigned int old_status = 0;
+ static unsigned int old_status = HOOK_UP;
// DBG("---Hook_work---\n");
mutex_lock(&headset_info->mutex_lock[HOOK]);
#ifdef CONFIG_SND_SOC_WM8994
if(wm8994_set_status() < 0)
{
- DBG("wm8994 is not set on heatset channel\n");
+ DBG("wm8994 is not set on heatset channel or suspend\n");
goto RE_ERROR;
}
#endif
ret = request_irq(headset->irq[HEADSET], headset_interrupt, headset->irq_type[HEADSET], NULL, NULL);
if (ret)
goto failed_free;
+ enable_irq_wake(headset->irq[HEADSET]);
//------------------------------------------------------------------
ret = gpio_request(pdata->Hook_gpio , NULL);
if (ret)
return ret;
}
+static int rockchip_headsetobserve_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ DBG("%s----%d\n",__FUNCTION__,__LINE__);
+ disable_irq(headset_info->irq[HEADSET]);
+ disable_irq(headset_info->irq[HOOK]);
+
+ return 0;
+}
+
+static int rockchip_headsetobserve_resume(struct platform_device *pdev)
+{
+ DBG("%s----%d\n",__FUNCTION__,__LINE__);
+ enable_irq(headset_info->irq[HEADSET]);
+ enable_irq(headset_info->irq[HOOK]);
+
+ return 0;
+}
+
static struct platform_driver rockchip_headsetobserve_driver = {
.probe = rockchip_headsetobserve_probe,
+// .resume = rockchip_headsetobserve_resume,
+// .suspend = rockchip_headsetobserve_suspend,
.driver = {
.name = "rk_headsetdet",
.owner = THIS_MODULE,
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
+#include <linux/wakelock.h>
+#include <linux/earlysuspend.h>
#include <mach/iomux.h>
#include <mach/gpio.h>
/* call_vol: save all kinds of system volume value. */
unsigned char call_vol;
unsigned char BT_call_vol;
+
+ struct wake_lock wm8994_on_wake;
};
int reg_send_data(struct i2c_client *client, unsigned short *reg, unsigned short *data, u32 scl_rate)
case wm8994_recorder_and_AP_to_headset:
case wm8994_handsetMIC_to_baseband_to_headset:
case wm8994_handsetMIC_to_baseband_to_headset_and_record:
+ case null:
ret = 1;
break;
default:
ret = -1;
break;
}
-
+ if(wm8994->work_type == SNDRV_PCM_TRIGGER_SUSPEND)
+ ret = -2;
mutex_unlock(&wm8994->route_lock);
return ret;
}
{
struct wm8994_priv *wm8994 = wm8994_codec->private_data;
char route = kcontrol->private_value & 0xff;
+ wake_lock(&wm8994->wm8994_on_wake);
mutex_lock(&wm8994->route_lock);
wm8994->kcontrol = kcontrol;//save rount
}
out:
mutex_unlock(&wm8994->route_lock);
+ wake_unlock(&wm8994->wm8994_on_wake);
return 0;
}
default:
break;
}
-
}
#define WM8994_RATES SNDRV_PCM_RATE_8000_48000
wm8994_current_mode< null )//incall status,wm8994 not suspend
return 0;
DBG("%s----%d\n",__FUNCTION__,__LINE__);
-
+
+ wm8994->work_type = SNDRV_PCM_TRIGGER_SUSPEND;
PA_ctrl(GPIO_LOW);
wm8994_write(0x00, 0x00);
INIT_DELAYED_WORK(&wm8994->wm8994_delayed_work, wm8994_work_fun);
mutex_init(&wm8994->io_lock);
mutex_init(&wm8994->route_lock);
+ wake_lock_init(&wm8994->wm8994_on_wake, WAKE_LOCK_SUSPEND, "wm8994_on_wake");
return wm8994_register(wm8994, SND_SOC_I2C);
}