backlight

Android6.0 RK3399 PWM Backlight 驱动分析 · Younix’s Studio【转】

泄露秘密 提交于 2020-08-05 05:24:13
转自: https://www.dazhuanlan.com/2019/10/25/5db29684e6460/ Platform: RK3399 OS: Android 6.0 Kernel: 4.4 DTS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 backlight: backlight { status = "disabled"; compatible = "pwm-backlight"; pwms = < &pwm0 0 25000 0>; brightness-levels = < 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

Linux PWM framework(二)- 背光子系统【转】

拜拜、爱过 提交于 2020-08-05 04:23:29
转自: https://blog.csdn.net/weixin_41028621/article/details/103542751?utm_medium=distribute.pc_relevant.none-task-blog-baidujs-3 了解backlight driver. 1.Backlight Framework 1.1.用户空间   背光设备文件对应于/sys/class/backlight/目录下的文件。/sys/class/backlight是注册的背光设备类型,而在/sys/class/backlight/目录下的文件就是所注册的背光设备。系统完成背光设备类型的注册,代码如下: drivers/video/backlight/backlight.c: 662 static int __init backlight_class_init(void) 663 { 664 backlight_class = class_create(THIS_MODULE, "backlight"); //注册背光设备类型; 670 671 backlight_class->dev_groups = bl_device_groups; //指定背光设备类型的属性文件; 672 backlight_class->pm = &backlight_class_dev_pm_ops

Android驱动学习-灯光系统总体框架

旧巷老猫 提交于 2020-05-09 10:18:32
Android的app访问硬件的大致流程可以分为一下几个步骤: 我们之前说过Android系统在添加新的硬件的时候需要添加一个接口java文件,通过jni来访问硬件。 这个java是我们自己实现的,我们自己能够清楚的知道如何调用它。但是像Android中有一些是别人都有的硬件,比如屏幕、振动器、声卡、led等,因为硬件不一样,所以驱动也不一样,那么我们如何让其他人的app在我们的系统上也能正常的运行呢?这里就需要注意下: Android系统中已经加入了一些必要的jni,我们想添加一些通用的设备时就需要用系统中的jni文件,编写HAL文件来适应JNI文件,从而达到其他人的app能正常的操作硬件的目的。 下面分析一下灯光系统。 灯光系统由以下四个文件组成 APP:电池灯APP,通知灯APP,背光灯APP JNI :com_android_server_lights_LightsService.cpp HAL:我们自己实现,实现一个lights.c 驱动:leds_nanopi3.c(JNI需要什么这里就给它提供什么,这里我们实现亮灭闪烁和亮度) 灯光系统的主要功能: 硬件上是属于同一个的有(包括颜色和闪烁): 电池灯:电池电量发生变化时颜色会发生变化 通知灯:有通知会闪烁,比如未接电话或短信 调节LCD亮度: 背光灯 灯光系统的jni文件是 com_android_server

Android灯光系统(2)——HAL实现

心不动则不痛 提交于 2020-05-09 09:44:17
1.Android系统中定义了如下一些灯 /frameworks/android_hardware/libhardware/include/hardware/ lights.h #define LIGHT_ID_BACKLIGHT "backlight" #define LIGHT_ID_KEYBOARD "keyboard" #define LIGHT_ID_BUTTONS "buttons" #define LIGHT_ID_BATTERY "battery" #define LIGHT_ID_NOTIFICATIONS "notifications" #define LIGHT_ID_ATTENTION "attention" 还有两个未实现的: #define LIGHT_ID_BLUETOOTH "bluetooth" #define LIGHT_ID_WIFI "wifi" 2.编写lights的hal文件 好的参考例子,sony手机使用的,移植这个程序: https://android.googlesource.com/device/sony/lt26/+/master/liblight/lights.c 移植后的hal文件如下: /* 移植: https://android.googlesource.com/device/sony/lt26/ +/master

manjaro 手动调节屏幕亮度

为君一笑 提交于 2020-05-08 02:38:36
1 问题描述 manjaro版本20.0,桌面XFCE,设置之类的地方没有屏幕亮度调节的功能。 2 解决方案 解决方案来自arch wiki。 亮度由ACPI内核模块控制,这个模块的接口在以下位置: /sys/class/backlight 笔者的设备上显示: 然后使用root进入这个文件夹,其中max_brightness表示亮度的最大值,笔者的设备显示为120000: 想要修改亮度的话直接修改brightness即可: echo xxxxx > brightness 其中xxxxx为亮度数值,注意一定要root用户。 3 使用脚本加别名 可以使用一个简单的脚本来完成: #!/usr/bin/bash sudo su<<EOF echo $1 > /sys/class/backlight/intel_backlight/brightness EOF 其中intel_backlight请对应修改。 假设文件名为a.sh,放在用户目录下,加上别名: alias changeBrightness='sh ~/a.sh ' 加一个亮度参数,再输入用户密码就可以修改了: 来源: oschina 链接: https://my.oschina.net/u/4231975/blog/4269838

how can I change the brightness of the keyboard backlight

主宰稳场 提交于 2020-02-07 05:44:06
问题 I just the want to change the brightness of the backlit by programming. If should use the private API, never mind, just want to finish the function. Anyone can tell me which API should I to use? 回答1: Might want to check out this article: http://www.osxbook.com/book/bonus/chapter10/light/. It was mentioned in a previous question that might be related to this question. Please note that the article (at the time of writing [2006],) does say: There Are No Published Motion/Light Sensor APIs 来源:

Changing Backlight Level, iPhone

余生颓废 提交于 2019-12-21 03:00:34
问题 I searched around for a way to set the backlight level within an app on the iPhone. I found a solution here: http://www.iphonedevsdk.com/forum/29097-post3.html The problem I have is, when I add this to my app I get an error and a warning. My code is as follows: #include "GraphicsServices.h" - (void) viewWillAppear:(BOOL)animated { NSNumber *bl = (NSNumber*) CFPreferencesCopyAppValue(CFSTR("SBBacklightLevel" ), CFSTR("com.apple.springboard")); previousBacklightLevel = [bl floatValue]; //Error

Windows: How to change monitor's backlight brightness

与世无争的帅哥 提交于 2019-12-19 19:49:11
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 9 years ago . Ever since I've been using an external monitor with my laptop, when I need to change the backlight brightness I have to press the monitor's buttons to navigate through its menu and adjust the brightness. That is really a pain. It's too many button presses! When I was using my laptop's integrated monitor, that was as simple as presing the Fn key plus a combination. Probably some of

Can I prevent screen timeout on Windows Phone 7?

人盡茶涼 提交于 2019-12-17 20:37:30
问题 In the CE based Windows Mobile you could prevent the screen back-light from timing out using the SetPowerRequirement and ReleasePowerRequirement API's like so: IntPtr handle = SetPowerRequirement("BKL1:", PowerState.FULL, 1, IntPtr.Zero, 0); // screen won't timeout while you do stuff in here ReleasePowerREquirement(handle); Is a similar thing possible on WP7? 回答1: Yes, it is possible. You can use PhoneApplicationService.Current.UserIdleDetectionMode to stop the screen backlight timing out and

J2ME backlight

谁都会走 提交于 2019-12-12 15:40:26
问题 Is there any reliable way to support back-light in J2ME on multitude of models, other then pre-processing? Is there any library available that may handle the back-light for various phones out there? Regards. 回答1: This is not a direct control as in Nokia UI API, but there is a method in MIDP that controls backlight, it is Display.flashBacklight(int duration) . Unfortunately, phones are not obliged to obey this method. But this method is at least part of MIDP, not some proprietary API. 回答2: