diff options
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-rw-r--r-- | sound/soc/codecs/max98088.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index bc22ee93a75d..d63e28773eb1 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -28,6 +28,11 @@ | |||
28 | #include <sound/max98088.h> | 28 | #include <sound/max98088.h> |
29 | #include "max98088.h" | 29 | #include "max98088.h" |
30 | 30 | ||
31 | enum max98088_type { | ||
32 | MAX98088, | ||
33 | MAX98089, | ||
34 | }; | ||
35 | |||
31 | struct max98088_cdata { | 36 | struct max98088_cdata { |
32 | unsigned int rate; | 37 | unsigned int rate; |
33 | unsigned int fmt; | 38 | unsigned int fmt; |
@@ -36,6 +41,7 @@ struct max98088_cdata { | |||
36 | 41 | ||
37 | struct max98088_priv { | 42 | struct max98088_priv { |
38 | u8 reg_cache[M98088_REG_CNT]; | 43 | u8 reg_cache[M98088_REG_CNT]; |
44 | enum max98088_type devtype; | ||
39 | void *control_data; | 45 | void *control_data; |
40 | struct max98088_pdata *pdata; | 46 | struct max98088_pdata *pdata; |
41 | unsigned int sysclk; | 47 | unsigned int sysclk; |
@@ -2013,7 +2019,10 @@ err_access: | |||
2013 | 2019 | ||
2014 | static int max98088_remove(struct snd_soc_codec *codec) | 2020 | static int max98088_remove(struct snd_soc_codec *codec) |
2015 | { | 2021 | { |
2022 | struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); | ||
2023 | |||
2016 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2024 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2025 | kfree(max98088->eq_texts); | ||
2017 | 2026 | ||
2018 | return 0; | 2027 | return 0; |
2019 | } | 2028 | } |
@@ -2040,6 +2049,8 @@ static int max98088_i2c_probe(struct i2c_client *i2c, | |||
2040 | if (max98088 == NULL) | 2049 | if (max98088 == NULL) |
2041 | return -ENOMEM; | 2050 | return -ENOMEM; |
2042 | 2051 | ||
2052 | max98088->devtype = id->driver_data; | ||
2053 | |||
2043 | i2c_set_clientdata(i2c, max98088); | 2054 | i2c_set_clientdata(i2c, max98088); |
2044 | max98088->control_data = i2c; | 2055 | max98088->control_data = i2c; |
2045 | max98088->pdata = i2c->dev.platform_data; | 2056 | max98088->pdata = i2c->dev.platform_data; |
@@ -2059,7 +2070,8 @@ static int __devexit max98088_i2c_remove(struct i2c_client *client) | |||
2059 | } | 2070 | } |
2060 | 2071 | ||
2061 | static const struct i2c_device_id max98088_i2c_id[] = { | 2072 | static const struct i2c_device_id max98088_i2c_id[] = { |
2062 | { "max98088", 0 }, | 2073 | { "max98088", MAX98088 }, |
2074 | { "max98089", MAX98089 }, | ||
2063 | { } | 2075 | { } |
2064 | }; | 2076 | }; |
2065 | MODULE_DEVICE_TABLE(i2c, max98088_i2c_id); | 2077 | MODULE_DEVICE_TABLE(i2c, max98088_i2c_id); |