ASoC: SOF: Intel: byt: Refactor fw ready / mem windows creation
authorDaniel Baluta <daniel.baluta@nxp.com>
Wed, 7 Aug 2019 15:02:01 +0000 (10:02 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 9 Aug 2019 12:26:20 +0000 (13:26 +0100)
commit83ee7ab1627b7597bbb9acc26b37e9f96fff40c9
treee59fc8ffa0bdef3cd195dbe335993f60242aebca
parente17422cda9d60339d71e117d3fdfd444e83669a4
ASoC: SOF: Intel: byt: Refactor fw ready / mem windows creation

There is a lot of duplicate code when processing IPC firmware ready
notification and creating memory windows.

First step in reducing the code duplication is to introduce generic
functions:
* sof_get_windows
* sof_fw_ready
that will replace, in the first step, the specific implementation related
to baytrail related platforms:
* byt_get_windows
* byt_fw_ready

So we are basically moving code from intel/byt.c to loader.c keeping
in mind that mbox_offset is a per platform constant so we need to
use newly introduced snd_sof_dsp_get_mailbox_offset /
snd_sof_dsp_get_window_offset in order to get the correct
mbox offset / window offset value.

Also, bar is a per platform constant so we use snd_sof_dsp_get_bar_index
instead of the hardcoded BYT_DSP_BAR.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190807150203.26359-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/byt.c
sound/soc/sof/loader.c
sound/soc/sof/sof-priv.h