Commit graph

1,399,111 commits

Author SHA1 Message Date
hrdl
fe4f8068cd rk3566-pinenote.dtsi: adjust CPLL_250M
Set CPLL_250M to 250 MHz as intended.
2025-12-07 16:09:35 -05:00
hrdl
bab4f19d2f rockchip_ebc: adjust cpll_333m and enhance clock management
diff mode works best with dclk 33.33 MHz using cpll_333m 33.33
MHz. The remaining modes work best at 8 * 33.33 MHz = 266.67 Mhz. By
default 200 MHz can be obtained by using gpll_200m as parent at 200
MHz. Alternatively cpll_333m can be used at 250 MHz, resulting in a
noticable speedup.
2025-12-07 16:09:35 -05:00
hrdl
dc24d2e8ba rk3566-pinenote.dtsi: set CPLL_333M to 33.33 MHZ and use in rockchip_ebc direct mode
This allows the panel to be run at the recommended 33.33 MHz sclk,
decreasing frame processing times by a bit more than a ms. This only
works in direct mode by setting EBC_DSP_CTRL_DSP_SDCLK_DIV to 0. This
behaviour is not documented in the Rockchip RK3568 TRM, but is used by
the Lenovo Smart Paper.

LUT mode and 3WIN mode are not compatible with this setting and need
to be run at sclk 25 MHz (dclk 200 MHz, clock divider of
8). Previously 31.25 MHz were supported by setting dclk to 250 MHz,
which resulted in CPLL_333M to be set to 250 MHz.
2025-12-07 16:09:35 -05:00
Maximilian Weigand
13e6fb605a dts: pinenote: activate rga hardware by default 2025-12-07 16:09:34 -05:00
Maximilian Weigand
9d2a3db7b9 rk3566-pinenote.dtsi: remove rk_rga node overlay 2025-12-07 16:09:34 -05:00
Maximilian Weigand
22ab57c2ab dts: pinenote: always leave vdd_gpu_npu: DCDC_REG2 on
We had problems with the gpu being permanently disabled if not used
within 30 seconds after boot....
2025-12-07 16:09:34 -05:00
Maximilian Weigand
2340b8986e dts: rk356x: remove unused/duplicate rk_rga node
The node actually used is just called rga
2025-12-07 16:09:34 -05:00
Maximilian Weigand
5aad98e68c Pinenote: modify frequencies of ACLK_TOP_HIGH and CLK_TOP_LOW to match
android

Previously, we defaulted to 200 MHz (TOP_LOW) and 300 MHz (TOP_HIGH).
However, the rockchip android kernel uses 500 and 400 MHz, respectively.
2025-12-07 16:09:34 -05:00
Maximilian Weigand
63a96c63dc pinenote: request a few clock frequencies to run hclk_ebc at 300 MHz 2025-12-07 16:09:33 -05:00
Maximilian Weigand
773f63f025 Pinenote DTS: Add a few fixes that help with Bluetooth audio
* define dma-names for uart1 (tx, rx)
* fix bluetooth dts entry (as suggested by user hrdl and from the q64a
  dts)

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
2025-12-07 16:09:33 -05:00
Maximilian Weigand
80feb614ae Pinenote: For later reference, add the memory-region used by the
rockchip-uboot for logos and framebuffers
2025-12-07 16:09:33 -05:00
Maximilian Weigand
bf901e290f Pinenote: reset maximum brightness of backlights to 255 - we assume that
fixing the overvoltage settings also fixed the problems with the
backlight
2025-12-07 16:09:33 -05:00
Maximilian Weigand
011c46910c pinenote-dts: based on recommendation by user Jazn, increase overvoltage value of the backlight to 32 V (reduces spikes on the power lines) 2025-12-07 16:09:32 -05:00
Maximilian Weigand
2e1e7c458b rk3566-pinenote.dtsi: modify lm3630a backlight entry
While still chasing various artifacts, it seems that limiting the
max-brightness of the chip to 125, AND limiting the current to below 20
mA, yields robust results.
2025-12-07 16:09:32 -05:00
Maximilian Weigand
da7de4e366 pinenote-dts: update lm3630a entries with new driver functionality 2025-12-07 16:09:32 -05:00
Maximilian Weigand
d72c2fafac [dts pinenote.dtsi] switch touchscreen (cyttsp5) interrupt from LEVEL
LOW to EDGE_FALLING.

My notes:

- I think the interrupt should indeed be FALLING EDGE, and the level low
  interrupt type documented here:

63355b9884/Documentation/devicetree/bindings/input/touchscreen/cypress,tt21000.yaml (L86)

is a remnant from the android cyttsp5 driver, which in turn is a remnant
of the android cyttsp4 driver.

The android driver has this if-statement where it basically supports
both level and falling edge interrupts:

8da04464e2/drivers/input/touchscreen/cyttsp5/cyttsp5_core.c (L5962)

