samsung-t03g: switch to mainline and armv7 (MR 3077)

This commit is contained in:
Maxim Kutnij 2022-04-17 20:09:44 +05:00 committed by Alexey Min
parent 47158e31f8
commit ffeeba88a5
No known key found for this signature in database
GPG key ID: 0B19D2A65870B448
7 changed files with 284 additions and 41 deletions

View file

@ -1,8 +0,0 @@
# udev rules file
# All device names can be read from weston's logfile
# Touchscreen (use 'weston-calibrator' to calibrate)
SUBSYSTEM=="input", ATTRS{name}=="sec_touchscreen", \
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1" \
ENV{WL_CALIBRATION}="0.954174 0.016888 -2.626083 -0.006031 1.011271 14.175903"

View file

@ -1,27 +0,0 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-n7100
pkgver=1
pkgrel=25
pkgdesc="Samsung Galaxy Note II (GSM)"
url="https://postmarketos.org"
arch="armhf"
license="MIT"
depends="postmarketos-base linux-samsung-n7100 mkbootimg mesa-dri-gallium"
makedepends="devicepkg-dev"
source="deviceinfo 90-android-touch-dev.rules"
options="!check !archcheck"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -D -m644 "$srcdir"/90-android-touch-dev.rules \
"$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules
}
sha512sums="
64556a0e9ebd44b4ef154c1b850c5410422eeccff29a5796420f3c8796382d997fec2f4643e4d70a69355c6175f651f78a953e266cc4915efc9bac1b93be0642 deviceinfo
089635daddd88eec35451bfe98dc3713035e3623c896dd21305b990ecf422e8fbb54e010cf347919bbb3a7385f639ab119280477fe0783df3228168d97d96fc6 90-android-touch-dev.rules
"

View file

@ -0,0 +1,55 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-t03g
pkgdesc="Samsung Galaxy Note II (GSM)"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
alsa-ucm-conf
linux-postmarketos-exynos4
mesa-dri-gallium
mkbootimg
postmarketos-base
soc-samsung-exynos4412-haptics
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="
deviceinfo
ucm/Midas.conf
ucm/HiFi.conf
modules-load.conf
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
# Alsa UCM configs
install -Dm644 "$srcdir"/Midas.conf \
"$pkgdir"/usr/share/alsa/ucm2/conf.d/Midas/Midas.conf
install -Dm644 "$srcdir"/HiFi.conf \
"$pkgdir"/usr/share/alsa/ucm2/conf.d/Midas/HiFi.conf
}
nonfree_firmware() {
pkgdesc="WiFi & Bluetooth firmware"
depends="
firmware-samsung-midas-bluetooth
firmware-samsung-midas-wifi
"
mkdir "$subpkgdir"
}
sha512sums="
6988a69d5f061f9e697373902f25c08c25dbabcc660f8b0b0c7af97012335ab305b21e7da4d02c65013d6a948e93caed25464a3afff5472d735b135e34415e72 deviceinfo
caa81e8ab6753c0ca24c22fb6742288765dfbf2469b8b8c35c5789edfcee546ef1c3b14ad6e540c417f434258399300f17d312b58157635eafab134587ef94cc Midas.conf
a56ce19331a8997b1cc493b8ab6b16ecfc423254a380e13a9461ec94ec5bc124cb3283256ef8cc014db60937a5e7404c6f7728bc2cc2494a70c612ccb3fd4105 HiFi.conf
56a2bdffc273cb0a581192e65378ff50e71c7bc8a696af7d5e7c165a53c005aae104c4514c68afb668454c5a94ce78bd509f8a40e3401d67e16636b1ed81d051 modules-load.conf
"

View file

@ -4,20 +4,32 @@
deviceinfo_format_version="0"
deviceinfo_name="Samsung Galaxy Note II"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-n7100"
deviceinfo_codename="samsung-t03g"
deviceinfo_year="2012"
deviceinfo_append_dtb="true"
deviceinfo_dtb="exynos4412-n710x"
deviceinfo_arch="armv7"
# Device related
deviceinfo_gpu_accelerated="true"
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_arch="armhf"
deviceinfo_generate_bootimg="true"
deviceinfo_screen_width="720"
deviceinfo_screen_height="1280"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
deviceinfo_flash_offset_base="0x40000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x11000000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"
# Heimdall related
deviceinfo_flash_heimdall_partition_kernel="BOOT"

