linux-stable/sound/soc/sof/imx/imx-common.h
Daniel Baluta 8253aa4700
ASoC: SOF: imx: Add code to manage DSP related clocks
We need at least 3 clocks in order to power up and access
DSP core registers found on i.MX8QM, i.MX8QXP and i.MX8MP
platforms.

Add code to request these clocks and enable them at probe. Next
patches will add PM support which will only activate clocks when
DSP is used.

DSP clocks are already documented in
Documentation/devicetree/bindings/dsp/fsl,dsp.yaml

We choose to add:
	* imx8_parse_clocks
	* imx8_enable_clocks
	* imx8_disable_clocks

wrappers because in the future DSP will need to take care about the
clocks of other related Audio IPs (e.g SAI, ESAI).

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211119094319.81674-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:08 +00:00

27 lines
740 B
C

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
#ifndef __IMX_COMMON_H__
#define __IMX_COMMON_H__
#include <linux/clk.h>
#define EXCEPT_MAX_HDR_SIZE 0x400
#define IMX8_STACK_DUMP_SIZE 32
void imx8_get_registers(struct snd_sof_dev *sdev,
struct sof_ipc_dsp_oops_xtensa *xoops,
struct sof_ipc_panic_info *panic_info,
u32 *stack, size_t stack_words);
void imx8_dump(struct snd_sof_dev *sdev, u32 flags);
struct imx_clocks {
struct clk_bulk_data *dsp_clks;
int num_dsp_clks;
};
int imx8_parse_clocks(struct snd_sof_dev *sdev, struct imx_clocks *clks);
int imx8_enable_clocks(struct snd_sof_dev *sdev, struct imx_clocks *clks);
void imx8_disable_clocks(struct snd_sof_dev *sdev, struct imx_clocks *clks);
#endif