However, when I grep for this level_irq_udelay variable, it is not used
anywhere in the cyttsp5 android driver. However, the cyttsp4 driver
actually uses it to add a delay to the interrupt handler, which makes
sense when you trigger on level low:

8da04464e2/drivers/input/touchscreen/cyttsp4_core.c (L1238)

Summarizing, I think the dt scheme and the pinenote dts should be fixed.
In case that you agree with my assessment, could you by chance advise me
how to proceed?
2025-12-07 16:09:32 -05:00
Maximilian Weigand
42d3accfcc [dts pinenote.dtsi] at some point the rk817 charger driver switched the
required device node for the charger from "battery" to "charger". Add
this node for newer kernels (at least >= 6.2)
2025-12-07 16:09:32 -05:00
Maximilian Weigand
7924f8ff88 [pinenote dts files] fix a few details that were lost when sorting out the 6.2 branch 2025-12-07 16:09:31 -05:00
Maximilian Weigand
ce5ddfa7a2 [pinenote dtsi] use new boolean switch for the lm3630a backlight driver
to activate the frequency shift for the boost converter switching
frequency from 500 kHz to 560 kHz. This reduces observed flickering of
the backlight during certain operations (one extreme flickering state
was observed for warm backlight brightness 186 and cold backlight
brightness 255).

Flickering can be even more reduced by activating the 1 Mhz switching
frequency (boolean currently commented out). However, activating this
option is associated with a reduced efficiency of the driver. Also, any
potential side effects associated with the Pinenote hardware should be
checked by someone with more in-depth knowledge of the Pinenote
hardware.
2025-12-07 16:09:31 -05:00
Maximilian Weigand
353953a19b [pinenote dts] add note why the v3p3 regulator should be always on (at
least in v1.1 and v1.2) based on information from smaeul
2025-12-07 16:09:31 -05:00
Maximilian Weigand
689c64aa79 rk356x.dtsi: add entry for the rockchip-rga, disabled.
enable in arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi, node rk_rga

