summaryrefslogtreecommitdiff
authorZhe Wang <Zhe.Wang@amlogic.com>2019-01-28 03:13:04 (GMT)
committer Zhe Wang <Zhe.Wang@amlogic.com>2019-01-28 05:46:59 (GMT)
commit10d893c329c1e66bb07dd8a4823337d2af93a733 (patch)
tree600a15aad6ebd2c3a6c33e2b938b2a83065badc0
parent52db8f43b10742a07ebbea9d1ddb64bfb0536021 (diff)
downloadcommon-10d893c329c1e66bb07dd8a4823337d2af93a733.zip
common-10d893c329c1e66bb07dd8a4823337d2af93a733.tar.gz
common-10d893c329c1e66bb07dd8a4823337d2af93a733.tar.bz2
audio: disable AMP before system shutdown[1/1]
PD#OTT-1875 bug:123291348 Problem: speaker with pop noise when reboot Solution: disable AMP before system shutdown Verify: verify on Atom Change-Id: Ib1fe2a33960fac619e463df6f05ea7dccd0c42c7 Signed-off-by: Zhe Wang <Zhe.Wang@amlogic.com>
Diffstat
-rw-r--r--sound/soc/codecs/amlogic/cs42528.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/codecs/amlogic/cs42528.c b/sound/soc/codecs/amlogic/cs42528.c
index bb27839..cdfbf6c 100644
--- a/sound/soc/codecs/amlogic/cs42528.c
+++ b/sound/soc/codecs/amlogic/cs42528.c
@@ -615,6 +615,15 @@ static int cs42528_i2c_remove(struct i2c_client *client)
return 0;
}
+static void cs42528_i2c_shutdown(struct i2c_client *client)
+{
+
+ struct cs42528_priv *cs42528 = dev_get_drvdata(&client->dev);
+ struct cs42528_platform_data *pdata = cs42528->pdata;
+
+ gpio_direction_output(pdata->amp_pin, GPIOF_OUT_INIT_LOW);
+}
+
static const struct i2c_device_id cs42528_i2c_id[] = {
{ "cs42528", 0 },
{}
@@ -634,6 +643,7 @@ static struct i2c_driver cs42528_i2c_driver = {
},
.probe = cs42528_i2c_probe,
.remove = cs42528_i2c_remove,
+ .shutdown = cs42528_i2c_shutdown,
.id_table = cs42528_i2c_id,
};
module_i2c_driver(cs42528_i2c_driver);