Verified Commit b8654ac0 authored by Andreas Kemnade's avatar Andreas Kemnade Committed by Alexey Min
Browse files

linux-kobo-clara: add sources instead of fixing binary linking (MR 2880)

Do not fiddle with a compiled .a file from the vendor, rather
ignore it and add functional equivalent sources.

[ci:skip-build] Already built successfuly on CI in MR
parent 7fe039dd
Pipeline #455601246 passed with stages
in 1 minute and 34 seconds
......@@ -3,7 +3,7 @@
pkgname=linux-kobo-clara
pkgver=4.1.15
pkgrel=1
pkgrel=2
pkgdesc="Kobo Clara HD kernel fork"
arch="armv7"
_carch="arm"
......@@ -28,7 +28,7 @@ source="
gcc8-fix-put-user.patch
gcc10-extern_YYLOC_global_declaration.patch
fix-device-tree.patch
fix-shipped-library-name.patch
fbdev-mxc-epdc-replace-blob-by-source-functions.patch
"
builddir="$srcdir/kernel"
_outdir="out"
......@@ -61,5 +61,5 @@ daea06c27d55d14c91a85e7b10162e52ac401a44a5c08f4a065339a32adf654e7570687b22884c49
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
8e6cc43ec5b3eb02e79d47841c3ada628e1ccfaece08a2a0c88542021f14603c99108bb1d4cd865b1dd3d62d3f7ae65b018bc778fb8dc9292e89e736c9b92a9d fix-device-tree.patch
a90128ca7d51ef36010ab8565f458f2914558cd8d77916b8a06cb750f14dde2b800d7886ed21553c16926616a00ec80ca2dce9a1f51164e5d110e0f4528db287 fix-shipped-library-name.patch
55217b0c69ecf7ff5ed9b58535e973e1527e07a4cd09b90aef99bcbcfd2d38ac8d06c2a04576cd572172cb3fbef270a1a495fc42a3ab2047f6d95d97d38d98e4 fbdev-mxc-epdc-replace-blob-by-source-functions.patch
"
From 092b5938363b42831aab1ebd8c2811ff9429d393 Mon Sep 17 00:00:00 2001
From: Andreas Kemnade <andreas@kemnade.info>
Date: Sun, 8 Dec 2019 23:34:36 +0100
Subject: [PATCH] fbdev: mxc: epdc: replace blob by source functions
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/video/fbdev/mxc/Makefile | 4 +--
drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c | 35 +++++++++++++++++++++++-
2 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/mxc/Makefile b/drivers/video/fbdev/mxc/Makefile
index cb81820c..c4c7fd3a 100644
--- a/drivers/video/fbdev/mxc/Makefile
+++ b/drivers/video/fbdev/mxc/Makefile
@@ -8,8 +8,8 @@ obj-$(CONFIG_FB_MXC_HDMI) += mxc_hdmi.o
obj-$(CONFIG_FB_MXC_EDID) += mxc_edid.o
obj-$(CONFIG_FB_MXC_SYNC_PANEL) += mxc_dispdrv.o mxc_lcdif.o mxc_ipuv3_fb.o
obj-$(CONFIG_FB_MXC_EINK_PANEL) += mxc_epdc_fb.o
-obj-$(CONFIG_FB_MXC_EINK_V2_PANEL) += mxc_epdc_v2_fb.o mxc_epdc_eink.o fake_s1d13522.o epdfb_dc.o
-mxc_epdc_eink-objs := mxc_epdc_eink_module.o lib.a_shipped-imx6sl-noaa
+obj-$(CONFIG_FB_MXC_EINK_V2_PANEL) += mxc_epdc_v2_fb.o fake_s1d13522.o epdfb_dc.o
+#mxc_epdc_eink-objs := mxc_epdc_eink_module.o lib.a_shipped-imx6sl-noaa
obj-$(CONFIG_FB_MXS_SII902X) += mxsfb_sii902x.o
obj-$(CONFIG_FB_MXC_DCIC) += mxc_dcic.o
obj-$(CONFIG_HANNSTAR_CABC) += hannstar_cabc.o
diff --git a/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c b/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
index 8f9aca48..d8a5ec03 100644
--- a/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
+++ b/drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
@@ -64,7 +64,6 @@
#include "../../../../arch/arm/mach-imx/hardware.h"
#include "epdc_v2_regs.h"
-#include "eink_processing2.h"
#include "../../../../kernel/ntx/ntx_timestamp.h"
@@ -1139,6 +1138,40 @@ static void mxc_epdc_fb_fw_handler(const struct firmware *fw,void *context);
// FW_IN_RAM //]
#include "mxc_epdc_fake_s1d13522.c"
+static unsigned mxc_epdc_fb_fetch_wxi_data(uint8_t *xwi_buffer, char *outbuf)
+{
+ unsigned l = xwi_buffer[0];
+ if (outbuf) {
+ u8 chk = 0;
+ unsigned i;
+
+ for (i = 0; i <= l; i++)
+ chk += xwi_buffer[i];
+
+ if (chk != xwi_buffer[i])
+ return 0;
+
+ memcpy(outbuf, xwi_buffer + 1, l);
+ }
+
+ return l;
+}
+
+static int mxc_epdc_fb_fetch_vc_data(u8 *vcd_buffer, u32 waveform_mode, u32 waveform_tempRange, u32 mc, u32 trc, u8 *vcd)
+{
+ u8 *vcd_src = vcd_buffer + 16 * (waveform_mode * trc + waveform_tempRange);
+ int i;
+ u8 chk = 0;
+ for(i = 0 ; i < 15; i++)
+ chk += vcd_src[i];
+
+ if (chk != vcd_src[i])
+ return -EINVAL;
+
+ memcpy(vcd, vcd_src, 16);
+ return 0;
+}
+
#ifdef DEBUG
static void dump_pxp_config(struct mxc_epdc_fb_data *fb_data,
--
2.30.2
External object files should end with _shipped so that kbuild handles
them correctly. Link drivers/video/fbdev/mxc/lib.a_shipped-imx6sl-noaa
to lib-imx6sl-noaa.a_shipped and fix the Makefile.
diff --git a/drivers/video/fbdev/mxc/Makefile b/drivers/video/fbdev/mxc/Makefile
index cb81820c..9e59b92a 100644
--- a/drivers/video/fbdev/mxc/Makefile
+++ b/drivers/video/fbdev/mxc/Makefile
@@ -9,7 +9,7 @@ obj-$(CONFIG_FB_MXC_EDID) += mxc_edid.o
obj-$(CONFIG_FB_MXC_SYNC_PANEL) += mxc_dispdrv.o mxc_lcdif.o mxc_ipuv3_fb.o
obj-$(CONFIG_FB_MXC_EINK_PANEL) += mxc_epdc_fb.o
obj-$(CONFIG_FB_MXC_EINK_V2_PANEL) += mxc_epdc_v2_fb.o mxc_epdc_eink.o fake_s1d13522.o epdfb_dc.o
-mxc_epdc_eink-objs := mxc_epdc_eink_module.o lib.a_shipped-imx6sl-noaa
+mxc_epdc_eink-objs := mxc_epdc_eink_module.o lib-imx6sl-noaa.a
obj-$(CONFIG_FB_MXS_SII902X) += mxsfb_sii902x.o
obj-$(CONFIG_FB_MXC_DCIC) += mxc_dcic.o
obj-$(CONFIG_HANNSTAR_CABC) += hannstar_cabc.o
diff --git a/drivers/video/fbdev/mxc/lib.a_shipped-imx6sl-noaa b/drivers/video/fbdev/mxc/lib-imx6sl-noaa.a_shipped
similarity index 100%
rename from drivers/video/fbdev/mxc/lib.a_shipped-imx6sl-noaa
rename to drivers/video/fbdev/mxc/lib-imx6sl-noaa.a_shipped
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment