Files
bfe-core1106-sdk/kernel/rv1106-enablement/thermal/rv1106_tsadc.c.frag
T
BFE EngineeringandClaude Opus 4.8 749f73568a kernel: RTC + tsadc ported (open-source, from vendor source); npu/rga plans
RTC: ported the vendor rockchip,rv1106-rtc driver (rtc-rockchip.c) to 6.18 — one
API delta (rtc_register_device -> devm_rtc_register_device). Verified on
warden-c8a3: /dev/rtc0 registers and reads.

tsadc thermal: ported the rv1106 data + rk_tsadcv9_initialize + the TSADCV9/VOGRF
macros + code table from the vendor; adapted .chn_id[SENSOR_CPU] -> .chn_offset
for 6.18. Verified: thermal_zone0 "soc-thermal" reads 39.8 C.

i2s-tdm: rv1126 fallback compatible added (DAI builds; sound card needs the acodec
port next). saradc still -22 (clk-rv1106 SARADC divider — deferred).

Includes the NPU + RGA open-source port plans (research): rknpu kernel driver is a
small port (RV1106 config already in the vendor driver; 4 dead-code headers need
compat stubs) but no open userspace exists for this NPU gen; RGA = port the vendor
char-dev rga3 driver (WardenOS's librga uses /dev/rga, not V4L2), + a cma pool +
hrtimer_setup. All ports are open source (vendor C source / mainline siblings).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wB8KB3MMQztRDXCMCkPrf
2026-08-24 22:48:39 -06:00

41 lines
1.1 KiB
GLSL

/* rv1106 tsadc (TSADCV9 + VOGRF) register defs, ported from vendor */
#define TSADCV9_Q_MAX 0x210
#define TSADCV9_FLOW_CON 0x218
#define TSADCV9_AUTO_SRC (0x10001 << 0)
#define TSADCV9_PD_MODE (0x10001 << 4)
#define TSADCV9_Q_MAX_VAL (0xffff0400 << 0)
#define RV1106_VOGRF_TSADC_CON 0x6000C
#define RV1106_VOGRF_TSADC_TSEN (0x10001 << 8)
#define RV1106_VOGRF_TSADC_ANA (0xff0007 << 0)
/**
* struct tsadc_table - code to temperature conversion table
* @code: the value of adc channel
* @temp: the temperature
* Note:
* code to temperature mapping of the temperature sensor is a piece wise linear
* curve.Any temperature, code faling between to 2 give temperatures can be
* linearly interpolated.
* Code to Temperature mapping should be updated based on manufacturer results.
*/
struct tsadc_table {
u32 code;
int temp;
};
static const struct tsadc_table rv1108_table[] = {
{0, -40000},
{374, -40000},
{382, -35000},
{389, -30000},
{397, -25000},
{405, -20000},
{413, -15000},
{421, -10000},
{429, -5000},
{436, 0},
{444, 5000},
{452, 10000},
{460, 15000},