162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (C) ST-Ericsson SA 2010 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson 662306a36Sopenharmony_ci */ 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci#ifndef __STMPE_H 962306a36Sopenharmony_ci#define __STMPE_H 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#include <linux/device.h> 1262306a36Sopenharmony_ci#include <linux/mfd/core.h> 1362306a36Sopenharmony_ci#include <linux/mfd/stmpe.h> 1462306a36Sopenharmony_ci#include <linux/printk.h> 1562306a36Sopenharmony_ci#include <linux/types.h> 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ciextern const struct dev_pm_ops stmpe_dev_pm_ops; 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ci#ifdef STMPE_DUMP_BYTES 2062306a36Sopenharmony_cistatic inline void stmpe_dump_bytes(const char *str, const void *buf, 2162306a36Sopenharmony_ci size_t len) 2262306a36Sopenharmony_ci{ 2362306a36Sopenharmony_ci print_hex_dump_bytes(str, DUMP_PREFIX_OFFSET, buf, len); 2462306a36Sopenharmony_ci} 2562306a36Sopenharmony_ci#else 2662306a36Sopenharmony_cistatic inline void stmpe_dump_bytes(const char *str, const void *buf, 2762306a36Sopenharmony_ci size_t len) 2862306a36Sopenharmony_ci{ 2962306a36Sopenharmony_ci} 3062306a36Sopenharmony_ci#endif 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci/** 3362306a36Sopenharmony_ci * struct stmpe_variant_block - information about block 3462306a36Sopenharmony_ci * @cell: base mfd cell 3562306a36Sopenharmony_ci * @irq: interrupt number to be added to each IORESOURCE_IRQ 3662306a36Sopenharmony_ci * in the cell 3762306a36Sopenharmony_ci * @block: block id; used for identification with platform data and for 3862306a36Sopenharmony_ci * enable and altfunc callbacks 3962306a36Sopenharmony_ci */ 4062306a36Sopenharmony_cistruct stmpe_variant_block { 4162306a36Sopenharmony_ci const struct mfd_cell *cell; 4262306a36Sopenharmony_ci int irq; 4362306a36Sopenharmony_ci enum stmpe_block block; 4462306a36Sopenharmony_ci}; 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ci/** 4762306a36Sopenharmony_ci * struct stmpe_variant_info - variant-specific information 4862306a36Sopenharmony_ci * @name: part name 4962306a36Sopenharmony_ci * @id_val: content of CHIPID register 5062306a36Sopenharmony_ci * @id_mask: bits valid in CHIPID register for comparison with id_val 5162306a36Sopenharmony_ci * @num_gpios: number of GPIOS 5262306a36Sopenharmony_ci * @af_bits: number of bits used to specify the alternate function 5362306a36Sopenharmony_ci * @regs: variant specific registers. 5462306a36Sopenharmony_ci * @blocks: list of blocks present on this device 5562306a36Sopenharmony_ci * @num_blocks: number of blocks present on this device 5662306a36Sopenharmony_ci * @num_irqs: number of internal IRQs available on this device 5762306a36Sopenharmony_ci * @enable: callback to enable the specified blocks. 5862306a36Sopenharmony_ci * Called with the I/O lock held. 5962306a36Sopenharmony_ci * @get_altfunc: callback to get the alternate function number for the 6062306a36Sopenharmony_ci * specific block 6162306a36Sopenharmony_ci * @enable_autosleep: callback to configure autosleep with specified timeout 6262306a36Sopenharmony_ci */ 6362306a36Sopenharmony_cistruct stmpe_variant_info { 6462306a36Sopenharmony_ci const char *name; 6562306a36Sopenharmony_ci u16 id_val; 6662306a36Sopenharmony_ci u16 id_mask; 6762306a36Sopenharmony_ci int num_gpios; 6862306a36Sopenharmony_ci int af_bits; 6962306a36Sopenharmony_ci const u8 *regs; 7062306a36Sopenharmony_ci struct stmpe_variant_block *blocks; 7162306a36Sopenharmony_ci int num_blocks; 7262306a36Sopenharmony_ci int num_irqs; 7362306a36Sopenharmony_ci int (*enable)(struct stmpe *stmpe, unsigned int blocks, bool enable); 7462306a36Sopenharmony_ci int (*get_altfunc)(struct stmpe *stmpe, enum stmpe_block block); 7562306a36Sopenharmony_ci int (*enable_autosleep)(struct stmpe *stmpe, int autosleep_timeout); 7662306a36Sopenharmony_ci}; 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci/** 7962306a36Sopenharmony_ci * struct stmpe_client_info - i2c or spi specific routines/info 8062306a36Sopenharmony_ci * @data: client specific data 8162306a36Sopenharmony_ci * @read_byte: read single byte 8262306a36Sopenharmony_ci * @write_byte: write single byte 8362306a36Sopenharmony_ci * @read_block: read block or multiple bytes 8462306a36Sopenharmony_ci * @write_block: write block or multiple bytes 8562306a36Sopenharmony_ci * @init: client init routine, called during probe 8662306a36Sopenharmony_ci */ 8762306a36Sopenharmony_cistruct stmpe_client_info { 8862306a36Sopenharmony_ci void *data; 8962306a36Sopenharmony_ci int irq; 9062306a36Sopenharmony_ci void *client; 9162306a36Sopenharmony_ci struct device *dev; 9262306a36Sopenharmony_ci int (*read_byte)(struct stmpe *stmpe, u8 reg); 9362306a36Sopenharmony_ci int (*write_byte)(struct stmpe *stmpe, u8 reg, u8 val); 9462306a36Sopenharmony_ci int (*read_block)(struct stmpe *stmpe, u8 reg, u8 len, u8 *values); 9562306a36Sopenharmony_ci int (*write_block)(struct stmpe *stmpe, u8 reg, u8 len, 9662306a36Sopenharmony_ci const u8 *values); 9762306a36Sopenharmony_ci void (*init)(struct stmpe *stmpe); 9862306a36Sopenharmony_ci}; 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ciint stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum); 10162306a36Sopenharmony_civoid stmpe_remove(struct stmpe *stmpe); 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci#define STMPE_ICR_LSB_HIGH (1 << 2) 10462306a36Sopenharmony_ci#define STMPE_ICR_LSB_EDGE (1 << 1) 10562306a36Sopenharmony_ci#define STMPE_ICR_LSB_GIM (1 << 0) 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci#define STMPE_SYS_CTRL_RESET (1 << 7) 10862306a36Sopenharmony_ci#define STMPE_SYS_CTRL_INT_EN (1 << 2) 10962306a36Sopenharmony_ci#define STMPE_SYS_CTRL_INT_HI (1 << 0) 11062306a36Sopenharmony_ci 11162306a36Sopenharmony_ci/* 11262306a36Sopenharmony_ci * STMPE801 11362306a36Sopenharmony_ci */ 11462306a36Sopenharmony_ci#define STMPE801_ID 0x0108 11562306a36Sopenharmony_ci#define STMPE801_NR_INTERNAL_IRQS 1 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci#define STMPE801_REG_CHIP_ID 0x00 11862306a36Sopenharmony_ci#define STMPE801_REG_VERSION_ID 0x02 11962306a36Sopenharmony_ci#define STMPE801_REG_SYS_CTRL 0x04 12062306a36Sopenharmony_ci#define STMPE801_REG_GPIO_INT_EN 0x08 12162306a36Sopenharmony_ci#define STMPE801_REG_GPIO_INT_STA 0x09 12262306a36Sopenharmony_ci#define STMPE801_REG_GPIO_MP_STA 0x10 12362306a36Sopenharmony_ci#define STMPE801_REG_GPIO_SET_PIN 0x11 12462306a36Sopenharmony_ci#define STMPE801_REG_GPIO_DIR 0x12 12562306a36Sopenharmony_ci 12662306a36Sopenharmony_ci/* 12762306a36Sopenharmony_ci * STMPE811 12862306a36Sopenharmony_ci */ 12962306a36Sopenharmony_ci#define STMPE811_ID 0x0811 13062306a36Sopenharmony_ci 13162306a36Sopenharmony_ci#define STMPE811_IRQ_TOUCH_DET 0 13262306a36Sopenharmony_ci#define STMPE811_IRQ_FIFO_TH 1 13362306a36Sopenharmony_ci#define STMPE811_IRQ_FIFO_OFLOW 2 13462306a36Sopenharmony_ci#define STMPE811_IRQ_FIFO_FULL 3 13562306a36Sopenharmony_ci#define STMPE811_IRQ_FIFO_EMPTY 4 13662306a36Sopenharmony_ci#define STMPE811_IRQ_TEMP_SENS 5 13762306a36Sopenharmony_ci#define STMPE811_IRQ_ADC 6 13862306a36Sopenharmony_ci#define STMPE811_IRQ_GPIOC 7 13962306a36Sopenharmony_ci#define STMPE811_NR_INTERNAL_IRQS 8 14062306a36Sopenharmony_ci 14162306a36Sopenharmony_ci#define STMPE811_REG_CHIP_ID 0x00 14262306a36Sopenharmony_ci#define STMPE811_REG_SYS_CTRL 0x03 14362306a36Sopenharmony_ci#define STMPE811_REG_SYS_CTRL2 0x04 14462306a36Sopenharmony_ci#define STMPE811_REG_SPI_CFG 0x08 14562306a36Sopenharmony_ci#define STMPE811_REG_INT_CTRL 0x09 14662306a36Sopenharmony_ci#define STMPE811_REG_INT_EN 0x0A 14762306a36Sopenharmony_ci#define STMPE811_REG_INT_STA 0x0B 14862306a36Sopenharmony_ci#define STMPE811_REG_GPIO_INT_EN 0x0C 14962306a36Sopenharmony_ci#define STMPE811_REG_GPIO_INT_STA 0x0D 15062306a36Sopenharmony_ci#define STMPE811_REG_GPIO_SET_PIN 0x10 15162306a36Sopenharmony_ci#define STMPE811_REG_GPIO_CLR_PIN 0x11 15262306a36Sopenharmony_ci#define STMPE811_REG_GPIO_MP_STA 0x12 15362306a36Sopenharmony_ci#define STMPE811_REG_GPIO_DIR 0x13 15462306a36Sopenharmony_ci#define STMPE811_REG_GPIO_ED 0x14 15562306a36Sopenharmony_ci#define STMPE811_REG_GPIO_RE 0x15 15662306a36Sopenharmony_ci#define STMPE811_REG_GPIO_FE 0x16 15762306a36Sopenharmony_ci#define STMPE811_REG_GPIO_AF 0x17 15862306a36Sopenharmony_ci 15962306a36Sopenharmony_ci#define STMPE811_SYS_CTRL_RESET (1 << 1) 16062306a36Sopenharmony_ci 16162306a36Sopenharmony_ci#define STMPE811_SYS_CTRL2_ADC_OFF (1 << 0) 16262306a36Sopenharmony_ci#define STMPE811_SYS_CTRL2_TSC_OFF (1 << 1) 16362306a36Sopenharmony_ci#define STMPE811_SYS_CTRL2_GPIO_OFF (1 << 2) 16462306a36Sopenharmony_ci#define STMPE811_SYS_CTRL2_TS_OFF (1 << 3) 16562306a36Sopenharmony_ci 16662306a36Sopenharmony_ci/* 16762306a36Sopenharmony_ci * STMPE1600 16862306a36Sopenharmony_ci */ 16962306a36Sopenharmony_ci#define STMPE1600_ID 0x0016 17062306a36Sopenharmony_ci#define STMPE1600_NR_INTERNAL_IRQS 16 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci#define STMPE1600_REG_CHIP_ID 0x00 17362306a36Sopenharmony_ci#define STMPE1600_REG_SYS_CTRL 0x03 17462306a36Sopenharmony_ci#define STMPE1600_REG_IEGPIOR_LSB 0x08 17562306a36Sopenharmony_ci#define STMPE1600_REG_IEGPIOR_MSB 0x09 17662306a36Sopenharmony_ci#define STMPE1600_REG_ISGPIOR_LSB 0x0A 17762306a36Sopenharmony_ci#define STMPE1600_REG_ISGPIOR_MSB 0x0B 17862306a36Sopenharmony_ci#define STMPE1600_REG_GPMR_LSB 0x10 17962306a36Sopenharmony_ci#define STMPE1600_REG_GPMR_MSB 0x11 18062306a36Sopenharmony_ci#define STMPE1600_REG_GPSR_LSB 0x12 18162306a36Sopenharmony_ci#define STMPE1600_REG_GPSR_MSB 0x13 18262306a36Sopenharmony_ci#define STMPE1600_REG_GPDR_LSB 0x14 18362306a36Sopenharmony_ci#define STMPE1600_REG_GPDR_MSB 0x15 18462306a36Sopenharmony_ci#define STMPE1600_REG_GPPIR_LSB 0x16 18562306a36Sopenharmony_ci#define STMPE1600_REG_GPPIR_MSB 0x17 18662306a36Sopenharmony_ci 18762306a36Sopenharmony_ci/* 18862306a36Sopenharmony_ci * STMPE1601 18962306a36Sopenharmony_ci */ 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ci#define STMPE1601_IRQ_GPIOC 8 19262306a36Sopenharmony_ci#define STMPE1601_IRQ_PWM3 7 19362306a36Sopenharmony_ci#define STMPE1601_IRQ_PWM2 6 19462306a36Sopenharmony_ci#define STMPE1601_IRQ_PWM1 5 19562306a36Sopenharmony_ci#define STMPE1601_IRQ_PWM0 4 19662306a36Sopenharmony_ci#define STMPE1601_IRQ_KEYPAD_OVER 2 19762306a36Sopenharmony_ci#define STMPE1601_IRQ_KEYPAD 1 19862306a36Sopenharmony_ci#define STMPE1601_IRQ_WAKEUP 0 19962306a36Sopenharmony_ci#define STMPE1601_NR_INTERNAL_IRQS 9 20062306a36Sopenharmony_ci 20162306a36Sopenharmony_ci#define STMPE1601_REG_SYS_CTRL 0x02 20262306a36Sopenharmony_ci#define STMPE1601_REG_SYS_CTRL2 0x03 20362306a36Sopenharmony_ci#define STMPE1601_REG_ICR_MSB 0x10 20462306a36Sopenharmony_ci#define STMPE1601_REG_ICR_LSB 0x11 20562306a36Sopenharmony_ci#define STMPE1601_REG_IER_MSB 0x12 20662306a36Sopenharmony_ci#define STMPE1601_REG_IER_LSB 0x13 20762306a36Sopenharmony_ci#define STMPE1601_REG_ISR_MSB 0x14 20862306a36Sopenharmony_ci#define STMPE1601_REG_ISR_LSB 0x15 20962306a36Sopenharmony_ci#define STMPE1601_REG_INT_EN_GPIO_MASK_MSB 0x16 21062306a36Sopenharmony_ci#define STMPE1601_REG_INT_EN_GPIO_MASK_LSB 0x17 21162306a36Sopenharmony_ci#define STMPE1601_REG_INT_STA_GPIO_MSB 0x18 21262306a36Sopenharmony_ci#define STMPE1601_REG_INT_STA_GPIO_LSB 0x19 21362306a36Sopenharmony_ci#define STMPE1601_REG_CHIP_ID 0x80 21462306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_SET_MSB 0x82 21562306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_SET_LSB 0x83 21662306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_CLR_MSB 0x84 21762306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_CLR_LSB 0x85 21862306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_MP_MSB 0x86 21962306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_MP_LSB 0x87 22062306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_SET_DIR_MSB 0x88 22162306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_SET_DIR_LSB 0x89 22262306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_ED_MSB 0x8A 22362306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_ED_LSB 0x8B 22462306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_RE_MSB 0x8C 22562306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_RE_LSB 0x8D 22662306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_FE_MSB 0x8E 22762306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_FE_LSB 0x8F 22862306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_PU_MSB 0x90 22962306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_PU_LSB 0x91 23062306a36Sopenharmony_ci#define STMPE1601_REG_GPIO_AF_U_MSB 0x92 23162306a36Sopenharmony_ci 23262306a36Sopenharmony_ci#define STMPE1601_SYS_CTRL_ENABLE_GPIO (1 << 3) 23362306a36Sopenharmony_ci#define STMPE1601_SYS_CTRL_ENABLE_KPC (1 << 1) 23462306a36Sopenharmony_ci#define STMPE1601_SYS_CTRL_ENABLE_SPWM (1 << 0) 23562306a36Sopenharmony_ci 23662306a36Sopenharmony_ci/* The 1601/2403 share the same masks */ 23762306a36Sopenharmony_ci#define STMPE1601_AUTOSLEEP_TIMEOUT_MASK (0x7) 23862306a36Sopenharmony_ci#define STPME1601_AUTOSLEEP_ENABLE (1 << 3) 23962306a36Sopenharmony_ci 24062306a36Sopenharmony_ci/* 24162306a36Sopenharmony_ci * STMPE1801 24262306a36Sopenharmony_ci */ 24362306a36Sopenharmony_ci#define STMPE1801_ID 0xc110 24462306a36Sopenharmony_ci#define STMPE1801_NR_INTERNAL_IRQS 5 24562306a36Sopenharmony_ci#define STMPE1801_IRQ_KEYPAD_COMBI 4 24662306a36Sopenharmony_ci#define STMPE1801_IRQ_GPIOC 3 24762306a36Sopenharmony_ci#define STMPE1801_IRQ_KEYPAD_OVER 2 24862306a36Sopenharmony_ci#define STMPE1801_IRQ_KEYPAD 1 24962306a36Sopenharmony_ci#define STMPE1801_IRQ_WAKEUP 0 25062306a36Sopenharmony_ci 25162306a36Sopenharmony_ci#define STMPE1801_REG_CHIP_ID 0x00 25262306a36Sopenharmony_ci#define STMPE1801_REG_SYS_CTRL 0x02 25362306a36Sopenharmony_ci#define STMPE1801_REG_INT_CTRL_LOW 0x04 25462306a36Sopenharmony_ci#define STMPE1801_REG_INT_EN_MASK_LOW 0x06 25562306a36Sopenharmony_ci#define STMPE1801_REG_INT_STA_LOW 0x08 25662306a36Sopenharmony_ci#define STMPE1801_REG_INT_EN_GPIO_MASK_LOW 0x0A 25762306a36Sopenharmony_ci#define STMPE1801_REG_INT_EN_GPIO_MASK_MID 0x0B 25862306a36Sopenharmony_ci#define STMPE1801_REG_INT_EN_GPIO_MASK_HIGH 0x0C 25962306a36Sopenharmony_ci#define STMPE1801_REG_INT_STA_GPIO_LOW 0x0D 26062306a36Sopenharmony_ci#define STMPE1801_REG_INT_STA_GPIO_MID 0x0E 26162306a36Sopenharmony_ci#define STMPE1801_REG_INT_STA_GPIO_HIGH 0x0F 26262306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_SET_LOW 0x10 26362306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_SET_MID 0x11 26462306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_SET_HIGH 0x12 26562306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_CLR_LOW 0x13 26662306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_CLR_MID 0x14 26762306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_CLR_HIGH 0x15 26862306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_MP_LOW 0x16 26962306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_MP_MID 0x17 27062306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_MP_HIGH 0x18 27162306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_SET_DIR_LOW 0x19 27262306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_SET_DIR_MID 0x1A 27362306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_SET_DIR_HIGH 0x1B 27462306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_RE_LOW 0x1C 27562306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_RE_MID 0x1D 27662306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_RE_HIGH 0x1E 27762306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_FE_LOW 0x1F 27862306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_FE_MID 0x20 27962306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_FE_HIGH 0x21 28062306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_PULL_UP_LOW 0x22 28162306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_PULL_UP_MID 0x23 28262306a36Sopenharmony_ci#define STMPE1801_REG_GPIO_PULL_UP_HIGH 0x24 28362306a36Sopenharmony_ci 28462306a36Sopenharmony_ci#define STMPE1801_MSK_INT_EN_KPC (1 << 1) 28562306a36Sopenharmony_ci#define STMPE1801_MSK_INT_EN_GPIO (1 << 3) 28662306a36Sopenharmony_ci 28762306a36Sopenharmony_ci/* 28862306a36Sopenharmony_ci * STMPE24xx 28962306a36Sopenharmony_ci */ 29062306a36Sopenharmony_ci 29162306a36Sopenharmony_ci#define STMPE24XX_IRQ_GPIOC 8 29262306a36Sopenharmony_ci#define STMPE24XX_IRQ_PWM2 7 29362306a36Sopenharmony_ci#define STMPE24XX_IRQ_PWM1 6 29462306a36Sopenharmony_ci#define STMPE24XX_IRQ_PWM0 5 29562306a36Sopenharmony_ci#define STMPE24XX_IRQ_ROT_OVER 4 29662306a36Sopenharmony_ci#define STMPE24XX_IRQ_ROT 3 29762306a36Sopenharmony_ci#define STMPE24XX_IRQ_KEYPAD_OVER 2 29862306a36Sopenharmony_ci#define STMPE24XX_IRQ_KEYPAD 1 29962306a36Sopenharmony_ci#define STMPE24XX_IRQ_WAKEUP 0 30062306a36Sopenharmony_ci#define STMPE24XX_NR_INTERNAL_IRQS 9 30162306a36Sopenharmony_ci 30262306a36Sopenharmony_ci#define STMPE24XX_REG_SYS_CTRL 0x02 30362306a36Sopenharmony_ci#define STMPE24XX_REG_SYS_CTRL2 0x03 30462306a36Sopenharmony_ci#define STMPE24XX_REG_ICR_MSB 0x10 30562306a36Sopenharmony_ci#define STMPE24XX_REG_ICR_LSB 0x11 30662306a36Sopenharmony_ci#define STMPE24XX_REG_IER_MSB 0x12 30762306a36Sopenharmony_ci#define STMPE24XX_REG_IER_LSB 0x13 30862306a36Sopenharmony_ci#define STMPE24XX_REG_ISR_MSB 0x14 30962306a36Sopenharmony_ci#define STMPE24XX_REG_ISR_LSB 0x15 31062306a36Sopenharmony_ci#define STMPE24XX_REG_IEGPIOR_MSB 0x16 31162306a36Sopenharmony_ci#define STMPE24XX_REG_IEGPIOR_CSB 0x17 31262306a36Sopenharmony_ci#define STMPE24XX_REG_IEGPIOR_LSB 0x18 31362306a36Sopenharmony_ci#define STMPE24XX_REG_ISGPIOR_MSB 0x19 31462306a36Sopenharmony_ci#define STMPE24XX_REG_ISGPIOR_CSB 0x1A 31562306a36Sopenharmony_ci#define STMPE24XX_REG_ISGPIOR_LSB 0x1B 31662306a36Sopenharmony_ci#define STMPE24XX_REG_CHIP_ID 0x80 31762306a36Sopenharmony_ci#define STMPE24XX_REG_GPSR_MSB 0x83 31862306a36Sopenharmony_ci#define STMPE24XX_REG_GPSR_CSB 0x84 31962306a36Sopenharmony_ci#define STMPE24XX_REG_GPSR_LSB 0x85 32062306a36Sopenharmony_ci#define STMPE24XX_REG_GPCR_MSB 0x86 32162306a36Sopenharmony_ci#define STMPE24XX_REG_GPCR_CSB 0x87 32262306a36Sopenharmony_ci#define STMPE24XX_REG_GPCR_LSB 0x88 32362306a36Sopenharmony_ci#define STMPE24XX_REG_GPDR_MSB 0x89 32462306a36Sopenharmony_ci#define STMPE24XX_REG_GPDR_CSB 0x8A 32562306a36Sopenharmony_ci#define STMPE24XX_REG_GPDR_LSB 0x8B 32662306a36Sopenharmony_ci#define STMPE24XX_REG_GPEDR_MSB 0x8C 32762306a36Sopenharmony_ci#define STMPE24XX_REG_GPEDR_CSB 0x8D 32862306a36Sopenharmony_ci#define STMPE24XX_REG_GPEDR_LSB 0x8E 32962306a36Sopenharmony_ci#define STMPE24XX_REG_GPRER_MSB 0x8F 33062306a36Sopenharmony_ci#define STMPE24XX_REG_GPRER_CSB 0x90 33162306a36Sopenharmony_ci#define STMPE24XX_REG_GPRER_LSB 0x91 33262306a36Sopenharmony_ci#define STMPE24XX_REG_GPFER_MSB 0x92 33362306a36Sopenharmony_ci#define STMPE24XX_REG_GPFER_CSB 0x93 33462306a36Sopenharmony_ci#define STMPE24XX_REG_GPFER_LSB 0x94 33562306a36Sopenharmony_ci#define STMPE24XX_REG_GPPUR_MSB 0x95 33662306a36Sopenharmony_ci#define STMPE24XX_REG_GPPUR_CSB 0x96 33762306a36Sopenharmony_ci#define STMPE24XX_REG_GPPUR_LSB 0x97 33862306a36Sopenharmony_ci#define STMPE24XX_REG_GPPDR_MSB 0x98 33962306a36Sopenharmony_ci#define STMPE24XX_REG_GPPDR_CSB 0x99 34062306a36Sopenharmony_ci#define STMPE24XX_REG_GPPDR_LSB 0x9A 34162306a36Sopenharmony_ci#define STMPE24XX_REG_GPAFR_U_MSB 0x9B 34262306a36Sopenharmony_ci#define STMPE24XX_REG_GPMR_MSB 0xA2 34362306a36Sopenharmony_ci#define STMPE24XX_REG_GPMR_CSB 0xA3 34462306a36Sopenharmony_ci#define STMPE24XX_REG_GPMR_LSB 0xA4 34562306a36Sopenharmony_ci#define STMPE24XX_SYS_CTRL_ENABLE_GPIO (1 << 3) 34662306a36Sopenharmony_ci#define STMPE24XX_SYSCON_ENABLE_PWM (1 << 2) 34762306a36Sopenharmony_ci#define STMPE24XX_SYS_CTRL_ENABLE_KPC (1 << 1) 34862306a36Sopenharmony_ci#define STMPE24XX_SYSCON_ENABLE_ROT (1 << 0) 34962306a36Sopenharmony_ci 35062306a36Sopenharmony_ci#endif 351