Difference between revisions of "BackLight"

From ArmadeusWiki
Jump to: navigation, search
m (Installation)
(Usage)
 
(7 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
==Introduction==
 
==Introduction==
  
Backlight control is done through the i.MXL/i.MX27 integrated backlight PWM (inside LCDC module). The output signal of this PWM is redirected to the CONTRAST pin of your LCD connector.
+
Backlight control is done through the i.MX integrated backlight PWM (inside LCDC module). The output signal of this PWM is redirected to the CONTRAST pin of your LCD connector.
  
 
In short the driver is mainly exporting a ''/sys'' interface to user space, allowing you to change the Duty Cycle of the PWM output signal and so the backlight intensity of the LCD.
 
In short the driver is mainly exporting a ''/sys'' interface to user space, allowing you to change the Duty Cycle of the PWM output signal and so the backlight intensity of the LCD.
  
 
==Installation==
 
==Installation==
This driver is now installed by default on the standard Armadeus rootfs. So, following instructions are only given as reference.
+
This driver is now installed by default on the standard Armadeus rootfs.
<pre class="host">
+
$ make linux26-menuconfig
+
</pre>
+
<pre class="config">
+
    Device Drivers --->
+
        Graphics support  --->
+
            Backlight & LCD device support
+
                <M>  Lowlevel Backlight controls
+
            ...
+
        Armadeus specific drivers --->
+
            Support for specific Armadeus drivers
+
                <M> i.MX backlight driver
+
</pre>
+
* If built in kernel, reflash your kernel image; if selected as module either reflash your rootfs or copy ''backlight.ko'', ''imx_bl.ko'' and ''.../lib/modules/2.6.18.1/modules.dep'' to your target (for more infos: [[Linux_drivers_generalities]]).
+
  
 
==Usage==
 
==Usage==
  
On your APF, load the module:
+
On your APF, load the module (not needed on [[APF6]] and [[OPOS6UL]]):
 
<pre class="apf">
 
<pre class="apf">
 
  # modprobe imx_bl
 
  # modprobe imx_bl
 
  i.MX Backlight driver v0.X initialized.
 
  i.MX Backlight driver v0.X initialized.
 
</pre>
 
</pre>
 +
 +
* Depending on your platform, backlight interface may have a different name, so let's define an envt variable to ease further instructions:
 +
{| border="1" cellpadding="10" cellspacing="0" summary="PWM usage depending on kernel version" class="wikitable"
 +
|- style="background:#efefef;" align="center"
 +
! APF27/51/28 || APF6 || OPOS6UL
 +
|-----
 +
 +
|<pre class="apf">
 +
export BACK_IF=imx-bl
 +
</pre>
 +
 +
||<pre class="apf">
 +
export BACK_IF=backlight_lcd
 +
</pre>
 +
 +
||<pre class="apf">
 +
export BACK_IF=lcd_backlight
 +
</pre>
 +
 +
|}
  
 
All backlight controls are done through the ''/sys'' interface:
 
All backlight controls are done through the ''/sys'' interface:
 
<pre class="apf">
 
<pre class="apf">
  # ls /sys/class/backlight/imxl-bl/
+
  # ls /sys/class/backlight/$BACK_IF/
 
  actual_brightness  max_brightness    subsystem
 
  actual_brightness  max_brightness    subsystem
 
  brightness        power              uevent
 
  brightness        power              uevent
Line 41: Line 47:
 
* To see the actual brightness:
 
* To see the actual brightness:
 
<pre class="apf">
 
<pre class="apf">
  # cat /sys/class/backlight/imxl-bl/actual_brightness
+
  # cat /sys/class/backlight/$BACK_IF/actual_brightness
 
</pre>
 
</pre>
 
* To see the max allowed brightness:
 
* To see the max allowed brightness:
 
<pre class="apf">
 
<pre class="apf">
  # cat /sys/class/backlight/imxl-bl/max_brightness
+
  # cat /sys/class/backlight/$BACK_IF/max_brightness
 
</pre>
 
</pre>
* To change the brightness:
+
* To change the brightness (X depends on previous allowed brightnesses):
 
<pre class="apf">
 
<pre class="apf">
  # echo 100 > /sys/class/backlight/imxl-bl/brightness
+
  # echo X > /sys/class/backlight/$BACK_IF/brightness
 
</pre>
 
</pre>
  
There is a small test script in ''target/linux/modules/backlight/test/''
+
===Examples===
 +
* There is a small test script (shell) in ''target/linux/modules/backlight/test/''
 +
* For a C/[[SDL]] example, take a look at ''target/demos/backlight_control/''
  
 
==Links==
 
==Links==

Latest revision as of 00:17, 19 July 2017

This page will explain you how to configure and use the Linux driver controlling the BackLight of your LCD

Introduction

Backlight control is done through the i.MX integrated backlight PWM (inside LCDC module). The output signal of this PWM is redirected to the CONTRAST pin of your LCD connector.

In short the driver is mainly exporting a /sys interface to user space, allowing you to change the Duty Cycle of the PWM output signal and so the backlight intensity of the LCD.

Installation

This driver is now installed by default on the standard Armadeus rootfs.

Usage

On your APF, load the module (not needed on APF6 and OPOS6UL):

 # modprobe imx_bl
 i.MX Backlight driver v0.X initialized.
  • Depending on your platform, backlight interface may have a different name, so let's define an envt variable to ease further instructions:
APF27/51/28 APF6 OPOS6UL
export BACK_IF=imx-bl
export BACK_IF=backlight_lcd
export BACK_IF=lcd_backlight

All backlight controls are done through the /sys interface:

 # ls /sys/class/backlight/$BACK_IF/
 actual_brightness  max_brightness     subsystem
 brightness         power              uevent
  • To see the actual brightness:
 # cat /sys/class/backlight/$BACK_IF/actual_brightness
  • To see the max allowed brightness:
 # cat /sys/class/backlight/$BACK_IF/max_brightness
  • To change the brightness (X depends on previous allowed brightnesses):
 # echo X > /sys/class/backlight/$BACK_IF/brightness

Examples

  • There is a small test script (shell) in target/linux/modules/backlight/test/
  • For a C/SDL example, take a look at target/demos/backlight_control/

Links