Datasheet
AVR32416
19
32105-AVR32-07/08
struct device *parent,
void *devdata,
struct lcd_ops *ops);
void lcd_device_unregister(struct lcd_device *ld);
Functions that can be implemented in a LCD driver are listed in the struct lcd_ops.
3.7.2 Backlight layer
The backlight client provides an easy integration of the backlight control in the frame
buffer driver and the LCD driver.
Relevant files are include/linux/backlight.h and drivers/video/backlight/backlight.c.
A LCD driver can register/un-register itself with the backlight client with the following
functions:
struct backlight_device *backlight_device_register(
const char *name,
struct device *dev,
void *devdata,
struct backlight_ops *ops);
void backlight_device_unregister(struct backlight_device *bd);
The functions named in struct backlight_ops can be implemented in the LCD driver
and tied to the structure.
The backlight client will also provide some attribute files in the sys file system. These
are bl_power, brightness, actual_brightness and max_brightness.
3.8 LCD driver
A LCD driver may be needed to do initialization, power on/off and other things that depend on
the used LCD. An example driver that was written for the LCD on the STK1000 board is
drivers/video/backlight/ltv350qv.c.
Depending on the display different configuration interfaces may be present such as SPI or TWI
(I2C). The reading of the application note “AVR32743 AVR32 AP7 Linux kernel module
application example” is recommended to understand the implementation approach for Linux
kernel modules. Especially the SPI example may be very helpful if the display provides a SPI
interface for configuration.
The LCD driver can provide a configuration interface for the LCD display by using the sys file
system and attribute files. Other interfaces are also possible (device file with ioctl or read/write
interface) but are too much effort for such simple tasks as power on/off and other display
controls.
By using the LCD abstraction layer the LCD driver can provide some of its functionalities to the
system. This has the advance that it is more general.
3.8.1 Adding a LCD driver to the Linux kernel configuration system
To make a custom LCD driver appear in the Linux kernel configuration system the file
drivers/video/backlight/Kconfig must be edited. Following example is taken from the
file and represents the entry for the LTV350QV display.
config LCD_LTV350QV
tristate "Samsung LTV350QV LCD Panel"
depends on LCD_CLASS_DEVICE && SPI_MASTER










