From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Cc: alsa-devel@alsa-project.org, Jonathan McDowell <noodles@earth.li>,
Tony Lindgren <tony@atomide.com>,
Peter Ujfalusi <peter.ujfalusi@nokia.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Takashi Iwai <tiwai@suse.de>,
e3-hacking@earth.li, Arun KS <arunks@mistralsolutions.com>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [RFC] [PATCH 3/3] ASoC: add support for Amstrad E3 (Delta) machine
Date: Wed, 22 Jul 2009 16:07:09 +0100 [thread overview]
Message-ID: <20090722150709.GB4987@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <4A6727D8.5080808@tis.icnet.pl>
On Wed, Jul 22, 2009 at 04:53:12PM +0200, Janusz Krzysztofik wrote:
> Mark Brown wrote:
> >>+#include <sound/jack.h>
> >ASoC will pull that one in for you, not that it really matters.
> Maybe it should, but without <sound/jack.h> I get:
> sound/soc/omap/ams-delta.c:184: error: 'SND_JACK_MICROPHONE'
> undeclared here (not in a function)
Hrmpf, that's no use. I'll add it - it'd be good if you could report
stuff like this when you find it, you've got several workarounds for
core code in here.
> >Is it possible to control all the functions of the audio mode
> >independantly or are only certain combinations possible?
> Certain combinations only. For example, no way of turning on the
> mouthpiece without turning on the earphone as well, turning on AGC
> automatically selects the speakerphone and turns off the handset.
OK, then this mode selection is fine.
> >names that make the paring a bit clearer, or possibly just put a comment
> >in there.
> With my limited English skills, I can only replace Earphone with
> Earpiece and add a comment. Please someone suggest better namings if
> not enough.
Prefixes of "Headset" on the ones that apply to that? Or the comment,
this is only really visible internally.
> >>+static void cx81801_timeout(unsigned long data)
> >>+{
> >>+ /* REVISIT - locking? */
> >Yeah, locking is probably a good idea :)
> I'll have to learn about locking first. Could somebody point me to
> an example code?
In what sense? For an overview of the various APIs Linux Device Drivers
is probably still good: http://lwn.net/Kernel/LDD3
> >>+ /* Add board specific DAPM controls */
> >>+ if (!snd_soc_dapm_new_controls(codec, ams_delta_dapm_widgets,
> >>+ ARRAY_SIZE(ams_delta_dapm_widgets))) {
> >>+ if (!snd_soc_dapm_add_routes(codec, ams_delta_audio_map,
> >>+ ARRAY_SIZE(ams_delta_audio_map))) {
> >The error handling here is a bit odd...
> Do you mean those negations? Would be better if replaced with "== 0"?
> I am not sure if this is acceptable, but I just tried to avoid
> giving up with a partialy working driver in case of errors on
> optional parts.
The negations, the nesting and the lack of any reporting of failures.
Probably just calling all the functions one after another and logging
any errors would be OK.
> >>+#ifdef CONFIG_GPIO_SYSFS
> >>+ /* Expose hook switch over sysfs if configured */
> >>+ gpio_export(ams_delta_hook_switch_gpios[0].gpio, false);
> >>+#endif
> >The gpio_export() should be in the ASoC GPIO code rather than here, I'd
> >expect - care to cook up a patch?
> When I tried to push a similiar code into the gpio-keys dirver,
> Dmitry said I was wrong because my application would be limited to
> gpio based devices only. However, it looks like there are no jacks
Userspace applications are a separate issue - it looked like this was
just for diagnostic purposes? Obviously any user space applications
using the GPIO interface will be limited to your device but that applies
no matter where you put this code.
> other than gpio based in ASoC, so maybe that objection does not
> apply here. Or maybe the ASoC framework could just provide its own
> sysfs file with actual jack state, whether gpio based or not?
There's at least a driver for the WM8350 headphone detection (possibly
others, I'd need to grep) and an awful lot of hardware which could use
this in-codec. TLV320AIC3x has some code that ought to be moved over to
the standard framework too.
> BTW, I decided to reuse already existing jack/input event types
> instead of inventing new. Anyway, should I CC: linux-input?
No need if you're not changing it.
next prev parent reply other threads:[~2009-07-22 15:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 3:22 [RFC] [PATCH 3/3] ASoC: add support for Amstrad E3 (Delta) machine Janusz Krzysztofik
2009-07-22 11:03 ` Mark Brown
2009-07-22 11:39 ` [alsa-devel] " Takashi Iwai
2009-07-22 12:19 ` Mark Brown
2009-07-22 14:55 ` Janusz Krzysztofik
2009-07-22 14:53 ` Janusz Krzysztofik
2009-07-22 15:07 ` Mark Brown [this message]
2009-07-22 19:18 ` Janusz Krzysztofik
2009-07-23 8:57 ` [alsa-devel] " 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=20090722150709.GB4987@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alsa-devel@alsa-project.org \
--cc=arunks@mistralsolutions.com \
--cc=e3-hacking@earth.li \
--cc=jkrzyszt@tis.icnet.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=noodles@earth.li \
--cc=peter.ujfalusi@nokia.com \
--cc=tiwai@suse.de \
--cc=tony@atomide.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