From 297b60346df8beafee954a0fd7c2d64f33f3b9bc Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Sat, 11 May 2024 01:44:05 +0000
Subject: [PATCH] rtl8211F_led_control

---
 kernel/include/linux/soc/rockchip/rk_vendor_storage.h |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/kernel/include/linux/soc/rockchip/rk_vendor_storage.h b/kernel/include/linux/soc/rockchip/rk_vendor_storage.h
index e3ee20f..d30b775 100644
--- a/kernel/include/linux/soc/rockchip/rk_vendor_storage.h
+++ b/kernel/include/linux/soc/rockchip/rk_vendor_storage.h
@@ -29,9 +29,68 @@
 #define LAN_RGMII_DL_ID			16
 #define EINK_VCOM_ID			17
 
+#define VENDOR_HEAD_TAG			0x524B5644
+#define FLASH_VENDOR_PART_SIZE		8
+#define VENDOR_PART_SIZE		128
+
+struct vendor_item {
+	u16  id;
+	u16  offset;
+	u16  size;
+	u16  flag;
+};
+
+struct vendor_info {
+	u32	tag;
+	u32	version;
+	u16	next_index;
+	u16	item_num;
+	u16	free_offset;
+	u16	free_size;
+	struct	vendor_item item[126]; /* 126 * 8 */
+	u8	data[VENDOR_PART_SIZE * 512 - 1024 - 8];
+	u32	hash;
+	u32	version2;
+};
+
+struct flash_vendor_info {
+	u32	tag;
+	u32	version;
+	u16	next_index;
+	u16	item_num;
+	u16	free_offset;
+	u16	free_size;
+	struct	vendor_item item[62]; /* 62 * 8 */
+	u8	data[FLASH_VENDOR_PART_SIZE * 512 - 512 - 8];
+	u32	hash;
+	u32	version2;
+};
+
+#if IS_REACHABLE(CONFIG_ROCKCHIP_VENDOR_STORAGE)
 int rk_vendor_read(u32 id, void *pbuf, u32 size);
 int rk_vendor_write(u32 id, void *pbuf, u32 size);
 int rk_vendor_register(void *read, void *write);
 bool is_rk_vendor_ready(void);
+#else
+static inline int rk_vendor_read(u32 id, void *pbuf, u32 size)
+{
+	return -1;
+}
+
+static inline int rk_vendor_write(u32 id, void *pbuf, u32 size)
+{
+	return -1;
+}
+
+static inline int rk_vendor_register(void *read, void *write)
+{
+	return -1;
+}
+
+static inline bool is_rk_vendor_ready(void)
+{
+	return false;
+}
+#endif
 
 #endif

--
Gitblit v1.6.2