leeco-s2: add firmware, fix fbdev, initial support for audio (MR 1129)

This commit is contained in:
rxbnDE 2020-04-13 22:39:58 +03:00 committed by Alexey Min
parent 95498daf1f
commit 0fa3ead28e
No known key found for this signature in database
GPG key ID: 0B19D2A65870B448
6 changed files with 451 additions and 9 deletions

View file

@ -2,15 +2,22 @@
# Contributor: Yan <nezd@protonmail.com>
pkgname="device-leeco-s2"
pkgdesc="LeEco Le 2"
pkgver=0.1
pkgrel=9
pkgver=0.2
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base linux-leeco-s2 mkbootimg msm-fb-refresher mesa-dri-swrast"
depends="postmarketos-base linux-leeco-s2 mkbootimg mdss-fb-init-hack mesa-dri-swrast"
makedepends="devicepkg-dev"
source="deviceinfo"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="
deviceinfo
fb.modes
directfbrc
ucm/msm8976-skun-snd-card.conf
ucm/HiFi
"
build() {
devicepkg_build $startdir $pkgname
@ -18,6 +25,27 @@ build() {
package() {
devicepkg_package $startdir $pkgname
install -Dm644 "$srcdir"/fb.modes \
"$pkgdir"/etc/fb.modes
install -Dm644 "$srcdir"/directfbrc \
"$pkgdir"/etc/directfbrc
# Alsa usecase manager config
install -D -m644 "$srcdir"/msm8976-skun-snd-card.conf \
"$pkgdir"/usr/share/alsa/ucm2/msm8976-skun-snd-card/msm8976-skun-snd-card.conf
install -D -m644 "$srcdir"/HiFi \
"$pkgdir"/usr/share/alsa/ucm2/msm8976-skun-snd-card/HiFi
}
sha512sums="a508c3dedd400d5be6c94122ce7a46f4c4afd9ef8f7e0f5e42efce6ada8a61687235f78fbb8ad95d6b81e4a2c193d37f1fc7e3fa6db20ee2dc76d663c7e1c351 deviceinfo"
nonfree_firmware() {
pkgdesc="wlan, audio firmware"
depends="firmware-leeco-s2-wcnss firmware-leeco-s2-adsp"
mkdir "$subpkgdir"
}
sha512sums="fb8c0c4a1f4833b26e31d21a05e58f5ac640310a3ad11db2cedc45c332d186d4580b7bda25c66656f3e7ff644baff7efa8333330377c9dddb0936ccdc0ea74e6 deviceinfo
ea23de7628945badcff9d4adbe09b671a50c76da6410b8ab0abdaea8529a6cdcc85524c2c785e284e226b2e247589b7c56afdd89c0778ad711e58cf4086b3a21 fb.modes
eea461b4c2e46351e606039b0fd489c5cf5fc3af71cd09a8aa3f327930ab9c8381908c8079e2cf1d1aba81e70d24b1aaf5e39b32a83596a32ce0c93de04202e9 directfbrc
72fd18d6fea98a081de1681bf39e4fb228c73e8390064a4d4ecde100ef53fce00142342bcbced3b17c4ad2d6976a9676538cc844e2e158739f6ef0d58be9960b msm8976-skun-snd-card.conf
7ac4d3fb2a12b3b0945dbf494edc90f01bea1ce1bfc1a55d2e862df4b1b916ddc43b3afe4b77351d109d4a0a6cf7d65695885a44930831c409a85512cc602471 HiFi"

View file

@ -5,7 +5,7 @@ deviceinfo_format_version="0"
deviceinfo_name="LeEco Le 2"
deviceinfo_manufacturer="LeEco"
deviceinfo_codename="leeco-s2"
deviceinfo_year="2019"
deviceinfo_year="2016"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="aarch64"
@ -13,18 +13,18 @@ deviceinfo_arch="aarch64"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="1920"
deviceinfo_screen_height="1080"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="1920"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlyprintk buildvariant=userdebug"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_sparse="true"
deviceinfo_flash_offset_base="0x80000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1 @@
pixelformat=RGB32

View file

@ -0,0 +1,7 @@
mode "1080x1920-1"
# D: 1.247 MHz, H: 1.086 kHz, V: 0.560 Hz
geometry 1080 1920 1080 1920 16
timings 801763 20 40 10 8 8 2
accel false
rgba 8/0,8/8,8/16,8/24
endmode

View file

@ -0,0 +1,235 @@
SectionVerb {
EnableSequence [
cdev "hw:msm8976skunsndc"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
]
DisableSequence [
cdev "hw:msm8976skunsndc"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
]
Value {
TQ "HiFi"
PlaybackPCM "hw:msm8976skunsndc,0"
CapturePCM "hw:msm8976skunsndc,0"
}
}
SectionDevice."Speaker" {
Comment "Internal Speaker"
ConflictingDevice [
]
EnableSequence [
cdev "hw:msm8976skunsndc"
cset "name='RX1 MIX1 INP1' RX1"
cset "name='RDAC2 MUX' RX1"
cset "name='RX1 Digital Volume' 84"
cset "name='WSA Spk Switch' WSA"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
]
DisableSequence [
cdev "hw:msm8976skunsndc"
cset "name='RX1 MIX1 INP1' ZERO"
cset "name='RDAC2 MUX' ZERO"
cset "name='RX1 Digital Volume' 88"
cset "name='WSA Spk Switch' ZERO"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
]
Value {
PlaybackChannels "2"
}
}
SectionDevice."Headphones" {
Comment "Headset"
ConflictingDevice [
]
EnableSequence [
cdev "hw:msm8976skunsndc"
cset "name='MI2S_RX Channels' Two"
cset "name='RX1 MIX1 INP1' RX1"
cset "name='RX2 MIX1 INP1' RX2"
cset "name='RDAC2 MUX' RX2"
cset "name='HPHL' Switch"
cset "name='HPHR' Switch"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
]
DisableSequence [
cdev "hw:msm8976skunsndc"
cset "name='MI2S_RX Channels' One"
cset "name='RX1 MIX1 INP1' ZERO"
cset "name='RX2 MIX1 INP1' ZERO"
cset "name='RDAC2 MUX' ZERO"
cset "name='HPHL' ZERO"
cset "name='HPHR' ZERO"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
]
Value {
PlaybackChannels "2"
}
}
SectionDevice."Handset" {
Comment "Handset earpiece"
ConflictingDevice [
"Speaker"
"SpeakerMic"
"Headphones"
]
EnableSequence [
cdev "hw:msm8976skunsndc"
cset "name='RX1 MIX1 INP1' RX1"
cset "name='RDAC2 MUX' RX1"
cset "name='RX1 Digital Volume' 88"
cset "name='EAR PA Gain' POS_6_DB"
cset "name='EAR_S' Switch"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
]
DisableSequence [
cdev "hw:msm8976skunsndc"
cset "name='RX1 MIX1 INP1' ZERO"
cset "name='RDAC2 MUX' ZERO"
cset "name='RX1 Digital Volume' 88"
cset "name='EAR PA Gain' POS_6_DB"
cset "name='EAR_S' ZERO"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
]
Value {
PlaybackChannels "2"
}
}
SectionDevice."HandsetMic" {
Comment "Handset microphone"
ConflictingDevice [
"Speaker"
"SpeakerMic"
"HeadsetMic"
]
EnableSequence [
cdev "hw:msm8976skunsndc"
cset "name='ADC1 Volume' 6"
cset "name='DEC1 MUX' ADC1"
cset "name='ADC1 Volume' 6"
cset "name='IIR1 INP1 MUX' DEC1"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
]
DisableSequence [
cdev "hw:msm8976skunsndc"
cset "name='ADC1 Volume' 4"
cset "name='DEC1 MUX' ZERO"
cset "name='ADC1 Volume' 4"
cset "name='IIR1 INP1 MUX' ZERO"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
]
Value {
CaptureChannels "2"
}
}
SectionDevice."SpeakerMic" {
Comment "Handset microphone for speaker-mode"
ConflictingDevice [
"Handset"
"HandsetMic"
"HeadsetMic"
]
EnableSequence [
cdev "hw:msm8976skunsndc"
cset "name='ADC1 Volume' 6"
cset "name='DEC1 MUX' ADC1"
cset "name='ADC3 Volume' 6"
cset "name='DEC2 MUX' ADC2"
cset "name='MI2S_TX Channels' Two"
cset "name='ADC2 MUX' INP3"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
]
DisableSequence [
cdev "hw:msm8976skunsndc"
cset "name='ADC1 Volume' 4"
cset "name='DEC1 MUX' ZERO"
cset "name='ADC3 Volume' 4"
cset "name='DEC2 MUX' ZERO"
cset "name='MI2S_TX Channels' One"
cset "name='ADC2 MUX' ZERO"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
]
Value {
CaptureChannels "2"
}
}
SectionDevice."HeadsetMic" {
Comment "Headset microphone"
ConflictingDevice [
"HandsetMic"
"SpeakerMic"
]
EnableSequence [
cdev "hw:msm8976skunsndc"
cset "name='ADC2 Volume' 6"
cset "name='DEC1 MUX' ADC2"
cset "name='ADC2 MUX' INP2"
cset "name='IIR1 INP1 MUX' DEC1"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 1"
]
DisableSequence [
cdev "hw:msm8976skunsndc"
cset "name='ADC2 Volume' 4"
cset "name='DEC1 MUX' ZERO"
cset "name='ADC2 MUX' ZERO"
cset "name='IIR1 INP1 MUX' ZERO"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
]
Value {
CaptureChannels "2"
}
}

View file

@ -0,0 +1,171 @@
Syntax 2
SectionUseCase."HiFi" {
File "HiFi"
Comment "Play HiFi quality music"
}
SectionDefaults [
cdev "hw:msm8976skunsndc"
cset "name='TTY Mode' OFF"
cset "name='RX1 Digital Volume' 88"
cset "name='RX2 Digital Volume' 88"
cset "name='RX3 Digital Volume' 88"
cset "name='IIR1 INP1 Volume' 84"
cset "name='IIR1 INP2 Volume' 84"
cset "name='IIR1 INP3 Volume' 84"
cset "name='IIR1 INP4 Volume' 84"
cset "name='ADC1 Volume' 4"
cset "name='ADC2 Volume' 4"
cset "name='ADC3 Volume' 4"
cset "name='DEC1 Volume' 84"
cset "name='DEC2 Volume' 84"
cset "name='DEC2 MUX' ZERO"
cset "name='DEC1 MUX' ZERO"
cset "name='ADC2 MUX' ZERO"
cset "name='RDAC2 MUX' ZERO"
cset "name='RX2 MIX2 INP1' ZERO"
cset "name='RX1 MIX2 INP1' ZERO"
cset "name='RX3 MIX1 INP2' ZERO"
cset "name='RX3 MIX1 INP1' ZERO"
cset "name='RX2 MIX1 INP2' ZERO"
cset "name='RX2 MIX1 INP1' ZERO"
cset "name='RX1 MIX1 INP2' ZERO"
cset "name='RX1 MIX1 INP1' ZERO"
cset "name='EAR_S' ZERO"
cset "name='HPHL' ZERO"
cset "name='HPHR' ZERO"
cset "name='SPK' ZERO"
cset "name='WSA Spk Switch' ZERO"
cset "name='EAR PA Gain' POS_6_DB"
cset "name='Speaker Boost' DISABLE"
cset "name='LOOPBACK Mode' DISABLE"
cset "name='VOC_EXT_EC MUX' NONE"
cset "name='Smart PA I2S' DISABLE"
cset "name='IIR1 INP1 MUX' ZERO"
cset "name='EAR PA Gain' POS_1P5_DB"
cset "name='EAR PA Boost' DISABLE"
cset "name='MI2S_RX Channels' One"
cset "name='MI2S_TX Channels' One"
cset "name='PRI_MI2S_RX_DL_HL Switch' 0"
cset "name='PRI_MI2S_RX_VI_FB_MUX' ZERO"
cset "name='DEC3 MUX' ZERO"
cset "name='DEC4 MUX' ZERO"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
cset "name='QUIN_MI2S_RX Audio Mixer MultiMedia1' 0"
cset "name='INTERNAL_BT_SCO_RX Audio Mixer MultiMedia1' 0"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia3' 0"
cset "name='QUIN_MI2S_RX Audio Mixer MultiMedia3' 0"
cset "name='INTERNAL_BT_SCO_RX Audio Mixer MultiMedia3' 0"
cset "name='AFE_PCM_RX Audio Mixer MultiMedia3' 0"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia4' 0"
cset "name='QUIN_MI2S_RX Audio Mixer MultiMedia4' 0"
cset "name='INTERNAL_BT_SCO_RX Audio Mixer MultiMedia4' 0"
cset "name='AFE_PCM_RX Audio Mixer MultiMedia4' 0"
cset "name='INTERNAL_FM_RX Audio Mixer MultiMedia4' 0"
cset "name='PRI_MI2S_RX Audio Mixer MultiMedia5' 0"
cset "name='QUIN_MI2S_RX Audio Mixer MultiMedia5' 0"
cset "name='INTERNAL_BT_SCO_RX Audio Mixer MultiMedia5' 0"
cset "name='MultiMedia1 Mixer TERT_MI2S_TX' 0"
cset "name='MultiMedia5 Mixer TERT_MI2S_TX' 0"
cset "name='MultiMedia1 Mixer INTERNAL_BT_SCO_TX' 0"
cset "name='PRI_MI2S_RX_Voice Mixer CSVoice' 0"
cset "name='Voice_Tx Mixer TERT_MI2S_TX_Voice' 0"
cset "name='Internal BTSCO SampleRate' BTSCO_RATE_8KHZ"
cset "name='INTERNAL_BT_SCO_RX_Voice Mixer CSVoice' 0"
cset "name='Voice_Tx Mixer INTERNAL_BT_SCO_TX_Voice' 0"
cset "name='MultiMedia6 Mixer TERT_MI2S_TX' 0"
cset "name='PRI_MI2S_RX_Voice Mixer Voice2' 0"
cset "name='QUIN_MI2S_RX_Voice Mixer Voice2' 0"
cset "name='Voice2_Tx Mixer TERT_MI2S_TX_Voice2' 0"
cset "name='INTERNAL_BT_SCO_RX_Voice Mixer Voice2' 0"
cset "name='Voice2_Tx Mixer INTERNAL_BT_SCO_TX_Voice2' 0"
cset "name='AFE_PCM_RX_Voice Mixer Voice2' 0"
cset "name='Voice2_Tx Mixer AFE_PCM_TX_Voice2' 0"
cset "name='PRI_MI2S_RX_Voice Mixer VoLTE' 0"
cset "name='VoLTE_Tx Mixer TERT_MI2S_TX_VoLTE' 0"
cset "name='HDMI_RX_Voice Mixer VoLTE' 0"
cset "name='VoLTE_Tx Mixer SLIM_0_TX_VoLTE' 0"
cset "name='INTERNAL_BT_SCO_RX_Voice Mixer VoLTE' 0"
cset "name='VoLTE_Tx Mixer INTERNAL_BT_SCO_TX_VoLTE' 0"
cset "name='AFE_PCM_RX_Voice Mixer VoLTE' 0"
cset "name='VoLTE_Tx Mixer AFE_PCM_TX_VoLTE' 0"
cset "name='PRI_MI2S_RX_Voice Mixer VoWLAN' 0"
cset "name='QUIN_MI2S_RX_Voice Mixer VoWLAN' 0"
cset "name='VoWLAN_Tx Mixer TERT_MI2S_TX_VoWLAN' 0"
cset "name='HDMI_RX_Voice Mixer VoWLAN' 0"
cset "name='INTERNAL_BT_SCO_RX_Voice Mixer VoWLAN' 0"
cset "name='VoWLAN_Tx Mixer INTERNAL_BT_SCO_TX_VoWLAN' 0"
cset "name='AFE_PCM_RX_Voice Mixer VoWLAN' 0"
cset "name='VoWLAN_Tx Mixer AFE_PCM_TX_VoWLAN' 0"
cset "name='PRI_MI2S_RX_Voice Mixer VoiceMMode1' 0"
cset "name='VoiceMMode1_Tx Mixer TERT_MI2S_TX_MMode1' 0"
cset "name='INTERNAL_BT_SCO_RX_Voice Mixer VoiceMMode1' 0"
cset "name='VoiceMMode1_Tx Mixer INT_BT_SCO_TX_MMode1' 0"
cset "name='AFE_PCM_RX_Voice Mixer VoiceMMode1' 0"
cset "name='VoiceMMode1_Tx Mixer AFE_PCM_TX_MMode1' 0"
cset "name='PRI_MI2S_RX_Voice Mixer VoiceMMode2' 0"
cset "name='VoiceMMode2_Tx Mixer TERT_MI2S_TX_MMode2' 0"
cset "name='INTERNAL_BT_SCO_RX_Voice Mixer VoiceMMode2' 0"
cset "name='VoiceMMode2_Tx Mixer INT_BT_SCO_TX_MMode2' 0"
cset "name='AFE_PCM_RX_Voice Mixer VoiceMMode2' 0"
cset "name='VoiceMMode2_Tx Mixer AFE_PCM_TX_MMode2' 0"
cset "name='PRI_MI2S_RX_Voice Mixer Voip' 0"
cset "name='QUIN_MI2S_RX_Voice Mixer Voip' 0"
cset "name='Voip_Tx Mixer TERT_MI2S_TX_Voip' 0"
cset "name='Internal BTSCO SampleRate' BTSCO_RATE_8KHZ"
cset "name='INTERNAL_BT_SCO_RX_Voice Mixer Voip' 0"
cset "name='Voip_Tx Mixer INTERNAL_BT_SCO_TX_Voip' 0"
cset "name='Internal FM RX Volume' 0"
cset "name='PRI_MI2S_RX Port Mixer INTERNAL_FM_TX' 0"
cset "name='QUIN_MI2S_RX Port Mixer INTERNAL_FM_TX' 0"
cset "name='QUIN_MI2S_RX_DL_HL Switch' 0"
cset "name='MultiMedia1 Mixer INTERNAL_FM_TX' 0"
cset "name='MultiMedia2 Mixer INTERNAL_FM_TX' 0"
cset "name='INTERNAL_FM_RX Audio Mixer MultiMedia1' 0"
cset "name='INTERNAL_FM_RX Audio Mixer MultiMedia5' 0"
cset "name='RT_PROXY_1_RX SetCalMode' CAL_MODE_NONE"
cset "name='RT_PROXY_1_TX SetCalMode' CAL_MODE_NONE"
cset "name='MultiMedia1 Mixer VOC_REC_UL' 0"
cset "name='MultiMedia1 Mixer VOC_REC_DL' 0"
cset "name='Incall_Music Audio Mixer MultiMedia2' 0"
cset "name='Incall_Music_2 Audio Mixer MultiMedia9' 0"
cset "name='PRI_MI2S_RX_Voice Mixer QCHAT' 0"
cset "name='QUIN_MI2S_RX_Voice Mixer QCHAT' 0"
cset "name='QCHAT_Tx Mixer TERT_MI2S_TX_QCHAT' 0"
cset "name='INTERNAL_BT_SCO_RX_Voice Mixer QCHAT' 0"
cset "name='QCHAT_Tx Mixer INTERNAL_BT_SCO_TX_QCHAT' 0"
cset "name='AUDIO_REF_EC_UL1 MUX' None"
cset "name='IIR1 Band1' 268435456"
cset "name='IIR1 Band1' 0"
cset "name='IIR1 Band1' ,0"
cset "name='IIR1 Band1' ,,0"
cset "name='IIR1 Band1' ,,,0"
cset "name='IIR1 Band2' 268435456"
cset "name='IIR1 Band2' 0"
cset "name='IIR1 Band2' ,0"
cset "name='IIR1 Band2' ,,0"
cset "name='IIR1 Band2' ,,,0"
cset "name='IIR1 Band3' 268435456"
cset "name='IIR1 Band3' 0"
cset "name='IIR1 Band3' ,0"
cset "name='IIR1 Band3' ,,0"
cset "name='IIR1 Band3' ,,,0"
cset "name='IIR1 Band4' 268435456"
cset "name='IIR1 Band4' 0"
cset "name='IIR1 Band4' ,0"
cset "name='IIR1 Band4' ,,0"
cset "name='IIR1 Band4' ,,,0"
cset "name='IIR1 Band5' 268435456"
cset "name='IIR1 Band5' 0"
cset "name='IIR1 Band5' ,0"
cset "name='IIR1 Band5' ,,0"
cset "name='IIR1 Band5' ,,,0"
cset "name='IIR1 Enable Band1' 0"
cset "name='IIR1 Enable Band2' 0"
cset "name='IIR1 Enable Band3' 0"
cset "name='IIR1 Enable Band4' 0"
cset "name='IIR1 Enable Band5' 0"
]