lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6TfGZNAnCEhm6Fa@lizhi-Precision-Tower-5810>
Date: Thu, 6 Feb 2025 11:11:05 -0500
From: Frank Li <Frank.li@....com>
To: Laurentiu Mihalcea <laurentiumihalcea111@...il.com>
Cc: Bard Liao <yung-chuan.liao@...ux.intel.com>,
	Daniel Baluta <daniel.baluta@....com>,
	Iuliana Prodan <iuliana.prodan@....com>,
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
	Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
	linux-sound@...r.kernel.org, imx@...ts.linux.dev
Subject: Re: [PATCH v2 2/8] ASoC: SOF: imx8: use common imx chip interface

On Wed, Feb 05, 2025 at 03:30:16PM -0500, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@....com>
>
> The common interface for imx chips (defined in imx-common.c) contains the
> definitions for a lot of functions required by the SOF core. As such, the
> platform driver can just use the common definitions instead of duplicating
> code by re-defining aforementioned functions.
>
> Make the transition to the new common interface. This consists of:
>
>   1) Removing unneeded functions, which are already defined in the
>   common interface.
>
>   2) Defining some chip-specific operations/structures required by the
>   interface to work.
>
>   3) Dropping structure definitions that are no longer needed.
>
>   4) Adapting some existing functions to the new interface.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@....com>
> ---
>  sound/soc/sof/imx/imx8.c | 522 +++++----------------------------------
>  1 file changed, 65 insertions(+), 457 deletions(-)
>
> diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
> index 1e7bf00d7c46..25e3296a1e5e 100644
> --- a/sound/soc/sof/imx/imx8.c
> +++ b/sound/soc/sof/imx/imx8.c
> @@ -1,6 +1,6 @@

...
>  static int imx8x_run(struct snd_sof_dev *sdev)
>  {
> -	struct imx8_priv *dsp_priv = sdev->pdata->hw_pdata;
>  	int ret;
>
> -	ret = imx_sc_misc_set_control(dsp_priv->sc_ipc, IMX_SC_R_DSP,
> +	ret = imx_sc_misc_set_control(get_chip_pdata(sdev), IMX_SC_R_DSP,
>  				      IMX_SC_C_OFS_SEL, 1);
>  	if (ret < 0) {
>  		dev_err(sdev->dev, "Error system address offset source select\n");
>  		return ret;
>  	}
>
> -	ret = imx_sc_misc_set_control(dsp_priv->sc_ipc, IMX_SC_R_DSP,
> +	ret = imx_sc_misc_set_control(get_chip_pdata(sdev), IMX_SC_R_DSP,
>  				      IMX_SC_C_OFS_AUDIO, 0x80);
>  	if (ret < 0) {
>  		dev_err(sdev->dev, "Error system address offset of AUDIO\n");
>  		return ret;
>  	}
>
> -	ret = imx_sc_misc_set_control(dsp_priv->sc_ipc, IMX_SC_R_DSP,
> +	ret = imx_sc_misc_set_control(get_chip_pdata(sdev), IMX_SC_R_DSP,
>  				      IMX_SC_C_OFS_PERIPH, 0x5A);

Not related with patch change, Can you define such magic number 0x5A,
0x80, 0x51? You can improve it later.

Reviewed-by: Frank Li <Frank.Li@....com>

>  	if (ret < 0) {
>  		dev_err(sdev->dev, "Error system address offset of PERIPH %d\n",
> @@ -142,14 +70,14 @@ static int imx8x_run(struct snd_sof_dev *sdev)
>  		return ret;
>  	}
>
...
>  	.ipc_supported_mask	= BIT(SOF_IPC_TYPE_3),
>  	.ipc_default		= SOF_IPC_TYPE_3,
>  	.default_fw_path = {
> @@ -666,6 +273,7 @@ static struct sof_dev_desc sof_of_imx8qm_desc = {
>  	},
>  	.nocodec_tplg_filename = "sof-imx8-nocodec.tplg",
>  	.ops = &sof_imx8_ops,
> +	.ops_init = imx8_ops_init,
>  };
>
>  static const struct of_device_id sof_of_imx8_ids[] = {
> --
> 2.34.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