Skip to content

Commit fee3e1c

Browse files
jwrdegoedebroonie
authored andcommitted
ASoC: Intel: bytcr_rt5651: Add quirk for PoV TAB-P1006W-232 (v1.0) tablet
Add a DMI quirk for the Point of View TAB-P1006W-232 (v1.0) tablet, this tablet is special in a number of ways: 1) It uses the 2nd GPIO resource in the ACPI tables for jack-detect rather then using the rt5651 codec's builtin jack-detect functionality 2) It uses the 3th GPIO resource in the ACPI tables to control the external amplifier rather then the usual first non GpioInt resource and the GPIO is active-low. 3) It is a BYTCR device, without a CHAN package and it uses SSP0-AIF1 rather then the default SSP0-AIF2. 4) Its internal mic is a digital mic (the first x86 rt5651 device that I'm aware of which does this), combined with having its headset-mic connected to IN2. Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 90768ea commit fee3e1c

File tree

1 file changed

+43
-5
lines changed

1 file changed

+43
-5
lines changed

sound/soc/intel/boards/bytcr_rt5651.c

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ struct byt_rt5651_private {
9595
struct snd_soc_jack jack;
9696
};
9797

98+
static const struct acpi_gpio_mapping *byt_rt5651_gpios;
99+
98100
/* Default: jack-detect on JD1_1, internal mic on in2, headsetmic on in3 */
99101
static unsigned long byt_rt5651_quirk = BYT_RT5651_DEFAULT_QUIRKS |
100102
BYT_RT5651_IN2_MAP;
@@ -365,6 +367,22 @@ static int byt_rt5651_aif1_hw_params(struct snd_pcm_substream *substream,
365367
return byt_rt5651_prepare_and_enable_pll1(codec_dai, rate, bclk_ratio);
366368
}
367369

370+
static const struct acpi_gpio_params pov_p1006w_hp_detect = { 1, 0, false };
371+
static const struct acpi_gpio_params pov_p1006w_ext_amp_en = { 2, 0, true };
372+
373+
static const struct acpi_gpio_mapping byt_rt5651_pov_p1006w_gpios[] = {
374+
{ "hp-detect-gpios", &pov_p1006w_hp_detect, 1, },
375+
{ "ext-amp-enable-gpios", &pov_p1006w_ext_amp_en, 1, },
376+
{ },
377+
};
378+
379+
static int byt_rt5651_pov_p1006w_quirk_cb(const struct dmi_system_id *id)
380+
{
381+
byt_rt5651_quirk = (unsigned long)id->driver_data;
382+
byt_rt5651_gpios = byt_rt5651_pov_p1006w_gpios;
383+
return 1;
384+
}
385+
368386
static int byt_rt5651_quirk_cb(const struct dmi_system_id *id)
369387
{
370388
byt_rt5651_quirk = (unsigned long)id->driver_data;
@@ -440,6 +458,23 @@ static const struct dmi_system_id byt_rt5651_quirk_table[] = {
440458
.driver_data = (void *)(BYT_RT5651_MCLK_EN |
441459
BYT_RT5651_IN1_MAP),
442460
},
461+
{
462+
/* Point of View mobii wintab p1006w (v1.0) */
463+
.callback = byt_rt5651_pov_p1006w_quirk_cb,
464+
.matches = {
465+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"),
466+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
467+
/* Note 105b is Foxcon's USB/PCI vendor id */
468+
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"),
469+
DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
470+
},
471+
.driver_data = (void *)(BYT_RT5651_DMIC_MAP |
472+
BYT_RT5651_OVCD_TH_2000UA |
473+
BYT_RT5651_OVCD_SF_0P75 |
474+
BYT_RT5651_DMIC_EN |
475+
BYT_RT5651_MCLK_EN |
476+
BYT_RT5651_SSP0_AIF1),
477+
},
443478
{
444479
/* VIOS LTH17 */
445480
.callback = byt_rt5651_quirk_cb,
@@ -848,7 +883,7 @@ static int snd_byt_rt5651_acpi_resource(struct acpi_resource *ares, void *arg)
848883
return 0;
849884
}
850885

851-
static void snd_byt_rt5651_mc_add_amp_en_gpio_mapping(struct device *codec)
886+
static void snd_byt_rt5651_mc_pick_amp_en_gpio_mapping(struct device *codec)
852887
{
853888
struct byt_rt5651_acpi_resource_data data = { 0, -1 };
854889
LIST_HEAD(resources);
@@ -866,10 +901,10 @@ static void snd_byt_rt5651_mc_add_amp_en_gpio_mapping(struct device *codec)
866901

867902
switch (data.gpio_int_idx) {
868903
case 0:
869-
devm_acpi_dev_add_driver_gpios(codec, byt_rt5651_amp_en_second);
904+
byt_rt5651_gpios = byt_rt5651_amp_en_second;
870905
break;
871906
case 1:
872-
devm_acpi_dev_add_driver_gpios(codec, byt_rt5651_amp_en_first);
907+
byt_rt5651_gpios = byt_rt5651_amp_en_first;
873908
break;
874909
default:
875910
dev_warn(codec, "Unknown GpioInt index %d, not adding external amplifier GPIO mapping\n",
@@ -1001,8 +1036,11 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
10011036
}
10021037

10031038
/* Cherry Trail devices use an external amplifier enable gpio */
1004-
if (x86_match_cpu(cherrytrail_cpu_ids)) {
1005-
snd_byt_rt5651_mc_add_amp_en_gpio_mapping(codec_dev);
1039+
if (x86_match_cpu(cherrytrail_cpu_ids) && !byt_rt5651_gpios)
1040+
snd_byt_rt5651_mc_pick_amp_en_gpio_mapping(codec_dev);
1041+
1042+
if (byt_rt5651_gpios) {
1043+
devm_acpi_dev_add_driver_gpios(codec_dev, byt_rt5651_gpios);
10061044
priv->ext_amp_gpio = devm_fwnode_get_index_gpiod_from_child(
10071045
&pdev->dev, "ext-amp-enable", 0,
10081046
codec_dev->fwnode,

0 commit comments

Comments
 (0)