History log of /linux-master/sound/soc/sof/sof-of-dev.h
Revision Date Author Comments
# d0ae9dc4 03-Dec-2023 Chen-Yu Tsai <wenst@chromium.org>

ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c

Commit 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to
sof-of-dev.c from sof-audio.c") caused a circular dependency between
the snd_sof and snd_sof_of modules:

depmod: ERROR: Cycle detected: snd_sof -> snd_sof_of -> snd_sof
depmod: ERROR: Found 2 modules in dependency cycles!

Move the function back with sof_machine_select().

Fixes: 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20231204033549.2020289-1-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 014fdeb0 29-Nov-2023 Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c

Move the sof_of_machine_select() function to sof-of-dev.c file and provide
an inline stub in case of non OF builds.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20231129125327.23708-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 52fee5c9 09-Oct-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: SOF: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

The SOF platform drivers all use either sof_of_remove() or
sof_acpi_remove() which both return zero unconditionally. Change these
functions to return void and the drivers to use .remove_new(). There is
no semantical change.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20231009155945.285537-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6ace85b9 05-Aug-2022 Chunxu Li <chunxu.li@mediatek.com>

ASoC: SOF: Introduce function sof_of_machine_select

From current design in sof_machine_check and snd_sof_new_platform_drv,
the SOF can only support ACPI type machine.

1. In sof_machine_check if there is no ACPI machine exist, the function
will return -ENODEV directly, that's we don't expected if we do not
base on ACPI machine.

2. In snd_sof_new_platform_drv the component driver need a driver name
to do ignore_machine, currently the driver name is obtained from
machine->drv_name, and the type of machine is snd_soc_acpi_mach.

So we add a new function named sof_of_machine_select that we can pass
sof_machine_check and obtain info required by snd_sof_new_platform_drv.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
Link: https://lore.kernel.org/r/20220805070449.6611-2-chunxu.li@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# fe70300c 06-Apr-2022 YC Hung <yc.hung@mediatek.com>

ASoC: SOF: OF: Add shutdown callback for SOF OF device

Add shutdown callback function for SOF OF device and call
snd_sof_device_shutdown in sof_of_shutdown callback for DSP
shutdown sequence.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220406194048.289787-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 28084f4a 15-Dec-2021 Daniel Baluta <daniel.baluta@nxp.com>

ASoC: SOF: OF: Avoid reverse module dependency

Similar with commit 8a49cd11e68ed0 ("ASoC: SOF: ACPI: avoid reverse
module dependency") we will be having hardware specific drivers that
link against a common "helper" framework.

sof-of-dev.c becomes a library with the interface defined in the newly
created file sof-of-dev.h.

This is the final step started with Kconfig simplification in
commit 7548a391c53ca ("ASoC: SOF: i.MX: simplify Kconfig")

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211215085703.137414-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>