|
@@ -309,6 +309,8 @@ static struct class *bt_class;
|
|
static int bt_major;
|
|
static int bt_major;
|
|
static int soc_id;
|
|
static int soc_id;
|
|
static bool probe_finished;
|
|
static bool probe_finished;
|
|
|
|
+struct mutex pwr_release;
|
|
|
|
+
|
|
static void bt_power_vote(struct work_struct *work);
|
|
static void bt_power_vote(struct work_struct *work);
|
|
|
|
|
|
static struct {
|
|
static struct {
|
|
@@ -1576,7 +1578,7 @@ static int bt_power_probe(struct platform_device *pdev)
|
|
skb_queue_head_init(&pwr_data->rxq);
|
|
skb_queue_head_init(&pwr_data->rxq);
|
|
mutex_init(&pwr_data->pwr_mtx);
|
|
mutex_init(&pwr_data->pwr_mtx);
|
|
mutex_init(&pwr_data->btpower_state.state_machine_lock);
|
|
mutex_init(&pwr_data->btpower_state.state_machine_lock);
|
|
- mutex_init(&pwr_data->pwr_release);
|
|
|
|
|
|
+ mutex_init(&pwr_release);
|
|
pwr_data->btpower_state.power_state = IDLE;
|
|
pwr_data->btpower_state.power_state = IDLE;
|
|
pwr_data->btpower_state.retention_mode = RETENTION_IDLE;
|
|
pwr_data->btpower_state.retention_mode = RETENTION_IDLE;
|
|
pwr_data->btpower_state.grant_state = NO_GRANT_FOR_ANY_SS;
|
|
pwr_data->btpower_state.grant_state = NO_GRANT_FOR_ANY_SS;
|
|
@@ -1622,21 +1624,21 @@ static int bt_power_probe(struct platform_device *pdev)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
free_pdata:
|
|
free_pdata:
|
|
- mutex_lock(&pwr_data->pwr_release);
|
|
|
|
|
|
+ mutex_lock(&pwr_release);
|
|
kfree(pwr_data);
|
|
kfree(pwr_data);
|
|
- mutex_unlock(&pwr_data->pwr_release);
|
|
|
|
|
|
+ mutex_unlock(&pwr_release);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
static int bt_power_remove(struct platform_device *pdev)
|
|
static int bt_power_remove(struct platform_device *pdev)
|
|
{
|
|
{
|
|
- mutex_lock(&pwr_data->pwr_release);
|
|
|
|
|
|
+ mutex_lock(&pwr_release);
|
|
dev_dbg(&pdev->dev, "%s\n", __func__);
|
|
dev_dbg(&pdev->dev, "%s\n", __func__);
|
|
probe_finished = false;
|
|
probe_finished = false;
|
|
btpower_rfkill_remove(pdev);
|
|
btpower_rfkill_remove(pdev);
|
|
bt_power_vreg_put();
|
|
bt_power_vreg_put();
|
|
kfree(pwr_data);
|
|
kfree(pwr_data);
|
|
- mutex_unlock(&pwr_data->pwr_release);
|
|
|
|
|
|
+ mutex_unlock(&pwr_release);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2517,7 +2519,7 @@ static long bt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|
static int bt_power_release(struct inode *inode, struct file *file)
|
|
static int bt_power_release(struct inode *inode, struct file *file)
|
|
{
|
|
{
|
|
|
|
|
|
- mutex_lock(&pwr_data->pwr_release);
|
|
|
|
|
|
+ mutex_lock(&pwr_release);
|
|
|
|
|
|
if (!pwr_data || !probe_finished) {
|
|
if (!pwr_data || !probe_finished) {
|
|
pr_err("%s: BTPower Probing Pending.Try Again\n", __func__);
|
|
pr_err("%s: BTPower Probing Pending.Try Again\n", __func__);
|
|
@@ -2566,7 +2568,7 @@ static int bt_power_release(struct inode *inode, struct file *file)
|
|
*/
|
|
*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- mutex_unlock(&pwr_data->pwr_release);
|
|
|
|
|
|
+ mutex_unlock(&pwr_release);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|