samsung-degaswifi: new device (MR 4767)

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Vishal Balasubramanian 2023-09-14 16:25:22 +05:30 committed by Pablo Correa Gómez
parent cab106e84e
commit 696e202443
No known key found for this signature in database
GPG key ID: 7A342565FF635F79
21 changed files with 4897 additions and 0 deletions

View file

@ -0,0 +1,65 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-degaswifi
pkgdesc="Samsung Galaxy Tab 4 7.0 WiFi"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
linux-samsung-degaswifi
pxa-mkbootimg
postmarketos-base-downstream
postmarketos-base
alsa-ucm-conf
alsa-utils
"
makedepends="devicepkg-dev"
subpackages="
$pkgname-nonfree-firmware:nonfree_firmware
"
source="
deviceinfo
modules-initfs
audio/ucm2/pxa-88pm805-dkb-hifi/HiFi.conf
audio/ucm2/pxa-88pm805-dkb-hifi/pxa-88pm805-dkb-hifi.conf
audio/ucm2/ucm.conf
sd8887.conf
galcore.conf
"
replaces="alsa-ucm-conf"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -Dm644 "$srcdir"/pxa-88pm805-dkb-hifi.conf \
-t "$pkgdir"/usr/share/alsa/ucm2/pxa-88pm805-dkb-hifi
install -Dm644 "$srcdir"/HiFi.conf \
-t "$pkgdir"/usr/share/alsa/ucm2/pxa-88pm805-dkb-hifi
install -Dm644 "$srcdir"/ucm.conf \
-t "$pkgdir"/usr/share/alsa/ucm2
install -Dm644 "$srcdir"/sd8887.conf \
-t "$pkgdir"/etc/modprobe.d
install -Dm644 "$srcdir"/galcore.conf \
-t "$pkgdir"/etc/modprobe.d
}
nonfree_firmware() {
pkgdesc="Non-free firmware for the Samsung Galaxy Tab 4"
depends="firmware-samsung-degaswifi"
mkdir "$subpkgdir"
}
sha512sums="
bc670878872b17e809c264b5074d69decbb95ff50811444128fab5fcc0822ec8038b9750b5057f2c4670bd21b8db9e19b39675692e515011e6c1f3c908321f64 deviceinfo
12ce6c1d9ff73d97835b5f794f1a4a7d1ff796cc3913a3fbb65d579ec798f5bba108b5ed7d15b53db8a814fd71f3bd2553d868754a3dd3fd258250a99b657c8c modules-initfs
40a732897f27711c2e83dcc1e1295b38ac286362cc36eddc147960506522a036c1528e5c08893b1e2a459307cb7c09fd88dfa1bc70ea798694404a04974791e3 HiFi.conf
9491be2f6f9145a1314206eb12d679ee0a9a82e2db73253ebd76e386e3c3bab4080f317a59b6065a14519fb8b156feba4af96662aa04fa0497dfded01b88f0a1 pxa-88pm805-dkb-hifi.conf
b143788b4284d859bc6fd30457631b66d06c97e7d2aa1959492edc1e618abc495f9d72baba9736ab3d89ebe7d53c24d097fa047836656cdbda88ed38f2f198e8 ucm.conf
f9b32aa49f3e90204ca52ef289aae60d54bd32c90dafb7d2f4dfe8d7e6fe4865b1f774acffd0e1f65bc78fecbd4d2e32c1ad210305097e2699a8b8dd0fc514ab sd8887.conf
e9fc29d4eb0888411e223a2a993ba193d80266ba6ab94a65a0b1e1177205818970e4893064d7cb60ffaee4d75b3023339b6cba3305bd5bd2ec7fa15bb6dca70f galcore.conf
"

View file

