summaryrefslogtreecommitdiff
path: root/utils/nwztools/plattools/nwz_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/nwztools/plattools/nwz_lib.c')
-rw-r--r--utils/nwztools/plattools/nwz_lib.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/nwztools/plattools/nwz_lib.c b/utils/nwztools/plattools/nwz_lib.c
index ec862e638b..6316217902 100644
--- a/utils/nwztools/plattools/nwz_lib.c
+++ b/utils/nwztools/plattools/nwz_lib.c
@@ -157,3 +157,29 @@ const char *nwz_key_get_name(int keycode)
157 else 157 else
158 return nwz_keyname[keycode]; 158 return nwz_keyname[keycode];
159} 159}
160
161int nwz_fb_open(bool lcd)
162{
163 return open(lcd ? "/dev/fb/0" : "/dev/fb/1", O_RDWR);
164}
165
166void nwz_fb_close(int fd)
167{
168 close(fd);
169}
170
171int nwz_fb_get_brightness(int fd, struct nwz_fb_brightness *bl)
172{
173 if(ioctl(fd, NWZ_FB_GET_BRIGHTNESS, bl) < 0)
174 return -1;
175 else
176 return 1;
177}
178
179int nwz_fb_set_brightness(int fd, struct nwz_fb_brightness *bl)
180{
181 if(ioctl(fd, NWZ_FB_SET_BRIGHTNESS, bl) < 0)
182 return -1;
183 else
184 return 1;
185}