Skip to content
Merged
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
9 changes: 5 additions & 4 deletions sound/soc/codecs/max98363.c

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao I'm not sure I follow the first part of your commit message. We are already doing all the remaining steps in case of success, isn't it? In case of error, we need mark last busy and then suspend no?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao I'm not sure I follow the first part of your commit message. We are already doing all the remaining steps in case of success, isn't it? In case of error, we need mark last busy and then suspend no?

@ranj063 The existing code return ret on success, and doesn't do the tasks after line 182. I didn't mark last busy before suspend is because it is very likely that there is something wrong with sdw bus when regmap_read return error and I hope the codec can go into suspend immediately and don't access the regmap.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao why does that have to prevent marking when the device was last busy?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao why does that have to prevent marking when the device was last busy?

It will suspend after 3 sec from last busy, because of pm_runtime_set_autosuspend_delay(dev, 3000);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao can you send this upstream when you have a moment? I have too many patches on my plate already :-)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao can you send this upstream when you have a moment? I have too many patches on my plate already :-)

Sure

Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ static int max98363_io_init(struct sdw_slave *slave)
pm_runtime_get_noresume(dev);

ret = regmap_read(max98363->regmap, MAX98363_R21FF_REV_ID, &reg);
if (!ret) {
if (!ret)
dev_info(dev, "Revision ID: %X\n", reg);
return ret;
}
else
goto out;

if (max98363->first_hw_init) {
regcache_cache_bypass(max98363->regmap, false);
Expand All @@ -187,10 +187,11 @@ static int max98363_io_init(struct sdw_slave *slave)
max98363->first_hw_init = true;
max98363->hw_init = true;

out:
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);

return 0;
return ret;
}

#define MAX98363_RATES SNDRV_PCM_RATE_8000_192000
Expand Down