Skip to content

Instantly share code, notes, and snippets.

#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 7.4.0-rc3 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="Alpine clang version 23.1.5"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=230105
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=230105
@valpackett
valpackett / ocv.py
Created November 13, 2026 23:12
qcom battery-data OCV converter to mainline
#!/usr/bin/env python3
# OCV conversion from downstream qcom,battery-data to mainline
# By Val Packett
from collections import defaultdict
from itertools import batched
# Paste from "qcom,pc-temp-v2-lut" or similar (V == voltage)
# Mind the negative numbers in the col legend, would be like 0xfffffff6 for -10
lut_col_legend = [-10, 0, 10, 25, 40, 50]
lut_row_legend = map(int, "10000 9800 9600 9400 9200 9000 8800 8600 8400 8200 8000 7800 7600 7400 7200 7000 6800 6600 6400 6200 6000 5800 5600 5400 5200 5000 4800 4600 4400 4200 4000 3800 3600 3400 3200 3000 2800 2600 2400 2200 2000 1800 1600 1400 1200 1000 900 800 700 600 500 400 300 200 100 0".split(" "))
May 16 08:53:26 syncthing[2619]: Lost device connection XXX
May 16 08:53:26 syncthing[2619]: Lost device connection XXX
May 16 08:53:26 syncthing[2619]: Connection closed XXX
May 16 08:53:26 syncthing[2619]: Lost device connection XXX
May 16 08:55:10 tailscaled[888]: netcheck: DetectCaptivePortal(found=false)
May 16 09:00:16 tailscaled[888]: netcheck: DetectCaptivePortal(found=false)
May 16 09:05:34 tailscaled[888]: netcheck: DetectCaptivePortal(found=false)
May 16 09:06:53 kernel: BUG: spinlock recursion on CPU#3, swapper/3/0
May 16 09:06:53 kernel: lock: 0xffff000f53ec0900, .magic: dead4ead, .owner: swapper/3/0, .owner_cpu: 3
May 16 09:06:53 tailscaled[888]: LinkChange: major, rebinding: old: XXX
@valpackett
valpackett / HiFi.conf
Last active May 19, 2026 00:55
motorola-dubai ucm2 wip
# /usr/share/alsa/ucm2/Motorola/dubai/HiFi.conf
SectionVerb {
EnableSequence [
cset "name='SEN_MI2S_RX Audio Mixer MultiMedia1' 1"
cset "name='MultiMedia3 Mixer TX_CODEC_DMA_TX_3' 1"
cset "name='ADC1 Switch' 0"
cset "name='ADC2 Switch' 0"
cset "name='ADC3 Switch' 0"
cset "name='ADC1_MIXER Switch' 0"
$ doas tree /usr/share/qcom/sm7325/Motorola/dubai/
/usr/share/qcom/sm7325/Motorola/dubai/
├── acdb
├── dsp
│ └── adsp -> /run/msm-firmware-loader/mnt/dsp_b/adsp
├── sensors
│ ├── config
│ │ ├── icm4x6xx.json
│ │ ├── kodiak_default_sensors.json
│ │ ├── kodiak_dynamic_sensors.json
@valpackett
valpackett / flatpak-rpi-ffmpeg.patch
Created December 31, 2025 23:15
freedesktop-sdk rpi-ffmpeg patch on top of 9673d931e0bbd4
diff --git a/elements/include/ffmpeg.yml b/elements/include/ffmpeg.yml
index 5d4983fea5..626c7e7f94 100644
--- a/elements/include/ffmpeg.yml
+++ b/elements/include/ffmpeg.yml
@@ -11,6 +11,7 @@
- components/fribidi.bst
- components/lame.bst
- components/libjxl.bst
+- components/libdrm.bst
- components/libva.bst
@valpackett
valpackett / README.md
Last active May 21, 2026 19:23
enable-aspm.sh with args (PCIe ASPM toggle per device)

This script allows toggling ASPM at runtime per bus via raw PCI config writes.

Example for Snapdragon X series:

doas enable-aspm.sh 0006:00:00.0 0006:01:00.0 0 # SSD ASPM OFF
doas enable-aspm.sh 0006:00:00.0 0006:01:00.0 2 # SSD ASPM ON
doas enable-aspm.sh 0004:00:00.0 0004:01:00.0 0 # WiFi ASPM OFF
doas enable-aspm.sh 0004:00:00.0 0004:01:00.0 2 # WiFi ASPM ON
@valpackett
valpackett / .config
Created January 7, 2025 00:40
mt8167 mainline dev .config for reference
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.13.0-rc3 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 19.1.6"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=190106
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=190106
@valpackett
valpackett / simpledrm-mtk-atags.patch
Created December 29, 2024 06:09
simpledrm hack to parse ATAGS for dynamic fb address
diff --git i/drivers/gpu/drm/tiny/simpledrm.c w/drivers/gpu/drm/tiny/simpledrm.c
index 5d9ab8adf8005..78f0b4b8d3df6 100644
--- i/drivers/gpu/drm/tiny/simpledrm.c
+++ w/drivers/gpu/drm/tiny/simpledrm.c
@@ -3,6 +3,7 @@
#include <linux/aperture.h>
#include <linux/clk.h>
#include <linux/of_clk.h>
+#include <linux/of_fdt.h>
#include <linux/minmax.h>
@valpackett
valpackett / out.txt
Created October 17, 2024 21:01
Versioned struct generation in Zig
$ zig test versioned_structs.zig ^0^ 17:58
v1:
field 0 is data_len type is i32
field 1 is data_ptr type is *const u8
example value: ver.MakeStruct(.{ .{ ... }, .{ ... }, .{ ... } },1){ .data_len = 420, .data_ptr = u8@deadbeef }
v69:
field 0 is data_len type is i32