Merge "input: touchscreen: Add synaptics v1 driver"
This commit is contained in:
commit
2142082d3b
15 changed files with 11194 additions and 0 deletions
22
kernel/Documentation/firmware_updater/request_firmware.txt
Normal file
22
kernel/Documentation/firmware_updater/request_firmware.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
Firmware Update Function
|
||||
========================
|
||||
|
||||
Call export function "synaptics_fw_updater" in rmi_fw_update.c to start
|
||||
firmware updating process in the driver.
|
||||
|
||||
The RMI4 driver uses the kernel's request_firmware() feature to obtain
|
||||
firmware for the touch sensor. The firmware is expected to live in
|
||||
the file firmware/<firmware_name>.img.ihex.
|
||||
|
||||
To prepare Synaptics provided .img file for reflashing, convert it to .ihex
|
||||
format using the following command:
|
||||
|
||||
objcopy -I binary -O ihex <firmware_name>.img firmware/<firmware_name>.img.ihex
|
||||
|
||||
Then make sure to add the image file name to the
|
||||
CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_RMI4_FW_UPDATE entry in firmware/Makefile.
|
||||
If you don't do this, the image file won't be included, and
|
||||
the firmware loader class will delay for 60 seconds waiting for a non-existent
|
||||
userspace response to the firmware load request.
|
||||
|
||||
Firmware updates for multichip solutions (aka LTS) are not supported.
|
BIN
kernel/Documentation/firmware_updater/synaptics_fw_updater
Normal file
BIN
kernel/Documentation/firmware_updater/synaptics_fw_updater
Normal file
Binary file not shown.
753
kernel/Documentation/firmware_updater/synaptics_fw_updater.c
Normal file
753
kernel/Documentation/firmware_updater/synaptics_fw_updater.c
Normal file
|
@ -0,0 +1,753 @@
|
|||
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
*
|
||||
* Copyright © 2011, 2012 Synaptics Incorporated. All rights reserved.
|
||||
*
|
||||
* The information in this file is confidential under the terms
|
||||
* of a non-disclosure agreement with Synaptics and is provided
|
||||
* AS IS without warranties or guarantees of any kind.
|
||||
*
|
||||
* The information in this file shall remain the exclusive property
|
||||
* of Synaptics and may be the subject of Synaptics patents, in
|
||||
* whole or part. Synaptics intellectual property rights in the
|
||||
* information in this file are not expressly or implicitly licensed
|
||||
* or otherwise transferred to you as a result of such information
|
||||
* being made available to you.
|
||||
*
|
||||
* File: synaptics_fw_updater.c
|
||||
*
|
||||
* Description: command line reflash implimentation using command
|
||||
* line args. This file should not be OS dependant and should build and
|
||||
* run under any Linux based OS that utilizes the Synaptice rmi driver
|
||||
* built into the kernel (kernel/drivers/input/rmi4).
|
||||
*
|
||||
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#define DEFAULT_SENSOR "/sys/class/input/input1"
|
||||
|
||||
#define MAX_STRING_LEN 256
|
||||
#define MAX_INT_LEN 33
|
||||
|
||||
#define DATA_FILENAME "data"
|
||||
#define IMAGESIZE_FILENAME "imagesize"
|
||||
#define DOREFLASH_FILENAME "doreflash"
|
||||
#define CONFIGAREA_FILENAME "configarea"
|
||||
#define READCONFIG_FILENAME "readconfig"
|
||||
#define WRITECONFIG_FILENAME "writeconfig"
|
||||
#define BLOCKSIZE_FILENAME "blocksize"
|
||||
#define IMAGEBLOCKCOUNT_FILENAME "fwblockcount"
|
||||
#define CONFIGBLOCKCOUNT_FILENAME "configblockcount"
|
||||
#define PMCONFIGBLOCKCOUNT_FILENAME "permconfigblockcount"
|
||||
#define BUILDID_FILENAME "buildid"
|
||||
#define FLASHPROG_FILENAME "flashprog"
|
||||
|
||||
#define UI_CONFIG_AREA 0
|
||||
#define PERM_CONFIG_AREA 1
|
||||
#define BL_CONFIG_AREA 2
|
||||
#define DISP_CONFIG_AREA 3
|
||||
|
||||
#define IMAGE_FILE_CHECKSUM_SIZE 4
|
||||
|
||||
unsigned char *firmware = NULL;
|
||||
int fileSize;
|
||||
int firmwareBlockSize;
|
||||
int firmwareBlockCount;
|
||||
int firmwareImgSize;
|
||||
int configBlockSize;
|
||||
int configBlockCount;
|
||||
int configImgSize;
|
||||
int totalBlockCount;
|
||||
int readConfig = 0;
|
||||
int writeConfig = 0;
|
||||
int uiConfig = 0;
|
||||
int pmConfig = 0;
|
||||
int blConfig = 0;
|
||||
int dpConfig = 0;
|
||||
int force = 0;
|
||||
int verbose = 0;
|
||||
|
||||
char mySensor[MAX_STRING_LEN];
|
||||
char imageFileName[MAX_STRING_LEN];
|
||||
|
||||
static void usage(char *name)
|
||||
{
|
||||
printf("Usage: %s [-b {image_file}] [-d {sysfs_entry}] [-r] [-ui] [-pm] [-bl] [-dp] [-f] [-v]\n", name);
|
||||
printf("\t[-b {image_file}] - Name of image file\n");
|
||||
printf("\t[-d {sysfs_entry}] - Path to sysfs entry of sensor\n");
|
||||
printf("\t[-r] - Read config area\n");
|
||||
printf("\t[-ui] - UI config area\n");
|
||||
printf("\t[-pm] - Permanent config area\n");
|
||||
printf("\t[-bl] - BL config area\n");
|
||||
printf("\t[-dp] - Display config area\n");
|
||||
printf("\t[-f] - Force reflash\n");
|
||||
printf("\t[-v] - Verbose output\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void TimeSubtract(struct timeval *result, struct timeval *x, struct timeval *y)
|
||||
{
|
||||
if (x->tv_usec < y->tv_usec) {
|
||||
result->tv_sec = x->tv_sec - y->tv_sec - 1;
|
||||
result->tv_usec = y->tv_usec - x->tv_usec;
|
||||
} else {
|
||||
result->tv_sec = x->tv_sec - y->tv_sec;
|
||||
result->tv_usec = x->tv_usec - y->tv_usec;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int CheckSysfsEntry(char *sensorName)
|
||||
{
|
||||
int retval;
|
||||
struct stat st;
|
||||
|
||||
retval = stat(sensorName, &st);
|
||||
if (retval)
|
||||
printf("ERROR: sensor sysfs entry %s not found\n", sensorName);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void WriteBinData(char *fname, unsigned char *buf, int len)
|
||||
{
|
||||
int numBytesWritten;
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(fname, "wb");
|
||||
if (!fp) {
|
||||
printf("ERROR: failed to open %s for writing data\n", fname);
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
numBytesWritten = fwrite(buf, 1, len, fp);
|
||||
|
||||
if (numBytesWritten != len) {
|
||||
printf("ERROR: failed to write all data to bin file\n");
|
||||
fclose(fp);
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void ReadBinData(char *fname, unsigned char *buf, int len)
|
||||
{
|
||||
int numBytesRead;
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(fname, "rb");
|
||||
if (!fp) {
|
||||
printf("ERROR: failed to open %s for reading data\n", fname);
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
numBytesRead = fread(buf, 1, len, fp);
|
||||
|
||||
if (numBytesRead != len) {
|
||||
printf("ERROR: failed to read all data from bin file\n");
|
||||
fclose(fp);
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void WriteValueToFp(FILE *fp, unsigned int value)
|
||||
{
|
||||
int numBytesWritten;
|
||||
char buf[MAX_INT_LEN];
|
||||
|
||||
snprintf(buf, MAX_INT_LEN, "%u", value);
|
||||
|
||||
fseek(fp, 0, 0);
|
||||
|
||||
numBytesWritten = fwrite(buf, 1, strlen(buf) + 1, fp);
|
||||
if (numBytesWritten != ((int)(strlen(buf) + 1))) {
|
||||
printf("ERROR: failed to write value to file pointer\n");
|
||||
fclose(fp);
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void WriteValueToSysfsFile(char *fname, unsigned int value)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(fname, "w");
|
||||
if (!fp) {
|
||||
printf("ERROR: failed to open %s for writing value\n", fname);
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
WriteValueToFp(fp, value);
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void ReadValueFromFp(FILE *fp, unsigned int *value)
|
||||
{
|
||||
int retVal;
|
||||
char buf[MAX_INT_LEN];
|
||||
|
||||
fseek(fp, 0, 0);
|
||||
|
||||
retVal = fread(buf, 1, sizeof(buf), fp);
|
||||
if (retVal == -1) {
|
||||
printf("ERROR: failed to read value from file pointer\n");
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
*value = strtoul(buf, NULL, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void ReadValueFromSysfsFile(char *fname, unsigned int *value)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(fname, "r");
|
||||
if (!fp) {
|
||||
printf("ERROR: failed to open %s for reading value\n", fname);
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
ReadValueFromFp(fp, value);
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void WriteBlockData(char *buf, int len)
|
||||
{
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, DATA_FILENAME);
|
||||
|
||||
WriteBinData(tmpfname, (unsigned char *)buf, len);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void ReadBlockData(char *buf, int len)
|
||||
{
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, DATA_FILENAME);
|
||||
|
||||
ReadBinData(tmpfname, (unsigned char *)buf, len);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void SetImageSize(int value)
|
||||
{
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, IMAGESIZE_FILENAME);
|
||||
|
||||
WriteValueToSysfsFile(tmpfname, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void StartReflash(int value)
|
||||
{
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, DOREFLASH_FILENAME);
|
||||
|
||||
WriteValueToSysfsFile(tmpfname, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void SetConfigArea(int value)
|
||||
{
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, CONFIGAREA_FILENAME);
|
||||
|
||||
WriteValueToSysfsFile(tmpfname, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void StartWriteConfig(int value)
|
||||
{
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, WRITECONFIG_FILENAME);
|
||||
|
||||
WriteValueToSysfsFile(tmpfname, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void StartReadConfig(int value)
|
||||
{
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, READCONFIG_FILENAME);
|
||||
|
||||
WriteValueToSysfsFile(tmpfname, value);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int ReadBlockSize(void)
|
||||
{
|
||||
unsigned int blockSize;
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, BLOCKSIZE_FILENAME);
|
||||
|
||||
ReadValueFromSysfsFile(tmpfname, &blockSize);
|
||||
|
||||
return blockSize;
|
||||
}
|
||||
|
||||
static int ReadFirmwareBlockCount(void)
|
||||
{
|
||||
unsigned int imageBlockCount;
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, IMAGEBLOCKCOUNT_FILENAME);
|
||||
|
||||
ReadValueFromSysfsFile(tmpfname, &imageBlockCount);
|
||||
|
||||
return imageBlockCount;
|
||||
}
|
||||
|
||||
static int ReadConfigBlockCount(void)
|
||||
{
|
||||
unsigned int configBlockCount;
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, CONFIGBLOCKCOUNT_FILENAME);
|
||||
|
||||
ReadValueFromSysfsFile(tmpfname, &configBlockCount);
|
||||
|
||||
return configBlockCount;
|
||||
}
|
||||
|
||||
static int ReadPmConfigBlockCount(void)
|
||||
{
|
||||
unsigned int configBlockCount;
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, PMCONFIGBLOCKCOUNT_FILENAME);
|
||||
|
||||
ReadValueFromSysfsFile(tmpfname, &configBlockCount);
|
||||
|
||||
return configBlockCount;
|
||||
}
|
||||
|
||||
static int ReadBuildID(void)
|
||||
{
|
||||
unsigned int buildID;
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, BUILDID_FILENAME);
|
||||
|
||||
ReadValueFromSysfsFile(tmpfname, &buildID);
|
||||
|
||||
return buildID;
|
||||
}
|
||||
|
||||
static int ReadFlashProg(void)
|
||||
{
|
||||
unsigned int flashProg;
|
||||
char tmpfname[MAX_STRING_LEN];
|
||||
|
||||
snprintf(tmpfname, MAX_STRING_LEN, "%s/%s", mySensor, FLASHPROG_FILENAME);
|
||||
|
||||
ReadValueFromSysfsFile(tmpfname, &flashProg);
|
||||
|
||||
return flashProg;
|
||||
}
|
||||
|
||||
static void ReadFirmwareInfo(void)
|
||||
{
|
||||
firmwareBlockSize = ReadBlockSize();
|
||||
firmwareBlockCount = ReadFirmwareBlockCount();
|
||||
firmwareImgSize = firmwareBlockCount * firmwareBlockSize;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void ReadConfigInfo(void)
|
||||
{
|
||||
configBlockSize = ReadBlockSize();
|
||||
configBlockCount = ReadConfigBlockCount();
|
||||
configImgSize = configBlockSize * configBlockCount;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void CalculateChecksum(unsigned short *data, unsigned short len, unsigned long *result)
|
||||
{
|
||||
unsigned long temp;
|
||||
unsigned long sum1 = 0xffff;
|
||||
unsigned long sum2 = 0xffff;
|
||||
|
||||
*result = 0xffffffff;
|
||||
|
||||
while (len--) {
|
||||
temp = *data;
|
||||
sum1 += temp;
|
||||
sum2 += sum1;
|
||||
sum1 = (sum1 & 0xffff) + (sum1 >> 16);
|
||||
sum2 = (sum2 & 0xffff) + (sum2 >> 16);
|
||||
data++;
|
||||
}
|
||||
|
||||
*result = sum2 << 16 | sum1;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int CompareChecksum(void)
|
||||
{
|
||||
unsigned long headerChecksum;
|
||||
unsigned long computedChecksum;
|
||||
|
||||
headerChecksum = (unsigned long)firmware[0] +
|
||||
(unsigned long)firmware[1] * 0x100 +
|
||||
(unsigned long)firmware[2] * 0x10000 +
|
||||
(unsigned long)firmware[3] * 0x1000000;
|
||||
|
||||
CalculateChecksum((unsigned short *)&firmware[IMAGE_FILE_CHECKSUM_SIZE],
|
||||
((fileSize - IMAGE_FILE_CHECKSUM_SIZE) / 2), &computedChecksum);
|
||||
|
||||
if (verbose) {
|
||||
printf("Checksum in image file header = 0x%08x\n", (unsigned int)headerChecksum);
|
||||
printf("Checksum computed from image file = 0x%08x\n", (unsigned int)computedChecksum);
|
||||
}
|
||||
|
||||
if (headerChecksum == computedChecksum)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ProceedWithReflash(void)
|
||||
{
|
||||
int index = 0;
|
||||
int deviceBuildID;
|
||||
int imageBuildID;
|
||||
char imagePR[MAX_STRING_LEN];
|
||||
char *strptr;
|
||||
|
||||
if (force) {
|
||||
printf("Force reflash...\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ReadFlashProg()) {
|
||||
printf("Force reflash (device in flash prog mode)...\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
strptr = strstr(imageFileName, "PR");
|
||||
if (!strptr) {
|
||||
printf("No valid PR number (PRxxxxxxx) found in image file name...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
strptr += 2;
|
||||
while (strptr[index] >= '0' && strptr[index] <= '9') {
|
||||
imagePR[index] = strptr[index];
|
||||
index++;
|
||||
}
|
||||
imagePR[index] = 0;
|
||||
|
||||
imageBuildID = strtoul(imagePR, NULL, 0);
|
||||
deviceBuildID = ReadBuildID();
|
||||
printf("Image file PR = %d\n", imageBuildID);
|
||||
printf("Device PR = %d\n", deviceBuildID);
|
||||
|
||||
if (imageBuildID > deviceBuildID) {
|
||||
printf("Proceed with reflash...\n");
|
||||
return 1;
|
||||
} else {
|
||||
printf("No need to do reflash...\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void DoReadConfig(void)
|
||||
{
|
||||
int ii;
|
||||
int jj;
|
||||
int index = 0;
|
||||
int configSize;
|
||||
int blockCount;
|
||||
unsigned char *buffer;
|
||||
|
||||
if (uiConfig) {
|
||||
SetConfigArea(UI_CONFIG_AREA);
|
||||
StartReadConfig(1);
|
||||
blockCount = configBlockCount;
|
||||
configSize = configImgSize;
|
||||
buffer = malloc(configSize);
|
||||
if (!buffer)
|
||||
exit(ENOMEM);
|
||||
ReadBlockData((char *)&buffer[0], configSize);
|
||||
} else if (pmConfig) {
|
||||
SetConfigArea(PERM_CONFIG_AREA);
|
||||
StartReadConfig(1);
|
||||
blockCount = ReadPmConfigBlockCount();
|
||||
configSize = configBlockSize * blockCount;
|
||||
buffer = malloc(configSize);
|
||||
if (!buffer)
|
||||
exit(ENOMEM);
|
||||
ReadBlockData((char *)&buffer[0], configSize);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ii = 0; ii < blockCount; ii++) {
|
||||
for (jj = 0; jj < configBlockSize; jj++) {
|
||||
printf("0x%02x ", buffer[index]);
|
||||
index++;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void DoWriteConfig(void)
|
||||
{
|
||||
printf("Starting config programming...\n");
|
||||
|
||||
if (uiConfig)
|
||||
SetConfigArea(UI_CONFIG_AREA);
|
||||
else if (pmConfig)
|
||||
SetConfigArea(PERM_CONFIG_AREA);
|
||||
else if (blConfig)
|
||||
SetConfigArea(BL_CONFIG_AREA);
|
||||
else if (dpConfig)
|
||||
SetConfigArea(DISP_CONFIG_AREA);
|
||||
else
|
||||
return;
|
||||
|
||||
SetImageSize(fileSize);
|
||||
WriteBlockData((char *)&firmware[0], fileSize);
|
||||
StartWriteConfig(1);
|
||||
|
||||
printf("Config programming completed...\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void DoReflash(void)
|
||||
{
|
||||
if (verbose)
|
||||
printf("Blocks: %d (firmware: %d, config: %d)\n", totalBlockCount, firmwareBlockCount, configBlockCount);
|
||||
|
||||
if (!ProceedWithReflash())
|
||||
return;
|
||||
|
||||
printf("Starting reflash...\n");
|
||||
|
||||
SetImageSize(fileSize);
|
||||
WriteBlockData((char *)&firmware[0], fileSize);
|
||||
StartReflash(1);
|
||||
|
||||
printf("Reflash completed...\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int InitFirmwareImage(void)
|
||||
{
|
||||
int numBytesRead;
|
||||
FILE *fp;
|
||||
|
||||
if (!readConfig) {
|
||||
fp = fopen(imageFileName, "rb");
|
||||
|
||||
if (!fp) {
|
||||
printf("ERROR: image file %s not found\n", imageFileName);
|
||||
exit(ENODEV);
|
||||
}
|
||||
|
||||
fseek(fp, 0L, SEEK_END);
|
||||
fileSize = ftell(fp);
|
||||
if (fileSize == -1) {
|
||||
printf("ERROR: failed to determine size of %s\n", imageFileName);
|
||||
exit(EIO);
|
||||
}
|
||||
|
||||
fseek(fp, 0L, SEEK_SET);
|
||||
|
||||
firmware = malloc(fileSize + 1);
|
||||
if (!firmware) {
|
||||
exit(ENOMEM);
|
||||
} else {
|
||||
numBytesRead = fread(firmware, 1, fileSize, fp);
|
||||
if (numBytesRead != fileSize) {
|
||||
printf("ERROR: failed to read entire content of image file\n");
|
||||
exit(EIO);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if (!(pmConfig || blConfig || dpConfig)) {
|
||||
if (!CompareChecksum()) {
|
||||
printf("ERROR: failed to validate checksum of image file\n");
|
||||
exit(EINVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int retVal;
|
||||
int this_arg = 1;
|
||||
struct stat st;
|
||||
struct timeval start_time;
|
||||
struct timeval end_time;
|
||||
struct timeval elapsed_time;
|
||||
|
||||
if (argc == 1) {
|
||||
usage(argv[0]);
|
||||
exit(EINVAL);
|
||||
}
|
||||
|
||||
while (this_arg < argc) {
|
||||
if (!strcmp((const char *)argv[this_arg], "-b")) {
|
||||
/* Image file */
|
||||
FILE *file;
|
||||
|
||||
this_arg++;
|
||||
if (this_arg >= argc) {
|
||||
printf("ERROR: image file missing\n");
|
||||
exit(EINVAL);
|
||||
}
|
||||
|
||||
/* check for presence of image file */
|
||||
file = fopen(argv[this_arg], "rb");
|
||||
if (file == 0) {
|
||||
printf("ERROR: image file %s not found\n", argv[this_arg]);
|
||||
exit(EINVAL);
|
||||
}
|
||||
fclose(file);
|
||||
|
||||
strncpy(imageFileName, argv[this_arg], MAX_STRING_LEN);
|
||||
} else if (!strcmp((const char *)argv[this_arg], "-d")) {
|
||||
/* path to sensor sysfs entry */
|
||||
this_arg++;
|
||||
|
||||
if (stat(argv[this_arg], &st) == 0) {
|
||||
strncpy(mySensor, argv[this_arg], MAX_STRING_LEN);
|
||||
} else {
|
||||
printf("ERROR: sensor sysfs entry %s not found\n", argv[this_arg]);
|
||||
exit(EINVAL);
|
||||
}
|
||||
} else if (!strcmp((const char *)argv[this_arg], "-r")) {
|
||||
readConfig = 1;
|
||||
} else if (!strcmp((const char *)argv[this_arg], "-ui")) {
|
||||
uiConfig = 1;
|
||||
} else if (!strcmp((const char *)argv[this_arg], "-pm")) {
|
||||
pmConfig = 1;
|
||||
} else if (!strcmp((const char *)argv[this_arg], "-bl")) {
|
||||
blConfig = 1;
|
||||
} else if (!strcmp((const char *)argv[this_arg], "-dp")) {
|
||||
dpConfig = 1;
|
||||
} else if (!strcmp((const char *)argv[this_arg], "-f")) {
|
||||
force = 1;
|
||||
} else if (!strcmp((const char *)argv[this_arg], "-v")) {
|
||||
verbose = 1;
|
||||
} else {
|
||||
usage(argv[0]);
|
||||
printf("ERROR: invalid parameter %s supplied\n", argv[this_arg]);
|
||||
exit(EINVAL);
|
||||
}
|
||||
this_arg++;
|
||||
}
|
||||
|
||||
if ((uiConfig + pmConfig + blConfig + dpConfig) > 1) {
|
||||
printf("ERROR: too many parameters\n");
|
||||
exit(EINVAL);
|
||||
}
|
||||
|
||||
if (uiConfig || pmConfig || blConfig || dpConfig)
|
||||
writeConfig = 1;
|
||||
|
||||
if (!readConfig && !strlen(imageFileName)) {
|
||||
printf("ERROR: no image file specified\n");
|
||||
exit(EINVAL);
|
||||
}
|
||||
|
||||
if (!strlen(mySensor))
|
||||
strncpy(mySensor, DEFAULT_SENSOR, MAX_STRING_LEN);
|
||||
|
||||
if (CheckSysfsEntry(mySensor))
|
||||
exit(ENODEV);
|
||||
|
||||
InitFirmwareImage();
|
||||
|
||||
ReadFirmwareInfo();
|
||||
ReadConfigInfo();
|
||||
totalBlockCount = configBlockCount + firmwareBlockCount;
|
||||
|
||||
retVal = gettimeofday(&start_time, NULL);
|
||||
if (retVal)
|
||||
printf("WARNING: failed to get start time\n");
|
||||
|
||||
if (verbose) {
|
||||
if (!readConfig)
|
||||
printf("Image file: %s\n", imageFileName);
|
||||
printf("Sensor sysfs entry: %s\n", mySensor);
|
||||
}
|
||||
|
||||
if (readConfig)
|
||||
DoReadConfig();
|
||||
else if (writeConfig)
|
||||
DoWriteConfig();
|
||||
else
|
||||
DoReflash();
|
||||
|
||||
retVal = gettimeofday(&end_time, NULL);
|
||||
if (retVal)
|
||||
printf("WARNING: failed to get end time\n");
|
||||
|
||||
TimeSubtract(&elapsed_time, &end_time, &start_time);
|
||||
|
||||
if (verbose) {
|
||||
printf("Elapsed time = %ld.%06ld seconds\n",
|
||||
(long)elapsed_time.tv_sec,
|
||||
(long)elapsed_time.tv_usec);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
Use ADB (Android Debug Bridge) to do command-line reflash
|
||||
- Power on device.
|
||||
- Connect device to host via USB.
|
||||
- Open command prompt on host and go to directory where adb, synaptics_fw_updater, and FW image (e.g. PR1234567.img) reside.
|
||||
- Run "adb devices" to ensure connection with device.
|
||||
- Run "adb root" to have root privileges.
|
||||
- Run "adb push synaptics_fw_updater /data" to copy synaptics_fw_updater to /data directory on device.
|
||||
- Run "adb push firmware.img /data" to copy firmware.img to /data directory on device.
|
||||
- Run "adb shell chmod 777 /data/synaptics_fw_updater" to make synaptics_fw_updater executable.
|
||||
- Run "adb shell /data/synaptics_fw_updater -b /data/PR1234567.img -f -v" to start reflash process.
|
||||
|
||||
Parameters
|
||||
[-b {image_file}] - Name of image file
|
||||
[-d {sysfs_entry}] - Path to sysfs entry of sensor
|
||||
[-r] - Read config area
|
||||
[-ui] - UI config area
|
||||
[-pm] - Permanent config area
|
||||
[-bl] - BL config area
|
||||
[-dp] - Display config area
|
||||
[-f] - Force reflash
|
||||
[-v] - Verbose output
|
||||
|
||||
Procedures for checking whether to proceed with reflash
|
||||
- If [-f] flag is set, proceed with reflash
|
||||
- If device is in flash prog (bootloader) mode, proceed with reflash
|
||||
- If PR number contained in name of new FW image is greater than PR number of FW on device, proceed with reflash.
|
||||
- Otherwise, no reflash is performed
|
||||
|
||||
Usage examples
|
||||
- Perform reflash using PR1234567.img regardless of PR number of FW on device
|
||||
synaptics_fw_updater -b PR1234567.img -f
|
||||
- Perform reflash using PR1234567.img only if 1234567 is greater than PR number of FW on device.
|
||||
synaptics_fw_updater -b PR1234567.img
|
||||
- Write UI config area from PR1234567.img (parsing UI config area from firmware image file)
|
||||
synaptics_fw_updater -b PR1234567.img -ui
|
||||
- Write permanent config area from pmconfig.img (binary file containing permanent config data)
|
||||
synaptics_fw_updater -b pmconfig.img -pm
|
||||
- Read UI config area
|
||||
synaptics_fw_updater -r -ui
|
||||
- Read permanent config area
|
||||
synaptics_fw_updater -r -pm
|
2419
kernel/arch/arm/configs/omap3_beagle_android_defconfig
Normal file
2419
kernel/arch/arm/configs/omap3_beagle_android_defconfig
Normal file
File diff suppressed because it is too large
Load diff
331
kernel/arch/arm/configs/panda_defconfig
Normal file
331
kernel/arch/arm/configs/panda_defconfig
Normal file
|
@ -0,0 +1,331 @@
|
|||
CONFIG_EXPERIMENTAL=y
|
||||
# CONFIG_SWAP is not set
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_CGROUPS=y
|
||||
CONFIG_CGROUP_DEBUG=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_RESOURCE_COUNTERS=y
|
||||
CONFIG_CGROUP_SCHED=y
|
||||
CONFIG_RT_GROUP_SCHED=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_KALLSYMS_ALL=y
|
||||
CONFIG_PANIC_TIMEOUT=5
|
||||
CONFIG_ASHMEM=y
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_EMBEDDED=y
|
||||
# CONFIG_SLUB_DEBUG is not set
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_FORCE_LOAD=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_MODULE_FORCE_UNLOAD=y
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
CONFIG_ARCH_OMAP=y
|
||||
CONFIG_OMAP_RESET_CLOCKS=y
|
||||
# CONFIG_ARCH_OMAP2 is not set
|
||||
# CONFIG_ARCH_OMAP3 is not set
|
||||
# CONFIG_MACH_OMAP_4430SDP is not set
|
||||
CONFIG_ARM_THUMBEE=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_SMP=y
|
||||
# CONFIG_SMP_ON_UP is not set
|
||||
CONFIG_NR_CPUS=2
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_CMDLINE="console=ttyO2,115200n8 mem=1G androidboot.console=ttyO2"
|
||||
CONFIG_CMDLINE_EXTEND=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_CPU_IDLE=y
|
||||
CONFIG_OMAP_SMARTREFLEX=y
|
||||
CONFIG_OMAP_SMARTREFLEX_CLASS1P5=y
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
CONFIG_BINFMT_MISC=y
|
||||
CONFIG_WAKELOCK=y
|
||||
CONFIG_PM_DEBUG=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_NET_KEY=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_INET_ESP=y
|
||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||
# CONFIG_INET_LRO is not set
|
||||
CONFIG_IPV6=y
|
||||
CONFIG_IPV6_PRIVACY=y
|
||||
CONFIG_IPV6_ROUTER_PREF=y
|
||||
CONFIG_IPV6_OPTIMISTIC_DAD=y
|
||||
CONFIG_INET6_AH=y
|
||||
CONFIG_INET6_ESP=y
|
||||
CONFIG_INET6_IPCOMP=y
|
||||
CONFIG_IPV6_MIP6=y
|
||||
CONFIG_IPV6_TUNNEL=y
|
||||
CONFIG_IPV6_MULTIPLE_TABLES=y
|
||||
CONFIG_NETFILTER=y
|
||||
CONFIG_NETFILTER_NETLINK_LOG=y
|
||||
CONFIG_NETFILTER_TPROXY=y
|
||||
CONFIG_NF_CONNTRACK=y
|
||||
CONFIG_NF_CONNTRACK_EVENTS=y
|
||||
CONFIG_NF_CT_PROTO_DCCP=y
|
||||
CONFIG_NF_CT_PROTO_SCTP=y
|
||||
CONFIG_NF_CT_PROTO_UDPLITE=y
|
||||
CONFIG_NF_CONNTRACK_AMANDA=y
|
||||
CONFIG_NF_CONNTRACK_FTP=y
|
||||
CONFIG_NF_CONNTRACK_H323=y
|
||||
CONFIG_NF_CONNTRACK_IRC=y
|
||||
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
|
||||
CONFIG_NF_CONNTRACK_PPTP=y
|
||||
CONFIG_NF_CONNTRACK_SANE=y
|
||||
CONFIG_NF_CONNTRACK_TFTP=y
|
||||
CONFIG_NF_CT_NETLINK=y
|
||||
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
|
||||
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
|
||||
CONFIG_NETFILTER_XT_TARGET_MARK=y
|
||||
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
|
||||
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
|
||||
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
|
||||
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
|
||||
CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
|
||||
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
|
||||
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
|
||||
CONFIG_NETFILTER_XT_MATCH_HELPER=y
|
||||
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
|
||||
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
|
||||
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
|
||||
CONFIG_NETFILTER_XT_MATCH_MAC=y
|
||||
CONFIG_NETFILTER_XT_MATCH_MARK=y
|
||||
CONFIG_NETFILTER_XT_MATCH_POLICY=y
|
||||
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
|
||||
CONFIG_NETFILTER_XT_MATCH_QTAGUID=y
|
||||
CONFIG_NETFILTER_XT_MATCH_QUOTA=y
|
||||
CONFIG_NETFILTER_XT_MATCH_QUOTA2=y
|
||||
CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG=y
|
||||
CONFIG_NETFILTER_XT_MATCH_SOCKET=y
|
||||
CONFIG_NETFILTER_XT_MATCH_STATE=y
|
||||
CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
|
||||
CONFIG_NETFILTER_XT_MATCH_STRING=y
|
||||
CONFIG_NETFILTER_XT_MATCH_TIME=y
|
||||
CONFIG_NETFILTER_XT_MATCH_U32=y
|
||||
CONFIG_NF_CONNTRACK_IPV4=y
|
||||
CONFIG_NF_CONNTRACK_IPV6=y
|
||||
CONFIG_IP_NF_IPTABLES=y
|
||||
CONFIG_IP_NF_MATCH_AH=y
|
||||
CONFIG_IP_NF_MATCH_ECN=y
|
||||
CONFIG_IP_NF_MATCH_TTL=y
|
||||
CONFIG_IP_NF_FILTER=y
|
||||
CONFIG_IP_NF_TARGET_REJECT=y
|
||||
CONFIG_IP_NF_TARGET_REJECT_SKERR=y
|
||||
CONFIG_IP_NF_TARGET_LOG=y
|
||||
CONFIG_NF_NAT=y
|
||||
CONFIG_IP_NF_MANGLE=y
|
||||
CONFIG_IP_NF_TARGET_MASQUERADE=y
|
||||
CONFIG_IP_NF_TARGET_NETMAP=y
|
||||
CONFIG_IP_NF_TARGET_REDIRECT=y
|
||||
CONFIG_IP_NF_RAW=y
|
||||
CONFIG_IP_NF_ARPTABLES=y
|
||||
CONFIG_IP_NF_ARPFILTER=y
|
||||
CONFIG_IP_NF_ARP_MANGLE=y
|
||||
CONFIG_IP6_NF_IPTABLES=y
|
||||
CONFIG_IP6_NF_TARGET_LOG=y
|
||||
CONFIG_IP6_NF_FILTER=y
|
||||
CONFIG_IP6_NF_TARGET_REJECT=y
|
||||
CONFIG_IP6_NF_TARGET_REJECT_SKERR=y
|
||||
CONFIG_IP6_NF_MANGLE=y
|
||||
CONFIG_IP6_NF_RAW=y
|
||||
CONFIG_PHONET=y
|
||||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_HTB=y
|
||||
CONFIG_NET_SCH_INGRESS=y
|
||||
CONFIG_NET_CLS_U32=y
|
||||
CONFIG_NET_EMATCH=y
|
||||
CONFIG_NET_EMATCH_U32=y
|
||||
CONFIG_NET_CLS_ACT=y
|
||||
CONFIG_NET_ACT_POLICE=y
|
||||
CONFIG_NET_ACT_GACT=y
|
||||
CONFIG_NET_ACT_MIRRED=y
|
||||
CONFIG_BT=y
|
||||
CONFIG_BT_BNEP=y
|
||||
CONFIG_BT_L2CAP=y
|
||||
CONFIG_BT_SCO=y
|
||||
CONFIG_BT_RFCOMM=y
|
||||
CONFIG_BT_RFCOMM_TTY=y
|
||||
CONFIG_BT_HCIUART=y
|
||||
CONFIG_BT_HCIUART_H4=y
|
||||
CONFIG_BT_WILINK=y
|
||||
CONFIG_RFKILL=y
|
||||
CONFIG_RFKILL_INPUT=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_CHAR=y
|
||||
CONFIG_MTD_BLOCK=y
|
||||
CONFIG_MTD_NAND_IDS=y
|
||||
CONFIG_MTD_ONENAND=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_SIZE=8192
|
||||
CONFIG_MISC_DEVICES=y
|
||||
# CONFIG_ANDROID_PMEM is not set
|
||||
CONFIG_KERNEL_DEBUGGER_CORE=y
|
||||
CONFIG_UID_STAT=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_CHR_DEV_SG=y
|
||||
CONFIG_MD=y
|
||||
CONFIG_BLK_DEV_DM=y
|
||||
CONFIG_DM_DEBUG=y
|
||||
CONFIG_DM_CRYPT=y
|
||||
CONFIG_DM_UEVENT=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_IFB=y
|
||||
CONFIG_USB_USBNET=y
|
||||
CONFIG_USB_NET_SMSC95XX=y
|
||||
CONFIG_PPP=y
|
||||
CONFIG_PPP_DEFLATE=y
|
||||
CONFIG_PPP_BSDCOMP=y
|
||||
CONFIG_PPP_MPPE=y
|
||||
CONFIG_PPPOLAC=y
|
||||
CONFIG_PPPOPNS=y
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
CONFIG_INPUT_KEYRESET=y
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
CONFIG_INPUT_TOUCHSCREEN=y
|
||||
CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y
|
||||
CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_RMI4_DEV=y
|
||||
CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE=y
|
||||
CONFIG_INPUT_MISC=y
|
||||
CONFIG_INPUT_KEYCHORD=y
|
||||
CONFIG_INPUT_UINPUT=y
|
||||
CONFIG_INPUT_GPIO=y
|
||||
# CONFIG_VT is not set
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_I2C_GPIO=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_GPIO=y
|
||||
CONFIG_GPIO_SYSFS=y
|
||||
CONFIG_GPIO_TWL4030=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_TWL6030_PWM=y
|
||||
CONFIG_REGULATOR_TWL4030=y
|
||||
CONFIG_MEDIA_SUPPORT=y
|
||||
CONFIG_PVR_SGX=y
|
||||
CONFIG_PVR_NEED_PVR_DPF=y
|
||||
CONFIG_PVR_NEED_PVR_ASSERT=y
|
||||
CONFIG_PVR_USSE_EDM_STATUS_DEBUG=y
|
||||
CONFIG_FB=y
|
||||
CONFIG_OMAP2_DSS=y
|
||||
# CONFIG_OMAP2_DSS_VENC is not set
|
||||
CONFIG_FB_OMAP2=y
|
||||
CONFIG_FB_OMAP2_NUM_FBS=2
|
||||
CONFIG_OMAP2_VRAM_SIZE=16
|
||||
CONFIG_PANEL_GENERIC_DPI=y
|
||||
CONFIG_DISPLAY_SUPPORT=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
|
||||
CONFIG_USB_DEVICEFS=y
|
||||
CONFIG_USB_SUSPEND=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_MUSB_HDRC=y
|
||||
CONFIG_USB_MUSB_OMAP2PLUS=y
|
||||
CONFIG_USB_MUSB_PERIPHERAL=y
|
||||
CONFIG_USB_GADGET_MUSB_HDRC=y
|
||||
CONFIG_USB_ACM=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_SERIAL=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_MPR=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA28=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA19=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
|
||||
CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_VBUS_DRAW=500
|
||||
CONFIG_USB_G_ANDROID=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_UNSAFE_RESUME=y
|
||||
CONFIG_MMC_EMBEDDED_SDIO=y
|
||||
CONFIG_MMC_PARANOID_SD_INIT=y
|
||||
CONFIG_MMC_OMAP=y
|
||||
CONFIG_MMC_OMAP_HS=y
|
||||
CONFIG_SWITCH=y
|
||||
CONFIG_SWITCH_GPIO=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_STAGING=y
|
||||
CONFIG_ANDROID=y
|
||||
CONFIG_ANDROID_BINDER_IPC=y
|
||||
CONFIG_ANDROID_LOGGER=y
|
||||
CONFIG_ANDROID_RAM_CONSOLE=y
|
||||
CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION=y
|
||||
CONFIG_ANDROID_TIMED_GPIO=y
|
||||
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT4_FS=y
|
||||
# CONFIG_EXT4_FS_XATTR is not set
|
||||
# CONFIG_DNOTIFY is not set
|
||||
CONFIG_FUSE_FS=y
|
||||
CONFIG_MSDOS_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
# CONFIG_NETWORK_FILESYSTEMS is not set
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
CONFIG_EFI_PARTITION=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ASCII=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_FS=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
# CONFIG_DEBUG_PREEMPT is not set
|
||||
CONFIG_DEBUG_RT_MUTEXES=y
|
||||
CONFIG_DEBUG_SPINLOCK=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_DEBUG_SPINLOCK_SLEEP=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_SYSCTL_SYSCALL_CHECK=y
|
||||
# CONFIG_ARM_UNWIND is not set
|
||||
CONFIG_DEBUG_USER=y
|
||||
CONFIG_CRYPTO_TWOFISH=y
|
||||
CONFIG_CRC_CCITT=y
|
||||
CONFIG_SOUND=y
|
||||
CONFIG_SND=y
|
||||
CONFIG_SND_SOC=y
|
||||
CONFIG_SND_OMAP_SOC=y
|
||||
CONFIG_SND_OMAP_SOC_SDP4430=y
|
||||
CONFIG_SND_OMAP_SOC_OMAP4_HDMI=y
|
||||
CONFIG_OMAP_HSI=y
|
||||
CONFIG_OMAP_HSI_DEVICE=y
|
||||
CONFIG_CFG80211=y
|
||||
CONFIG_NL80211_TESTMODE=y
|
||||
CONFIG_LIB80211=y
|
||||
CONFIG_MAC80211=y
|
||||
CONFIG_MAC80211_LEDS=y
|
||||
CONFIG_MAC80211_DEBUGFS=y
|
||||
CONFIG_USB_ZD1201=y
|
||||
CONFIG_WL12XX_MENU=y
|
||||
CONFIG_WL12XX=y
|
||||
CONFIG_WL12XX_SDIO=y
|
||||
CONFIG_CRYPTO_PCBC=y
|
||||
CONFIG_CRYPTO_MD4=y
|
||||
CONFIG_CRYPTO_MICHAEL_MIC=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_OMAP_TEMP_SENSOR=y
|
||||
CONFIG_OMAP_DIE_TEMP_SENSOR=y
|
||||
CONFIG_TI_ST=y
|
||||
CONFIG_KEYBOARD_GPIO=y
|
1038
kernel/arch/arm/mach-omap2/board-omap3beagle.c
Normal file
1038
kernel/arch/arm/mach-omap2/board-omap3beagle.c
Normal file
File diff suppressed because it is too large
Load diff
1053
kernel/arch/arm/mach-omap2/board-omap4panda.c
Normal file
1053
kernel/arch/arm/mach-omap2/board-omap4panda.c
Normal file
File diff suppressed because it is too large
Load diff
721
kernel/drivers/input/touchscreen/Kconfig
Normal file
721
kernel/drivers/input/touchscreen/Kconfig
Normal file
|
@ -0,0 +1,721 @@
|
|||
#
|
||||
# Touchscreen driver configuration
|
||||
#
|
||||
menuconfig INPUT_TOUCHSCREEN
|
||||
bool "Touchscreens"
|
||||
help
|
||||
Say Y here, and a list of supported touchscreens will be displayed.
|
||||
This option doesn't affect the kernel.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
if INPUT_TOUCHSCREEN
|
||||
|
||||
config TOUCHSCREEN_88PM860X
|
||||
tristate "Marvell 88PM860x touchscreen"
|
||||
depends on MFD_88PM860X
|
||||
help
|
||||
Say Y here if you have a 88PM860x PMIC and want to enable
|
||||
support for the built-in touchscreen.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called 88pm860x-ts.
|
||||
|
||||
config TOUCHSCREEN_ADS7846
|
||||
tristate "ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens"
|
||||
depends on SPI_MASTER
|
||||
depends on HWMON = n || HWMON
|
||||
help
|
||||
Say Y here if you have a touchscreen interface using the
|
||||
ADS7846/TSC2046/AD7873 or ADS7843/AD7843 controller,
|
||||
and your board-specific setup code includes that in its
|
||||
table of SPI devices.
|
||||
|
||||
If HWMON is selected, and the driver is told the reference voltage
|
||||
on your board, you will also get hwmon interfaces for the voltage
|
||||
(and on ads7846/tsc2046/ad7873, temperature) sensors of this chip.
|
||||
|
||||
If unsure, say N (but it's safe to say "Y").
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called ads7846.
|
||||
|
||||
config TOUCHSCREEN_AD7877
|
||||
tristate "AD7877 based touchscreens"
|
||||
depends on SPI_MASTER
|
||||
help
|
||||
Say Y here if you have a touchscreen interface using the
|
||||
AD7877 controller, and your board-specific initialization
|
||||
code includes that in its table of SPI devices.
|
||||
|
||||
If unsure, say N (but it's safe to say "Y").
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called ad7877.
|
||||
|
||||
config TOUCHSCREEN_AD7879
|
||||
tristate "Analog Devices AD7879-1/AD7889-1 touchscreen interface"
|
||||
help
|
||||
Say Y here if you want to support a touchscreen interface using
|
||||
the AD7879-1/AD7889-1 controller.
|
||||
|
||||
You should select a bus connection too.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called ad7879.
|
||||
|
||||
config TOUCHSCREEN_AD7879_I2C
|
||||
tristate "support I2C bus connection"
|
||||
depends on TOUCHSCREEN_AD7879 && I2C
|
||||
help
|
||||
Say Y here if you have AD7879-1/AD7889-1 hooked to an I2C bus.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called ad7879-i2c.
|
||||
|
||||
config TOUCHSCREEN_AD7879_SPI
|
||||
tristate "support SPI bus connection"
|
||||
depends on TOUCHSCREEN_AD7879 && SPI_MASTER
|
||||
help
|
||||
Say Y here if you have AD7879-1/AD7889-1 hooked to a SPI bus.
|
||||
|
||||
If unsure, say N (but it's safe to say "Y").
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called ad7879-spi.
|
||||
|
||||
config TOUCHSCREEN_BITSY
|
||||
tristate "Compaq iPAQ H3600 (Bitsy) touchscreen"
|
||||
depends on SA1100_BITSY
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have the h3600 (Bitsy) touchscreen.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called h3600_ts_input.
|
||||
|
||||
config TOUCHSCREEN_BU21013
|
||||
tristate "BU21013 based touch panel controllers"
|
||||
depends on I2C
|
||||
help
|
||||
Say Y here if you have a bu21013 touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called bu21013_ts.
|
||||
|
||||
config TOUCHSCREEN_CY8CTMG110
|
||||
tristate "cy8ctmg110 touchscreen"
|
||||
depends on I2C
|
||||
depends on GPIOLIB
|
||||
|
||||
help
|
||||
Say Y here if you have a cy8ctmg110 capacitive touchscreen on
|
||||
an AAVA device.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called cy8ctmg110_ts.
|
||||
|
||||
config TOUCHSCREEN_DA9034
|
||||
tristate "Touchscreen support for Dialog Semiconductor DA9034"
|
||||
depends on PMIC_DA903X
|
||||
default y
|
||||
help
|
||||
Say Y here to enable the support for the touchscreen found
|
||||
on Dialog Semiconductor DA9034 PMIC.
|
||||
|
||||
config TOUCHSCREEN_DYNAPRO
|
||||
tristate "Dynapro serial touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have a Dynapro serial touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called dynapro.
|
||||
|
||||
config TOUCHSCREEN_HAMPSHIRE
|
||||
tristate "Hampshire serial touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have a Hampshire serial touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called hampshire.
|
||||
|
||||
config TOUCHSCREEN_EETI
|
||||
tristate "EETI touchscreen panel support"
|
||||
depends on I2C
|
||||
help
|
||||
Say Y here to enable support for I2C connected EETI touch panels.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called eeti_ts.
|
||||
|
||||
config TOUCHSCREEN_FUJITSU
|
||||
tristate "Fujitsu serial touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have the Fujitsu touchscreen (such as one
|
||||
installed in Lifebook P series laptop) connected to your
|
||||
system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called fujitsu-ts.
|
||||
|
||||
config TOUCHSCREEN_S3C2410
|
||||
tristate "Samsung S3C2410/generic touchscreen input driver"
|
||||
depends on ARCH_S3C2410 || SAMSUNG_DEV_TS
|
||||
select S3C_ADC
|
||||
help
|
||||
Say Y here if you have the s3c2410 touchscreen.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called s3c2410_ts.
|
||||
|
||||
config TOUCHSCREEN_GUNZE
|
||||
tristate "Gunze AHL-51S touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have the Gunze AHL-51 touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called gunze.
|
||||
|
||||
config TOUCHSCREEN_ELO
|
||||
tristate "Elo serial touchscreens"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have an Elo serial touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called elo.
|
||||
|
||||
config TOUCHSCREEN_WACOM_W8001
|
||||
tristate "Wacom W8001 penabled serial touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have an Wacom W8001 penabled serial touchscreen
|
||||
connected to your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called wacom_w8001.
|
||||
|
||||
config TOUCHSCREEN_LPC32XX
|
||||
tristate "LPC32XX touchscreen controller"
|
||||
depends on ARCH_LPC32XX
|
||||
help
|
||||
Say Y here if you have a LPC32XX device and want
|
||||
to support the built-in touchscreen.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called lpc32xx_ts.
|
||||
|
||||
config TOUCHSCREEN_MCS5000
|
||||
tristate "MELFAS MCS-5000 touchscreen"
|
||||
depends on I2C
|
||||
help
|
||||
Say Y here if you have the MELFAS MCS-5000 touchscreen controller
|
||||
chip in your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called mcs5000_ts.
|
||||
|
||||
config TOUCHSCREEN_MTOUCH
|
||||
tristate "MicroTouch serial touchscreens"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have a MicroTouch (3M) serial touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called mtouch.
|
||||
|
||||
config TOUCHSCREEN_INEXIO
|
||||
tristate "iNexio serial touchscreens"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have an iNexio serial touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called inexio.
|
||||
|
||||
config TOUCHSCREEN_INTEL_MID
|
||||
tristate "Intel MID platform resistive touchscreen"
|
||||
depends on INTEL_SCU_IPC
|
||||
help
|
||||
Say Y here if you have a Intel MID based touchscreen in
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called intel_mid_touch.
|
||||
|
||||
config TOUCHSCREEN_MK712
|
||||
tristate "ICS MicroClock MK712 touchscreen"
|
||||
help
|
||||
Say Y here if you have the ICS MicroClock MK712 touchscreen
|
||||
controller chip in your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called mk712.
|
||||
|
||||
config TOUCHSCREEN_HP600
|
||||
tristate "HP Jornada 6xx touchscreen"
|
||||
depends on SH_HP6XX && SH_ADC
|
||||
help
|
||||
Say Y here if you have a HP Jornada 620/660/680/690 and want to
|
||||
support the built-in touchscreen.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called hp680_ts_input.
|
||||
|
||||
config TOUCHSCREEN_HP7XX
|
||||
tristate "HP Jornada 7xx touchscreen"
|
||||
depends on SA1100_JORNADA720_SSP
|
||||
help
|
||||
Say Y here if you have a HP Jornada 710/720/728 and want
|
||||
to support the built-in touchscreen.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called jornada720_ts.
|
||||
|
||||
config TOUCHSCREEN_HTCPEN
|
||||
tristate "HTC Shift X9500 touchscreen"
|
||||
depends on ISA
|
||||
help
|
||||
Say Y here if you have an HTC Shift UMPC also known as HTC X9500
|
||||
Clio / Shangrila and want to support the built-in touchscreen.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called htcpen.
|
||||
|
||||
config TOUCHSCREEN_PENMOUNT
|
||||
tristate "Penmount serial touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have a Penmount serial touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called penmount.
|
||||
|
||||
config TOUCHSCREEN_QT602240
|
||||
tristate "QT602240 I2C Touchscreen"
|
||||
depends on I2C
|
||||
help
|
||||
Say Y here if you have the AT42QT602240/ATMXT224 I2C touchscreen
|
||||
connected to your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called qt602240_ts.
|
||||
|
||||
config TOUCHSCREEN_MIGOR
|
||||
tristate "Renesas MIGO-R touchscreen"
|
||||
depends on SH_MIGOR && I2C
|
||||
help
|
||||
Say Y here to enable MIGO-R touchscreen support.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called migor_ts.
|
||||
|
||||
config TOUCHSCREEN_TNETV107X
|
||||
tristate "TI TNETV107X touchscreen support"
|
||||
depends on ARCH_DAVINCI_TNETV107X
|
||||
help
|
||||
Say Y here if you want to use the TNETV107X touchscreen.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called tnetv107x-ts.
|
||||
|
||||
config TOUCHSCREEN_SYNAPTICS_I2C_RMI4
|
||||
tristate "Synaptics DSX I2C touchscreen"
|
||||
depends on I2C
|
||||
help
|
||||
Say Y here if you have a Synaptics DSX I2C touchscreen
|
||||
connected to your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called synaptics_i2c_rmi4.
|
||||
|
||||
config TOUCHSCREEN_SYNAPTICS_DSX_RMI4_DEV
|
||||
tristate "Synaptics I2C touchscreen rmi device"
|
||||
depends on TOUCHSCREEN_SYNAPTICS_I2C_RMI4
|
||||
help
|
||||
This enables support for character device channel for Synaptics RMI
|
||||
touchscreens.
|
||||
|
||||
config TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE
|
||||
tristate "Synaptics I2C touchscreen firmware update"
|
||||
depends on TOUCHSCREEN_SYNAPTICS_I2C_RMI4
|
||||
help
|
||||
This enables support for firmware update for Synaptics RMI
|
||||
touchscreens.
|
||||
|
||||
config TOUCHSCREEN_TOUCHRIGHT
|
||||
tristate "Touchright serial touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have a Touchright serial touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called touchright.
|
||||
|
||||
config TOUCHSCREEN_TOUCHWIN
|
||||
tristate "Touchwin serial touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have a Touchwin serial touchscreen connected to
|
||||
your system.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called touchwin.
|
||||
|
||||
config TOUCHSCREEN_ATMEL_TSADCC
|
||||
tristate "Atmel Touchscreen Interface"
|
||||
depends on ARCH_AT91SAM9RL || ARCH_AT91SAM9G45
|
||||
help
|
||||
Say Y here if you have a 4-wire touchscreen connected to the
|
||||
ADC Controller on your Atmel SoC (such as the AT91SAM9RL).
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called atmel_tsadcc.
|
||||
|
||||
config TOUCHSCREEN_UCB1400
|
||||
tristate "Philips UCB1400 touchscreen"
|
||||
depends on AC97_BUS
|
||||
depends on UCB1400_CORE
|
||||
help
|
||||
This enables support for the Philips UCB1400 touchscreen interface.
|
||||
The UCB1400 is an AC97 audio codec. The touchscreen interface
|
||||
will be initialized only after the ALSA subsystem has been
|
||||
brought up and the UCB1400 detected. You therefore have to
|
||||
configure ALSA support as well (either built-in or modular,
|
||||
independently of whether this driver is itself built-in or
|
||||
modular) for this driver to work.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called ucb1400_ts.
|
||||
|
||||
config TOUCHSCREEN_WM97XX
|
||||
tristate "Support for WM97xx AC97 touchscreen controllers"
|
||||
depends on AC97_BUS
|
||||
help
|
||||
Say Y here if you have a Wolfson Microelectronics WM97xx
|
||||
touchscreen connected to your system. Note that this option
|
||||
only enables core driver, you will also need to select
|
||||
support for appropriate chip below.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called wm97xx-ts.
|
||||
|
||||
config TOUCHSCREEN_WM9705
|
||||
bool "WM9705 Touchscreen interface support"
|
||||
depends on TOUCHSCREEN_WM97XX
|
||||
default y
|
||||
help
|
||||
Say Y here to enable support for the Wolfson Microelectronics
|
||||
WM9705 touchscreen controller.
|
||||
|
||||
config TOUCHSCREEN_WM9712
|
||||
bool "WM9712 Touchscreen interface support"
|
||||
depends on TOUCHSCREEN_WM97XX
|
||||
default y
|
||||
help
|
||||
Say Y here to enable support for the Wolfson Microelectronics
|
||||
WM9712 touchscreen controller.
|
||||
|
||||
config TOUCHSCREEN_WM9713
|
||||
bool "WM9713 Touchscreen interface support"
|
||||
depends on TOUCHSCREEN_WM97XX
|
||||
default y
|
||||
help
|
||||
Say Y here to enable support for the Wolfson Microelectronics
|
||||
WM9713 touchscreen controller.
|
||||
|
||||
config TOUCHSCREEN_WM97XX_ATMEL
|
||||
tristate "WM97xx Atmel accelerated touch"
|
||||
depends on TOUCHSCREEN_WM97XX && (AVR32 || ARCH_AT91)
|
||||
help
|
||||
Say Y here for support for streaming mode with WM97xx touchscreens
|
||||
on Atmel AT91 or AVR32 systems with an AC97C module.
|
||||
|
||||
Be aware that this will use channel B in the controller for
|
||||
streaming data, this must not conflict with other AC97C drivers.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the module will
|
||||
be called atmel-wm97xx.
|
||||
|
||||
config TOUCHSCREEN_WM97XX_MAINSTONE
|
||||
tristate "WM97xx Mainstone/Palm accelerated touch"
|
||||
depends on TOUCHSCREEN_WM97XX && ARCH_PXA
|
||||
help
|
||||
Say Y here for support for streaming mode with WM97xx touchscreens
|
||||
on Mainstone, Palm Tungsten T5, TX and LifeDrive systems.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called mainstone-wm97xx.
|
||||
|
||||
config TOUCHSCREEN_WM97XX_ZYLONITE
|
||||
tristate "Zylonite accelerated touch"
|
||||
depends on TOUCHSCREEN_WM97XX && MACH_ZYLONITE
|
||||
select TOUCHSCREEN_WM9713
|
||||
help
|
||||
Say Y here for support for streaming mode with the touchscreen
|
||||
on Zylonite systems.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called zylonite-wm97xx.
|
||||
|
||||
config TOUCHSCREEN_USB_COMPOSITE
|
||||
tristate "USB Touchscreen Driver"
|
||||
depends on USB_ARCH_HAS_HCD
|
||||
select USB
|
||||
help
|
||||
USB Touchscreen driver for:
|
||||
- eGalax Touchkit USB (also includes eTurboTouch CT-410/510/700)
|
||||
- PanJit TouchSet USB
|
||||
- 3M MicroTouch USB (EX II series)
|
||||
- ITM
|
||||
- some other eTurboTouch
|
||||
- Gunze AHL61
|
||||
- DMC TSC-10/25
|
||||
- IRTOUCHSYSTEMS/UNITOP
|
||||
- IdealTEK URTC1000
|
||||
- GoTop Super_Q2/GogoPen/PenPower tablets
|
||||
- JASTEC USB Touch Controller/DigiTech DTR-02U
|
||||
- Zytronic controllers
|
||||
|
||||
Have a look at <http://linux.chapter7.ch/touchkit/> for
|
||||
a usage description and the required user-space stuff.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called usbtouchscreen.
|
||||
|
||||
config TOUCHSCREEN_MC13783
|
||||
tristate "Freescale MC13783 touchscreen input driver"
|
||||
depends on MFD_MC13783
|
||||
help
|
||||
Say Y here if you have an Freescale MC13783 PMIC on your
|
||||
board and want to use its touchscreen
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called mc13783_ts.
|
||||
|
||||
config TOUCHSCREEN_USB_EGALAX
|
||||
default y
|
||||
bool "eGalax, eTurboTouch CT-410/510/700 device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_PANJIT
|
||||
default y
|
||||
bool "PanJit device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_3M
|
||||
default y
|
||||
bool "3M/Microtouch EX II series device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_ITM
|
||||
default y
|
||||
bool "ITM device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_ETURBO
|
||||
default y
|
||||
bool "eTurboTouch (non-eGalax compatible) device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_GUNZE
|
||||
default y
|
||||
bool "Gunze AHL61 device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_DMC_TSC10
|
||||
default y
|
||||
bool "DMC TSC-10/25 device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_IRTOUCH
|
||||
default y
|
||||
bool "IRTOUCHSYSTEMS/UNITOP device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_IDEALTEK
|
||||
default y
|
||||
bool "IdealTEK URTC1000 device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_GENERAL_TOUCH
|
||||
default y
|
||||
bool "GeneralTouch Touchscreen device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_GOTOP
|
||||
default y
|
||||
bool "GoTop Super_Q2/GogoPen/PenPower tablet device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_JASTEC
|
||||
default y
|
||||
bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_E2I
|
||||
default y
|
||||
bool "e2i Touchscreen controller (e.g. from Mimo 740)"
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_ZYTRONIC
|
||||
default y
|
||||
bool "Zytronic controller" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_ETT_TC45USB
|
||||
default y
|
||||
bool "ET&T USB series TC4UM/TC5UH touchscreen controler support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_USB_NEXIO
|
||||
default y
|
||||
bool "NEXIO/iNexio device support" if EMBEDDED
|
||||
depends on TOUCHSCREEN_USB_COMPOSITE
|
||||
|
||||
config TOUCHSCREEN_TOUCHIT213
|
||||
tristate "Sahara TouchIT-213 touchscreen"
|
||||
select SERIO
|
||||
help
|
||||
Say Y here if you have a Sahara TouchIT-213 Tablet PC.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called touchit213.
|
||||
|
||||
config TOUCHSCREEN_TSC2007
|
||||
tristate "TSC2007 based touchscreens"
|
||||
depends on I2C
|
||||
help
|
||||
Say Y here if you have a TSC2007 based touchscreen.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called tsc2007.
|
||||
|
||||
config TOUCHSCREEN_TSC2004
|
||||
tristate "TSC2004 based touchscreens"
|
||||
depends on I2C
|
||||
help
|
||||
Say Y here if you have a TSC2004 based touchscreen.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called tsc2004.
|
||||
|
||||
config TOUCHSCREEN_W90X900
|
||||
tristate "W90P910 touchscreen driver"
|
||||
depends on HAVE_CLK
|
||||
help
|
||||
Say Y here if you have a W90P910 based touchscreen.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called w90p910_ts.
|
||||
|
||||
config TOUCHSCREEN_PCAP
|
||||
tristate "Motorola PCAP touchscreen"
|
||||
depends on EZX_PCAP
|
||||
help
|
||||
Say Y here if you have a Motorola EZX telephone and
|
||||
want to enable support for the built-in touchscreen.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called pcap_ts.
|
||||
|
||||
config TOUCHSCREEN_TPS6507X
|
||||
tristate "TPS6507x based touchscreens"
|
||||
depends on I2C
|
||||
help
|
||||
Say Y here if you have a TPS6507x based touchscreen
|
||||
controller.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called tps6507x_ts.
|
||||
|
||||
config TOUCHSCREEN_STMPE
|
||||
tristate "STMicroelectronics STMPE touchscreens"
|
||||
depends on MFD_STMPE
|
||||
help
|
||||
Say Y here if you want support for STMicroelectronics
|
||||
STMPE touchscreen controllers.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called stmpe-ts.
|
||||
|
||||
endif
|
68
kernel/drivers/input/touchscreen/Makefile
Normal file
68
kernel/drivers/input/touchscreen/Makefile
Normal file
|
@ -0,0 +1,68 @@
|
|||
#
|
||||
# Makefile for the touchscreen drivers.
|
||||
#
|
||||
|
||||
# Each configuration option enables a list of files.
|
||||
|
||||
wm97xx-ts-y := wm97xx-core.o
|
||||
|
||||
obj-$(CONFIG_TOUCHSCREEN_88PM860X) += 88pm860x-ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_AD7877) += ad7877.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_AD7879) += ad7879.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_AD7879_I2C) += ad7879-i2c.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI) += ad7879-spi.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_DA9034) += da9034-ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_DYNAPRO) += dynapro.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_HAMPSHIRE) += hampshire.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_EETI) += eeti_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_INTEL_MID) += intel-mid-touch.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_MIGOR) += migor_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_MTOUCH) += mtouch.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_MK712) += mk712.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_HP600) += hp680_ts_input.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_HP7XX) += jornada720_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_HTCPEN) += htcpen.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_USB_COMPOSITE) += usbtouchscreen.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_PCAP) += pcap_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_PENMOUNT) += penmount.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_QT602240) += qt602240_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_TNETV107X) += tnetv107x-ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += synaptics_i2c_rmi4.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_RMI4_DEV) += synaptics_rmi_dev.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE) += synaptics_fw_update.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_TSC2007) += tsc2007.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_TSC2004) += tsc2004.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_WACOM_W8001) += wacom_w8001.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_WM97XX) += wm97xx-ts.o
|
||||
wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o
|
||||
wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o
|
||||
wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_WM97XX_ATMEL) += atmel-wm97xx.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
|
||||
|
||||
all:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
1587
kernel/drivers/input/touchscreen/synaptics_fw_update.c
Normal file
1587
kernel/drivers/input/touchscreen/synaptics_fw_update.c
Normal file
File diff suppressed because it is too large
Load diff
2110
kernel/drivers/input/touchscreen/synaptics_i2c_rmi4.c
Normal file
2110
kernel/drivers/input/touchscreen/synaptics_i2c_rmi4.c
Normal file
File diff suppressed because it is too large
Load diff
282
kernel/drivers/input/touchscreen/synaptics_i2c_rmi4.h
Normal file
282
kernel/drivers/input/touchscreen/synaptics_i2c_rmi4.h
Normal file
|
@ -0,0 +1,282 @@
|
|||
/*
|
||||
* Synaptics RMI4 touchscreen driver
|
||||
*
|
||||
* Copyright (C) 2012 Synaptics Incorporated
|
||||
*
|
||||
* Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
|
||||
* Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _SYNAPTICS_DSX_RMI4_H_
|
||||
#define _SYNAPTICS_DSX_RMI4_H_
|
||||
|
||||
#define SYNAPTICS_RMI4_DRIVER_VERSION "DSX 1.0"
|
||||
|
||||
#include <linux/version.h>
|
||||
#ifdef CONFIG_HAS_EARLYSUSPEND
|
||||
#include <linux/earlysuspend.h>
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38))
|
||||
#define KERNEL_ABOVE_2_6_38
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL_ABOVE_2_6_38
|
||||
#define sstrtoul(...) kstrtoul(__VA_ARGS__)
|
||||
#else
|
||||
#define sstrtoul(...) strict_strtoul(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 7, 0))
|
||||
#define KERNEL_ABOVE_3_7
|
||||
#endif
|
||||
|
||||
#define PDT_PROPS (0x00EF)
|
||||
#define PDT_START (0x00E9)
|
||||
#define PDT_END (0x000A)
|
||||
#define PDT_ENTRY_SIZE (0x0006)
|
||||
#define PAGES_TO_SERVICE (10)
|
||||
#define PAGE_SELECT_LEN (2)
|
||||
|
||||
#define SYNAPTICS_RMI4_F01 (0x01)
|
||||
#define SYNAPTICS_RMI4_F11 (0x11)
|
||||
#define SYNAPTICS_RMI4_F1A (0x1a)
|
||||
#define SYNAPTICS_RMI4_F34 (0x34)
|
||||
#define SYNAPTICS_RMI4_F54 (0x54)
|
||||
#define SYNAPTICS_RMI4_F55 (0x55)
|
||||
|
||||
#define SYNAPTICS_RMI4_PRODUCT_INFO_SIZE 2
|
||||
#define SYNAPTICS_RMI4_DATE_CODE_SIZE 3
|
||||
#define SYNAPTICS_RMI4_PRODUCT_ID_SIZE 10
|
||||
#define SYNAPTICS_RMI4_BUILD_ID_SIZE 3
|
||||
|
||||
#define MAX_NUMBER_OF_FINGERS 10
|
||||
#define MAX_NUMBER_OF_BUTTONS 4
|
||||
#define MAX_INTR_REGISTERS 4
|
||||
|
||||
#define MASK_16BIT 0xFFFF
|
||||
#define MASK_8BIT 0xFF
|
||||
#define MASK_7BIT 0x7F
|
||||
#define MASK_6BIT 0x3F
|
||||
#define MASK_5BIT 0x1F
|
||||
#define MASK_4BIT 0x0F
|
||||
#define MASK_3BIT 0x07
|
||||
#define MASK_2BIT 0x03
|
||||
#define MASK_1BIT 0x01
|
||||
|
||||
/*
|
||||
* struct synaptics_rmi4_fn_desc - function descriptor fields in PDT
|
||||
* @query_base_addr: base address for query registers
|
||||
* @cmd_base_addr: base address for command registers
|
||||
* @ctrl_base_addr: base address for control registers
|
||||
* @data_base_addr: base address for data registers
|
||||
* @intr_src_count: number of interrupt sources
|
||||
* @fn_number: function number
|
||||
*/
|
||||
struct synaptics_rmi4_fn_desc {
|
||||
unsigned char query_base_addr;
|
||||
unsigned char cmd_base_addr;
|
||||
unsigned char ctrl_base_addr;
|
||||
unsigned char data_base_addr;
|
||||
unsigned char intr_src_count;
|
||||
unsigned char fn_number;
|
||||
};
|
||||
|
||||
/*
|
||||
* synaptics_rmi4_fn_full_addr - full 16-bit base addresses
|
||||
* @query_base: 16-bit base address for query registers
|
||||
* @cmd_base: 16-bit base address for data registers
|
||||
* @ctrl_base: 16-bit base address for command registers
|
||||
* @data_base: 16-bit base address for control registers
|
||||
*/
|
||||
struct synaptics_rmi4_fn_full_addr {
|
||||
unsigned short query_base;
|
||||
unsigned short cmd_base;
|
||||
unsigned short ctrl_base;
|
||||
unsigned short data_base;
|
||||
};
|
||||
|
||||
/*
|
||||
* struct synaptics_rmi4_fn - function handler data structure
|
||||
* @fn_number: function number
|
||||
* @num_of_data_sources: number of data sources
|
||||
* @num_of_data_points: maximum number of fingers supported
|
||||
* @size_of_data_register_block: data register block size
|
||||
* @data1_offset: offset to data1 register from data base address
|
||||
* @intr_reg_num: index to associated interrupt register
|
||||
* @intr_mask: interrupt mask
|
||||
* @full_addr: full 16-bit base addresses of function registers
|
||||
* @link: linked list for function handlers
|
||||
* @data_size: size of private data
|
||||
* @data: pointer to private data
|
||||
*/
|
||||
struct synaptics_rmi4_fn {
|
||||
unsigned char fn_number;
|
||||
unsigned char num_of_data_sources;
|
||||
unsigned char num_of_data_points;
|
||||
unsigned char size_of_data_register_block;
|
||||
unsigned char data1_offset;
|
||||
unsigned char intr_reg_num;
|
||||
unsigned char intr_mask;
|
||||
struct synaptics_rmi4_fn_full_addr full_addr;
|
||||
struct list_head link;
|
||||
int data_size;
|
||||
void *data;
|
||||
};
|
||||
|
||||
/*
|
||||
* struct synaptics_rmi4_device_info - device information
|
||||
* @version_major: rmi protocol major version number
|
||||
* @version_minor: rmi protocol minor version number
|
||||
* @manufacturer_id: manufacturer id
|
||||
* @product_props: product properties information
|
||||
* @product_info: product info array
|
||||
* @date_code: device manufacture date
|
||||
* @tester_id: tester id array
|
||||
* @serial_number: device serial number
|
||||
* @product_id_string: device product id
|
||||
* @support_fn_list: linked list for function handlers
|
||||
*/
|
||||
struct synaptics_rmi4_device_info {
|
||||
unsigned int version_major;
|
||||
unsigned int version_minor;
|
||||
unsigned char manufacturer_id;
|
||||
unsigned char product_props;
|
||||
unsigned char product_info[SYNAPTICS_RMI4_PRODUCT_INFO_SIZE];
|
||||
unsigned char date_code[SYNAPTICS_RMI4_DATE_CODE_SIZE];
|
||||
unsigned short tester_id;
|
||||
unsigned short serial_number;
|
||||
unsigned char product_id_string[SYNAPTICS_RMI4_PRODUCT_ID_SIZE + 1];
|
||||
unsigned char build_id[SYNAPTICS_RMI4_BUILD_ID_SIZE];
|
||||
struct list_head support_fn_list;
|
||||
};
|
||||
|
||||
/*
|
||||
* struct synaptics_rmi4_data - rmi4 device instance data
|
||||
* @i2c_client: pointer to associated i2c client
|
||||
* @input_dev: pointer to associated input device
|
||||
* @board: constant pointer to platform data
|
||||
* @rmi4_mod_info: device information
|
||||
* @regulator: pointer to associated regulator
|
||||
* @rmi4_io_ctrl_mutex: mutex for i2c i/o control
|
||||
* @det_work: work thread instance for expansion function detection
|
||||
* @det_workqueue: pointer to work queue for work thread instance
|
||||
* @early_suspend: instance to support early suspend power management
|
||||
* @current_page: current page in sensor to acess
|
||||
* @button_0d_enabled: flag for 0d button support
|
||||
* @full_pm_cycle: flag for full power management cycle in early suspend stage
|
||||
* @num_of_intr_regs: number of interrupt registers
|
||||
* @f01_query_base_addr: query base address for f01
|
||||
* @f01_cmd_base_addr: command base address for f01
|
||||
* @f01_ctrl_base_addr: control base address for f01
|
||||
* @f01_data_base_addr: data base address for f01
|
||||
* @irq: attention interrupt
|
||||
* @sensor_max_x: sensor maximum x value
|
||||
* @sensor_max_y: sensor maximum y value
|
||||
* @irq_enabled: flag for indicating interrupt enable status
|
||||
* @touch_stopped: flag to stop interrupt thread processing
|
||||
* @fingers_on_2d: flag to indicate presence of fingers in 2d area
|
||||
* @sensor_sleep: flag to indicate sleep state of sensor
|
||||
* @wait: wait queue for touch data polling in interrupt thread
|
||||
* @i2c_read: pointer to i2c read function
|
||||
* @i2c_write: pointer to i2c write function
|
||||
* @irq_enable: pointer to irq enable function
|
||||
*/
|
||||
struct synaptics_rmi4_data {
|
||||
struct i2c_client *i2c_client;
|
||||
struct input_dev *input_dev;
|
||||
const struct synaptics_rmi4_platform_data *board;
|
||||
struct synaptics_rmi4_device_info rmi4_mod_info;
|
||||
struct regulator *regulator;
|
||||
struct mutex rmi4_io_ctrl_mutex;
|
||||
struct delayed_work det_work;
|
||||
struct workqueue_struct *det_workqueue;
|
||||
struct early_suspend early_suspend;
|
||||
unsigned char current_page;
|
||||
unsigned char button_0d_enabled;
|
||||
unsigned char full_pm_cycle;
|
||||
unsigned char num_of_rx;
|
||||
unsigned char num_of_tx;
|
||||
unsigned char num_of_fingers;
|
||||
unsigned char intr_mask[MAX_INTR_REGISTERS];
|
||||
unsigned short num_of_intr_regs;
|
||||
unsigned short f01_query_base_addr;
|
||||
unsigned short f01_cmd_base_addr;
|
||||
unsigned short f01_ctrl_base_addr;
|
||||
unsigned short f01_data_base_addr;
|
||||
int irq;
|
||||
int sensor_max_x;
|
||||
int sensor_max_y;
|
||||
bool irq_enabled;
|
||||
bool touch_stopped;
|
||||
bool fingers_on_2d;
|
||||
bool sensor_sleep;
|
||||
wait_queue_head_t wait;
|
||||
int (*i2c_read)(struct synaptics_rmi4_data *pdata, unsigned short addr,
|
||||
unsigned char *data, unsigned short length);
|
||||
int (*i2c_write)(struct synaptics_rmi4_data *pdata, unsigned short addr,
|
||||
unsigned char *data, unsigned short length);
|
||||
int (*irq_enable)(struct synaptics_rmi4_data *rmi4_data, bool enable);
|
||||
int (*reset_device)(struct synaptics_rmi4_data *rmi4_data);
|
||||
};
|
||||
|
||||
enum exp_fn {
|
||||
RMI_DEV = 0,
|
||||
RMI_F34,
|
||||
RMI_F54,
|
||||
RMI_FW_UPDATER,
|
||||
RMI_LAST,
|
||||
};
|
||||
|
||||
struct synaptics_rmi4_exp_fn_ptr {
|
||||
int (*read)(struct synaptics_rmi4_data *rmi4_data, unsigned short addr,
|
||||
unsigned char *data, unsigned short length);
|
||||
int (*write)(struct synaptics_rmi4_data *rmi4_data, unsigned short addr,
|
||||
unsigned char *data, unsigned short length);
|
||||
int (*enable)(struct synaptics_rmi4_data *rmi4_data, bool enable);
|
||||
};
|
||||
|
||||
void synaptics_rmi4_new_function(enum exp_fn fn_type, bool insert,
|
||||
int (*func_init)(struct synaptics_rmi4_data *rmi4_data),
|
||||
void (*func_remove)(struct synaptics_rmi4_data *rmi4_data),
|
||||
void (*func_attn)(struct synaptics_rmi4_data *rmi4_data,
|
||||
unsigned char intr_mask));
|
||||
|
||||
static inline ssize_t synaptics_rmi4_show_error(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
dev_warn(dev, "%s Attempted to read from write-only attribute %s\n",
|
||||
__func__, attr->attr.name);
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
static inline ssize_t synaptics_rmi4_store_error(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
dev_warn(dev, "%s Attempted to write to read-only attribute %s\n",
|
||||
__func__, attr->attr.name);
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
static inline void batohs(unsigned short *dest, unsigned char *src)
|
||||
{
|
||||
*dest = src[1] * 0x100 + src[0];
|
||||
}
|
||||
|
||||
static inline void hstoba(unsigned char *dest, unsigned short src)
|
||||
{
|
||||
dest[0] = src % 0x100;
|
||||
dest[1] = src / 0x100;
|
||||
}
|
||||
|
||||
#endif
|
710
kernel/drivers/input/touchscreen/synaptics_rmi_dev.c
Normal file
710
kernel/drivers/input/touchscreen/synaptics_rmi_dev.c
Normal file
|
@ -0,0 +1,710 @@
|
|||
/*
|
||||
* Synaptics RMI4 touchscreen driver
|
||||
*
|
||||
* Copyright (C) 2012 Synaptics Incorporated
|
||||
*
|
||||
* Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
|
||||
* Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/input/synaptics_dsx.h>
|
||||
#include "synaptics_i2c_rmi4.h"
|
||||
|
||||
#define CHAR_DEVICE_NAME "rmi"
|
||||
#define DEVICE_CLASS_NAME "rmidev"
|
||||
#define DEV_NUMBER 1
|
||||
#define REG_ADDR_LIMIT 0xFFFF
|
||||
|
||||
static ssize_t rmidev_sysfs_open_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count);
|
||||
|
||||
static ssize_t rmidev_sysfs_release_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count);
|
||||
|
||||
static ssize_t rmidev_sysfs_address_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count);
|
||||
|
||||
static ssize_t rmidev_sysfs_length_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count);
|
||||
|
||||
static ssize_t rmidev_sysfs_data_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
|
||||
static ssize_t rmidev_sysfs_data_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count);
|
||||
|
||||
struct rmidev_handle {
|
||||
dev_t dev_no;
|
||||
unsigned short address;
|
||||
unsigned int length;
|
||||
struct device dev;
|
||||
struct synaptics_rmi4_data *rmi4_data;
|
||||
struct synaptics_rmi4_exp_fn_ptr *fn_ptr;
|
||||
struct kobject *sysfs_dir;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct rmidev_data {
|
||||
int ref_count;
|
||||
struct cdev main_dev;
|
||||
struct class *device_class;
|
||||
struct mutex file_mutex;
|
||||
struct rmidev_handle *rmi_dev;
|
||||
};
|
||||
|
||||
static struct device_attribute attrs[] = {
|
||||
__ATTR(open, S_IWUGO,
|
||||
synaptics_rmi4_show_error,
|
||||
rmidev_sysfs_open_store),
|
||||
__ATTR(release, S_IWUGO,
|
||||
synaptics_rmi4_show_error,
|
||||
rmidev_sysfs_release_store),
|
||||
__ATTR(address, S_IWUGO,
|
||||
synaptics_rmi4_show_error,
|
||||
rmidev_sysfs_address_store),
|
||||
__ATTR(length, S_IWUGO,
|
||||
synaptics_rmi4_show_error,
|
||||
rmidev_sysfs_length_store),
|
||||
__ATTR(data, (S_IRUGO | S_IWUGO),
|
||||
rmidev_sysfs_data_show,
|
||||
rmidev_sysfs_data_store),
|
||||
};
|
||||
|
||||
static int rmidev_major_num;
|
||||
|
||||
static struct class *rmidev_device_class;
|
||||
|
||||
static struct rmidev_handle *rmidev;
|
||||
|
||||
static struct completion remove_complete;
|
||||
|
||||
static ssize_t rmidev_sysfs_open_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
unsigned int input;
|
||||
|
||||
if (sscanf(buf, "%u", &input) != 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (input != 1)
|
||||
return -EINVAL;
|
||||
|
||||
rmidev->fn_ptr->enable(rmidev->rmi4_data, false);
|
||||
dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
|
||||
"%s: Attention interrupt disabled\n",
|
||||
__func__);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t rmidev_sysfs_release_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
unsigned int input;
|
||||
|
||||
if (sscanf(buf, "%u", &input) != 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (input != 1)
|
||||
return -EINVAL;
|
||||
|
||||
rmidev->fn_ptr->enable(rmidev->rmi4_data, true);
|
||||
dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
|
||||
"%s: Attention interrupt enabled\n",
|
||||
__func__);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t rmidev_sysfs_address_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
unsigned int input;
|
||||
|
||||
if (sscanf(buf, "%u", &input) != 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (input > REG_ADDR_LIMIT)
|
||||
return -EINVAL;
|
||||
|
||||
rmidev->address = (unsigned short)input;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t rmidev_sysfs_length_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
unsigned int input;
|
||||
|
||||
if (sscanf(buf, "%u", &input) != 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (input > REG_ADDR_LIMIT)
|
||||
return -EINVAL;
|
||||
|
||||
rmidev->length = input;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t rmidev_sysfs_data_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
int retval;
|
||||
unsigned int data_length = rmidev->length;
|
||||
|
||||
if (data_length > (REG_ADDR_LIMIT - rmidev->address))
|
||||
data_length = REG_ADDR_LIMIT - rmidev->address;
|
||||
|
||||
if (data_length) {
|
||||
retval = rmidev->fn_ptr->read(rmidev->rmi4_data,
|
||||
rmidev->address,
|
||||
(unsigned char *)buf,
|
||||
data_length);
|
||||
if (retval < 0) {
|
||||
dev_err(&rmidev->rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to read data\n",
|
||||
__func__);
|
||||
return retval;
|
||||
}
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return data_length;
|
||||
}
|
||||
|
||||
static ssize_t rmidev_sysfs_data_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
int retval;
|
||||
unsigned int data_length = rmidev->length;
|
||||
|
||||
if (data_length > (REG_ADDR_LIMIT - rmidev->address))
|
||||
data_length = REG_ADDR_LIMIT - rmidev->address;
|
||||
|
||||
if (data_length) {
|
||||
retval = rmidev->fn_ptr->write(rmidev->rmi4_data,
|
||||
rmidev->address,
|
||||
(unsigned char *)buf,
|
||||
data_length);
|
||||
if (retval < 0) {
|
||||
dev_err(&rmidev->rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to write data\n",
|
||||
__func__);
|
||||
return retval;
|
||||
}
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return data_length;
|
||||
}
|
||||
|
||||
/*
|
||||
* rmidev_llseek - used to set up register address
|
||||
*
|
||||
* @filp: file structure for seek
|
||||
* @off: offset
|
||||
* if whence == SEEK_SET,
|
||||
* high 16 bits: page address
|
||||
* low 16 bits: register address
|
||||
* if whence == SEEK_CUR,
|
||||
* offset from current position
|
||||
* if whence == SEEK_END,
|
||||
* offset from end position (0xFFFF)
|
||||
* @whence: SEEK_SET, SEEK_CUR, or SEEK_END
|
||||
*/
|
||||
static loff_t rmidev_llseek(struct file *filp, loff_t off, int whence)
|
||||
{
|
||||
loff_t newpos;
|
||||
struct rmidev_data *dev_data = filp->private_data;
|
||||
|
||||
if (IS_ERR(dev_data)) {
|
||||
pr_err("%s: Pointer of char device data is invalid", __func__);
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
switch (whence) {
|
||||
case SEEK_SET:
|
||||
newpos = off;
|
||||
break;
|
||||
case SEEK_CUR:
|
||||
newpos = filp->f_pos + off;
|
||||
break;
|
||||
case SEEK_END:
|
||||
newpos = REG_ADDR_LIMIT + off;
|
||||
break;
|
||||
default:
|
||||
newpos = -EINVAL;
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
if (newpos < 0 || newpos > REG_ADDR_LIMIT) {
|
||||
dev_err(&rmidev->rmi4_data->i2c_client->dev,
|
||||
"%s: New position 0x%04x is invalid\n",
|
||||
__func__, (unsigned int)newpos);
|
||||
newpos = -EINVAL;
|
||||
goto clean_up;
|
||||
}
|
||||
|
||||
filp->f_pos = newpos;
|
||||
|
||||
clean_up:
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
|
||||
return newpos;
|
||||
}
|
||||
|
||||
/*
|
||||
* rmidev_read: - use to read data from rmi device
|
||||
*
|
||||
* @filp: file structure for read
|
||||
* @buf: user space buffer pointer
|
||||
* @count: number of bytes to read
|
||||
* @f_pos: offset (starting register address)
|
||||
*/
|
||||
static ssize_t rmidev_read(struct file *filp, char __user *buf,
|
||||
size_t count, loff_t *f_pos)
|
||||
{
|
||||
ssize_t retval;
|
||||
unsigned char tmpbuf[count + 1];
|
||||
struct rmidev_data *dev_data = filp->private_data;
|
||||
|
||||
if (IS_ERR(dev_data)) {
|
||||
pr_err("%s: Pointer of char device data is invalid", __func__);
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
return 0;
|
||||
|
||||
if (count > (REG_ADDR_LIMIT - *f_pos))
|
||||
count = REG_ADDR_LIMIT - *f_pos;
|
||||
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
retval = rmidev->fn_ptr->read(rmidev->rmi4_data,
|
||||
*f_pos,
|
||||
tmpbuf,
|
||||
count);
|
||||
if (retval < 0)
|
||||
goto clean_up;
|
||||
|
||||
if (copy_to_user(buf, tmpbuf, count))
|
||||
retval = -EFAULT;
|
||||
else
|
||||
*f_pos += retval;
|
||||
|
||||
clean_up:
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* rmidev_write: - used to write data to rmi device
|
||||
*
|
||||
* @filep: file structure for write
|
||||
* @buf: user space buffer pointer
|
||||
* @count: number of bytes to write
|
||||
* @f_pos: offset (starting register address)
|
||||
*/
|
||||
static ssize_t rmidev_write(struct file *filp, const char __user *buf,
|
||||
size_t count, loff_t *f_pos)
|
||||
{
|
||||
ssize_t retval;
|
||||
unsigned char tmpbuf[count + 1];
|
||||
struct rmidev_data *dev_data = filp->private_data;
|
||||
|
||||
if (IS_ERR(dev_data)) {
|
||||
pr_err("%s: Pointer of char device data is invalid", __func__);
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
return 0;
|
||||
|
||||
if (count > (REG_ADDR_LIMIT - *f_pos))
|
||||
count = REG_ADDR_LIMIT - *f_pos;
|
||||
|
||||
if (copy_from_user(tmpbuf, buf, count))
|
||||
return -EFAULT;
|
||||
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
retval = rmidev->fn_ptr->write(rmidev->rmi4_data,
|
||||
*f_pos,
|
||||
tmpbuf,
|
||||
count);
|
||||
if (retval >= 0)
|
||||
*f_pos += retval;
|
||||
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* rmidev_open: enable access to rmi device
|
||||
* @inp: inode struture
|
||||
* @filp: file structure
|
||||
*/
|
||||
static int rmidev_open(struct inode *inp, struct file *filp)
|
||||
{
|
||||
int retval = 0;
|
||||
struct rmidev_data *dev_data =
|
||||
container_of(inp->i_cdev, struct rmidev_data, main_dev);
|
||||
|
||||
if (!dev_data)
|
||||
return -EACCES;
|
||||
|
||||
filp->private_data = dev_data;
|
||||
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
rmidev->fn_ptr->enable(rmidev->rmi4_data, false);
|
||||
dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
|
||||
"%s: Attention interrupt disabled\n",
|
||||
__func__);
|
||||
|
||||
if (dev_data->ref_count < 1)
|
||||
dev_data->ref_count++;
|
||||
else
|
||||
retval = -EACCES;
|
||||
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* rmidev_release: - release access to rmi device
|
||||
* @inp: inode structure
|
||||
* @filp: file structure
|
||||
*/
|
||||
static int rmidev_release(struct inode *inp, struct file *filp)
|
||||
{
|
||||
struct rmidev_data *dev_data =
|
||||
container_of(inp->i_cdev, struct rmidev_data, main_dev);
|
||||
|
||||
if (!dev_data)
|
||||
return -EACCES;
|
||||
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
dev_data->ref_count--;
|
||||
if (dev_data->ref_count < 0)
|
||||
dev_data->ref_count = 0;
|
||||
|
||||
rmidev->fn_ptr->enable(rmidev->rmi4_data, true);
|
||||
dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
|
||||
"%s: Attention interrupt enabled\n",
|
||||
__func__);
|
||||
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct file_operations rmidev_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = rmidev_llseek,
|
||||
.read = rmidev_read,
|
||||
.write = rmidev_write,
|
||||
.open = rmidev_open,
|
||||
.release = rmidev_release,
|
||||
};
|
||||
|
||||
static void rmidev_device_cleanup(struct rmidev_data *dev_data)
|
||||
{
|
||||
dev_t devno;
|
||||
|
||||
if (dev_data) {
|
||||
devno = dev_data->main_dev.dev;
|
||||
|
||||
if (dev_data->device_class)
|
||||
device_destroy(dev_data->device_class, devno);
|
||||
|
||||
cdev_del(&dev_data->main_dev);
|
||||
|
||||
unregister_chrdev_region(devno, 1);
|
||||
|
||||
dev_dbg(&rmidev->rmi4_data->i2c_client->dev,
|
||||
"%s: rmidev device removed\n",
|
||||
__func__);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static char *rmi_char_devnode(struct device *dev, mode_t *mode)
|
||||
{
|
||||
if (!mode)
|
||||
return NULL;
|
||||
|
||||
*mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
||||
|
||||
return kasprintf(GFP_KERNEL, "rmi/%s", dev_name(dev));
|
||||
}
|
||||
|
||||
static int rmidev_create_device_class(void)
|
||||
{
|
||||
rmidev_device_class = class_create(THIS_MODULE, DEVICE_CLASS_NAME);
|
||||
|
||||
if (IS_ERR(rmidev_device_class)) {
|
||||
pr_err("%s: Failed to create /dev/%s\n",
|
||||
__func__, CHAR_DEVICE_NAME);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
rmidev_device_class->devnode = rmi_char_devnode;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rmidev_init_device(struct synaptics_rmi4_data *rmi4_data)
|
||||
{
|
||||
int retval;
|
||||
dev_t dev_no;
|
||||
unsigned char attr_count;
|
||||
struct rmidev_data *dev_data;
|
||||
struct device *device_ptr;
|
||||
|
||||
rmidev = kzalloc(sizeof(*rmidev), GFP_KERNEL);
|
||||
if (!rmidev) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to alloc mem for rmidev\n",
|
||||
__func__);
|
||||
retval = -ENOMEM;
|
||||
goto err_rmidev;
|
||||
}
|
||||
|
||||
rmidev->fn_ptr = kzalloc(sizeof(*(rmidev->fn_ptr)), GFP_KERNEL);
|
||||
if (!rmidev) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to alloc mem for fn_ptr\n",
|
||||
__func__);
|
||||
retval = -ENOMEM;
|
||||
goto err_fn_ptr;
|
||||
}
|
||||
|
||||
rmidev->fn_ptr->read = rmi4_data->i2c_read;
|
||||
rmidev->fn_ptr->write = rmi4_data->i2c_write;
|
||||
rmidev->fn_ptr->enable = rmi4_data->irq_enable;
|
||||
rmidev->rmi4_data = rmi4_data;
|
||||
|
||||
retval = rmidev_create_device_class();
|
||||
if (retval < 0) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to create device class\n",
|
||||
__func__);
|
||||
goto err_device_class;
|
||||
}
|
||||
|
||||
if (rmidev_major_num) {
|
||||
dev_no = MKDEV(rmidev_major_num, DEV_NUMBER);
|
||||
retval = register_chrdev_region(dev_no, 1, CHAR_DEVICE_NAME);
|
||||
} else {
|
||||
retval = alloc_chrdev_region(&dev_no, 0, 1, CHAR_DEVICE_NAME);
|
||||
if (retval < 0) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to allocate char device region\n",
|
||||
__func__);
|
||||
goto err_device_region;
|
||||
}
|
||||
|
||||
rmidev_major_num = MAJOR(dev_no);
|
||||
dev_dbg(&rmi4_data->i2c_client->dev,
|
||||
"%s: Major number of rmidev = %d\n",
|
||||
__func__, rmidev_major_num);
|
||||
}
|
||||
|
||||
dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
|
||||
if (!dev_data) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to alloc mem for dev_data\n",
|
||||
__func__);
|
||||
retval = -ENOMEM;
|
||||
goto err_dev_data;
|
||||
}
|
||||
|
||||
mutex_init(&dev_data->file_mutex);
|
||||
dev_data->rmi_dev = rmidev;
|
||||
rmidev->data = dev_data;
|
||||
|
||||
cdev_init(&dev_data->main_dev, &rmidev_fops);
|
||||
|
||||
retval = cdev_add(&dev_data->main_dev, dev_no, 1);
|
||||
if (retval < 0) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to add rmi char device\n",
|
||||
__func__);
|
||||
goto err_char_device;
|
||||
}
|
||||
|
||||
dev_set_name(&rmidev->dev, "rmidev%d", MINOR(dev_no));
|
||||
dev_data->device_class = rmidev_device_class;
|
||||
|
||||
device_ptr = device_create(dev_data->device_class, NULL, dev_no,
|
||||
NULL, CHAR_DEVICE_NAME"%d", MINOR(dev_no));
|
||||
if (IS_ERR(device_ptr)) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to create rmi char device\n",
|
||||
__func__);
|
||||
retval = -ENODEV;
|
||||
goto err_char_device;
|
||||
}
|
||||
|
||||
retval = gpio_export(rmi4_data->board->irq_gpio, false);
|
||||
if (retval < 0) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to export attention gpio\n",
|
||||
__func__);
|
||||
} else {
|
||||
retval = gpio_export_link(&(rmi4_data->input_dev->dev),
|
||||
"attn", rmi4_data->board->irq_gpio);
|
||||
if (retval < 0) {
|
||||
dev_err(&rmi4_data->input_dev->dev,
|
||||
"%s Failed to create gpio symlink\n",
|
||||
__func__);
|
||||
} else {
|
||||
dev_dbg(&rmi4_data->input_dev->dev,
|
||||
"%s: Exported attention gpio %d\n",
|
||||
__func__, rmi4_data->board->irq_gpio);
|
||||
}
|
||||
}
|
||||
|
||||
rmidev->sysfs_dir = kobject_create_and_add("rmidev",
|
||||
&rmi4_data->input_dev->dev.kobj);
|
||||
if (!rmidev->sysfs_dir) {
|
||||
dev_err(&rmi4_data->i2c_client->dev,
|
||||
"%s: Failed to create sysfs directory\n",
|
||||
__func__);
|
||||
goto err_sysfs_dir;
|
||||
}
|
||||
|
||||
for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++) {
|
||||
retval = sysfs_create_file(rmidev->sysfs_dir,
|
||||
&attrs[attr_count].attr);
|
||||
if (retval < 0) {
|
||||
dev_err(&rmi4_data->input_dev->dev,
|
||||
"%s: Failed to create sysfs attributes\n",
|
||||
__func__);
|
||||
retval = -ENODEV;
|
||||
goto err_sysfs_attrs;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_sysfs_attrs:
|
||||
for (attr_count--; attr_count >= 0; attr_count--) {
|
||||
sysfs_remove_file(&rmi4_data->input_dev->dev.kobj,
|
||||
&attrs[attr_count].attr);
|
||||
}
|
||||
|
||||
kobject_put(rmidev->sysfs_dir);
|
||||
|
||||
err_sysfs_dir:
|
||||
err_char_device:
|
||||
rmidev_device_cleanup(dev_data);
|
||||
kfree(dev_data);
|
||||
|
||||
err_dev_data:
|
||||
unregister_chrdev_region(dev_no, 1);
|
||||
|
||||
err_device_region:
|
||||
class_destroy(rmidev_device_class);
|
||||
|
||||
err_device_class:
|
||||
kfree(rmidev->fn_ptr);
|
||||
|
||||
err_fn_ptr:
|
||||
kfree(rmidev);
|
||||
|
||||
err_rmidev:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void rmidev_remove_device(struct synaptics_rmi4_data *rmi4_data)
|
||||
{
|
||||
unsigned char attr_count;
|
||||
struct rmidev_data *dev_data;
|
||||
|
||||
if (!rmidev)
|
||||
return;
|
||||
|
||||
for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++)
|
||||
sysfs_remove_file(rmidev->sysfs_dir, &attrs[attr_count].attr);
|
||||
|
||||
kobject_put(rmidev->sysfs_dir);
|
||||
|
||||
dev_data = rmidev->data;
|
||||
if (dev_data) {
|
||||
rmidev_device_cleanup(dev_data);
|
||||
kfree(dev_data);
|
||||
}
|
||||
|
||||
unregister_chrdev_region(rmidev->dev_no, 1);
|
||||
|
||||
class_destroy(rmidev_device_class);
|
||||
|
||||
kfree(rmidev->fn_ptr);
|
||||
kfree(rmidev);
|
||||
|
||||
complete(&remove_complete);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int __init rmidev_module_init(void)
|
||||
{
|
||||
synaptics_rmi4_new_function(RMI_DEV, true,
|
||||
rmidev_init_device,
|
||||
rmidev_remove_device,
|
||||
NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit rmidev_module_exit(void)
|
||||
{
|
||||
init_completion(&remove_complete);
|
||||
synaptics_rmi4_new_function(RMI_DEV, false,
|
||||
rmidev_init_device,
|
||||
rmidev_remove_device,
|
||||
NULL);
|
||||
wait_for_completion(&remove_complete);
|
||||
return;
|
||||
}
|
||||
|
||||
module_init(rmidev_module_init);
|
||||
module_exit(rmidev_module_exit);
|
||||
|
||||
MODULE_AUTHOR("Synaptics, Inc.");
|
||||
MODULE_DESCRIPTION("RMI4 RMI_Dev Module");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_VERSION(SYNAPTICS_RMI4_DRIVER_VERSION);
|
59
kernel/include/linux/input/synaptics_dsx.h
Normal file
59
kernel/include/linux/input/synaptics_dsx.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Synaptics RMI4 touchscreen driver
|
||||
*
|
||||
* Copyright (C) 2012 Synaptics Incorporated
|
||||
*
|
||||
* Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com>
|
||||
* Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _SYNAPTICS_DSX_H_
|
||||
#define _SYNAPTICS_DSX_H_
|
||||
|
||||
/*
|
||||
* struct synaptics_rmi4_capacitance_button_map - 0d button map
|
||||
* @nbuttons: number of buttons
|
||||
* @map: button map
|
||||
*/
|
||||
struct synaptics_rmi4_capacitance_button_map {
|
||||
unsigned char nbuttons;
|
||||
unsigned char *map;
|
||||
};
|
||||
|
||||
/*
|
||||
* struct synaptics_rmi4_platform_data - rmi4 platform data
|
||||
* @x_flip: x flip flag
|
||||
* @y_flip: y flip flag
|
||||
* @regulator_en: regulator enable flag
|
||||
* @irq_gpio: attention interrupt gpio
|
||||
* @irq_flags: flags used by the irq
|
||||
* @reset_gpio: reset gpio
|
||||
* @panel_x: panel maximum values on the x
|
||||
* @panel_y: panel maximum values on the y
|
||||
* @gpio_config: pointer to gpio configuration function
|
||||
* @capacitance_button_map: pointer to 0d button map
|
||||
*/
|
||||
struct synaptics_rmi4_platform_data {
|
||||
bool x_flip;
|
||||
bool y_flip;
|
||||
bool regulator_en;
|
||||
unsigned irq_gpio;
|
||||
unsigned long irq_flags;
|
||||
unsigned reset_gpio;
|
||||
unsigned panel_x;
|
||||
unsigned panel_y;
|
||||
int (*gpio_config)(unsigned gpio, bool configure);
|
||||
struct synaptics_rmi4_capacitance_button_map *capacitance_button_map;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Reference in a new issue