From: Mark Brown <broonie@kernel.org>
To: Marian Postevca <posteuca@mutex.one>
Cc: Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec
Date: Thu, 24 Aug 2023 23:03:12 +0100 [thread overview]
Message-ID: <ZOfToAkO6JmB2VjC@finisterre.sirena.org.uk> (raw)
In-Reply-To: <20230824210135.19303-5-posteuca@mutex.one>
[-- Attachment #1: Type: text/plain, Size: 1902 bytes --]
On Fri, Aug 25, 2023 at 12:01:35AM +0300, Marian Postevca wrote:
> +static int acp_asoc_suspend_pre(struct snd_soc_card *card)
> +{
> + int ret;
> +
> + ret = acp_ops_suspend_pre(card);
> + if (ret == 1)
> + return 0;
> + else
> + return ret;
> +}
> +
> +static int acp_asoc_resume_post(struct snd_soc_card *card)
> +{
> + int ret;
> +
> + ret = acp_ops_resume_post(card);
> + if (ret == 1)
> + return 0;
> + else
> + return ret;
> +}
This feels like it should've been part of the prior commit adding
support for more complex cards?
> + card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data;
> + acp_card_drvdata = card->drvdata;
> + acp_card_drvdata->acpi_mach = (struct snd_soc_acpi_mach *)pdev->dev.platform_data;
Similarly these changes in probe() -
> + {
> + .name = "acp3x-es83xx",
> + .driver_data = (kernel_ulong_t)&es83xx_rn_data,
> + },
The main thing I'd expect to see in the generic code in a patch adding a
specific driver is table entries like this and the ones you had earlier.
> + if (drv_data->hs_codec_id == ES83XX) {
> + rc = acp_ops_configure_link(card, &links[i]);
> + if (rc != 0) {
> + dev_err(dev, "Failed to configure link for ES83XX: %d\n", rc);
> + return rc;
> + }
> + }
This function should ideally have been using switch statemnts but that's
not an issue your patch introduced.
> +#define ES83XX_ENABLE_DMIC BIT(4)
> +#define ES83XX_48_MHZ_MCLK BIT(5)
> +static void acp3x_es83xx_set_gpios_values(struct acp3x_es83xx_private *priv,
> + bool speaker, bool headphone)
> +{
> + gpiod_set_value_cansleep(priv->gpio_speakers, speaker);
> + gpiod_set_value_cansleep(priv->gpio_headphone, headphone);
> +}
I'm not clear what this function buys us other than just calling gpiolib
directly in the DAPM events?
Otherewise the actual machine driver looks good.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2023-08-24 22:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 21:01 [PATCH v2 0/4] ASoC: amd: acp: Add sound support for a line of HUAWEI laptops Marian Postevca
2023-08-24 21:01 ` [PATCH v2 1/4] ASoC: es8316: Enable support for S32 LE format Marian Postevca
2023-08-24 21:33 ` Mark Brown
2023-08-25 21:55 ` Marian Postevca
2023-08-26 11:24 ` Mark Brown
2023-08-24 21:01 ` [PATCH v2 2/4] ASoC: es8316: Enable support for MCLK div by 2 Marian Postevca
2023-08-24 21:53 ` Mark Brown
2023-08-27 21:50 ` Marian Postevca
2023-08-28 18:09 ` Mark Brown
2023-08-28 20:22 ` Marian Postevca
2023-08-29 10:18 ` Mark Brown
2023-08-24 21:01 ` [PATCH v2 3/4] ASoC: amd: acp: Add support for splitting the codec specific code from the ACP driver Marian Postevca
2023-08-24 21:01 ` [PATCH v2 4/4] ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec Marian Postevca
2023-08-24 22:03 ` Mark Brown [this message]
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=ZOfToAkO6JmB2VjC@finisterre.sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=posteuca@mutex.one \
--cc=tiwai@suse.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;
as well as URLs for NNTP newsgroup(s).