Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/soundwire/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,7 @@ void sdw_clear_slave_status(struct sdw_bus *bus, u32 request)
if (slave->status != SDW_SLAVE_UNATTACHED) {
sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
slave->first_interrupt_done = false;
sdw_update_slave_status(slave, SDW_SLAVE_UNATTACHED);
}

/* keep track of request, used in pm_runtime resume */
Expand Down
16 changes: 9 additions & 7 deletions sound/soc/codecs/max98373-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static __maybe_unused int max98373_suspend(struct device *dev)
regmap_read(max98373->regmap, max98373->cache[i].reg, &max98373->cache[i].val);

regcache_cache_only(max98373->regmap, true);
regcache_mark_dirty(max98373->regmap);

return 0;
}

Expand All @@ -271,7 +271,7 @@ static __maybe_unused int max98373_resume(struct device *dev)
struct max98373_priv *max98373 = dev_get_drvdata(dev);
unsigned long time;

if (!max98373->hw_init)
if (!max98373->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down Expand Up @@ -362,15 +362,15 @@ static int max98373_io_init(struct sdw_slave *slave)
struct device *dev = &slave->dev;
struct max98373_priv *max98373 = dev_get_drvdata(dev);

if (max98373->pm_init_once) {
if (max98373->first_hw_init) {
regcache_cache_only(max98373->regmap, false);
regcache_cache_bypass(max98373->regmap, true);
}

/*
* PM runtime is only enabled when a Slave reports as Attached
*/
if (!max98373->pm_init_once) {
if (!max98373->first_hw_init) {
/* set autosuspend parameters */
pm_runtime_set_autosuspend_delay(dev, 3000);
pm_runtime_use_autosuspend(dev);
Expand Down Expand Up @@ -462,12 +462,12 @@ static int max98373_io_init(struct sdw_slave *slave)
regmap_write(max98373->regmap, MAX98373_R20B5_BDE_EN, 1);
regmap_write(max98373->regmap, MAX98373_R20E2_LIMITER_EN, 1);

if (max98373->pm_init_once) {
if (max98373->first_hw_init) {
regcache_cache_bypass(max98373->regmap, false);
regcache_mark_dirty(max98373->regmap);
}

max98373->pm_init_once = true;
max98373->first_hw_init = true;
max98373->hw_init = true;

pm_runtime_mark_last_busy(dev);
Expand Down Expand Up @@ -787,6 +787,8 @@ static int max98373_init(struct sdw_slave *slave, struct regmap *regmap)
max98373->cache = devm_kcalloc(dev, max98373->cache_num,
sizeof(*max98373->cache),
GFP_KERNEL);
if (!max98373->cache)
return -ENOMEM;

for (i = 0; i < max98373->cache_num; i++)
max98373->cache[i].reg = max98373_sdw_cache_reg[i];
Expand All @@ -795,7 +797,7 @@ static int max98373_init(struct sdw_slave *slave, struct regmap *regmap)
max98373_slot_config(dev, max98373);

max98373->hw_init = false;
max98373->pm_init_once = false;
max98373->first_hw_init = false;

/* codec registration */
ret = devm_snd_soc_register_component(dev, &soc_codec_dev_max98373_sdw,
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/max98373.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ struct max98373_priv {
/* variables to support soundwire */
struct sdw_slave *slave;
bool hw_init;
bool pm_init_once;
bool first_hw_init;
int slot;
unsigned int rx_mask;
};
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt1308-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ static int __maybe_unused rt1308_dev_resume(struct device *dev)
struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev);
unsigned long time;

if (!rt1308->hw_init)
if (!rt1308->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt1316-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ static int __maybe_unused rt1316_dev_resume(struct device *dev)
struct rt1316_sdw_priv *rt1316 = dev_get_drvdata(dev);
unsigned long time;

if (!rt1316->hw_init)
if (!rt1316->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt5682-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ static int __maybe_unused rt5682_dev_resume(struct device *dev)
struct rt5682_priv *rt5682 = dev_get_drvdata(dev);
unsigned long time;

if (!rt5682->hw_init)
if (!rt5682->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt700-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ static int __maybe_unused rt700_dev_resume(struct device *dev)
struct rt700_priv *rt700 = dev_get_drvdata(dev);
unsigned long time;

if (!rt700->hw_init)
if (!rt700->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt711-sdca-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static int __maybe_unused rt711_sdca_dev_resume(struct device *dev)
struct rt711_sdca_priv *rt711 = dev_get_drvdata(dev);
unsigned long time;

if (!rt711->hw_init)
if (!rt711->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt711-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ static int __maybe_unused rt711_dev_resume(struct device *dev)
struct rt711_priv *rt711 = dev_get_drvdata(dev);
unsigned long time;

if (!rt711->hw_init)
if (!rt711->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt715-sdca-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
struct rt715_sdca_priv *rt715 = dev_get_drvdata(dev);
unsigned long time;

if (!rt715->hw_init)
if (!rt715->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/codecs/rt715-sdca.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ int rt715_sdca_init(struct device *dev, struct regmap *mbq_regmap,
* HW init will be performed when device reports present
*/
rt715->hw_init = false;
rt715->first_init = false;
rt715->first_hw_init = false;

ret = devm_snd_soc_register_component(dev,
&soc_codec_dev_rt715_sdca,
Expand All @@ -1018,7 +1018,7 @@ int rt715_sdca_io_init(struct device *dev, struct sdw_slave *slave)
/*
* PM runtime is only enabled when a Slave reports as Attached
*/
if (!rt715->first_init) {
if (!rt715->first_hw_init) {
/* set autosuspend parameters */
pm_runtime_set_autosuspend_delay(&slave->dev, 3000);
pm_runtime_use_autosuspend(&slave->dev);
Expand All @@ -1031,7 +1031,7 @@ int rt715_sdca_io_init(struct device *dev, struct sdw_slave *slave)

pm_runtime_enable(&slave->dev);

rt715->first_init = true;
rt715->first_hw_init = true;
}

pm_runtime_get_noresume(&slave->dev);
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt715-sdca.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct rt715_sdca_priv {
enum sdw_slave_status status;
struct sdw_bus_params params;
bool hw_init;
bool first_init;
bool first_hw_init;
int l_is_unmute;
int r_is_unmute;
int hw_sdw_ver;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/rt715-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
struct rt715_priv *rt715 = dev_get_drvdata(dev);
unsigned long time;

if (!rt715->hw_init)
if (!rt715->first_hw_init)
return 0;

if (!slave->unattach_request)
Expand Down