From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ola Lilja <ola.o.lilja@stericsson.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lrg@ti.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 16/16] ASoC: Ux500: Add machine-driver
Date: Tue, 13 Mar 2012 23:03:54 +0000 [thread overview]
Message-ID: <20120313230353.GN3177@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1331651503-16917-17-git-send-email-ola.o.lilja@stericsson.com>
[-- Attachment #1.1: Type: text/plain, Size: 3279 bytes --]
On Tue, Mar 13, 2012 at 04:11:43PM +0100, Ola Lilja wrote:
> +config SND_SOC_UX500_AB8500
> + bool "Codec/Machine - AB8500 (MSA)"
Wny non-modular?
> + depends on SND_SOC_UX500_MSP_I2S && SND_SOC_UX500_PLATFORM && AB8500_CORE && AB8500_GPADC
Word wrapping and this should select pretty much all of this with the
possible exception of the MFD core.
> +ifdef CONFIG_SND_SOC_UX500_AB8500
> +snd-soc-ux500-machine-objs += ux500_ab8500.o
> +endif
Again, why are you doing this non-idiomatic stuff?
> +/* Create dummy devices for platform drivers */
> +static struct platform_device ux500_pcm = {
> + .name = "ux500-pcm",
> + .id = 0,
> + .dev = {
> + .platform_data = NULL,
> + },
> +};
The SoC or CPU side drivers should be taking care of stuff like this.
> +/* Define the whole U8500 soundcard, linking platform to the codec-drivers */
> +struct snd_soc_dai_link u8500_dai_links[] = {
> + #ifdef CONFIG_SND_SOC_UX500_AB8500
What's this ifdef doing...? It looks very, very suspicous.
> + {
> + .name = "ab8500_0",
Your indentation is also fairly broken here.
> + pdev = platform_device_alloc("soc-audio", -1);
> + if (!pdev)
> + return -ENOMEM;
No, probe using the normal device model and register using
snd_soc_register_card().
> +++ b/sound/soc/ux500/ux500_ab8500.c
The fact that you've got multiple files for a machine driver is
worrying...
> +/* ANC States */
> +static const char * const enum_anc_state[] = {
> + "Unconfigured",
> + "Apply FIR and IIR",
> + "FIR and IIR are configured",
> + "Apply FIR",
> + "FIR is configured",
> + "Apply IIR",
> + "IIR is configured"
> +};
Why is this not part of the CODEC driver? What makes this machine
specific?
> +/* Regulators */
> +enum regulator_idx {
> + REGULATOR_AUDIO,
> + REGULATOR_DMIC,
> + REGULATOR_AMIC1,
> + REGULATOR_AMIC2
> +};
> +static struct regulator_bulk_data reg_info[4] = {
> + { .consumer = NULL, .supply = "V-AUD" },
> + { .consumer = NULL, .supply = "V-DMIC" },
> + { .consumer = NULL, .supply = "V-AMIC1" },
> + { .consumer = NULL, .supply = "V-AMIC2" }
> +};
> +static bool reg_enabled[4] = {
> + false,
> + false,
> + false,
> + false
> +};
> +static int reg_claim[4];
> +enum amic_idx { AMIC_1A, AMIC_1B, AMIC_2 };
> +struct amic_conf {
> + enum regulator_idx reg_id;
> + bool enabled;
> + char *name;
I have no idea what this code is intended to do but it looks *extremely*
confused, it's especially surprising given that your CODEC makes no use
of regulators even for basic power.
> +static int enable_regulator(struct device *dev, enum regulator_idx idx)
> +{
You appear to be defining some sort of subsystem on top of the regulator
API here but I'm not sure what it's intended to do or why you're doing
it...
> +static const struct snd_soc_dapm_widget ux500_ab8500_dapm_widgets[] = {
> + SND_SOC_DAPM_SUPPLY("AUDIO Regulator",
> + SND_SOC_NOPM, 0, 0, dapm_audioreg_event,
> + SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
DAPM has native support for regulator supplies.
> + /* Enable gpio.1-clock (needed by DSP in burst mode) */
> + ret = clk_enable(clk_ptr_gpio1);
> + if (ret) {
> + dev_err(dev, "%s: ERROR: clk_enable(gpio.1) failed (ret = %d)!",
> + __func__, ret);
> + return ret;
> + }
Why can't the DSP figure out that it needs to enable the clock?
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2012-03-13 23:03 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 15:11 [PATCH 01/16] ASoC: core: Add multi reg control struct & macros Ola Lilja
2012-03-13 15:11 ` [PATCH 02/16] ASoC: core: Add 8bit multi reg control accessors Ola Lilja
2012-03-13 21:25 ` Mark Brown
2012-03-22 16:58 ` Kristoffer KARLSSON
2012-03-22 17:02 ` Mark Brown
2012-03-13 15:11 ` [PATCH 03/16] ASoC: core: Add range of " Ola Lilja
2012-03-13 21:23 ` Mark Brown
2012-03-13 15:11 ` [PATCH 04/16] ASoC: core: Add info accessor for mreg control Ola Lilja
2012-03-13 15:11 ` [PATCH 05/16] ASoC: core: Add strobe control Ola Lilja
2012-03-13 21:33 ` Mark Brown
2012-03-22 16:20 ` Kristoffer KARLSSON
2012-03-22 16:33 ` Mark Brown
2012-03-22 17:09 ` Kristoffer KARLSSON
2012-03-22 17:28 ` Mark Brown
2012-03-13 15:11 ` [PATCH 06/16] ASoC: core: Add macros for 8bit hwdep multi reg cntrl Ola Lilja
2012-03-13 21:36 ` Mark Brown
2012-03-13 15:11 ` [PATCH 07/16] ASoC: core: Add macro for hwdep range of regs control Ola Lilja
2012-03-13 15:11 ` [PATCH 08/16] ARM: ux500: Add DMA-channels for MSP Ola Lilja
2012-03-13 15:11 ` [PATCH 09/16] arm: ux500: Add audio-regulators Ola Lilja
2012-03-14 10:42 ` Linus Walleij
2012-03-13 15:11 ` [PATCH 10/16] arm: ux500: Add support for MSP I2S-devices Ola Lilja
2012-03-13 21:40 ` Mark Brown
2012-03-14 9:39 ` Linus Walleij
2012-03-14 11:44 ` Mark Brown
2012-03-13 15:11 ` [PATCH 11/16] ARM: ux500: Add placeholder for clk_set_parent Ola Lilja
2012-03-14 10:43 ` Linus Walleij
2012-03-13 15:11 ` [PATCH 14/16] ASoC: Ux500: Add platform-driver Ola Lilja
2012-03-13 22:48 ` Mark Brown
2012-03-14 10:50 ` Linus Walleij
2012-03-14 12:31 ` Mark Brown
2012-03-13 15:11 ` [PATCH 15/16] ASoC: Ux500: Activate the Ux500 ASoC-driver Ola Lilja
2012-03-13 15:11 ` [PATCH 16/16] ASoC: Ux500: Add machine-driver Ola Lilja
2012-03-13 23:03 ` Mark Brown [this message]
2012-03-13 21:39 ` [PATCH 01/16] ASoC: core: Add multi reg control struct & macros Mark Brown
2012-03-21 12:07 ` Kristoffer KARLSSON
2012-03-21 12:40 ` Mark Brown
2012-03-22 15:46 ` Kristoffer KARLSSON
2012-03-22 15:56 ` Mark Brown
[not found] ` <1331651503-16917-13-git-send-email-ola.o.lilja@stericsson.com>
2012-03-13 22:11 ` [PATCH 12/16] ASoC: Ux500: Add MSP I2S-driver Mark Brown
[not found] ` <1331651503-16917-14-git-send-email-ola.o.lilja@stericsson.com>
2012-03-13 22:45 ` [PATCH 13/16] ASoC: codecs: Add AB8500 codec-driver Mark Brown
2012-03-14 13:27 ` Ola LILJA2
2012-03-14 13:45 ` Mark Brown
2012-03-15 14:50 ` Ola Lilja
2012-03-15 15:29 ` Mark Brown
2012-03-16 13:09 ` Ola Lilja
2012-03-17 22:31 ` Mark Brown
2012-03-19 8:07 ` Ola Lilja
2012-03-19 8:23 ` Linus Walleij
2012-03-19 12:09 ` Mark Brown
2012-03-19 14:54 ` Ola Lilja
2012-03-19 15:43 ` 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=20120313230353.GN3177@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=linus.walleij@linaro.org \
--cc=lrg@ti.com \
--cc=ola.o.lilja@stericsson.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).