summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2018-11-12 18:28:37 +0300
committerLee Jones <lee.jones@linaro.org>2019-01-03 11:32:42 +0300
commit7f9472134a5af31bad191f074a5d416146da26f7 (patch)
tree0679bd7a187a97ca78c23a80e5f9895f8eac9f3e /include/linux
parent628f3dfe4c7b35bbe63ec194ca6da857b00b0083 (diff)
downloadlinux-7f9472134a5af31bad191f074a5d416146da26f7.tar.xz
mfd: madera: Add shared data for accessory detection
Add variables to struct madera that will be shared by the extcon and audio codec drivers to synchronize output state during accessory detection. Also add a mutex to protect the DAPM pointer. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mfd/madera/core.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mfd/madera/core.h b/include/linux/mfd/madera/core.h
index fe69c0f4398f..4d5d51a9c8a6 100644
--- a/include/linux/mfd/madera/core.h
+++ b/include/linux/mfd/madera/core.h
@@ -15,6 +15,7 @@
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/mfd/madera/pdata.h>
+#include <linux/mutex.h>
#include <linux/notifier.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
@@ -37,6 +38,8 @@ enum madera_type {
#define MADERA_MAX_MICBIAS 4
+#define MADERA_MAX_HP_OUTPUT 3
+
/* Notifier events */
#define MADERA_NOTIFY_VOICE_TRIGGER 0x1
#define MADERA_NOTIFY_HPDET 0x2
@@ -183,6 +186,10 @@ struct madera {
unsigned int num_childbias[MADERA_MAX_MICBIAS];
struct snd_soc_dapm_context *dapm;
+ struct mutex dapm_ptr_lock;
+ unsigned int hp_ena;
+ bool out_clamp[MADERA_MAX_HP_OUTPUT];
+ bool out_shorted[MADERA_MAX_HP_OUTPUT];
struct blocking_notifier_head notifier;
};