[PATCH 0/3] ASoc: rt286: Fix combojack detection for ALC3263 (Dell XPS 13 9343)
This fixes a longstanding issue that prevented jack detection from working on systems with the ALC3263 codec, such as the Dell XPS 13 9343, when using I2S mode for audio (instead of HDA mode).
There is currently an ACPI quirk for the Dell XPS 13 9343 that forces it to use HDA mode instead of I2S mode, because jack detection did not work. See:
https://lore.kernel.org/alsa-devel/CAPeXnHv07HkvcHrYFmZMr8OTp7U7F=k_k=LPYnUt...
There are very likely codec fixups for the HDA driver which should be added to the I2S codec driver, to attempt to achieve parity. Commit 394c97f824fa ("ALSA: hda/realtek - Change EAPD to verb control") describes an issue that still seems to be present in the I2S codec driver, for example. In any case this change should move closer to allowing the Dell XPS 13 9343 to default to I2S mode; and it resolves this issue for systems which use I2S mode now, including the Dell Latitude 7350 and the Dell Venue 11 Pro 7140.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=114171 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=150601 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205961 Signed-off-by: David Ward david.ward@gatech.edu
David Ward (3): ASoC: rt286: Make RT286_SET_GPIO_* readable and writable ASoC: rt286: Handle all devices with ALC3263 codec ASoc: rt286: Handle headphones in combo jack correctly
sound/soc/codecs/rt286.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
Otherwise, the GPIO configuration for the Dell XPS 13 9343 is not actually applied, so the headset microphone does not work.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=114171 Signed-off-by: David Ward david.ward@gatech.edu --- sound/soc/codecs/rt286.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index f9b29782b62a..e16e7237156f 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -171,6 +171,9 @@ static bool rt286_readable_register(struct device *dev, unsigned int reg) case RT286_PROC_COEF: case RT286_SET_AMP_GAIN_ADC_IN1: case RT286_SET_AMP_GAIN_ADC_IN2: + case RT286_SET_GPIO_MASK: + case RT286_SET_GPIO_DIRECTION: + case RT286_SET_GPIO_DATA: case RT286_SET_POWER(RT286_DAC_OUT1): case RT286_SET_POWER(RT286_DAC_OUT2): case RT286_SET_POWER(RT286_ADC_IN1):
The ALC3263 codec on the Dell XPS 13 9343 is also on the Dell Latitude 7350 and the Dell Venue 11 Pro 7140. These require the same handling: GPIO pin 6 needs to be set for a headset or microphone to work in the combo jack.
This is implemented for the HDA driver, which always sets GPIO pin 6 on the ALC3263. It is detected using the codec vendor/device ID 0x10ec0288 and the PCI subsystem vendor ID 0x1028 (Dell). Because the I2S codec driver doesn't use PCI, adapt this by using DMI to check if Dell is the system vendor.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=150601 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205961 Signed-off-by: David Ward david.ward@gatech.edu --- sound/soc/codecs/rt286.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index e16e7237156f..c0129edf5993 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -1120,12 +1120,11 @@ static const struct dmi_system_id force_combo_jack_table[] = { { } };
-static const struct dmi_system_id dmi_dell_dino[] = { +static const struct dmi_system_id dmi_dell[] = { { - .ident = "Dell Dino", + .ident = "Dell", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343") } }, { } @@ -1136,7 +1135,7 @@ static int rt286_i2c_probe(struct i2c_client *i2c, { struct rt286_platform_data *pdata = dev_get_platdata(&i2c->dev); struct rt286_priv *rt286; - int i, ret, val; + int i, ret, vendor_id;
rt286 = devm_kzalloc(&i2c->dev, sizeof(*rt286), GFP_KERNEL); @@ -1152,14 +1151,15 @@ static int rt286_i2c_probe(struct i2c_client *i2c, }
ret = regmap_read(rt286->regmap, - RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &val); + RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &vendor_id); if (ret != 0) { dev_err(&i2c->dev, "I2C error %d\n", ret); return ret; } - if (val != RT286_VENDOR_ID && val != RT288_VENDOR_ID) { + if (vendor_id != RT286_VENDOR_ID && vendor_id != RT288_VENDOR_ID) { dev_err(&i2c->dev, - "Device with ID register %#x is not rt286\n", val); + "Device with ID register %#x is not rt286\n", + vendor_id); return -ENODEV; }
@@ -1183,8 +1183,8 @@ static int rt286_i2c_probe(struct i2c_client *i2c, if (pdata) rt286->pdata = *pdata;
- if (dmi_check_system(force_combo_jack_table) || - dmi_check_system(dmi_dell_dino)) + if ((vendor_id == RT288_VENDOR_ID && dmi_check_system(dmi_dell)) || + dmi_check_system(force_combo_jack_table)) rt286->pdata.cbj_en = true;
regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3); @@ -1223,7 +1223,7 @@ 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_CTRL4, 0x00ff, 0x003f);
- if (dmi_check_system(dmi_dell_dino)) { + if (vendor_id == RT288_VENDOR_ID && dmi_check_system(dmi_dell)) { regmap_update_bits(rt286->regmap, RT286_SET_GPIO_MASK, 0x40, 0x40); regmap_update_bits(rt286->regmap,
If headphones are detected in the combo jack instead of a headset, set the index register RT286_CBJ_CTRL1 to the correct value (from the HDA driver).
Signed-off-by: David Ward david.ward@gatech.edu --- sound/soc/codecs/rt286.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index c0129edf5993..7e67165a43e6 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -260,6 +260,12 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic) else *mic = false; } + + if (!*mic) { + regmap_update_bits(rt286->regmap, + RT286_CBJ_CTRL1, 0xfcc0, 0xc400); + } + regmap_update_bits(rt286->regmap, RT286_DC_GAIN, 0x200, 0x0);
participants (1)
-
David Ward