• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef HDF_BL_H
10 #define HDF_BL_H
11 
12 #include "hdf_disp.h"
13 #include "hdf_types.h"
14 
15 enum FbPowerStatus {
16     FB_POWER_ON,
17     FB_POWER_STANDBY,
18     FB_POWER_SUSPEND,
19     FB_POWER_OFF,
20 };
21 
22 struct BacklightDev;
23 struct BacklightOps {
24     int32_t (*updateBrightness)(struct BacklightDev *bl, uint32_t brightness);
25     uint32_t (*getBrightness)(struct BacklightDev *bl);
26 };
27 
28 struct BacklightProperties {
29     uint32_t brightness;
30     uint32_t maxBrightness;
31     uint32_t minBrightness;
32     uint32_t defBrightness;
33     enum FbPowerStatus fbStatus;
34 };
35 
36 struct BacklightDev *RegisterBlDev(const char *name, struct BacklightProperties *props,
37     struct BacklightOps *ops, void *priv);
38 void *ToBlDevPriv(struct BacklightDev *blDev);
39 struct BacklightDev *GetBacklightDev(const char *name);
40 int32_t UpdateBacklightState(struct BacklightDev *blDev, enum FbPowerStatus status);
41 int32_t UpdateBrightness(struct BacklightDev *blDev, uint32_t brightness);
42 int32_t GetMinBrightness(struct BacklightDev *blDev, uint32_t *brightness);
43 int32_t GetCurrBrightness(struct BacklightDev *blDev, uint32_t *brightness);
44 int32_t GetDefBrightness(struct BacklightDev *blDev, uint32_t *brightness);
45 int32_t GetMaxBrightness(struct BacklightDev *blDev, uint32_t *brightness);
46 #endif /* HDF_BL_H */
47 
48