/* * Cypress APA trackpad with I2C interface * * Author: Dudley Du <dudl@cypress.com> * * Copyright (C) 2014-2015 Cypress Semiconductor, Inc. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive for * more details.
*/
#ifndef _CYAPA_H #define _CYAPA_H
#include <linux/firmware.h>
/* APA trackpad firmware generation number. */ #define CYAPA_GEN_UNKNOWN 0x00 /* unknown protocol. */ #define CYAPA_GEN3 0x03 /* support MT-protocol B with tracking ID. */ #define CYAPA_GEN5 0x05 /* support TrueTouch GEN5 trackpad device. */ #define CYAPA_GEN6 0x06 /* support TrueTouch GEN6 trackpad device. */
#define BL_STATUS_SIZE 3 /* Length of gen3 bootloader status registers */ #define CYAPA_REG_MAP_SIZE 256
/* * Gen3 Operational Device Status Register * * bit 7: Valid interrupt source * bit 6 - 4: Reserved * bit 3 - 2: Power status * bit 1 - 0: Device status
*/ #define REG_OP_STATUS 0x00 #define OP_STATUS_SRC 0x80 #define OP_STATUS_POWER 0x0c #define OP_STATUS_DEV 0x03 #define OP_STATUS_MASK (OP_STATUS_SRC | OP_STATUS_POWER | OP_STATUS_DEV)
/* * Operational Finger Count/Button Flags Register * * bit 7 - 4: Number of touched finger * bit 3: Valid data * bit 2: Middle Physical Button * bit 1: Right Physical Button * bit 0: Left physical Button
*/ #define REG_OP_DATA1 0x01 #define OP_DATA_VALID 0x08 #define OP_DATA_MIDDLE_BTN 0x04 #define OP_DATA_RIGHT_BTN 0x02 #define OP_DATA_LEFT_BTN 0x01 #define OP_DATA_BTN_MASK (OP_DATA_MIDDLE_BTN | OP_DATA_RIGHT_BTN | \
OP_DATA_LEFT_BTN)
/* * Write-only command file register used to issue commands and * parameters to the bootloader. * The default value read from it is always 0x00.
*/ #define REG_BL_FILE 0x00 #define BL_FILE 0x00
/* * Bootloader Status Register * * bit 7: Busy * bit 6 - 5: Reserved * bit 4: Bootloader running * bit 3 - 2: Reserved * bit 1: Watchdog Reset * bit 0: Checksum valid
*/ #define REG_BL_STATUS 0x01 #define BL_STATUS_REV_6_5 0x60 #define BL_STATUS_BUSY 0x80 #define BL_STATUS_RUNNING 0x10 #define BL_STATUS_REV_3_2 0x0c #define BL_STATUS_WATCHDOG 0x02 #define BL_STATUS_CSUM_VALID 0x01 #define BL_STATUS_REV_MASK (BL_STATUS_WATCHDOG | BL_STATUS_REV_3_2 | \
BL_STATUS_REV_6_5)
/* Read from query data region. */ char product_id[16];
u8 platform_ver; /* Platform version. */
u8 fw_maj_ver; /* Firmware major version. */
u8 fw_min_ver; /* Firmware minor version. */
u8 btn_capability;
u8 gen; int max_abs_x; int max_abs_y; int physical_size_x; int physical_size_y;
/* Used in ttsp and truetouch based trackpad devices. */
u8 x_origin; /* X Axis Origin: 0 = left side; 1 = right side. */
u8 y_origin; /* Y Axis Origin: 0 = top; 1 = bottom. */ int electrodes_x; /* Number of electrodes on the X Axis*/ int electrodes_y; /* Number of electrodes on the Y Axis*/ int electrodes_rx; /* Number of Rx electrodes */ int aligned_electrodes_rx; /* 4 aligned */ int max_z;
/* * Used to synchronize the access or update the device state. * And since update firmware and read firmware image process will take * quite long time, maybe more than 10 seconds, so use mutex_lock * to sync and wait other interface and detecting are done or ready.
*/ struct mutex state_sync_lock;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.