Commit 2cc3f234 authored by Bard Liao's avatar Bard Liao Committed by Mark Brown

ASoC: rt286: Add customize setting for Dell Dino

The patch add the customize setting for Dell Dino project.
Signed-off-by: default avatarBard Liao <bardliao@realtek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 54d96a40
...@@ -1188,6 +1188,17 @@ static struct dmi_system_id force_combo_jack_table[] = { ...@@ -1188,6 +1188,17 @@ static struct dmi_system_id force_combo_jack_table[] = {
{ } { }
}; };
static struct dmi_system_id dmi_dell_dino[] = {
{
.ident = "Dell Dino",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_BOARD_NAME, "0144P8")
}
},
{ }
};
static int rt286_i2c_probe(struct i2c_client *i2c, static int rt286_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
...@@ -1223,7 +1234,8 @@ static int rt286_i2c_probe(struct i2c_client *i2c, ...@@ -1223,7 +1234,8 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
if (pdata) if (pdata)
rt286->pdata = *pdata; rt286->pdata = *pdata;
if (dmi_check_system(force_combo_jack_table)) if (dmi_check_system(force_combo_jack_table) ||
dmi_check_system(dmi_dell_dino))
rt286->pdata.cbj_en = true; rt286->pdata.cbj_en = true;
regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3); 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,6 +1274,17 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL3, 0xf777, 0x4737); regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL3, 0xf777, 0x4737);
regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL4, 0x00ff, 0x003f); regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL4, 0x00ff, 0x003f);
if (dmi_check_system(dmi_dell_dino)) {
regmap_update_bits(rt286->regmap,
RT286_SET_GPIO_MASK, 0x40, 0x40);
regmap_update_bits(rt286->regmap,
RT286_SET_GPIO_DIRECTION, 0x40, 0x40);
regmap_update_bits(rt286->regmap,
RT286_SET_GPIO_DATA, 0x40, 0x40);
regmap_update_bits(rt286->regmap,
RT286_GPIO_CTRL, 0xc, 0x8);
}
if (rt286->i2c->irq) { if (rt286->i2c->irq) {
ret = request_threaded_irq(rt286->i2c->irq, NULL, rt286_irq, ret = request_threaded_irq(rt286->i2c->irq, NULL, rt286_irq,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt286", rt286); IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt286", rt286);
......
...@@ -117,6 +117,12 @@ ...@@ -117,6 +117,12 @@
VERB_CMD(AC_VERB_SET_COEF_INDEX, RT286_VENDOR_REGISTERS, 0) VERB_CMD(AC_VERB_SET_COEF_INDEX, RT286_VENDOR_REGISTERS, 0)
#define RT286_PROC_COEF\ #define RT286_PROC_COEF\
VERB_CMD(AC_VERB_SET_PROC_COEF, RT286_VENDOR_REGISTERS, 0) VERB_CMD(AC_VERB_SET_PROC_COEF, RT286_VENDOR_REGISTERS, 0)
#define RT286_SET_GPIO_MASK\
VERB_CMD(AC_VERB_SET_GPIO_MASK, RT286_AUDIO_FUNCTION_GROUP, 0)
#define RT286_SET_GPIO_DIRECTION\
VERB_CMD(AC_VERB_SET_GPIO_DIRECTION, RT286_AUDIO_FUNCTION_GROUP, 0)
#define RT286_SET_GPIO_DATA\
VERB_CMD(AC_VERB_SET_GPIO_DATA, RT286_AUDIO_FUNCTION_GROUP, 0)
/* Index registers */ /* Index registers */
#define RT286_A_BIAS_CTRL1 0x01 #define RT286_A_BIAS_CTRL1 0x01
...@@ -131,6 +137,7 @@ ...@@ -131,6 +137,7 @@
#define RT286_POWER_CTRL3 0x0f #define RT286_POWER_CTRL3 0x0f
#define RT286_MIC1_DET_CTRL 0x19 #define RT286_MIC1_DET_CTRL 0x19
#define RT286_MISC_CTRL1 0x20 #define RT286_MISC_CTRL1 0x20
#define RT286_GPIO_CTRL 0x29
#define RT286_IRQ_CTRL 0x33 #define RT286_IRQ_CTRL 0x33
#define RT286_PLL_CTRL1 0x49 #define RT286_PLL_CTRL1 0x49
#define RT286_CBJ_CTRL1 0x4f #define RT286_CBJ_CTRL1 0x4f
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment