From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ola LILJA2 <ola.o.lilja@stericsson.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Liam Girdwood <lrg@ti.com>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 3/3] ASoC: Ux500: Add driver for Ux500/AB8500 platform/codec
Date: Tue, 13 Mar 2012 21:21:59 +0000 [thread overview]
Message-ID: <20120313212158.GB3177@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <AC3CA153830A24419D7BF22D87B39D0557F2EC71DA@EXDCVYMBSTM006.EQ1STM.local>
[-- Attachment #1.1: Type: text/plain, Size: 3342 bytes --]
On Tue, Mar 13, 2012 at 03:56:20PM +0100, Ola LILJA2 wrote:
> Answers inline.
>
> PS. New patch-set uploaded.
Ugh, you *really* should've sent this at the time (or in general before
sending the new patches) since now a bunch of review comments are going
to get repetitive...
> > Nothing in this header looks like it should be exported, I've not
> > actually looked at any of the code to see what this stuff is doing but
> > it all looks like it should be private to the relevant drivers.
> The machine-driver is split up in a main machine-driver and several
> sub-machine-drivers (one for each platform<->codec), so this inteface is
> just so that the main machine-file can call reach the functions implemented
> in the sub-machine-driver-file. It is not meant for the world outside our
> driver.
This sounds suspicious, what is this "generic" machine driver?
> > > +ifdef CONFIG_SND_SOC_UX500_DEBUG
> > > +CFLAGS_ab8500_audio.o := -DDEBUG
> > > +endif
> > No other driver has this. Why does your driver have it?
> Can't answer to why other people don't have it =) I found it convenient
> to be able to turn on the debug-prints in our driver by just using a flag
> in menuncofig rather than modifying Makefiles every time.
> It is easier to tell our customer to just activate this flag.
> Do you want me to remove it?
Either make this a generic feature or remove it, we shouldn't have
stuff like this available randomly.
> > > +static int st_fir_value_control_get(struct snd_kcontrol *kcontrol,
> > > + struct snd_ctl_elem_value
> > *ucontrol) {
> > > + return 0;
> > > +}
> > This looks obviously buggy.
> These are FIR-coeffecients and can (by HW-design) not be read. So there is nothing to
> do here.
This still looks obviously buggy. If readback is not supported there
shouldn't be a readback function, and returning success is clearly not
the right thinng to do.
> > > + data = ab8500_codec_read_reg(codec, AB8500_MISC,
> > AB8500_GPIO_DIR4_REG);
> > > + data |= GPIO27_DIR_OUTPUT | GPIO29_DIR_OUTPUT |
> > GPIO31_DIR_OUTPUT;
> > > + ab8500_codec_write_reg(codec, AB8500_MISC,
> > AB8500_GPIO_DIR4_REG,
> > > +data);
> > This loooks like platform data...
> Well, this is actually GPIO on the codec-chip and not the base-chip.
That doesn't seem germane to it being provied as platform data.
> > > +void ab8500_audio_power_control(bool power_on) {
> > > + if (ab8500_codec == NULL) {
> > > + pr_err("%s: ERROR: AB8500 ASoC-driver not yet
> > probed!\n", __func__);
> > > + return;
> > > + }
> > Use the framework features for power management, we've got enough ways
> > for your driver to get told when to power up and down none of which
> > require a global pointer to a device.
> This is called as an effect of a DAPM-chain so it is using the ASoC-framework.
> The reason for having this like it is, is due to the fact that we need to call
> this funtion not only from the DAPM-chain, but also from another kernel-driver
> (our vibra-driver). I would love to see this extra way into the audio-driver but
> as the design of our platform require this, we are stuck with this solution.
No, you're not. Use a MFD like the existing drivers doing this. Having
a global data thing like this is really not suitable for mainline.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
prev parent reply other threads:[~2012-03-13 21:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-30 14:18 [PATCH 3/3] ASoC: Ux500: Add driver for Ux500/AB8500 platform/codec Ola Lilja
2012-01-30 17:22 ` Mark Brown
2012-03-13 14:56 ` Ola LILJA2
2012-03-13 21:21 ` 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=20120313212158.GB3177@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