From 97872f0a58d3bbd8c2758f9783b64970ff5fda71 Mon Sep 17 00:00:00 2001 From: Zorro Liu Date: Mon, 25 Mar 2024 14:54:24 +0800 Subject: [PATCH] include: linux: add ebc.h Change-Id: Id475a878e770f37f9110391d8864f8fcccbd3bfa Signed-off-by: Zorro Liu --- drivers/gpu/drm/rockchip/ebc-dev/ebc_dev.h | 30 +--------------- include/linux/ebc.h | 42 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 29 deletions(-) create mode 100644 include/linux/ebc.h diff --git a/drivers/gpu/drm/rockchip/ebc-dev/ebc_dev.h b/drivers/gpu/drm/rockchip/ebc-dev/ebc_dev.h index 5fc2fecd22cb..88338aa9d600 100644 --- a/drivers/gpu/drm/rockchip/ebc-dev/ebc_dev.h +++ b/drivers/gpu/drm/rockchip/ebc-dev/ebc_dev.h @@ -8,6 +8,7 @@ #ifndef __EBC_DEV_H__ #define __EBC_DEV_H__ +#include #include /* @@ -25,14 +26,6 @@ #define EBC_SUCCESS (0) #define EBC_ERROR (-1) -/* - * ebc status notify - */ -#define EBC_OFF (0) -#define EBC_ON (1) -#define EBC_FB_BLANK (2) -#define EBC_FB_UNBLANK (3) - /* * ebc system ioctl command */ @@ -90,25 +83,4 @@ struct ebc_buf_info { int height_mm; }; -#if IS_ENABLED(CONFIG_ROCKCHIP_EBC_DEV) -int ebc_register_notifier(struct notifier_block *nb); -int ebc_unregister_notifier(struct notifier_block *nb); -int ebc_notify(unsigned long event); -#else -static inline int ebc_register_notifier(struct notifier_block *nb) -{ - return 0; -} - -static inline int ebc_unregister_notifier(struct notifier_block *nb) -{ - return 0; -} - -static inline int ebc_notify(unsigned long event) -{ - return 0; -} -#endif - #endif diff --git a/include/linux/ebc.h b/include/linux/ebc.h new file mode 100644 index 000000000000..75d30745ad6f --- /dev/null +++ b/include/linux/ebc.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2024 Rockchip Electronics Co. Ltd. + * + * Author: Zorro Liu + */ + +#ifndef __LINUX_EBC_H__ +#define __LINUX_EBC_H__ + +#include + +/* + * ebc status notify + */ +#define EBC_OFF (0) +#define EBC_ON (1) +#define EBC_FB_BLANK (2) +#define EBC_FB_UNBLANK (3) + +#if IS_REACHABLE(CONFIG_ROCKCHIP_EBC_DEV) +int ebc_register_notifier(struct notifier_block *nb); +int ebc_unregister_notifier(struct notifier_block *nb); +int ebc_notify(unsigned long event); +#else +static inline int ebc_register_notifier(struct notifier_block *nb) +{ + return 0; +} + +static inline int ebc_unregister_notifier(struct notifier_block *nb) +{ + return 0; +} + +static inline int ebc_notify(unsigned long event) +{ + return 0; +} +#endif + +#endif