aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorBard Liao <bardliao@realtek.com>2015-02-05 03:40:34 -0500
committerMark Brown <broonie@kernel.org>2015-02-05 13:18:02 -0500
commit2cc3f2347022969f00a429951ce489d35a9b4ea8 (patch)
tree1f4e50b43b5ad283a4415a88aa4b604eac4c0f5d /sound/soc
parent54d96a40e0dfb5aa2eea0b010ddc1c7e8742e364 (diff)
ASoC: rt286: Add customize setting for Dell Dino
The patch add the customize setting for Dell Dino project. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/rt286.c25
-rw-r--r--sound/soc/codecs/rt286.h7
2 files changed, 31 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index 847cc4b9bee5..1fbebaf6dbf4 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -1188,6 +1188,17 @@ static struct dmi_system_id force_combo_jack_table[] = {
1188 { } 1188 { }
1189}; 1189};
1190 1190
1191static struct dmi_system_id dmi_dell_dino[] = {
1192 {
1193 .ident = "Dell Dino",
1194 .matches = {
1195 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1196 DMI_MATCH(DMI_BOARD_NAME, "0144P8")
1197 }
1198 },
1199 { }
1200};
1201
1191static int rt286_i2c_probe(struct i2c_client *i2c, 1202static int rt286_i2c_probe(struct i2c_client *i2c,
1192 const struct i2c_device_id *id) 1203 const struct i2c_device_id *id)
1193{ 1204{
@@ -1223,7 +1234,8 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
1223 if (pdata) 1234 if (pdata)
1224 rt286->pdata = *pdata; 1235 rt286->pdata = *pdata;
1225 1236
1226 if (dmi_check_system(force_combo_jack_table)) 1237 if (dmi_check_system(force_combo_jack_table) ||
1238 dmi_check_system(dmi_dell_dino))
1227 rt286->pdata.cbj_en = true; 1239 rt286->pdata.cbj_en = true;
1228 1240
1229 regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3); 1241 regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3);
@@ -1262,6 +1274,17 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
1262 regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL3, 0xf777, 0x4737); 1274 regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL3, 0xf777, 0x4737);
1263 regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL4, 0x00ff, 0x003f); 1275 regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL4, 0x00ff, 0x003f);
1264 1276
1277 if (dmi_check_system(dmi_dell_dino)) {
1278 regmap_update_bits(rt286->regmap,
1279 RT286_SET_GPIO_MASK, 0x40, 0x40);
1280 regmap_update_bits(rt286->regmap,
1281 RT286_SET_GPIO_DIRECTION, 0x40, 0x40);
1282 regmap_update_bits(rt286->regmap,
1283 RT286_SET_GPIO_DATA, 0x40, 0x40);
1284 regmap_update_bits(rt286->regmap,
1285 RT286_GPIO_CTRL, 0xc, 0x8);
1286 }
1287
1265 if (rt286->i2c->irq) { 1288 if (rt286->i2c->irq) {
1266 ret = request_threaded_irq(rt286->i2c->irq, NULL, rt286_irq, 1289 ret = request_threaded_irq(rt286->i2c->irq, NULL, rt286_irq,
1267 IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt286", rt286); 1290 IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt286", rt286);
diff --git a/sound/soc/codecs/rt286.h b/sound/soc/codecs/rt286.h
index b539b7320a79..7130edb152ef 100644
--- a/sound/soc/codecs/rt286.h
+++ b/sound/soc/codecs/rt286.h
@@ -117,6 +117,12 @@
117 VERB_CMD(AC_VERB_SET_COEF_INDEX, RT286_VENDOR_REGISTERS, 0) 117 VERB_CMD(AC_VERB_SET_COEF_INDEX, RT286_VENDOR_REGISTERS, 0)
118#define RT286_PROC_COEF\ 118#define RT286_PROC_COEF\
119 VERB_CMD(AC_VERB_SET_PROC_COEF, RT286_VENDOR_REGISTERS, 0) 119 VERB_CMD(AC_VERB_SET_PROC_COEF, RT286_VENDOR_REGISTERS, 0)
120#define RT286_SET_GPIO_MASK\
121 VERB_CMD(AC_VERB_SET_GPIO_MASK, RT286_AUDIO_FUNCTION_GROUP, 0)
122#define RT286_SET_GPIO_DIRECTION\
123 VERB_CMD(AC_VERB_SET_GPIO_DIRECTION, RT286_AUDIO_FUNCTION_GROUP, 0)
124#define RT286_SET_GPIO_DATA\
125 VERB_CMD(AC_VERB_SET_GPIO_DATA, RT286_AUDIO_FUNCTION_GROUP, 0)
120 126
121/* Index registers */ 127/* Index registers */
122#define RT286_A_BIAS_CTRL1 0x01 128#define RT286_A_BIAS_CTRL1 0x01
@@ -131,6 +137,7 @@
131#define RT286_POWER_CTRL3 0x0f 137#define RT286_POWER_CTRL3 0x0f
132#define RT286_MIC1_DET_CTRL 0x19 138#define RT286_MIC1_DET_CTRL 0x19
133#define RT286_MISC_CTRL1 0x20 139#define RT286_MISC_CTRL1 0x20
140#define RT286_GPIO_CTRL 0x29
134#define RT286_IRQ_CTRL 0x33 141#define RT286_IRQ_CTRL 0x33
135#define RT286_PLL_CTRL1 0x49 142#define RT286_PLL_CTRL1 0x49
136#define RT286_CBJ_CTRL1 0x4f 143#define RT286_CBJ_CTRL1 0x4f