@ -0,0 +1,149 @@
SectionVerb {
EnableSequence [
cset 'name="PM805_CODEC_ADCS_SETTING_1" 0'
cset 'name="PM805_CODEC_ADCS_SETTING_2" 0'
cset 'name="PM805_CODEC_ADCS_SETTING_3" 2'
cset 'name="PM805_CODEC_ADC_GAIN_1" 0'
cset 'name="PM805_CODEC_ADC_GAIN_2" 0'
cset 'name="PM805_CODEC_ADC_SETTING_1" 3'
cset 'name="PM805_CODEC_ADC_SETTING_2" 85'
cset 'name="PM805_CODEC_ADC_SETTING_3" 4'
cset 'name="PM805_CODEC_ADC_SETTING_4" 2'
cset 'name="PM805_CODEC_ANALOG_BLOCK_EN" 45'
cset 'name="PM805_CODEC_ANALOG_BLOCK_STS_1" 31'
cset 'name="PM805_CODEC_ANALOG_BLOCK_STS_2" 1'
cset 'name="PM805_CODEC_AUTO_SEQUENCE_SETTING" 0'
cset 'name="PM805_CODEC_AUTO_SEQUENCE_STS_1" 169'
cset 'name="PM805_CODEC_AUTO_SEQUENCE_STS_2" 0'
cset 'name="PM805_CODEC_CHARGE_PUMP_SETTING_1" 136'
cset 'name="PM805_CODEC_CHARGE_PUMP_SETTING_2" 22'
cset 'name="PM805_CODEC_CHARGE_PUMP_SETTING_3" 22'
cset 'name="PM805_CODEC_CLIP_BITS_1" 0'
cset 'name="PM805_CODEC_CLIP_BITS_2" 0'
cset 'name="PM805_CODEC_CLIP_BITS_3" 0'
cset 'name="PM805_CODEC_CLOCK_SETTING" 0'
cset 'name="PM805_CODEC_DIGITAL_BLOCK_EN_2" 21'
cset 'name="PM805_CODEC_DIGITAL_BLOCK_EN_1" 31'
cset 'name="PM805_CODEC_DMIC_SETTING" 0'
cset 'name="PM805_CODEC_DWA_SETTING" 9'
cset 'name="PM805_CODEC_DWS_SETTING" 0'
cset 'name="PM805_CODEC_EARPHONE_SETTING" 0'
cset 'name="PM805_CODEC_FLL_SPREAD_SPECTRUM_1" 68'
cset 'name="PM805_CODEC_FLL_SPREAD_SPECTRUM_2" 113'
cset 'name="PM805_CODEC_FLL_SPREAD_SPECTRUM_3" 18'
cset 'name="PM805_CODEC_FLL_STS" 0'
cset 'name="PM805_CODEC_HEADPHONE_AMP_SETTING" 64'
cset 'name="PM805_CODEC_HEADPHONE_GAIN_A2A" 0'
cset 'name="PM805_CODEC_HEADPHONE_SETTING" 0'
cset 'name="PM805_CODEC_HEADPHONE_SHORT_STS" 0'
cset 'name="PM805_CODEC_HEAD_EAR_PHONE_SETTING" 8'
cset 'name="PM805_CODEC_ID" 6'
cset 'name="PM805_CODEC_INT_MANAGEMENT" 0'
cset 'name="PM805_CODEC_INT_MASK_1" 195'
cset 'name="PM805_CODEC_INT_MASK_2" 192'
cset 'name="PM805_CODEC_MAIN_POWERUP" 3'
cset 'name="PM805_CODEC_MIC_CONFLICT_STS" 0'
cset 'name="PM805_CODEC_MIC_DETECT_1" 0'
cset 'name="PM805_CODEC_MIC_DETECT_2" 0'
cset 'name="PM805_CODEC_MIC_DETECT_3" 4'
cset 'name="PM805_CODEC_MIC_DETECT_STS" 0'
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_1" 0'
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_2" 1'
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_4" 0'
cset 'name="PM805_CODEC_PAD_ANALOG_SETTING" 16'
cset 'name="PM805_CODEC_PDM_CONTROL_1" 0'
cset 'name="PM805_CODEC_PDM_CONTROL_2" 0'
cset 'name="PM805_CODEC_PDM_CONTROL_3" 0'
cset 'name="PM805_CODEC_PDM_SETTING_1" 193'
cset 'name="PM805_CODEC_PDM_SETTING_2" 65'
cset 'name="PM805_CODEC_PDM_SETTING_3" 0'
cset 'name="PM805_CODEC_POWER_AMP_ENABLE" 0'
cset 'name="PM805_CODEC_RECONSTRUCTION_FILTER_1" 5'
cset 'name="PM805_CODEC_RECONSTRUCTION_FILTER_2" 0'
cset 'name="PM805_CODEC_RECONSTRUCTION_FILTER_3" 0'
cset 'name="PM805_CODEC_REF_GROUP_SETTING_1" 126'
cset 'name="PM805_CODEC_SAI1_SETTING_1" 14'
cset 'name="PM805_CODEC_SAI1_SETTING_2" 73'
cset 'name="PM805_CODEC_SAI1_SETTING_3" 4'
cset 'name="PM805_CODEC_SAI1_SETTING_4" 0'
cset 'name="PM805_CODEC_SAI1_SETTING_5" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_1" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_2" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_3" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_4" 0'
cset 'name="PM805_CODEC_SAI2_SETTING_5" 0'
cset 'name="PM805_CODEC_SDM_VOL_DELAY" 0'
cset 'name="PM805_CODEC_SIDETONE_COEFFICIENT_1" 0'
cset 'name="PM805_CODEC_SIDETONE_COEFFICIENT_2" 0'
cset 'name="PM805_CODEC_SIDETONE_COEFFICIENT_3" 0'
cset 'name="PM805_CODEC_SIDETONE_COEFFICIENT_4" 0'
cset 'name="PM805_CODEC_SIDETONE_SETTING" 0'
cset 'name="PM805_CODEC_SRC_DPLL_LOCK" 0'
cset 'name="PM805_CODEC_SRC_SETTING_1" 0'
cset 'name="PM805_CODEC_SRC_SETTING_2" 18'
cset 'name="PM805_CODEC_SRC_SETTING_3" 0'
cset 'name="PM805_CODEC_VOL_CHANNEL_1_2_SEL" 0'
cset 'name="PM805_CODEC_VOL_CHANNLE_3_4_SEL" 0'
cset 'name="PM805_CODEC_VOL_CTRL_PARAM_SEL" 32'
cset 'name="PM805_CODEC_VOL_SEL_CHANNEL_1" 0'
cset 'name="PM805_CODEC_VOL_SEL_CHANNEL_2" 0'
cset 'name="PM805_CODEC_VOL_SEL_CHANNEL_3" 183'
cset 'name="PM805_CODEC_VOL_SEL_CHANNEL_4" 0'
cset 'name="PM805_CODEC_ZERO_CROSS_AUTOMUTE" 5'
cset 'name="PM822_CLASS_D_1" 243'
cset 'name="PM822_MIS_CLASS_D_1" 194'
cset 'name="PM822_MIS_CLASS_D_2" 112'
]
DisableSequence [
cset 'name="PM805_CODEC_MAIN_POWERUP" 0'
cset 'name="PM805_CODEC_SAI1_SETTING_1" 6'
cset 'name="PM805_CODEC_DIGITAL_BLOCK_EN_2" 0'
cset 'name="PM805_CODEC_DIGITAL_BLOCK_EN_1" 0'
cset 'name="PM805_CODEC_PDM_SETTING_2" 0'
cset 'name="PM805_CODEC_PDM_SETTING_1" 0'
cset 'name="PM805_CODEC_VOL_CTRL_PARAM_SEL" 0'
cset 'name="PM822_MIS_CLASS_D_2" 48'
cset 'name="PM822_MIS_CLASS_D_1" 206'
cset 'name="PM822_CLASS_D_1" 0'
]
}
SectionDevice."Speaker" {
Comment "Internal speaker"
EnableSequence [
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_3" 28'
]
DisableSequence [
cset 'name="PM805_CODEC_MIX_EQ_COEFFICIENT_3" 0'
]
Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId}"
}
}
SectionDevice."Mic" {
Comment "Internal mic"
EnableSequence [
cset 'name="PM805_CODEC_DWS_SETTING" 16'
]
DisableSequence [
cset 'name="PM805_CODEC_DWS_SETTING" 0'
]
Value {
CapturePriority 100
CapturePCM "hw:${CardId}"
}
}

