summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJinyoung Park <jinyoungp@nvidia.com>2017-05-19 05:18:44 -0400
committerJinyoung Park <jinyoungp@nvidia.com>2018-05-04 07:32:56 -0400
commitaebaece6326e6f98fcae2c407783273d259a8511 (patch)
tree6b4bacac950f0966566c398dff1c15928f547b88 /include
parent788d572b0e384f1602607df2e4cec776444040b7 (diff)
tmpm32xi2c: Add Toshiba MCU TMPM32x I2C driver
Added MFD core, GPIO expender and Power off drivers for Toshiba MCU TMPM32x I2C. Bug 1928059 Bug 200309618 Change-Id: I76d58511ad64a3eb13ba0b64df22583372c31e41 Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/1485846 Reviewed-by: Aniruddha Banerjee <aniruddhab@nvidia.com> Tested-by: Aniruddha Banerjee <aniruddhab@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Timo Alho <talho@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/tmpm32xi2c.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/include/linux/mfd/tmpm32xi2c.h b/include/linux/mfd/tmpm32xi2c.h
new file mode 100644
index 000000000..c4c8cd307
--- /dev/null
+++ b/include/linux/mfd/tmpm32xi2c.h
@@ -0,0 +1,77 @@
1/*
2 *
3 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef _LINUX_TMPM32XI2C_H
16#define _LINUX_TMPM32XI2C_H
17
18#define CMD_INT_REG 0x10
19
20#define CMD_PIN_RD 0x20
21#define CMD_PORT_RD 0x21
22#define CMD_PIN_IN 0x22
23#define CMD_GET_DIR 0x23
24#define CMD_POL_INV 0x24
25#define CMD_RD_VOLT 0x25
26#define CMD_RD_ADC 0x26
27#define CMD_RESET 0x27
28#define CMD_POWER 0x28
29#define CMD_INT_MASK 0x29
30#define CMD_FAN_TACH 0x2A
31#define CMD_FORCE_RCV 0x2B
32#define CMD_SHUTDOWN_PREPARE 0x2C
33#define CMD_VERSION 0x2F
34
35#define CMD_PIN_WR 0x30
36#define CMD_PORT_WR 0x31
37#define CMD_PIN_OUT 0x32
38#define CMD_FAN_PWM 0x33
39
40#define CMD_I2C_PROB 0xA0
41#define CMD_CAN_TEST 0xA1
42
43#define R_SYS_9V 0
44#define R_VBAT 1
45#define R_VDD_DDR_1V8 2
46
47/* CMD_RD_VOLT 0x25 */
48#define R_VDD_GPU 0
49#define R_VDD_BCPU 1
50#define R_VDD_MCPU 2
51#define R_VDD_SOC 3
52#define R_VDD_SRAM 4
53#define R_VDD_DDR 5
54
55/* CMD_VERSION 0x2F */
56#define V_FW 0
57#define V_CMD 1
58
59/* CMD_SHUTDOWN_PREPARE 0x2C */
60#define SHUTDOWN_PREPARE_CLEAR 0
61#define SHUTDOWN_PREPARE_SET 1
62
63struct tmpm32xi2c_chip {
64 struct device *dev;
65
66 struct mutex lock;
67 int irq;
68 unsigned long irq_flags;
69
70 u8 fw_ver[2];
71 u8 cmd_ver;
72
73 int (*write_read)(struct tmpm32xi2c_chip *chip,
74 u8 *tx_buf, int tx_size, u8 *rx_buf, int rx_size);
75};
76
77#endif /* _LINUX_TMPM32XI2C_H */