Datasheet
18
AVR32416
32105-AVR32-07/08
correct view, the LCD Controller and its DMA engine have to be restarted. A possible
solution to guarantee access to the external bus interface for the LCD Controller is to
enable a priority based arbitration algorithm for this slave. If the LCD Controller gets
the highest priority for the slave it is guaranteed that it gets access before all other
masters. A major drawback is that all other masters will have a reduced access or
even in a worst case no access at all to the slave. Chapter “HSB Bus Matrix” of the
device datasheet describes how to activate the priority-based arbitration and the
setting of priorities.
Code example
The following code sample can be used in the board setup code to set up the LCD
controller as fixed master with priority-based arbitration on the external bus interface.
The right place would be in the
file arch/avr32/mach-at32ap/at32ap700x.c in the LCD
controller setup function.
hmatrix_writel(SCFG4, HMATRIX_BIT(ARBT)
| HMATRIX_BF(FIXED_DEFMSTR, 0x5)
| HMATRIX_BF(SLOT_CYCLE, 0x10)
| HMATRIX_BF(DEFMSTR_TYPE,
HMATRIX_DEFMSTR_TYPE_FIXED_DEFAULT));
hmatrix_writel(PRAS4, HMATRIX_BF(M5PR, 0xF));
The above example sets the priority to the maximum and uses a reasonable slot
cycle but these settings may be changed to fit the actual needs.
3.7 LCD low level abstraction layer
The low level LCD abstraction layer consists of several independent clients that are
connected to the frame buffer driver. If a change has been made by an application in
the frame buffer driver the clients will be notified and they have to decide if they have
to react to this change. After the client has decided that the change is relevant it will
provide the new settings to the actual LCD driver.
3.7.1 LCD layer
The LCD layer (or client) currently supports basic functions like power on/off and contrast. The
abstraction layer registers itself as a client with the frame buffer driver and installs a callback
routine that is called when settings like contrast are changed through the frame buffer driver
core. The settings are also available through the sys file system. For the display on the
STK1000 the attribute files contrast, lcd_power and max_contrast are available in the directory
/sys/class/lcd/ltv350qv. Currently only the lcd_power attribute file is functional because the
contrast setting is not implemented in the LCD driver for the LTV350QV display. The display
can be turned off with following command:
echo 2 > /sys/class/lcd/ltv350qv/lcd_power
To turn the display on again use
echo 1 > /sys/class/lcd/ltv350qv/lcd_power
Custom LCDs and their corresponding drivers will use another directory in /sys/class/lcd
depending on the driver name.
The API of the LCD layer is defined in the header file include/linux/lcd.h and can be included in
a LCD driver in order to use it. The source code can be found in drivers/video/backlight/lcd.c.
LCD drivers can register/un-register itself with the LCD layer with the functions
struct lcd_device *lcd_device_register(const char *name,










