summaryrefslogtreecommitdiff
path: root/driver/ioexpander/it8801.h
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2019-11-19 10:15:35 -0800
committerCommit Bot <commit-bot@chromium.org>2019-11-22 02:02:15 +0000
commitb6e36785982074af5638c456f305871f1465d460 (patch)
tree1d8537c283419139d881b7321b28be5927c61b06 /driver/ioexpander/it8801.h
parent2748f2cbe6850d9ec7a307f53b3025924e25bf05 (diff)
downloadchrome-ec-b6e36785982074af5638c456f305871f1465d460.tar.gz
cleanup: Segregate ioexpander related drivers in ioexpander folder
BUG=none BRANCH=none TEST=make buildall -j Change-Id: I7fe9ab23254dbd8515936d10ad6782305e76236c Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925173 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver/ioexpander/it8801.h')
-rw-r--r--driver/ioexpander/it8801.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/driver/ioexpander/it8801.h b/driver/ioexpander/it8801.h
new file mode 100644
index 0000000000..9b84adf764
--- /dev/null
+++ b/driver/ioexpander/it8801.h
@@ -0,0 +1,46 @@
+/* Copyright 2019 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * IT8801 is an I/O expander with the keyboard matrix controller.
+ *
+ */
+
+#ifndef __CROS_EC_IO_EXPANDER_IT8801_H
+#define __CROS_EC_IO_EXPANDER_IT8801_H
+
+/* I2C slave address(7-bit without R/W) */
+#define IT8801_I2C_ADDR 0x38
+
+/* Keyboard Matrix Scan control (KBS) */
+#define IT8801_REG_KSOMCR 0x40
+#define IT8801_REG_MASK_KSOSDIC BIT(7)
+#define IT8801_REG_MASK_KSE BIT(6)
+#define IT8801_REG_MASK_AKSOSC BIT(5)
+#define IT8801_REG_KSIDR 0x41
+#define IT8801_REG_KSIEER 0x42
+#define IT8801_REG_KSIIER 0x43
+#define IT8801_REG_SMBCR 0xfa
+#define IT8801_REG_MASK_ARE BIT(4)
+#define IT8801_REG_GIECR 0xfb
+#define IT8801_REG_MASK_GKSIIE BIT(3)
+#define IT8801_REG_GPIO10 0x12
+#define IT8801_REG_GPIO00_KSO19 0x0a
+#define IT8801_REG_GPIO01_KSO18 0x0b
+#define IT8801_REG_GPIO22_KSO21 0x1c
+#define IT8801_REG_GPIO23_KSO20 0x1d
+#define IT8801_REG_MASK_GPIOAFS_PULLUP BIT(7)
+#define IT8801_REG_MASK_GPIOAFS_FUNC2 BIT(6)
+#define IT8801_REG_MASK_GPIODIR BIT(5)
+#define IT8801_REG_MASK_GPIOPUE BIT(0)
+#define IT8801_REG_GPIOG2SOVR 0x07
+#define IT8801_REG_GPIO23SOV BIT(3)
+#define IT8801_REG_MASK_SELKSO2 0x02
+#define IT8801_REG_LBVIDR 0xFE
+#define IT8801_REG_HBVIDR 0xFF
+#define IT8801_KSO_COUNT 18
+
+/* ISR for IT8801's SMB_INT# */
+void io_expander_it8801_interrupt(enum gpio_signal signal);
+
+#endif /* __CROS_EC_KBEXPANDER_IT8801_H */