Merge 57453cfbdd
on remote branch
Change-Id: I0be3c7242810f8f798a664eb795967c00d009592
This commit is contained in:
@@ -676,7 +676,6 @@ struct platform_pwr_data {
|
|||||||
struct work_struct wq_pwr_voting;
|
struct work_struct wq_pwr_voting;
|
||||||
struct sk_buff_head rxq;
|
struct sk_buff_head rxq;
|
||||||
struct mutex pwr_mtx;
|
struct mutex pwr_mtx;
|
||||||
struct mutex pwr_release;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int btpower_register_slimdev(struct device *dev);
|
int btpower_register_slimdev(struct device *dev);
|
||||||
|
@@ -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,6 @@ 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);
|
|
||||||
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 +1623,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 +2518,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 +2567,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2611,12 +2612,13 @@ static int __init btpower_init(void)
|
|||||||
goto class_err;
|
goto class_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (device_create(bt_class, NULL, MKDEV(bt_major, 0),
|
if (device_create(bt_class, NULL, MKDEV(bt_major, 0),
|
||||||
NULL, "btpower") == NULL) {
|
NULL, "btpower") == NULL) {
|
||||||
pr_err("%s: failed to allocate char dev\n", __func__);
|
pr_err("%s: failed to allocate char dev\n", __func__);
|
||||||
goto device_err;
|
goto device_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutex_init(&pwr_release);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
device_err:
|
device_err:
|
||||||
|
@@ -68,7 +68,7 @@ def define_niobe():
|
|||||||
|
|
||||||
def define_anorak61():
|
def define_anorak61():
|
||||||
define_bt_modules(
|
define_bt_modules(
|
||||||
target = "anorak",
|
target = "anorak61",
|
||||||
modules = [
|
modules = [
|
||||||
"btpower",
|
"btpower",
|
||||||
"bt_fm_slim",
|
"bt_fm_slim",
|
||||||
|
Reference in New Issue
Block a user