diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2024-05-16 21:37:55 -0600 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2024-05-18 14:06:44 -0600 |
| commit | 4c60d54b505b90ce685ff2cc924e8b9f1bbe5240 (patch) | |
| tree | dc1a1cd80a9848cdd7b9fec06376b6f5becbbe7c /meta-xilinx-core | |
| parent | d10655447ff337cf718a727773d03d319675dcb5 (diff) | |
| download | meta-xilinx-4c60d54b505b90ce685ff2cc924e8b9f1bbe5240.tar.gz | |
kernel-module-dp: Fix 6.1.0 and prior kernel compatibility
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core')
3 files changed, 254 insertions, 24 deletions
diff --git a/meta-xilinx-core/recipes-kernel/dp/files/0001-Support-both-pre-6.1.0-and-current-i2c-probing.patch b/meta-xilinx-core/recipes-kernel/dp/files/0001-Support-both-pre-6.1.0-and-current-i2c-probing.patch new file mode 100644 index 00000000..8ac3abc2 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/dp/files/0001-Support-both-pre-6.1.0-and-current-i2c-probing.patch | |||
| @@ -0,0 +1,252 @@ | |||
| 1 | From acda49e5baee80e8b06f7019e57e9aace4f7f923 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mark Hatle <mark.hatle@amd.com> | ||
| 3 | Date: Thu, 16 May 2024 20:31:29 -0600 | ||
| 4 | Subject: [PATCH] Support both pre 6.1.0 and current i2c probing | ||
| 5 | |||
| 6 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
| 7 | --- | ||
| 8 | dp/xfmc/dp141.c | 8 ++++++++ | ||
| 9 | dp/xfmc/fmc.c | 8 ++++++++ | ||
| 10 | dp/xfmc/fmc64.c | 9 +++++++++ | ||
| 11 | dp/xfmc/fmc65.c | 8 ++++++++ | ||
| 12 | dp/xfmc/idt.c | 16 ++++++++++++---- | ||
| 13 | dp/xfmc/mcdp6000.c | 8 ++++++++ | ||
| 14 | dp/xfmc/tipower.c | 8 ++++++++ | ||
| 15 | 7 files changed, 61 insertions(+), 4 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/dp/xfmc/dp141.c b/dp/xfmc/dp141.c | ||
| 18 | index 002afe8..29e6c61 100755 | ||
| 19 | --- a/dp/xfmc/dp141.c | ||
| 20 | +++ b/dp/xfmc/dp141.c | ||
| 21 | @@ -14,6 +14,7 @@ | ||
| 22 | #include <linux/module.h> | ||
| 23 | #include <linux/regmap.h> | ||
| 24 | #include <linux/slab.h> | ||
| 25 | +#include <linux/version.h> | ||
| 26 | |||
| 27 | /**************************** Type Definitions *******************************/ | ||
| 28 | |||
| 29 | @@ -135,9 +136,16 @@ err_regmap: | ||
| 30 | return ret; | ||
| 31 | } | ||
| 32 | |||
| 33 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) | ||
| 34 | static void dp141_remove(struct i2c_client *client) | ||
| 35 | { | ||
| 36 | } | ||
| 37 | +#else | ||
| 38 | +static int dp141_remove(struct i2c_client *client) | ||
| 39 | +{ | ||
| 40 | + return 0; | ||
| 41 | +} | ||
| 42 | +#endif | ||
| 43 | |||
| 44 | static struct i2c_driver dp141_i2c_driver = { | ||
| 45 | .driver = { | ||
| 46 | diff --git a/dp/xfmc/fmc.c b/dp/xfmc/fmc.c | ||
| 47 | index 16767c7..9be45d9 100755 | ||
| 48 | --- a/dp/xfmc/fmc.c | ||
| 49 | +++ b/dp/xfmc/fmc.c | ||
| 50 | @@ -14,6 +14,7 @@ | ||
| 51 | #include <linux/module.h> | ||
| 52 | #include <linux/regmap.h> | ||
| 53 | #include <linux/slab.h> | ||
| 54 | +#include <linux/version.h> | ||
| 55 | |||
| 56 | /**************************** Type Definitions *******************************/ | ||
| 57 | |||
| 58 | @@ -122,9 +123,16 @@ err_regmap: | ||
| 59 | return ret; | ||
| 60 | } | ||
| 61 | |||
| 62 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) | ||
| 63 | static void fmc_remove(struct i2c_client *client) | ||
| 64 | { | ||
| 65 | } | ||
| 66 | +#else | ||
| 67 | +static int fmc_remove(struct i2c_client *client) | ||
| 68 | +{ | ||
| 69 | + return 0; | ||
| 70 | +} | ||
| 71 | +#endif | ||
| 72 | |||
| 73 | static struct i2c_driver fmc_i2c_driver = { | ||
| 74 | .driver = { | ||
| 75 | diff --git a/dp/xfmc/fmc64.c b/dp/xfmc/fmc64.c | ||
| 76 | index 2d06327..c677072 100755 | ||
| 77 | --- a/dp/xfmc/fmc64.c | ||
| 78 | +++ b/dp/xfmc/fmc64.c | ||
| 79 | @@ -14,6 +14,8 @@ | ||
| 80 | #include <linux/module.h> | ||
| 81 | #include <linux/regmap.h> | ||
| 82 | #include <linux/slab.h> | ||
| 83 | +#include <linux/version.h> | ||
| 84 | + | ||
| 85 | /**************************** Type Definitions *******************************/ | ||
| 86 | static const struct regmap_config fmc64_regmap_config = { | ||
| 87 | .reg_bits = 16, | ||
| 88 | @@ -119,9 +121,16 @@ err_regmap: | ||
| 89 | return ret; | ||
| 90 | } | ||
| 91 | |||
| 92 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) | ||
| 93 | static void fmc64_remove(struct i2c_client *client) | ||
| 94 | { | ||
| 95 | } | ||
| 96 | +#else | ||
| 97 | +static int fmc64_remove(struct i2c_client *client) | ||
| 98 | +{ | ||
| 99 | + return 0; | ||
| 100 | +} | ||
| 101 | +#endif | ||
| 102 | |||
| 103 | static struct i2c_driver fmc64_i2c_driver = { | ||
| 104 | .driver = { | ||
| 105 | diff --git a/dp/xfmc/fmc65.c b/dp/xfmc/fmc65.c | ||
| 106 | index 5eb6c81..6927f05 100755 | ||
| 107 | --- a/dp/xfmc/fmc65.c | ||
| 108 | +++ b/dp/xfmc/fmc65.c | ||
| 109 | @@ -14,6 +14,7 @@ | ||
| 110 | #include <linux/module.h> | ||
| 111 | #include <linux/regmap.h> | ||
| 112 | #include <linux/slab.h> | ||
| 113 | +#include <linux/version.h> | ||
| 114 | |||
| 115 | /**************************** Type Definitions *******************************/ | ||
| 116 | |||
| 117 | @@ -121,9 +122,16 @@ err_regmap: | ||
| 118 | return ret; | ||
| 119 | } | ||
| 120 | |||
| 121 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) | ||
| 122 | static void fmc65_remove(struct i2c_client *client) | ||
| 123 | { | ||
| 124 | } | ||
| 125 | +#else | ||
| 126 | +static int fmc65_remove(struct i2c_client *client) | ||
| 127 | +{ | ||
| 128 | + return 0; | ||
| 129 | +} | ||
| 130 | +#endif | ||
| 131 | |||
| 132 | static struct i2c_driver fmc65_i2c_driver = { | ||
| 133 | .driver = { | ||
| 134 | diff --git a/dp/xfmc/idt.c b/dp/xfmc/idt.c | ||
| 135 | index 84ba521..458d685 100755 | ||
| 136 | --- a/dp/xfmc/idt.c | ||
| 137 | +++ b/dp/xfmc/idt.c | ||
| 138 | @@ -17,6 +17,7 @@ | ||
| 139 | #include <linux/of_gpio.h> | ||
| 140 | #include <linux/regmap.h> | ||
| 141 | #include <linux/slab.h> | ||
| 142 | +#include <linux/version.h> | ||
| 143 | |||
| 144 | #define IDT_8T49N24X_REVID 0x0 /**< Device Revision */ | ||
| 145 | #define IDT_8T49N24X_DEVID 0x0607 /**< Device ID Code */ | ||
| 146 | @@ -38,8 +39,8 @@ | ||
| 147 | #define IDT_8T49N24X_P_MAX pow(2, 22) //!< Maximum P divider value | ||
| 148 | #define IDT_8T49N24X_M_MAX pow(2, 24) //!< Maximum M multiplier value | ||
| 149 | |||
| 150 | -#define TRUE 1 | ||
| 151 | -#define FALSE 0 | ||
| 152 | +#define IDT_TRUE 1 | ||
| 153 | +#define IDT_FALSE 0 | ||
| 154 | #define XPAR_IIC_0_BASEADDR 0xA0080000 | ||
| 155 | #define I2C_IDT8N49_ADDR 0x7C | ||
| 156 | /* | ||
| 157 | @@ -455,7 +456,7 @@ int IDT_8T49N24x_Init(void) | ||
| 158 | int ret = 0; | ||
| 159 | |||
| 160 | msleep_range(30); | ||
| 161 | - ret = idt_enable(FALSE); | ||
| 162 | + ret = idt_enable(IDT_FALSE); | ||
| 163 | if (ret) | ||
| 164 | dev_dbg(&idt->client->dev, | ||
| 165 | "IDT_8T49N24x_enable 0 I2C progmming failed\n"); | ||
| 166 | @@ -468,7 +469,7 @@ int IDT_8T49N24x_Init(void) | ||
| 167 | |||
| 168 | msleep_range(30); | ||
| 169 | /* enable DPLL and APLL calibration. */ | ||
| 170 | - ret = idt_enable(TRUE); | ||
| 171 | + ret = idt_enable(IDT_TRUE); | ||
| 172 | if (ret) | ||
| 173 | dev_dbg(&idt->client->dev, | ||
| 174 | "IDT_8T49N24x_enable 1 I2C progmming failed\n"); | ||
| 175 | @@ -518,9 +519,16 @@ err_regmap: | ||
| 176 | return ret; | ||
| 177 | } | ||
| 178 | |||
| 179 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) | ||
| 180 | static void idt_remove(struct i2c_client *client) | ||
| 181 | { | ||
| 182 | } | ||
| 183 | +#else | ||
| 184 | +static int idt_remove(struct i2c_client *client) | ||
| 185 | +{ | ||
| 186 | + return 0; | ||
| 187 | +} | ||
| 188 | +#endif | ||
| 189 | |||
| 190 | static struct i2c_driver idt_i2c_driver = { | ||
| 191 | .driver = { | ||
| 192 | diff --git a/dp/xfmc/mcdp6000.c b/dp/xfmc/mcdp6000.c | ||
| 193 | index d14a75d..60a1fdf 100755 | ||
| 194 | --- a/dp/xfmc/mcdp6000.c | ||
| 195 | +++ b/dp/xfmc/mcdp6000.c | ||
| 196 | @@ -14,6 +14,7 @@ | ||
| 197 | #include <linux/module.h> | ||
| 198 | #include <linux/regmap.h> | ||
| 199 | #include <linux/slab.h> | ||
| 200 | +#include <linux/version.h> | ||
| 201 | |||
| 202 | #define SWAP_BYTES(u32Value) ((u32Value & 0x000000FF) << 24)\ | ||
| 203 | |((u32Value & 0x0000FF00) << 8) \ | ||
| 204 | @@ -394,9 +395,16 @@ err_regmap: | ||
| 205 | return ret; | ||
| 206 | } | ||
| 207 | |||
| 208 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) | ||
| 209 | static void mcdp6000_remove(struct i2c_client *client) | ||
| 210 | { | ||
| 211 | } | ||
| 212 | +#else | ||
| 213 | +static int mcdp6000_remove(struct i2c_client *client) | ||
| 214 | +{ | ||
| 215 | + return 0; | ||
| 216 | +} | ||
| 217 | +#endif | ||
| 218 | |||
| 219 | static struct i2c_driver mcdp6000_i2c_driver = { | ||
| 220 | .driver = { | ||
| 221 | diff --git a/dp/xfmc/tipower.c b/dp/xfmc/tipower.c | ||
| 222 | index d3536ab..ce00fff 100755 | ||
| 223 | --- a/dp/xfmc/tipower.c | ||
| 224 | +++ b/dp/xfmc/tipower.c | ||
| 225 | @@ -14,6 +14,7 @@ | ||
| 226 | #include <linux/module.h> | ||
| 227 | #include <linux/regmap.h> | ||
| 228 | #include <linux/slab.h> | ||
| 229 | +#include <linux/version.h> | ||
| 230 | |||
| 231 | /**************************** Type Definitions *******************************/ | ||
| 232 | |||
| 233 | @@ -163,9 +164,16 @@ err_regmap: | ||
| 234 | return ret; | ||
| 235 | } | ||
| 236 | |||
| 237 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) | ||
| 238 | static void tipower_remove(struct i2c_client *client) | ||
| 239 | { | ||
| 240 | } | ||
| 241 | +#else | ||
| 242 | +static int tipower_remove(struct i2c_client *client) | ||
| 243 | +{ | ||
| 244 | + return 0; | ||
| 245 | +} | ||
| 246 | +#endif | ||
| 247 | |||
| 248 | static struct i2c_driver tipower_i2c_driver = { | ||
| 249 | .driver = { | ||
| 250 | -- | ||
| 251 | 2.34.1 | ||
| 252 | |||
diff --git a/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_2023.2.bb b/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_2023.2.bb deleted file mode 100644 index 7e24cd7d..00000000 --- a/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_2023.2.bb +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | SUMMARY = "Xilinx DisplayPort Linux Kernel module" | ||
| 2 | DESCRIPTION = "Out-of-tree DisplayPort(DP) kernel modules provider for aarch64 devices" | ||
| 3 | SECTION = "kernel/modules" | ||
| 4 | LICENSE = "GPL-2.0-only" | ||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=eb723b61539feef013de476e68b5c50a" | ||
| 6 | |||
| 7 | XLNX_DP_VERSION = "6.1.0" | ||
| 8 | PV = "${XLNX_DP_VERSION}+xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git" | ||
| 9 | |||
| 10 | S = "${WORKDIR}/git" | ||
| 11 | |||
| 12 | BRANCH ?= "xlnx_rel_v2023.2" | ||
| 13 | REPO ?= "git://github.com/xilinx/dp-modules.git;protocol=https" | ||
| 14 | SRCREV ?= "5b0969ac09f301c33bccc140c8f60e832f5cf222" | ||
| 15 | |||
| 16 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | ||
| 17 | SRC_URI = "${REPO};${BRANCHARG}" | ||
| 18 | |||
| 19 | inherit module | ||
| 20 | |||
| 21 | EXTRA_OEMAKE += "O=${STAGING_KERNEL_BUILDDIR}" | ||
| 22 | COMPATIBLE_MACHINE = "^$" | ||
| 23 | COMPATIBLE_MACHINE:zynqmp = "zynqmp" | ||
| 24 | COMPATIBLE_MACHINE:versal = "versal" | ||
diff --git a/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_6.1.60.bb b/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_6.1.60.bb index ac49cf95..067f5af6 100644 --- a/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_6.1.60.bb +++ b/meta-xilinx-core/recipes-kernel/dp/kernel-module-dp_6.1.60.bb | |||
| @@ -15,6 +15,8 @@ SRCREV ?= "5b0969ac09f301c33bccc140c8f60e832f5cf222" | |||
| 15 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | 15 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" |
| 16 | SRC_URI = "${REPO};${BRANCHARG}" | 16 | SRC_URI = "${REPO};${BRANCHARG}" |
| 17 | 17 | ||
| 18 | SRC_URI += "file://0001-Support-both-pre-6.1.0-and-current-i2c-probing.patch" | ||
| 19 | |||
| 18 | inherit module | 20 | inherit module |
| 19 | 21 | ||
| 20 | EXTRA_OEMAKE += "O=${STAGING_KERNEL_BUILDDIR}" | 22 | EXTRA_OEMAKE += "O=${STAGING_KERNEL_BUILDDIR}" |