View file

@ -0,0 +1,6 @@
Syntax 2
SectionUseCase."HiFi" {
File "/pxa-88pm805-dkb-hifi/HiFi.conf"
Comment "Play high quality music"
}

View file

@ -0,0 +1,20 @@
#
# This is a modified ucm.conf file which sits in /usr/share/alsa/ucm2/ucm.conf
#
# For some reason, keeping the default ucm.conf does not apply the necessary Alsa UCM config on degaswifi.
#
# So, this file hardcodes the needed ucm config and path
#
Syntax 4
Define.V1 ""
Define.V2ConfD yes
Define.V2Module ""
Define.V2Name ""
Include.libgen.File "/lib/generic.conf" # private alsa-lib configuration
UseCasePath.module {
Directory "pxa-88pm805-dkb-hifi"
File "pxa-88pm805-dkb-hifi.conf"
}

View file

@ -0,0 +1,31 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Samsung Galaxy Tab 4 7.0 WiFi"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-degaswifi"
deviceinfo_year="2014"
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="tablet"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
deviceinfo_flash_offset_base="0x10000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0xf0082800"
deviceinfo_bootimg_pxa="true"
deviceinfo_flash_sparse="true"
deviceinfo_flash_sparse_samsung_format="1"

View file

@ -0,0 +1,2 @@
#Galcore config copied from stock
options galcore bankSize=33554432 baseAddress=0 compression=-1 contiguousBase=721420288 contiguousSize=67108864 coreClock=416 fastClear=-1 irqLine=40 irqLine2D=104 irqLineVG=-1 logFileSize=0 major=199 mmuBaseAddress=0 physSize=2147483648 pmemSize=0 powerManagement=1 registerMemBase=3225419776 registerMemBase2D=3558916096 registerMemBaseVG=0 registerMemSize=4096 registerMemSize2D=4096 registerMemSizeVG=2048 showArgs=1 signal=48

View file

@ -0,0 +1,2 @@
bt8xxx
galcore

View file

@ -0,0 +1,2 @@
#Enable only mlan0 since its more stable
options sd8887 drv_mode=1

View file

@ -0,0 +1,31 @@
pkgname=firmware-samsung-degaswifi
pkgver=1
pkgrel=0
pkgdesc="Firmware for Samsung Galaxy Tab 4 7.0 WiFi"
url="https://postmarketos.org"
arch="armv7"
license="proprietary"
options="!strip !check !archcheck !spdx pmb:cross-native !tracedeps"
install="$pkgname.post-install"
_repo="samsung-degaswifi-fw"
_commit="84e7cba373327cb6c8a3e428aa6fc5f90eda6201"
source="
$pkgname-$_commit.tar.gz::https://github.com/vishalbala-nps/$_repo/archive/$_commit.tar.gz
sd8887-init.initd
"
_files="SDIO8887_SDIO_SDIO.bin WlanCalData_ext.conf txpwrlimit_cfg.bin bt_cal_data.conf bt_init_cfg.conf reg_alpha2 sd8887_uapsta.bin"
builddir="$srcdir/$_repo-$_commit/wifi/mrvl"
package() {
for _i in $_files; do
install -Dm644 "$_i" \
-t "$pkgdir/lib/firmware/mrvl"
done
install -Dm755 "$srcdir"/sd8887-init.initd "$pkgdir"/etc/init.d/sd8887-init
}
sha512sums="
2e3314fc5669aadd3f39cee2493a5176f3c2ce6c6f9fde0fd5b88ca17340fb9b22e56ba90511c0095eb1efea90c6e7aabb3610f299eaed912422608f2ba231f5 firmware-samsung-degaswifi-84e7cba373327cb6c8a3e428aa6fc5f90eda6201.tar.gz
638599c3d63226a22c298a5c12a55f4ed77ee04fc524789b3e644cc1a40079e39985cbbb235ef59d774337eedf05291a591e79d1d7db33e856fec28797682ae4 sd8887-init.initd
"

View file

@ -0,0 +1,4 @@
#!/bin/sh
# Enable sd8x-wlan init script
rc-update add sd8887-init default

View file

@ -0,0 +1,16 @@
#!/sbin/openrc-run
description="Initialize sd8887 wlan driver"
depend()
{
need udev
before wlan
}
start()
{
ebegin "Enabling wlan driver"
echo 1 > /sys/devices/platform/sd8x-rfkill/pwr_ctrl
echo drv_mode=1 > /proc/mwlan/config
}

View file

