- 1 DCON 개관
- 2 DCON 리눅스 드라이버
- 2.1 요건
- 2.2 DCON 드라이버 로딩
- 2.3 DCON 드라이버 사용 (/sys interface)
- 2.4 Using the DCON driver (ioctl)
- 2.5 Using the backlight driver
DCON은 디스플레이 컨트롤러 (Display CONtroller)의 약자입니다. 하드웨어 사양에서 언급하듯이, 컬러 모드에서 deswizzling과 anti-aliasing을 지원하고, 프로세서가 정지한 상태에서도 디스플레이가 살아있게 만드는 특별한 "DCON" 칩을 사용합니다. 아래는 CPU와 DCON간의 다양한 연결에 대한 간단한 다이어그램입니다:
DCON 리눅스 드라이버
이 섹션은 DCON과 관련 하드웨어를 위한 리눅스 커널 드라이버를 다룹니다.
가장 크고 뛰어난 DCON 는 geode GIT tree의 'dcon' 브렌치에 있습니다. git://git.infradead.org/users/jcrouse/geode.git.
Make sure that you enable the following devices:
- The Geode GX frambuffer driver (CONFIG_FB_GEODE and CONFIG_FB_GEODE_GX). Make sure you build this into the kernel - its not useful as a module.
- The DCON driver (CONFIG_FB_GEODE_GX_DCON). You can either build this in to the kernel or use it as a module. Its much easier to debug as a module. This option automatically selects the I2C subsystem.
- The Geode ACB (smbus) driver (CONFIG_SCx200_ACB).
- The DCON backlight driver (CONFIG_BACKLIGHT_LCD_SUPPORT and CONFIG_BACKLIGHT_CLASS_DEVICE and CONFIG_BACKLIGHT_DCON). This module allows you to control the backlight through the existing kernel backlight mechanism.
DCON 드라이버 로딩
- Load the I2C driver (if you didn't build it in)
$ modprobe scx200_acb
- Load the DCON driver
$ modprobe gxfb_dcon
- Load the backlight driver
$ modprobe dcon_bl
The driver is now loaded. There should be two new platform drivers in /sys/devices/platform:
dcon i2c-0 power uevent dcon-bl pcspkr serial8250
DCON 드라이버 사용 (/sys interface)
The DCON driver functionality is accessable through the /sys interface. This may not always be the case, since it might be a bit of a security issue, but its good for debugging. Here is what the /sys/devices/platform/dcon directory looks like:
bus mode power source uevent modalias output sleep subsystem
This is a read only file that shows the current hex value of the DCON mode register (0x01).
This file lets you change the output mode from color to mono. Write a number to the file to change the mode:
Read the file to see what the current mode is.
This file lets you change the source of the display from the CPU to the DCON. Write a number to the file to change the source:
Read the file to see what the current source is.
This file isn't yet implemented, but it will alow you to put the DCON into sleep mode.
Using the DCON driver (ioctl)
The DCON functionality can also be accessed with ioctl() calls through the /dev/fb0 device file. The following ioctls are defined:
#define DCONIOC_SOURCE _IOW('d', 0, int) #define DCONIOC_OUTPUT _IOW('d', 1, int) #define DCONIOC_SETREG _IOW('d', 2, int) #define DCONIOC_DUMPREG _IOW('d', 3, int) #define DCONIOC_GETREG _IOW('d', 4, int) #define DCONIOC_SETBL _IOW('d', 5, int) #define DCONIOC_GETBL _IOW('d', 6, int)
Change the source of the DCON data. The argument should either be 0 (DCON) or 1 (CPU).
Change the output type of the display. The argument should either be 0 (color) or 1 (mono).
Sets a register on the DCON. Upper 16 bits of the argument is the register, and the lower 16 bits is the value.
Prompts the driver to prink() all of the registers in the DCON.
Get a DCON register value. The argument is the desired register and it will contain the value on return.
Get the current value of the backlight register. The argument will contain the backlight value on return.
Set the current value of the backlight register. The argument should have the new value. Any value from 0 (off) to 15 (full on) is acceptable
Using the backlight driver
/sys/class/backlight/dcon-bl looks like this:
actual_brightness max_brightness subsystem brightness power uevent
Change the brightness by writing a new number to the brightness file. The value can range from 0 (off) to 15 (full on).
This example changes the backlight to about 50%:
$ echo "7" > /sys/class/backlight/dcon-bl/brightness