This is actually a kernel bug, in Linux. The issue is the absence of platform data for this particular board in the snd_soc_rt5645 module.
The issue can be worked around by creating /etc/modprobe.d/hacksound.conf with the following contents:
# Invert jack detection (1) and use detection mode 2 (2). options snd_soc_rt5645 quirk=0x21
This takes advantage of the "quirk" option for the module, added in https://github.com/torvalds/linux/commit/4999b0214b05a08b42bbafcb29a0b9c413002d3f, which allows overriding the platform data it usually just has built into it about how audio jacks are hooked up on particular systems.
It looks like this board needs special system info added to sound/soc/codecs/rt5645.c, keyed on DMI data. The platform data would look something like:
static const struct rt5645_platform_data lattepanda_platform_data = { .jd_mode = 2, .inv_jd1_1 = true };
Here's the DMI data for the motherboard; it's a bit generic. I can provide other DMI data to match on if needed.
Base Board Information Manufacturer: AMI Corporation Product Name: Cherry Trail CR Version: Default string Serial Number: Default string Asset Tag: Default string Features: Board is a hosting board Board is replaceable Location In Chassis: Default string Chassis Handle: 0x0003 Type: Motherboard Contained Object Handles: 0
This is actually a kernel bug, in Linux. The issue is the absence of platform data for this particular board in the snd_soc_rt5645 module.
The issue can be worked around by creating /etc/modprobe. d/hacksound. conf with the following contents:
# Invert jack detection (1) and use detection mode 2 (2).
options snd_soc_rt5645 quirk=0x21
This takes advantage of the "quirk" option for the module, added in https:/ /github. com/torvalds/ linux/commit/ 4999b0214b05a08 b42bbafcb29a0b9 c413002d3f, which allows overriding the platform data it usually just has built into it about how audio jacks are hooked up on particular systems.
It looks like this board needs special system info added to sound/soc/ codecs/ rt5645. c, keyed on DMI data. The platform data would look something like:
static const struct rt5645_ platform_ data lattepanda_ platform_ data = {
.jd_mode = 2,
.inv_jd1_1 = true
};
Here's the DMI data for the motherboard; it's a bit generic. I can provide other DMI data to match on if needed.
Base Board Information
Manufacturer: AMI Corporation
Board is a hosting board
Board is replaceable
Product Name: Cherry Trail CR
Version: Default string
Serial Number: Default string
Asset Tag: Default string
Features:
Location In Chassis: Default string
Chassis Handle: 0x0003
Type: Motherboard
Contained Object Handles: 0