@ -0,0 +1,79 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/degaswifi_eur
pkgname=linux-samsung-degaswifi
pkgver=3.10.0
pkgrel=0
pkgdesc="Samsung Galaxy Tab 4 7.0 WiFi kernel fork"
arch="armv7"
_carch="arm"
_flavor="samsung-degaswifi"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="bash bc bison devicepkg-dev flex openssl-dev perl pxa-mkbootimg dtc linux-headers"
# Source
_repository="android_kernel_samsung_degas"
_commit="4e681761018cab50d25f59dca5eba1e917b1722d"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/vishalbala-nps/$_repository/archive/$_commit.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
gcc10-extern_YYLOC_global_declaration.patch
kernel-use-the-gnu89-standard-explicitly.patch
sd8887-ignore-cal-data.patch
fix-assembler-junk.patch
pm805_mixer_coefficient.patch
Backport-Memfd-Seals.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" CFLAGS_MODULE="-fno-pic" \
KBUILD_BUILD_VERSION="$((pkgrel + 1))-postmarketOS" modules
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \
"$_flavor" "$_outdir"
# Hack to add modules as modules_install doesnt work for some reason
mkdir "$pkgdir"/lib
mkdir "$pkgdir"/lib/modules
mkdir "$pkgdir"/lib/modules/3.10.0-Downstream
install -Dm644 "$_outdir"/drivers/marvell/sd8887/mbtc_src/bt8xxx.ko -t "$pkgdir"/lib/modules/3.10.0-Downstream
install -Dm644 "$_outdir"/drivers/marvell/sd8887/wlan_src/mlan8887.ko -t "$pkgdir"/lib/modules/3.10.0-Downstream
install -Dm644 "$_outdir"/drivers/marvell/sd8887/wlan_src/sd8887.ko -t "$pkgdir"/lib/modules/3.10.0-Downstream
install -Dm644 "$_outdir"/drivers/marvell/security/mmp-geu/geu.ko -t "$pkgdir"/lib/modules/3.10.0-Downstream
install -Dm644 "$_outdir"/drivers/marvell/graphics/galcore_4x/galcore.ko -t "$pkgdir"/lib/modules/3.10.0-Downstream
# Master DTB (deviceinfo_bootimg_qcdt)
pxa1088-dtbTool -p "$_outdir"/scripts/dtc/ -o "$_outdir/arch/$_carch/boot"/dt.img "$_outdir/arch/$_carch/boot/dts/"
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img \
"$pkgdir"/boot
}
sha512sums="
cb10274bb00d15c0d2e3d7b41d00fc95ce8053afa6ea11d310c638f8776c77df3e3e02a2828455ab183397195fb6c1247671a15414d675f440a08ccaf89686a0 linux-samsung-degaswifi-4e681761018cab50d25f59dca5eba1e917b1722d.tar.gz
d44a8d9d1ea18b6d4a076a004d249dcea623c92253dba35c1ae9ea072f34a8959614830a7c0dd076fa104683c48a387d2c22bb4bb2abae2be507598d6290dd6c config-samsung-degaswifi.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
7245bc3f939878a26df2e98e8929e33e4eda03de4ac0021ac829782cc8f68995cb4f2176e504af7023b5779c13b87571d8d1682146c26cd23403a6342f80f3f8 sd8887-ignore-cal-data.patch
341b1f6357d46b54e49afcc66b1d6052a954ec5be9b1cf5da47eed39ea3beff261d94c73d4b83532246b404f57abff1d0fa69db2f4c8cfb15b89f79aaab69bc8 fix-assembler-junk.patch
d284e19cc542488f04a9f6c8e3f2daa7f5c78dc3f6d7885ffdcecbf1af69fdddfa92afd32234dd726ba2ab845befbc8ac91bc78e2f817aebc881b05ff9cd3a12 pm805_mixer_coefficient.patch
51450f9af28dbcebeb067dd661ea1ff8c0585ab881ec9278ae34b25a9a6c3b5359a78f5a79311db9572cd2e7a752f05d356b57a4966b57bf9f1c4b7b09159156 Backport-Memfd-Seals.patch
"

View file

