Merge "asoc: codecs: Vote for codec core and NPL clocks before regcache_sync"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
1543085859
@@ -661,7 +661,11 @@ static int bolero_ssr_enable(struct device *dev, void *data)
|
||||
priv->dev_up = true;
|
||||
mutex_unlock(&priv->clk_lock);
|
||||
regcache_mark_dirty(priv->regmap);
|
||||
bolero_clk_rsc_enable_all_clocks(priv->clk_dev, true);
|
||||
regcache_sync(priv->regmap);
|
||||
/* Add a 100usec sleep to ensure last register write is done */
|
||||
usleep_range(100,110);
|
||||
bolero_clk_rsc_enable_all_clocks(priv->clk_dev, false);
|
||||
/* call ssr event for supported macros */
|
||||
for (macro_idx = START_MACRO; macro_idx < MAX_MACRO; macro_idx++) {
|
||||
if (!priv->macro_params[macro_idx].event_handler)
|
||||
|
||||
@@ -137,6 +137,49 @@ int bolero_rsc_clk_reset(struct device *dev, int clk_id)
|
||||
}
|
||||
EXPORT_SYMBOL(bolero_rsc_clk_reset);
|
||||
|
||||
void bolero_clk_rsc_enable_all_clocks(struct device *dev, bool enable)
|
||||
{
|
||||
struct device *clk_dev = NULL;
|
||||
struct bolero_clk_rsc *priv = NULL;
|
||||
int i = 0;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("%s: dev is null %d\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
clk_dev = bolero_get_rsc_clk_device_ptr(dev->parent);
|
||||
if (!clk_dev) {
|
||||
pr_err("%s: Invalid rsc clk device\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
priv = dev_get_drvdata(clk_dev);
|
||||
if (!priv) {
|
||||
pr_err("%s: Invalid rsc clk private data\n", __func__);
|
||||
return;
|
||||
}
|
||||
mutex_lock(&priv->rsc_clk_lock);
|
||||
for (i = 0; i < MAX_CLK - NPL_CLK_OFFSET; i++) {
|
||||
if (enable) {
|
||||
if (priv->clk[i])
|
||||
clk_prepare_enable(priv->clk[i]);
|
||||
if (priv->clk[i + NPL_CLK_OFFSET])
|
||||
clk_prepare_enable(
|
||||
priv->clk[i + NPL_CLK_OFFSET]);
|
||||
} else {
|
||||
if (priv->clk[i + NPL_CLK_OFFSET])
|
||||
clk_disable_unprepare(
|
||||
priv->clk[i + NPL_CLK_OFFSET]);
|
||||
if (priv->clk[i])
|
||||
clk_disable_unprepare(priv->clk[i]);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&priv->rsc_clk_lock);
|
||||
return;
|
||||
}
|
||||
EXPORT_SYMBOL(bolero_clk_rsc_enable_all_clocks);
|
||||
|
||||
static int bolero_clk_rsc_mux0_clk_request(struct bolero_clk_rsc *priv,
|
||||
int clk_id,
|
||||
bool enable)
|
||||
|
||||
@@ -19,6 +19,7 @@ int bolero_clk_rsc_request_clock(struct device *dev,
|
||||
int clk_id_req,
|
||||
bool enable);
|
||||
int bolero_rsc_clk_reset(struct device *dev, int clk_id);
|
||||
void bolero_clk_rsc_enable_all_clocks(struct device *dev, bool enable);
|
||||
#else
|
||||
static inline void bolero_clk_rsc_fs_gen_request(struct device *dev,
|
||||
bool enable)
|
||||
@@ -42,5 +43,10 @@ static inline int bolero_rsc_clk_reset(struct device *dev, int clk_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void bolero_clk_rsc_enable_all_clocks(struct device *dev,
|
||||
bool enable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_SND_SOC_BOLERO */
|
||||
#endif /* BOLERO_CLK_RSC_H */
|
||||
|
||||
Reference in New Issue
Block a user