summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorCheng-Yi Chiang2015-01-05 12:26:59 +0100
committerMark Brown2015-01-05 16:29:51 +0100
commit8e3e36e87c9e624a30d31c576b839eed3ac8abf4 (patch)
treea3887e4beda3c5ed7db3b801f03fbf0f2acbb4f0 /sound
parentLinux 3.19-rc1 (diff)
downloadkernel-qcow2-linux-8e3e36e87c9e624a30d31c576b839eed3ac8abf4.tar.gz
kernel-qcow2-linux-8e3e36e87c9e624a30d31c576b839eed3ac8abf4.tar.xz
kernel-qcow2-linux-8e3e36e87c9e624a30d31c576b839eed3ac8abf4.zip
ASoC: ts3a227e: Check and report jack status at probe
ts3a227e does not trigger interrupt to report jack status when system boots from warm reset because ts3a227e's power remains on during warm reset. Read jack status at probe to get current jack status. Note that if system boots from EC reset, then this issue will not happen. Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/ts3a227e.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c
index 1d1205702d23..9f2dced046de 100644
--- a/sound/soc/codecs/ts3a227e.c
+++ b/sound/soc/codecs/ts3a227e.c
@@ -254,6 +254,7 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
struct ts3a227e *ts3a227e;
struct device *dev = &i2c->dev;
int ret;
+ unsigned int acc_reg;
ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL);
if (ts3a227e == NULL)
@@ -283,6 +284,11 @@ static int ts3a227e_i2c_probe(struct i2c_client *i2c,
INTB_DISABLE | ADC_COMPLETE_INT_DISABLE,
ADC_COMPLETE_INT_DISABLE);
+ /* Read jack status because chip might not trigger interrupt at boot. */
+ regmap_read(ts3a227e->regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg);
+ ts3a227e_new_jack_state(ts3a227e, acc_reg);
+ ts3a227e_jack_report(ts3a227e);
+
return 0;
}