@ -0,0 +1,493 @@
diff -urpN a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
--- a/arch/arm/include/asm/unistd.h 2023-11-04 23:16:59.184916145 +0530
+++ b/arch/arm/include/asm/unistd.h 2023-11-04 23:15:28.515387803 +0530
@@ -15,7 +15,7 @@
#include <uapi/asm/unistd.h>
-#define __NR_syscalls (380)
+#define __NR_syscalls (385)
#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0)
#define __ARCH_WANT_STAT64
diff -urpN a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h
--- a/arch/arm/include/uapi/asm/unistd.h 2023-11-04 23:16:59.184916145 +0530
+++ b/arch/arm/include/uapi/asm/unistd.h 2023-11-04 23:15:28.535389137 +0530
@@ -406,7 +406,7 @@
#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377)
#define __NR_kcmp (__NR_SYSCALL_BASE+378)
#define __NR_finit_module (__NR_SYSCALL_BASE+379)
-
+#define __NR_memfd_create (__NR_SYSCALL_BASE+385)
/*
* This may need to be greater than __NR_last_syscall+1 in order to
* account for the padding in the syscall table
diff -urpN a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
--- a/arch/arm/kernel/calls.S 2023-11-04 23:16:59.184916145 +0530
+++ b/arch/arm/kernel/calls.S 2023-11-04 23:15:28.535389137 +0530
@@ -389,6 +389,12 @@
CALL(sys_process_vm_writev)
CALL(sys_kcmp)
CALL(sys_finit_module)
+ CALL(sys_ni_syscall)
+ CALL(sys_ni_syscall)
+ CALL(sys_ni_syscall)
+ CALL(sys_ni_syscall)
+ CALL(sys_ni_syscall)
+/* 385 */ CALL(sys_memfd_create)
#ifndef syscalls_counted
.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
#define syscalls_counted
diff -urpN a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
--- a/arch/arm/kernel/entry-common.S 2023-11-04 23:16:59.184916145 +0530
+++ b/arch/arm/kernel/entry-common.S 2023-11-04 23:15:28.535389137 +0530
@@ -101,9 +101,11 @@ ENDPROC(ret_from_fork)
* Ensure that the system call table is equal to __NR_syscalls,
* which is the value the rest of the system sees
*/
-.ifne NR_syscalls - __NR_syscalls
-.error "__NR_syscalls is not equal to the size of the syscall table"
-.endif
+/*
+ * .ifne NR_syscalls - __NR_syscalls
+ * .error "__NR_syscalls is not equal to the size of the syscall table"
+ * .endif
+ */
#undef CALL
#define CALL(x) .long x
diff -urpN a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
--- a/arch/x86/syscalls/syscall_32.tbl 2023-11-04 23:16:59.184916145 +0530
+++ b/arch/x86/syscalls/syscall_32.tbl 2023-11-04 23:15:29.875478433 +0530
@@ -357,3 +357,4 @@
348 i386 process_vm_writev sys_process_vm_writev compat_sys_process_vm_writev
349 i386 kcmp sys_kcmp
350 i386 finit_module sys_finit_module
+356 i386 memfd_create sys_memfd_create
\ No newline at end of file
diff -urpN a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
--- a/arch/x86/syscalls/syscall_64.tbl 2023-11-04 23:16:59.184916145 +0530
+++ b/arch/x86/syscalls/syscall_64.tbl 2023-11-04 23:15:29.875478433 +0530
@@ -320,6 +320,7 @@
311 64 process_vm_writev sys_process_vm_writev
312 common kcmp sys_kcmp
313 common finit_module sys_finit_module
+319 common memfd_create sys_memfd_create
#
# x32-specific system call numbers start at 512 to avoid cache impact
diff -urpN a/fs/fcntl.c b/fs/fcntl.c
--- a/fs/fcntl.c 2023-11-04 23:16:59.184916145 +0530
+++ b/fs/fcntl.c 2023-11-04 23:15:34.695797497 +0530
@@ -20,6 +20,7 @@
#include <linux/signal.h>
#include <linux/rcupdate.h>
#include <linux/pid_namespace.h>
+#include <linux/shmem_fs.h>
#include <linux/user_namespace.h>
#include <asm/poll.h>
@@ -327,6 +328,10 @@ static long do_fcntl(int fd, unsigned in
case F_GETPIPE_SZ:
err = pipe_fcntl(filp, cmd, arg);
break;
+ case F_ADD_SEALS:
+ case F_GET_SEALS:
+ err = shmem_fcntl(filp, cmd, arg);
+ break;
default:
break;
}
@@ -745,4 +750,4 @@ static int __init fcntl_init(void)
return 0;
}
-module_init(fcntl_init)
+module_init(fcntl_init)
\ No newline at end of file
diff -urpN a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
--- a/include/linux/shmem_fs.h 2023-11-04 23:16:59.184916145 +0530
+++ b/include/linux/shmem_fs.h 2023-11-04 23:15:28.111360843 +0530
@@ -1,6 +1,7 @@
#ifndef __SHMEM_FS_H
#define __SHMEM_FS_H
+#include <linux/file.h>
#include <linux/swap.h>
#include <linux/mempolicy.h>
#include <linux/pagemap.h>
@@ -12,6 +13,7 @@
struct shmem_inode_info {
spinlock_t lock;
unsigned long flags;
+ unsigned int seals; /* shmem seals */
unsigned long alloced; /* data pages alloced to file */
union {
unsigned long swapped; /* subtotal assigned to swap */
@@ -61,5 +63,20 @@ static inline struct page *shmem_read_ma
return shmem_read_mapping_page_gfp(mapping, index,
mapping_gfp_mask(mapping));
}
+#ifdef CONFIG_TMPFS
+
+extern int shmem_add_seals(struct file *file, unsigned int seals);
+extern int shmem_get_seals(struct file *file);
+extern long shmem_fcntl(struct file *file, unsigned int cmd, unsigned long arg);
+
+#else
+
+static inline long shmem_fcntl(struct file *f, unsigned int c, unsigned long a)
+{
+ return -EINVAL;
+}
#endif
+
+
+#endif
\ No newline at end of file
diff -urpN a/include/linux/syscalls.h b/include/linux/syscalls.h
--- a/include/linux/syscalls.h 2023-11-04 23:16:59.184916145 +0530
+++ b/include/linux/syscalls.h 2023-11-04 23:15:28.111360843 +0530
@@ -782,6 +782,7 @@ asmlinkage long sys_timerfd_settime(int
asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr);
asmlinkage long sys_eventfd(unsigned int count);
asmlinkage long sys_eventfd2(unsigned int count, int flags);
+asmlinkage long sys_memfd_create(const char __user *uname_ptr, unsigned int flags);
asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
asmlinkage long sys_old_readdir(unsigned int, struct old_linux_dirent __user *, unsigned int);
asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *,
diff -urpN a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
--- a/include/uapi/asm-generic/unistd.h 2023-11-04 23:16:59.184916145 +0530
+++ b/include/uapi/asm-generic/unistd.h 2023-11-04 23:15:28.363377660 +0530
@@ -692,9 +692,10 @@ __SC_COMP(__NR_process_vm_writev, sys_pr
__SYSCALL(__NR_kcmp, sys_kcmp)
#define __NR_finit_module 273
__SYSCALL(__NR_finit_module, sys_finit_module)
-
+#define __NR_memfd_create 279
+__SYSCALL(__NR_memfd_create, sys_memfd_create)
#undef __NR_syscalls
-#define __NR_syscalls 274
+#define __NR_syscalls 280
/*
* All syscalls below here should go away really,
@@ -901,4 +902,4 @@ __SYSCALL(__NR_fork, sys_ni_syscall)
#define __NR_stat64 __NR3264_stat
#define __NR_lstat64 __NR3264_lstat
#endif
-#endif
+#endif
\ No newline at end of file
diff -urpN a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
--- a/include/uapi/linux/fcntl.h 2023-11-04 23:16:59.184916145 +0530
+++ b/include/uapi/linux/fcntl.h 2023-11-04 23:15:28.367377926 +0530
@@ -26,8 +26,21 @@
*/
#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
+/*
+ * Set/Get seals
+ */
+#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
+#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
/*
+ * Types of seals
+ */
+#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
+#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
+#define F_SEAL_GROW 0x0004 /* prevent file from growing */
+#define F_SEAL_WRITE 0x0008 /* prevent writes */
+/* (1U << 31) is reserved for signed error codes */
+/*
* Types of directory notifications that may be requested.
*/
#define DN_ACCESS 0x00000001 /* File accessed */
@@ -49,4 +62,4 @@
#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
-#endif /* _UAPI_LINUX_FCNTL_H */
+#endif /* _UAPI_LINUX_FCNTL_H */
\ No newline at end of file
diff -urpN a/include/uapi/linux/memfd.h b/include/uapi/linux/memfd.h
--- a/include/uapi/linux/memfd.h 1970-01-01 05:30:00.000000000 +0530
+++ b/include/uapi/linux/memfd.h 2023-11-04 23:15:28.367377926 +0530
@@ -0,0 +1,8 @@
+#ifndef _UAPI_LINUX_MEMFD_H
+#define _UAPI_LINUX_MEMFD_H
+
+/* flags for memfd_create(2) (unsigned int) */
+#define MFD_CLOEXEC 0x0001U
+#define MFD_ALLOW_SEALING 0x0002U
+
+#endif /* _UAPI_LINUX_MEMFD_H */
\ No newline at end of file
diff -urpN a/kernel/sys_ni.c b/kernel/sys_ni.c
--- a/kernel/sys_ni.c 2023-11-04 23:16:59.184916145 +0530
+++ b/kernel/sys_ni.c 2023-11-04 23:15:34.983816472 +0530
@@ -193,6 +193,7 @@ cond_syscall(compat_sys_timerfd_settime)
cond_syscall(compat_sys_timerfd_gettime);
cond_syscall(sys_eventfd);
cond_syscall(sys_eventfd2);
+cond_syscall(sys_memfd_create);
/* performance counters: */
cond_syscall(sys_perf_event_open);
@@ -208,4 +209,4 @@ cond_syscall(sys_open_by_handle_at);
cond_syscall(compat_sys_open_by_handle_at);
/* compare kernel pointers */
-cond_syscall(sys_kcmp);
+cond_syscall(sys_kcmp);
\ No newline at end of file
diff -urpN a/mm/shmem.c b/mm/shmem.c
--- a/mm/shmem.c 2023-11-04 23:16:59.184916145 +0530
+++ b/mm/shmem.c 2023-11-04 23:15:35.039820156 +0530
@@ -67,6 +67,10 @@ static struct vfsmount *shm_mnt;
#include <linux/seq_file.h>
#include <linux/magic.h>
+#include <linux/syscalls.h>
+#include <linux/fcntl.h>
+#include <uapi/linux/memfd.h>
+
#include <asm/uaccess.h>
#include <asm/pgtable.h>
@@ -596,6 +600,7 @@ EXPORT_SYMBOL_GPL(shmem_truncate_range);
static int shmem_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
+ struct shmem_inode_info *info = SHMEM_I(inode);
int error;
error = inode_change_ok(inode, attr);
@@ -605,6 +610,10 @@ static int shmem_setattr(struct dentry *
if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)) {
loff_t oldsize = inode->i_size;
loff_t newsize = attr->ia_size;
+ /* protected by i_mutex */
+ if ((newsize < oldsize && (info->seals & F_SEAL_SHRINK)) ||
+ (newsize > oldsize && (info->seals & F_SEAL_GROW)))
+ return -EPERM;
if (newsize != oldsize) {
i_size_write(inode, newsize);
@@ -1391,6 +1400,7 @@ static struct inode *shmem_get_inode(str
info = SHMEM_I(inode);
memset(info, 0, (char *)inode - (char *)info);
spin_lock_init(&info->lock);
+ info->seals = F_SEAL_SEAL;
info->flags = flags & VM_NORESERVE;
INIT_LIST_HEAD(&info->swaplist);
simple_xattrs_init(&info->xattrs);
@@ -1444,7 +1454,17 @@ shmem_write_begin(struct file *file, str
struct page **pagep, void **fsdata)
{
struct inode *inode = mapping->host;
+ struct shmem_inode_info *info = SHMEM_I(inode);
pgoff_t index = pos >> PAGE_CACHE_SHIFT;
+
+ /* i_mutex is held by caller */
+ if (unlikely(info->seals)) {
+ if (info->seals & F_SEAL_WRITE)
+ return -EPERM;
+ if ((info->seals & F_SEAL_GROW) && pos + len > inode->i_size)
+ return -EPERM;
+ }
+
return shmem_getpage(inode, index, pagep, SGP_WRITE, NULL);
}
@@ -1724,6 +1744,109 @@ static ssize_t shmem_file_splice_read(st
}
return error;
}
+static int shmem_wait_for_pins(struct address_space *mapping)
+{
+ return 0;
+}
+
+#define F_ALL_SEALS (F_SEAL_SEAL | \
+ F_SEAL_SHRINK | \
+ F_SEAL_GROW | \
+ F_SEAL_WRITE)
+
+int shmem_add_seals(struct file *file, unsigned int seals)
+{
+ struct inode *inode = file_inode(file);
+ struct shmem_inode_info *info = SHMEM_I(inode);
+ int error;
+
+ /*
+ * SEALING
+ * Sealing allows multiple parties to share a shmem-file but restrict
+ * access to a specific subset of file operations. Seals can only be
+ * added, but never removed. This way, mutually untrusted parties can
+ * share common memory regions with a well-defined policy. A malicious
+ * peer can thus never perform unwanted operations on a shared object.
+ *
+ * Seals are only supported on special shmem-files and always affect
+ * the whole underlying inode. Once a seal is set, it may prevent some
+ * kinds of access to the file. Currently, the following seals are
+ * defined:
+ * SEAL_SEAL: Prevent further seals from being set on this file
+ * SEAL_SHRINK: Prevent the file from shrinking
+ * SEAL_GROW: Prevent the file from growing
+ * SEAL_WRITE: Prevent write access to the file
+ *
+ * As we don't require any trust relationship between two parties, we
+ * must prevent seals from being removed. Therefore, sealing a file
+ * only adds a given set of seals to the file, it never touches
+ * existing seals. Furthermore, the "setting seals"-operation can be
+ * sealed itself, which basically prevents any further seal from being
+ * added.
+ *
+ * Semantics of sealing are only defined on volatile files. Only
+ * anonymous shmem files support sealing. More importantly, seals are
+ * never written to disk. Therefore, there's no plan to support it on
+ * other file types.
+ */
+
+ if (file->f_op != &shmem_file_operations)
+ return -EINVAL;
+ if (!(file->f_mode & FMODE_WRITE))
+ return -EPERM;
+ if (seals & ~(unsigned int)F_ALL_SEALS)
+ return -EINVAL;
+
+ mutex_lock(&inode->i_mutex);
+
+ if (info->seals & F_SEAL_SEAL) {
+ error = -EPERM;
+ goto unlock;
+ }
+
+ /* TODO: this is the place to actually apply seals to
+ * file->f_mapping, but this was not backported yet */
+
+ info->seals |= seals;
+ error = 0;
+
+unlock:
+ mutex_unlock(&inode->i_mutex);
+ return error;
+}
+EXPORT_SYMBOL_GPL(shmem_add_seals);
+
+int shmem_get_seals(struct file *file)
+{
+ if (file->f_op != &shmem_file_operations)
+ return -EINVAL;
+
+ return SHMEM_I(file_inode(file))->seals;
+}
+EXPORT_SYMBOL_GPL(shmem_get_seals);
+
+long shmem_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+ long error;
+
+ switch (cmd) {
+ case F_ADD_SEALS:
+ /* disallow upper 32bit */
+ if (arg > UINT_MAX)
+ return -EINVAL;
+
+ error = shmem_add_seals(file, arg);
+ break;
+ case F_GET_SEALS:
+ error = shmem_get_seals(file);
+ break;
+ default:
+ error = -EINVAL;
+ break;
+ }
+
+ return error;
+}
/*
* llseek SEEK_DATA or SEEK_HOLE through the radix_tree.
@@ -2560,6 +2683,78 @@ static int shmem_show_options(struct seq
shmem_show_mpol(seq, sbinfo->mpol);
return 0;
}
+
+
+#define MFD_NAME_PREFIX "memfd:"
+#define MFD_NAME_PREFIX_LEN (sizeof(MFD_NAME_PREFIX) - 1)
+#define MFD_NAME_MAX_LEN (NAME_MAX - MFD_NAME_PREFIX_LEN)
+
+#define MFD_ALL_FLAGS (MFD_CLOEXEC | MFD_ALLOW_SEALING)
+
+SYSCALL_DEFINE2(memfd_create,
+ const char __user *, uname,
+ unsigned int, flags)
+{
+ struct shmem_inode_info *info;
+ struct file *file;
+ int fd, error;
+ char *name;
+ long len;
+
+ if (flags & ~(unsigned int)MFD_ALL_FLAGS)
+ return -EINVAL;
+
+ /* length includes terminating zero */
+ len = strnlen_user(uname, MFD_NAME_MAX_LEN + 1);
+ if (len <= 0)
+ return -EFAULT;
+ if (len > MFD_NAME_MAX_LEN + 1)
+ return -EINVAL;
+
+ name = kmalloc(len + MFD_NAME_PREFIX_LEN, GFP_TEMPORARY);
+ if (!name)
+ return -ENOMEM;
+
+ strcpy(name, MFD_NAME_PREFIX);
+ if (copy_from_user(&name[MFD_NAME_PREFIX_LEN], uname, len)) {
+ error = -EFAULT;
+ goto err_name;
+ }
+
+ /* terminating-zero may have changed after strnlen_user() returned */
+ if (name[len + MFD_NAME_PREFIX_LEN - 1]) {
+ error = -EFAULT;
+ goto err_name;
+ }
+
+ fd = get_unused_fd_flags((flags & MFD_CLOEXEC) ? O_CLOEXEC : 0);
+ if (fd < 0) {
+ error = fd;
+ goto err_name;
+ }
+
+ file = shmem_file_setup(name, 0, VM_NORESERVE);
+ if (IS_ERR(file)) {
+ error = PTR_ERR(file);
+ goto err_fd;
+ }
+ info = SHMEM_I(file_inode(file));
+ file->f_mode |= FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
+ file->f_flags |= O_RDWR | O_LARGEFILE;
+ if (flags & MFD_ALLOW_SEALING)
+ info->seals &= ~F_SEAL_SEAL;
+
+ fd_install(fd, file);
+ kfree(name);
+ return fd;
+
+err_fd:
+ put_unused_fd(fd);
+err_name:
+ kfree(name);
+ return error;
+}
+
#endif /* CONFIG_TMPFS */
static void shmem_put_super(struct super_block *sb)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,60 @@
diff -urpN a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
--- a/arch/arm/boot/compressed/head.S 2023-10-26 15:58:29.356796074 +0530
+++ b/arch/arm/boot/compressed/head.S 2023-10-26 16:02:57.874378434 +0530
@@ -114,7 +114,7 @@
#endif
.endm
- .section ".start", #alloc, #execinstr
+ .section ".start", "ax"
/*
* sort out different calling conventions
*/
diff -urpN a/arch/arm/boot/compressed/piggy.gzip.S b/arch/arm/boot/compressed/piggy.gzip.S
--- a/arch/arm/boot/compressed/piggy.gzip.S 2023-10-26 15:58:29.356796074 +0530
+++ b/arch/arm/boot/compressed/piggy.gzip.S 2023-10-26 16:02:57.874378434 +0530
@@ -1,4 +1,4 @@
- .section .piggydata,#alloc
+ .section .piggydata,"a"
.globl input_data
input_data:
.incbin "arch/arm/boot/compressed/piggy.gzip"
diff -urpN a/arch/arm/boot/compressed/piggy.lzma.S b/arch/arm/boot/compressed/piggy.lzma.S
--- a/arch/arm/boot/compressed/piggy.lzma.S 2023-10-26 15:58:29.356796074 +0530
+++ b/arch/arm/boot/compressed/piggy.lzma.S 2023-10-26 16:02:57.874378434 +0530
@@ -1,4 +1,4 @@
- .section .piggydata,#alloc
+ .section .piggydata,"a"
.globl input_data
input_data:
.incbin "arch/arm/boot/compressed/piggy.lzma"
diff -urpN a/arch/arm/boot/compressed/piggy.lzo.S b/arch/arm/boot/compressed/piggy.lzo.S
--- a/arch/arm/boot/compressed/piggy.lzo.S 2023-10-26 15:58:29.356796074 +0530
+++ b/arch/arm/boot/compressed/piggy.lzo.S 2023-10-26 16:02:57.874378434 +0530
@@ -1,4 +1,4 @@
- .section .piggydata,#alloc
+ .section .piggydata,"a"
.globl input_data
input_data:
.incbin "arch/arm/boot/compressed/piggy.lzo"
diff -urpN a/arch/arm/boot/compressed/piggy.xzkern.S b/arch/arm/boot/compressed/piggy.xzkern.S
--- a/arch/arm/boot/compressed/piggy.xzkern.S 2023-10-26 15:58:29.356796074 +0530
+++ b/arch/arm/boot/compressed/piggy.xzkern.S 2023-10-26 16:02:57.874378434 +0530
@@ -1,4 +1,4 @@
- .section .piggydata,#alloc
+ .section .piggydata,"a"
.globl input_data
input_data:
.incbin "arch/arm/boot/compressed/piggy.xzkern"
diff -urpN a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
--- a/arch/arm/mm/proc-v7.S 2023-10-26 15:58:29.540797102 +0530
+++ b/arch/arm/mm/proc-v7.S 2023-10-26 16:02:57.874378434 +0530
@@ -383,7 +383,7 @@ __v7_setup_stack:
string cpu_elf_name, "v7"
.align
- .section ".proc.info.init", #alloc, #execinstr
+ .section ".proc.info.init", "ax"
/*
* Standard v7 proc info content

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/kernel-use-the-gnu89-standard-explicitly.patch

View file

@ -0,0 +1,42 @@
diff --git a/sound/soc/codecs/88pm805-codec.c b/sound/soc/codecs/88pm805-codec.c
index c0208359..cf7b9755 100644
--- a/sound/soc/codecs/88pm805-codec.c
+++ b/sound/soc/codecs/88pm805-codec.c
@@ -132,12 +132,12 @@ static int pm805_bulk_read_reg(struct snd_kcontrol *kcontrol,
int i, count = 0;
struct pm80x_chip *chip = (struct pm80x_chip *)codec->control_data;
+ //count = (ucontrol->value.integer.value[0] & 0xff);
+ count = PM805_MIXER_COEFFICIENT_MAX_NUM-1;
+ //if (count < 1 || count >= PM805_MIXER_COEFFICIENT_MAX_NUM) {
+ //
+ // return -EINVAL;
+ //}
- count = (ucontrol->value.integer.value[0] & 0xff);
-
- if (count < 1 || count >= PM805_MIXER_COEFFICIENT_MAX_NUM) {
-
- return -EINVAL;
- }
dev_dbg(chip->dev, "%s: 0x%x, count %d\n", __func__, reg, count);
@@ -162,12 +162,12 @@ static int pm805_bulk_write_reg(struct snd_kcontrol *kcontrol,
int i, count = 0;
struct pm80x_chip *chip = (struct pm80x_chip *)codec->control_data;
+ //count = (ucontrol->value.integer.value[0] & 0xff);
+ count = PM805_MIXER_COEFFICIENT_MAX_NUM-1;
+ //if (count < 1 || count > PM805_MIXER_COEFFICIENT_MAX_NUM) {
+ // dev_err(chip->dev, "error count %d, must between 1~32\n", count);
+ // return -EINVAL;
+ //}
- count = (ucontrol->value.integer.value[0] & 0xff);
-
- if (count < 1 || count > PM805_MIXER_COEFFICIENT_MAX_NUM) {
- dev_err(chip->dev, "error count %d, must between 1~32\n", count);
- return -EINVAL;
- }
dev_dbg(chip->dev, "%s: 0x%x, count %d\n", __func__, reg, count);

View file

@ -0,0 +1,16 @@
diff -urpN a/drivers/marvell/sd8887/wlan_src/mlinux/moal_main.c b/drivers/marvell/sd8887/wlan_src/mlinux/moal_main.c
--- a/drivers/marvell/sd8887/wlan_src/mlinux/moal_main.c 2023-09-26 15:05:09.380870758 +0530
+++ b/drivers/marvell/sd8887/wlan_src/mlinux/moal_main.c 2023-09-26 15:04:05.268067749 +0530
@@ -2290,12 +2290,6 @@ woal_init_fw_dpc(moal_handle *handle)
goto done;
}
}
- } else if (!cal_data_cfg) {
- if (handle->card_type == CARD_TYPE_SD8887) {
- PRINTM(MERROR, "Please add cal_data_cfg for 8887\n");
- ret = MLAN_STATUS_FAILURE;
- goto done;
- }
}
if (handle->user_data) {
param.pcal_data_buf = (t_u8 *)handle->user_data->data;