ASoC: wcd938x: Add support for codec wakeup
Add an API to wakeup codec from sleep. Change-Id: I90de653947f794cbc4a47a91bd5f22251440ef75 Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
4d31c00084
commit
d1c3e9b51e
@@ -79,7 +79,6 @@ struct wcd938x_priv {
|
|||||||
struct codec_port_info
|
struct codec_port_info
|
||||||
rx_port_mapping[MAX_PORT][MAX_CH_PER_PORT];
|
rx_port_mapping[MAX_PORT][MAX_CH_PER_PORT];
|
||||||
struct regulator_bulk_data *supplies;
|
struct regulator_bulk_data *supplies;
|
||||||
|
|
||||||
struct notifier_block nblock;
|
struct notifier_block nblock;
|
||||||
/* wcd callback to bolero */
|
/* wcd callback to bolero */
|
||||||
void *handle;
|
void *handle;
|
||||||
@@ -87,6 +86,7 @@ struct wcd938x_priv {
|
|||||||
int (*register_notifier)(void *handle,
|
int (*register_notifier)(void *handle,
|
||||||
struct notifier_block *nblock,
|
struct notifier_block *nblock,
|
||||||
bool enable);
|
bool enable);
|
||||||
|
int (*wakeup)(void *handle, bool enable);
|
||||||
u32 version;
|
u32 version;
|
||||||
/* Entry for version info */
|
/* Entry for version info */
|
||||||
struct snd_info_entry *entry;
|
struct snd_info_entry *entry;
|
||||||
|
@@ -2578,6 +2578,25 @@ static int wcd938x_add_slave_components(struct device *dev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int wcd938x_wakeup(void *handle, bool enable)
|
||||||
|
{
|
||||||
|
struct wcd938x_priv *priv;
|
||||||
|
|
||||||
|
if (!handle) {
|
||||||
|
pr_err("%s: NULL handle\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
priv = (struct wcd938x_priv *)handle;
|
||||||
|
if (!priv->tx_swr_dev) {
|
||||||
|
pr_err("%s: tx swr dev is NULL\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
if (enable)
|
||||||
|
return swr_device_wakeup_vote(priv->tx_swr_dev);
|
||||||
|
else
|
||||||
|
return swr_device_wakeup_unvote(priv->tx_swr_dev);
|
||||||
|
}
|
||||||
|
|
||||||
static int wcd938x_probe(struct platform_device *pdev)
|
static int wcd938x_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct component_match *match = NULL;
|
struct component_match *match = NULL;
|
||||||
@@ -2652,6 +2671,8 @@ static int wcd938x_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
wcd938x_reset(dev);
|
wcd938x_reset(dev);
|
||||||
|
|
||||||
|
wcd938x->wakeup = wcd938x_wakeup;
|
||||||
|
|
||||||
return component_master_add_with_match(&pdev->dev,
|
return component_master_add_with_match(&pdev->dev,
|
||||||
&wcd938x_comp_ops, match);
|
&wcd938x_comp_ops, match);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user