]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: arizona-jack: Use snd_soc_jack to report jack events
authorHans de Goede <hdegoede@redhat.com>
Sun, 7 Mar 2021 15:18:04 +0000 (16:18 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 24 Mar 2021 19:50:17 +0000 (19:50 +0000)
commitde464ef9724f91965dece8a3c3010b3a34115432
tree9e562b5da1048ff28c4d6c6e154aa6e5662cf906
parentbc96556c4d3ed8856d8e828d5a91d091de76da89
ASoC: arizona-jack: Use snd_soc_jack to report jack events

Use the snd_soc_jack code to report jack events, instead of using extcon
for reporting the cable-type + an input_dev for reporting the button
presses.

The snd_soc_jack code will report the cable-type through both input_dev
events and through ALSA controls and the button-presses through input_dev
events.

Note that this means that when the codec drivers are moved over to use
the new arizona-jack.c library code instead of having a separate MFD
extcon cell with the extcon-arizona.c driver, we will no longer report
extcon events to userspace for cable-type changes. This should not be
a problem since "standard" Linux distro userspace does not (and has
never) used the extcon class interface for this. Android does have
support for the extcon class interface, but that was introduced in
the same release as support for input_dev cable-type events, so this
should not be a problem for Android either.

Note this also reduces ARIZONA_MAX_MICD_RANGE from 8 to 6, this is
ok to do since this info is always provided through pdata (or defaults)
and cannot be overridden from devicetree. All in-kernel users of the
pdata (and the fallback defaults) define 6 or less buttons/ranges.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-11-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/arizona-jack.c
sound/soc/codecs/arizona.h