From 5ea92eff9700c58b0909a5873dceb0cc483e30dc Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 12 Jul 2026 18:18:44 +0200 Subject: Add MHS35 kernel driver Signed-off-by: Mel --- Kbuild | 1 + mhs35.c | 551 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 552 insertions(+) create mode 100644 Kbuild create mode 100644 mhs35.c diff --git a/Kbuild b/Kbuild new file mode 100644 index 0000000..98d99ac --- /dev/null +++ b/Kbuild @@ -0,0 +1 @@ +obj-m := mhs35.o diff --git a/mhs35.c b/mhs35.c new file mode 100644 index 0000000..855f450 --- /dev/null +++ b/mhs35.c @@ -0,0 +1,551 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * drm driver for the goodtft mhs-3.5 raspberry pi display, + * a cheap clone of the waveshare 3.5" ili9486 hat! + * + * whatever the clone is using as its display controller (i doubt + * it's the ili9486) has a number of severe defects on memory writes, + * causing various corruption if the display is attempted to be used + * directly via drm with proper damage tracking, and not the default + * framebuffer full-page copy approach goodtft wants you to use. + * + * this kernel module implements a kernel drm driver for this type + * of panel, compensating any writes to avoid exposing any corruption + * inherent to the panel hardware, allowing you to use it in a simple, + * performant and clean manner! the differences between the genuine + * hardware and the clone are pointed out in the code. + * + * it's also important to note, even though i'm referring to this panel + * as "goodtft" hardware, it's quite likely that the actual manufacturer + * is someone completely different. this panel seems like it's created + * in large quantities at various factories, sold under a thousand + * different storefronts, with the one similarity being that it's + * documentation points you to a repository hosted under "goodtft" to + * set up all the driver and userspace ecosystem for this display + * for you, in the only official way the panel supports. + * + * Copyright 2020 Kamlesh Gurudasani + * Copyright 2026 Mel G. + */ + +#include +#include +#include +#include +#include +#include + +#include