Config Update - atmel-maxtouch/linux GitHub Wiki

Configuration Download

The maXTouch chip contains a configuration which is stored in NVRAM.

Formats

There are several configuration file formats. For further information, E-9078 - Object Server Configuration File Format is available from Atmel under NDA.

OBP_RAW

Raw files are in an easily-generated and easily-parsed format. Raw config files are given a .raw (or sometimes .cfg) file extension.

This format is supported by the kernel driver.

OBP_RAW V1
A0 01 10 AA 18 20 18
5AFE1A
123456
0026 0000 0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0007 0000 0003 12 64 00
0008 0000 000A 32 00 00 00 00 00 00 00 00 00
[...]

It may also be saved by mxt-app.

.xcfg

Extended config files are laid out as per standard Windows INI files (see http://en.wikipedia.org/wiki/INI_file), with the addition of extra information about the chip, the size of objects, and the size and offset of each field in each object. They also contain a comments section containing a history of changes made to the file, and can contain arbitrary text. Extended config files are denoted by a .xcfg file extension.

[COMMENTS]
Saved by: aa
Date and time: Thu Dec 15 15:12:28 2014
[VERSION_INFO_HEADER]
FAMILY_ID=160
VARIANT=1
VERSION=2
BUILD=170
VENDOR_ID=255
PRODUCT_ID=TBD
CHECKSUM=0x123456
INFO_BLOCK_CHECKSUM=0x5AFE1A
[APPLICATION_INFO_HEADER]
NAME=Object-Based Server
VERSION=4.0.0.0
[SPT_USERDATA_T38 INSTANCE 0]
OBJECT_ADDRESS=305
OBJECT_SIZE=64
0 1 DATA[0]=0
1 1 DATA[1]=0
2 1 DATA[2]=0
3 1 DATA[3]=0
4 1 DATA[4]=0
5 1 DATA[5]=0
6 1 DATA[6]=0
7 1 DATA[7]=0
[...]

.cfg

An deprecated INI-style format. It isn't supported by currently available tools.

[SPT_USERDATA_T38 INSTANCE 0]
DATA[0]=0
DATA[1]=0
DATA[2]=0
DATA[3]=0
DATA[4]=0
DATA[5]=0
DATA[6]=0
DATA[7]=0
[...]

Downloading configuration

To trigger config download:

echo mxt540.raw > /sys/bus/i2c/drivers/atmel_mxt_ts/1-004a/update_cfg

The configuration will be downloaded to the device and backed up to NVRAM.

Automatically downloading configuration on probe

During the integration phase, this configuration may be set manually. However for shipping devices it is desirable to have the kernel driver check the configuration on every boot and upload it if necessary. This guards against problems cause by the configuration being changed accidentally, and allows the initial configuration to be set when the firmware is updated.

When the cfg_name parameter is set in platform data, module insertion will trigger the configuration download.

The configuration file can be compiled into the kernel - see CONFIG_FIRMWARE_IN_KERNEL.