]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jack
authorHans de Goede <hdegoede@redhat.com>
Thu, 19 Aug 2021 19:05:39 +0000 (21:05 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 19 Aug 2021 22:27:56 +0000 (23:27 +0100)
commit15d54840ecf6f00061d03180394a0a21ff8ffa48
tree47581d9ee7dd2c5bf78219db52ac8e1113fd9876
parent5caab9f48b96f6998fb23d38a7b57fca91ef1653
ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jack

Delay requesting the IRQ until the machine-drv calls set_jack.

The main reason for this is that the codec's IRQ is unused on some boards,
in which case we really should not call request_irq at all.

On some boards there is an IRQ listed at index 0 for the codec, but
this is not connected to the codec, but rather is directly connected
to the jack's jack-detect pin. These special setups will be handled
by the machine-driver, but the machine driver can only request the IRQ
if it is not first requested by the codec driver. Moving the request_irq
to the set_jack callback (which will not get called in this case) avoids
the codec-driver clobbering the IRQ.

Moving the request_irq also removes the need to disable the IRQ immediately
after requesting it, avoiding a small race (this could also have been fixed
by using the new IRQF_NO_AUTOEN flag when requesting the IRQ).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210819190543.784415-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5640.c