All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: John Hsu <KCHSU0@nuvoton.com>
Cc: AP MS30 Linux ALSA <alsa-devel@alsa-project.org>,
	"anatol.pomozov@gmail.com" <anatol.pomozov@gmail.com>,
	AC30 YHChuang <YHCHuang@nuvoton.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"benzh@chromium.org" <benzh@chromium.org>,
	AC30 CTLin0 <CTLIN0@nuvoton.com>, MS40 MHKuo <MHKuo@nuvoton.com>,
	"yong.zhi@intel.com" <yong.zhi@intel.com>
Subject: Re: [PATCH 1/2] ASoC: nau8825: non-clock jack detection for power saving at standby
Date: Wed, 4 May 2016 17:39:44 +0100	[thread overview]
Message-ID: <20160504163943.GZ6292@sirena.org.uk> (raw)
In-Reply-To: <57286D40.6030002@nuvoton.com>


[-- Attachment #1.1: Type: text/plain, Size: 2206 bytes --]

On Tue, May 03, 2016 at 05:20:00PM +0800, John Hsu wrote:
> On 5/3/2016 12:27 AM, Mark Brown wrote:
> > On Fri, Apr 29, 2016 at 04:15:17PM +0800, John Hsu wrote:

> > > +	/* Mask all interruptions except jack insertion interruption */
> > > +	regmap_write(regmap, NAU8825_REG_INTERRUPT_DIS_CTRL, 0xfffe);

> > So if any other interrupts occur then things will break...

> The codec only has headset output and its function works when headset is
> connected. When headset is not connected, the driver only permit insertion
> interruption to happen. After insertion, the internal clock of codec turns
> on and all other interruptions just will be enabled. Without clock, the
> codec can detect jack insertion only.

People do surprising things with devices - they may not wire up the
headphone detection for some reason, or may connect some external
circuit.

> > This is ignoring the attempt to set up a clock but returning success
> > which is going to break things, printing the warning is dubious (a
> > system could be built without detection for example, or a speaker driver
> > connected) but probably OK in itself but the fact that we don't tell the
> > caller may make things worse.

> For clear expression, we should print error message and return error to
> caller. Is it right?

It'd be better to just accept the configuration but what you suggest is
less bad than just completely ignoring the problem.

> > > +		nau8825_eject_jack(nau8825);
> > > +		snd_soc_jack_report(nau8825->jack, 0, SND_JACK_HEADSET);
> > > +	}
> > > +	enable_irq(nau8825->irq);

> > The interrupt is optional (that bug appears to be already present in the
> > driver but should be fixed).

> If headset ejection happened when system suspend. After resume, the codec
> won't detect the change and no report to the kernel. The application does
> not aware the device change and still outputs stream to the headset device.
> For the issue, the driver has to notice the application of ejection ever
> happened in suspend. Let the application to change its device correctly.

This does not address the issue at all.  The interrupt is optional, it
may not have been wired up and the probe function handles that case
gracefully.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2016-05-04 16:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29  8:15 [PATCH 1/2] ASoC: nau8825: non-clock jack detection for power saving at standby John Hsu
2016-04-29  8:15 ` [PATCH 2/2] ASoC: nau8825: cross talk suppression measurement function John Hsu
2016-05-02 16:27 ` [PATCH 1/2] ASoC: nau8825: non-clock jack detection for power saving at standby Mark Brown
2016-05-03  9:20   ` John Hsu
2016-05-04 16:39     ` Mark Brown [this message]
2016-05-06  7:41       ` John Hsu
2016-05-06 18:18         ` Mark Brown
2016-05-09  2:57           ` John Hsu
2016-05-09 16:35             ` Mark Brown
2016-05-10  3:18               ` John Hsu
2016-05-11 17:15                 ` Mark Brown
2016-05-12  3:54                   ` John Hsu
2016-05-12 10:58                     ` 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=20160504163943.GZ6292@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=CTLIN0@nuvoton.com \
    --cc=KCHSU0@nuvoton.com \
    --cc=MHKuo@nuvoton.com \
    --cc=YHCHuang@nuvoton.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=anatol.pomozov@gmail.com \
    --cc=benzh@chromium.org \
    --cc=lgirdwood@gmail.com \
    --cc=yong.zhi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.