From: Frank Li <Frank.li@nxp.com>
To: Laurentiu Mihalcea <laurentiumihalcea111@gmail.com>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Iuliana Prodan <iuliana.prodan@nxp.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
imx@lists.linux.dev
Subject: Re: [PATCH v2 1/8] ASoC: SOF: imx: introduce more common structures and functions
Date: Thu, 6 Feb 2025 11:05:37 -0500 [thread overview]
Message-ID: <Z6Td0SUXBZGD/s3O@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20250205203022.2754-2-laurentiumihalcea111@gmail.com>
On Wed, Feb 05, 2025 at 03:30:15PM -0500, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> The SOF drivers for imx chips have a lot of duplicate code and
> routines/code snippets that could certainly be reused among drivers.
>
> As such, introduce a new set of structures and functions that will help
> eliminate the redundancy and code size of the drivers.
>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
some nits
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> sound/soc/sof/imx/imx-common.c | 432 ++++++++++++++++++++++++++++++++-
> sound/soc/sof/imx/imx-common.h | 151 ++++++++++++
> 2 files changed, 582 insertions(+), 1 deletion(-)
>
...
> +static int imx_probe(struct snd_sof_dev *sdev)
> +{
> + struct dev_pm_domain_attach_data domain_data = {
> + .pd_names = NULL, /* no filtering */
> + .pd_flags = PD_FLAG_DEV_LINK_ON,
> + };
> + struct imx_common_data *common;
> + struct platform_device *pdev;
> + int ret;
> +
> + pdev = to_platform_device(sdev->dev);
> +
...
> +
> + ret = devm_clk_bulk_get_all(sdev->dev, &common->clks);
> + if (ret < 0)
> + return dev_err_probe(sdev->dev, common->clk_num,
> + "failed to fetch clocks\n");
> + common->clk_num = ret;
> +
> + /* no effect if number of clocks is 0 */
this comments should be common sense, can be removed.
Frank
> + ret = clk_bulk_prepare_enable(common->clk_num, common->clks);
> + if (ret < 0)
> + return dev_err_probe(sdev->dev, ret, "failed to enable clocks\n");
> +
> + common->ipc_handle->ops = &imx_ipc_ops;
> + imx_dsp_set_data(common->ipc_handle, sdev);
> +
> + sdev->num_cores = 1;
> + sdev->pdata->hw_pdata = common;
> + sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM;
> + sdev->dsp_box.offset = get_chip_info(sdev)->ipc_info.boot_mbox_offset;
> +
> + return imx_chip_probe(sdev);
> +}
> +
...
> +
> #endif
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-02-06 16:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 20:30 [PATCH v2 0/8] Refactor imx drivers and introduce support for imx95 Laurentiu Mihalcea
2025-02-05 20:30 ` [PATCH v2 1/8] ASoC: SOF: imx: introduce more common structures and functions Laurentiu Mihalcea
2025-02-06 16:05 ` Frank Li [this message]
2025-02-05 20:30 ` [PATCH v2 2/8] ASoC: SOF: imx8: use common imx chip interface Laurentiu Mihalcea
2025-02-06 16:11 ` Frank Li
2025-02-05 20:30 ` [PATCH v2 3/8] ASoC: SOF: imx8: use IMX_SOF_* macros Laurentiu Mihalcea
2025-02-06 16:13 ` Frank Li
2025-02-05 20:30 ` [PATCH v2 4/8] ASoC: SOF: imx8: shuffle structure and function definitions Laurentiu Mihalcea
2025-02-06 16:18 ` Frank Li
2025-02-06 17:28 ` Mark Brown
2025-02-05 20:30 ` [PATCH v2 5/8] ASoC: SOF: imx8: drop unneeded/unused macros/header includes Laurentiu Mihalcea
2025-02-06 16:18 ` Frank Li
2025-02-05 20:30 ` [PATCH v2 6/8] ASoC: SOF: imx: merge imx8 and imx8m drivers Laurentiu Mihalcea
2025-02-06 16:26 ` Frank Li
2025-02-05 20:30 ` [PATCH v2 7/8] ASoC: SOF: imx: merge imx8 and imx8ulp drivers Laurentiu Mihalcea
2025-02-06 16:28 ` Frank Li
2025-02-05 20:30 ` [PATCH v2 8/8] ASoC: SOF: imx: add driver for the imx95 chip Laurentiu Mihalcea
2025-02-06 16:29 ` Frank Li
2025-02-10 16:30 ` (subset) [PATCH v2 0/8] Refactor imx drivers and introduce support for imx95 Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z6Td0SUXBZGD/s3O@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=imx@lists.linux.dev \
--cc=iuliana.prodan@nxp.com \
--cc=laurentiumihalcea111@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®