mirror of
https://github.com/physwizz/a155-U-u1.git
synced 2025-10-07 10:09:34 +00:00
41 lines
1.0 KiB
C
41 lines
1.0 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Copyright (C) 2021 MediaTek Inc.
|
|
*
|
|
*/
|
|
|
|
#include <linux/leds.h>
|
|
|
|
enum mtk_leds_events {
|
|
LED_BRIGHTNESS_CHANGED = 0,
|
|
LED_STATUS_SHUTDOWN = 1
|
|
};
|
|
|
|
struct led_conf_info {
|
|
int max_hw_brightness;
|
|
int limit_hw_brightness;
|
|
unsigned int aal_enable;
|
|
struct led_classdev cdev;
|
|
int flags;
|
|
#define LED_MT_BRIGHTNESS_HW_CHANGED BIT(1)
|
|
#define LED_MT_BRIGHTNESS_CHANGED BIT(2)
|
|
|
|
#ifdef CONFIG_LEDS_MT_BRIGHTNESS_HW_CHANGED
|
|
int brightness_hw_changed;
|
|
struct kernfs_node *brightness_hw_changed_kn;
|
|
#endif
|
|
};
|
|
|
|
#ifdef CONFIG_LEDS_MT_BRIGHTNESS_HW_CHANGED
|
|
void mtk_leds_notify_brightness_hw_changed(
|
|
struct led_conf_info *led_conf, enum led_brightness brightness);
|
|
#else
|
|
static inline void mtk_leds_notify_brightness_hw_changed(
|
|
struct led_conf_info *led_conf, enum led_brightness brightness) { }
|
|
#endif
|
|
|
|
int mtk_leds_register_notifier(struct notifier_block *nb);
|
|
int mtk_leds_unregister_notifier(struct notifier_block *nb);
|
|
int mtk_leds_brightness_set(char *name, int bl_1024);
|
|
int setMaxBrightness(char *name, int percent, bool enable);
|