View file

@ -0,0 +1,5 @@
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# notification led module
ledtrig-pattern

View file

@ -0,0 +1,200 @@
# Based on https://github.com/LineageOS/android_device_samsung_t0lte/blob/cm-14.1/configs/tiny_hw.xml
SectionVerb {
EnableSequence [
cdev "hw:Midas"
# do not change the adc & dac source of AIF2
cset "name='AIF2DACL Source' 0"
cset "name='AIF2DACR Source' 0"
cset "name='AIF2ADCL Source' 0"
cset "name='AIF2ADCR Source' 1"
# AIF1->DAC1
cset "name='DAC1 Switch' 1"
# general
cset "name='IN1L ZC Switch' 0"
cset "name='IN1R ZC Switch' 0"
cset "name='IN2L ZC Switch' 0"
cset "name='IN2R ZC Switch' 0"
cset "name='Output ZC Switch' 0"
cset "name='Speaker ZC Switch' 0"
cset "name='Headphone ZC Switch' 0"
# AIF1->DAC1
cset "name='DAC1L Mixer AIF1.1 Switch' 1"
cset "name='DAC1R Mixer AIF1.1 Switch' 1"
cset "name='DAC1 Switch' 1"
# ADC->AIF2
cset "name='AIF2DAC2L Mixer Left Sidetone Switch' 1"
cset "name='AIF2DAC2L Mixer Right Sidetone Switch' 0"
cset "name='AIF2DAC2R Mixer Left Sidetone Switch' 0"
cset "name='AIF2DAC2R Mixer Right Sidetone Switch' 1"
cset "name='DAC2 Left Sidetone Volume' 12"
cset "name='DAC2 Right Sidetone Volume' 12"
cset "name='DAC2 Switch' 1"
# DAC1->HP
cset "name='Left Headphone Mux' Mixer"
cset "name='Right Headphone Mux' Mixer"
# DAC1->SPKL/R->SPKL/R Boost->SPK
cset "name='SPKL DAC1 Switch' 1"
cset "name='SPKR DAC1 Switch' 1"
cset "name='SPKL Boost SPKL Switch' 1"
cset "name='SPKL Boost SPKR Switch' 1"
cset "name='SPKR Boost SPKL Switch' 0"
cset "name='SPKR Boost SPKR Switch' 0"
cset "name='Speaker Mixer Volume' 3"
# DAC->Output mixer->Earpiece
cset "name='Left Output Mixer DAC Switch' 1"
cset "name='Right Output Mixer DAC Switch' 1"
cset "name='Earpiece Mixer Left Output Switch' 1"
cset "name='Earpiece Mixer Right Output Switch' 1"
cset "name='Earpiece Switch' 1"
# LINEOUT
cset "name='LINEOUT2N Mixer Left Output Switch' 1"
cset "name='LINEOUT2P Mixer Right Output Switch' 1"
cset "name='LINEOUT1N Mixer Right Output Switch' 1"
cset "name='LINEOUT1P Mixer Left Output Switch' 1"
# Input mixer->ADC->AIF1.1
cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 1"
cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 1"
# Main Mic->IN1LP/N->Input Mixer with +30dB at mixer
cset "name='IN1L PGA IN1LP Switch' 1"
cset "name='IN1L PGA IN1LN Switch' 1"
cset "name='MIXINL IN1L Volume' 1"
cset "name='IN1L Switch' 1"
# Sub Mic->IN1RP/N->Input Mixer with +30dB at mixer
cset "name='IN1R PGA IN1RP Switch' 1"
cset "name='IN1R PGA IN1RN Switch' 1"
cset "name='MIXINR IN1R Volume' 1"
cset "name='IN1R Switch' 1"
# FM Radio->IN2RP/N->Input Mixer with +30dB at mixer
cset "name='IN2R PGA IN2RP Switch' 1"
cset "name='IN2R PGA IN2RN Switch' 1"
cset "name='MIXINR IN2R Volume' 1"
cset "name='IN2R Switch' 1"
# Ear Mic->IN2LP/N->Input Mixer with +30dB at mixer
cset "name='IN2L PGA IN2LP Switch' 1"
cset "name='IN2L PGA IN2LN Switch' 1"
cset "name='MIXINL IN2L Volume' 1"
cset "name='IN2L Switch' 1"
# Input mixer->ADC->AIF1
cset "name='AIF1ADC1L Mixer ADC/DMIC Switch' 1"
cset "name='AIF1ADC1R Mixer ADC/DMIC Switch' 1"
cset "name='ADCL Mux' ADC"
# HPF on to take out some bounce
cset "name='Sidetone HPF Switch' 0"
# Work around core issue
cset "name='ADCL Mux' DMIC"
cset "name='ADCL Mux' ADC"
cset "name='ADCR Mux' DMIC"
cset "name='ADCR Mux' ADC"
# AIF2ADCDAT to AIF3ADC mux
cset "name='AIF3ADC Mux' 1"
# Default all outputs off
cset "name='HP Switch' 0"
cset "name='SPK Switch' 0"
cset "name='RCV Switch' 0"
cset "name='LINE Switch' 0"
cset "name='HDMI Switch' 0"
# Default all inputs off
cset "name='Main Mic Switch' 0"
cset "name='Sub Mic Switch' 0"
cset "name='Headset Mic Switch' 0"
cset "name='FM In Switch' 0"
]
DisableSequence [
]
}
SectionDevice."Speaker" {
Comment "Built-in speaker"
EnableSequence [
cset "name='SPK Switch' 1"
cset "name='AIF1DAC1 Volume' 96"
cset "name='AIF1 Boost Volume' 0"
cset "name='DAC1 Volume' 96"
cset "name='SPKL DAC1 Volume' 1"
cset "name='SPKR DAC1 Volume' 1"
cset "name='Speaker Mixer Volume' 3"
cset "name='Speaker Boost Volume' 6"
cset "name='Speaker Volume' 57"
cset "name='AIF1DAC1 EQ Switch' 1"
cset "name='AIF1DAC1 EQ1 Volume' 9"
cset "name='AIF1DAC1 EQ2 Volume' 7"
cset "name='AIF1DAC1 EQ3 Volume' 10"
cset "name='AIF1DAC1 EQ4 Volume' 13"
cset "name='AIF1DAC1 EQ5 Volume' 12"
]
DisableSequence [
cset "name='SPK Switch' 0"
cset "name='AIF1DAC1 Volume' 96"
cset "name='AIF1 Boost Volume' 0"
cset "name='DAC1 Volume' 96"
cset "name='SPKL DAC1 Volume' 1"
cset "name='SPKR DAC1 Volume' 1"
cset "name='Speaker Mixer Volume' 0"
cset "name='Speaker Volume' 0"
cset "name='Speaker Boost Volume' 0"
cset "name='AIF1DAC1 EQ Switch' 0"
]
Value {
PlaybackVolume "Speaker Volume"
PlaybackSwitch "SPK Switch"
PlaybackChannels 2
PlaybackPCM "hw:${CardId}"
}
}
SectionDevice."MainInternalMicrophone" {
Comment "Main Internal Microphone"
EnableSequence [
cset "name='Main Mic Switch' 1"
cset "name='IN2L Volume' 26"
cset "name='MIXINL IN2L Switch' 1"
cset "name='MIXINL IN2L Volume' 0"
cset "name='AIF1ADCL Source' 0"
cset "name='AIF1ADC1 HPF Mode' 0"
cset "name='AIF1ADC1 HPF Switch' 1"
cset "name='AIF1ADC1 Volume' 96"
]
DisableSequence [
cset "name='Main Mic Switch' 0"
cset "name='MIXINL IN2L Switch' 0"
cset "name='MIXINL IN2L Volume' 0"
cset "name='IN2L Volume' 4"
]
Value {
CapturePCM "hw:${CardId}"
CaptureChannels 2
CaptureVolume "IN2L Volume"
}
}

View file

@ -0,0 +1,6 @@
Syntax 2
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Play high quality music"
}