]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ASoC: rt5645: Headphone Jack sense inverts on the LattePanda board
authorHui Wang <hui.wang@canonical.com>
Tue, 7 May 2019 05:50:00 +0000 (07:50 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 May 2019 12:57:44 +0000 (14:57 +0200)
BugLink: https://bugs.launchpad.net/bugs/1824259
The LattePanda board has a sound card chtrt5645, when there is nothing
plugged in the headphone jack, the system thinks the headphone is
plugged in, while we plug a headphone in the jack, the system thinks
the headphone is unplugged.

If adding quirk=0x21 in the module parameter, the headphone jack can
work well. So let us fix it via platform_data.

https://bugs.launchpad.net/bugs/182459
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(backported from commit 406dcbc55a0a20fd155be889a4a0c4b812f7c18e
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
sound/soc/codecs/rt5645.c

index edc152c8a1fe7596e9bbc5760574d973a9185d16..66fce92fb1a96287aa27aa8f61dacad57f523a69 100644 (file)
@@ -3681,6 +3681,23 @@ static const struct dmi_system_id dmi_platform_minix_z83_4[] = {
        { }
 };
 
+static const struct rt5645_platform_data lattepanda_board_platform_data = {
+       .jd_mode = 2,
+       .inv_jd1_1 = true,
+};
+
+static const struct dmi_system_id dmi_platform_lattepanda_board[] = {
+       {
+               .ident = "LattePanda board",
+               .matches = {
+                 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
+                 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
+                 DMI_EXACT_MATCH(DMI_BOARD_VERSION, "Default string"),
+               },
+       },
+       { }
+};
+
 static bool rt5645_check_dp(struct device *dev)
 {
        if (device_property_present(dev, "realtek,in2-differential") ||
@@ -3737,6 +3754,8 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
                rt5645->pdata = general_platform_data2;
        else if (dmi_check_system(dmi_platform_minix_z83_4))
                rt5645->pdata = minix_z83_4_platform_data;
+       else if (dmi_check_system(dmi_platform_lattepanda_board))
+               rt5645->pdata = lattepanda_board_platform_data;
 
        if (quirk != -1) {
                rt5645->pdata.in2_diff = QUIRK_IN2_DIFF(quirk);