-----Original Message----- From: Mark Brown [mailto:broonie@kernel.org] Sent: Wednesday, February 04, 2015 8:59 PM To: Jie, Yang Cc: alsa-devel@alsa-project.org; bardliao@realtek.com; Girdwood, Liam R Subject: Re: [PATCH] ASoC: rt286: add irq enable/disable APIs and export
On Wed, Feb 04, 2015 at 08:44:55PM +0800, Jie Yang wrote:
Some platforms, e.g. WSB, don't need irq handler and jack detection when system is in Suspend, for power save reason.
Here add irq enable/disable APIs and export them, also disable LDO1, which is used for jack detection when headphone is plugged in.
+int rt286_enable_irq(struct snd_soc_codec *codec) {
This isn't a great idiom for the API - the machine driver isn't working with the interrupt, it's working with the jack detection so it should do the disable and reenable in terms of the jack detection too. Otherwise it's not clear that this won't interfere with other interrupt functions the device has and that it'll disable the jack detection hardware in the device rather than just ignoring the interrupt (which is presumably desired and appears to be actually happening in the code).
[Keyon] thanks for review, Mark, do you mean we should change the function names to rt286_enable/disable_jack_detection()?