todo: the entry does not define resets for the rga as this leads to a
kernel panic. Therefore module unloading does not work at the moment and
the module should be blacklisted to prevent accidental loading.
2025-12-07 16:09:31 -05:00
Maximilian Weigand
9a7f16187d rk3566-pinenote.dtsi: fix mount orientation of accelerometer when
panel_reflection=1 is used with the ebc driver
2025-12-07 16:09:31 -05:00
Maximilian Weigand
c33ed701b1 rk3566-pinenote.dtsi: disable BT sound 2025-12-07 16:09:30 -05:00
Maximilian Weigand
edde16bea3 Import pinenote dts fixes for version 1.2, discussed in the pinenote
chat and based on merge request by samsaptidev
(https://github.com/samsaptidev)

https://github.com/m-weigand/mw_pinenote_misc/pull/1
2025-12-07 16:09:30 -05:00
Samuel Holland
bedcc48d36 arm64: dts: rockchip: pinenote: Add Bluetooth PCM audio
Signed-off-by: Samuel Holland <samuel@sholland.org>
2025-12-07 16:09:30 -05:00
Samuel Holland
f56609bfa6 arm64: dts: rockchip: pinenote: Add touchscreen
Signed-off-by: Samuel Holland <samuel@sholland.org>
2025-12-07 16:09:30 -05:00
Samuel Holland
98d5bc688a arm64: dts: rockchip: pinenote: Add EPD panel and PMIC
Signed-off-by: Samuel Holland <samuel@sholland.org>
2025-12-07 16:09:29 -05:00
Samuel Holland
93c1b35a81 arm64: dts: rockchip: pinenote: Add battery
Signed-off-by: Samuel Holland <samuel@sholland.org>
2025-12-07 16:09:29 -05:00
Samuel Holland
35339ead80 arm64: dts: rockchip: pinenote: Enable the GPU
Signed-off-by: Samuel Holland <samuel@sholland.org>
2025-12-07 16:09:29 -05:00
hrdl
18608a877d Revert "rockchip_ebc: enhance resilience to zero counters of advance()"
This reverts commit b88c5c8eeed0351dfc589777fe9e7581f5519dba. I
suspect this commits introduces artefacts that can potentially damage
the display if not interrupted.
2025-12-07 16:09:29 -05:00
hrdl
c98b91eaff rockchip_ebc: add phase_sequence mode 2025-12-07 16:09:29 -05:00
hrdl
9a0ab7b283 rockchip_ebc: enhance resilience to zero counters of advance()
Early cancellation modifies inner counters and can introduce 0 counters.
2025-12-07 16:09:28 -05:00
hrdl
3d532e145e rockchip_ebc: emergency fix: don't allow temperatures < 19
Early cancellation is broken for DU sequences with >29 phases and can
cause damages to the display.
2025-12-07 16:09:28 -05:00
hrdl
bcda7f6975 rockchip_ebc: set all pixels to IDLE when changing waveforms
and don't allow redraws when redraw_delay <= 0

Previously changing waveforms using redraw_delay=0 could cause pixels
to be stuck in what was previously their WAITING state without
shrinking clip_ongoing_or_waiting. The display would stay responsive,
but the refresh thread would occupy the CPU, causing the kernel to
warn about soft lockups.

This change resets all pixels to IDLE when modifying the LUT. At this
point all pixels are either IDLE or WAITING. Pixels that are intended
to be redrawn would become WAITING in the same iteration.
2025-12-07 16:09:28 -05:00
hrdl
b605ce7a1a rockchip_ebc: tidy up and remove unneeded pr_debug statements 2025-12-07 16:09:28 -05:00
hrdl
38d5a72386 rockchip_ebc: implement y4 unpacked off screen as firmware 2025-12-07 16:09:27 -05:00
hrdl
26bee7e535 rockchip_ebc: extend mode and add zero_waveform ioctl
Extend mode ioctl to get/set the dither mode and the redraw delay.

Add zero_waveform ioctl that causes the controller to drive the
display with an all-neutral phase buffer. This allows measuring the
VCOM using the following protocol:

1. Perform IOCTL zero_waveform(set_zero_waveform_mode=1,
  zero_waveform_mode=1)
2. Confirm that the phase buffer is all zero. zero_waveform_mode needs
  to be 1 after ICTL zero_waveform(set_zero_waveform_mode=0).
3. Perform the VCOM measurement.
4. Perform IOCTL zero_waveform(set_zero_waveform_mode=1,
  zero_waveform_mode=0)
2025-12-07 16:09:27 -05:00
hrdl
c9a8339273 rockchip_ebc: add module author and description 2025-12-07 16:09:27 -05:00
hrdl
12a8fce7e1 rockchip_ebc: rework ebc_off_screen ioctl
changes in uAPI:
- Change IOCTL define from IOWR to IOW

changes in driver:
- Instead of packed Y4 use 1 byte per pixel similar to the rest of the
  driver
- Enhance error handling
2025-12-07 16:09:27 -05:00
hrdl
d8f815d8bb rockchip_ebc: clamp y to [0, height]
This shouldn't happen under normal circumstances, but this shouldn't hurt.
2025-12-07 16:09:27 -05:00
hrdl
fdded31ce0 rockchip_ebc: reflect fb and hints before processing
Previously hints and input were misaligned, causing artefacts when
hints were not aligned on 16 pixel boundaries.
2025-12-07 16:09:26 -05:00
hrdl
6aafc96101 rockchip_ebc: remove unneeded rockchip_ebc_blit unit 2025-12-07 16:09:26 -05:00
hrdl
6c9bd4b55e rockchip_ebc: move spin lock into conditional 2025-12-07 16:09:26 -05:00
hrdl
98368b4502 rockchip_ebc: check clamp y by height 2025-12-07 16:09:26 -05:00
hrdl
9e5caac3f4 rockchip_ebc: rework set_fast_mode ioctl
changes in uAPI:
- Generalise structure to allow reading and writing as well as future
  generalisations of mode
- Rename ioctl and structure

changes in driver:
- Accomodate new ioctl
2025-12-07 16:09:26 -05:00
hrdl
9b28191827 rockchip_ebc: rework extract_fbs ioctl
changes in uAPI:
- Adjust buffer names to reflect their reworked purpose

changes in driver:
- Write all buffers requested
- Enhance error handling
2025-12-07 16:09:25 -05:00
phantomas
c2568a9044 rockchip_ebc: remove ebc->hint_changed, since it's never used 2025-12-07 16:09:25 -05:00
phantomas
75262eb142 rockchip_ebc: rework rect_hint ioctl
changes in uAPI:
- Uses drm_mode_rect to not leak an include from include/linux (drm_rect)
- make ioctl parameter 64bit clean (https://www.kernel.org/doc/html/latest/process/botching-up-ioctls.html)
- change the IOCTL define from IOWR to IOW, since we don't plan on
  reading anything from kernel.
- fix the ROCKCHIP_EBC_HINT_BIT_DEPTH_MASK to mask every bits used.
- add a default_hint field in the structure, so it can be set in one go,
  instead of relying on first setting the parameter.

changes in driver:
- setting default_hint now uses the new field from uAPI struct, and
  write it to the kernel parameter
- rect_hint count is now variable and controlled from userland.
2025-12-07 16:09:25 -05:00
phantomas
3993d85fdb rockchip_ebc: fix ebc->num_pixels
The value was previously computed as width * width.

We now properly compute it as width * height
2025-12-07 16:09:25 -05:00
hrdl
8d3111cc78 rockchip_ebc: use DRM_FBDEV_SHMEM_DRIVER_OPS to allow fbdev emulation 2025-12-07 16:09:24 -05:00