2 * Copyright (C) 2012 Invensense, Inc.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
18 #include <linux/types.h>
19 #include <linux/ioctl.h>
22 enum secondary_slave_type {
23 SECONDARY_SLAVE_TYPE_NONE,
24 SECONDARY_SLAVE_TYPE_ACCEL,
25 SECONDARY_SLAVE_TYPE_COMPASS,
26 SECONDARY_SLAVE_TYPE_PRESSURE,
27 SECONDARY_SLAVE_TYPE_ALS,
29 SECONDARY_SLAVE_TYPE_TYPES
37 GYRO_ID_MPU6050B1_NO_ACCEL,
64 COMPASS_ID_HSCDTD002B,
65 COMPASS_ID_HSCDTD004A,
78 #define INV_PROD_KEY(ver, rev) (ver * 100 + rev)
80 * struct mpu_platform_data - Platform data for the mpu driver
81 * @int_config: Bits [7:3] of the int config register.
82 * @level_shifter: 0: VLogic, 1: VDD
83 * @orientation: Orientation matrix of the gyroscope
84 * @sec_slave_type: secondary slave device type, can be compass, accel, etc
85 * @sec_slave_id: id of the secondary slave device
86 * @secondary_i2c_address: secondary device's i2c address
87 * @secondary_orientation: secondary device's orientation matrix
88 * @aux_slave_type: auxiliary slave. Another slave device type
89 * @aux_slave_id: auxiliary slave ID.
90 * @aux_i2c_addr: auxiliary device I2C address.
91 * @read_only_slave_type: read only slave type.
92 * @read_only_slave_id: read only slave device ID.
93 * @read_only_i2c_addr: read only slave device address.
95 * Contains platform specific information on how to configure the MPU3050 to
96 * work on this platform. The orientation matricies are 3x3 rotation matricies
97 * that are applied to the data to rotate from the mounting orientation to the
98 * platform orientation. The values must be one of 0, 1, or -1 and each row and
99 * column should have exactly 1 non-zero value.
101 struct mpu_platform_data {
105 enum secondary_slave_type sec_slave_type;
106 enum ext_slave_id sec_slave_id;
107 __u16 secondary_i2c_addr;
108 __s8 secondary_orientation[9];
109 enum secondary_slave_type aux_slave_type;
110 enum ext_slave_id aux_slave_id;
112 enum secondary_slave_type read_only_slave_type;
113 enum ext_slave_id read_only_slave_id;
114 __u16 read_only_i2c_addr;
115 #ifdef CONFIG_DTS_INV_MPU_IIO
116 int (*power_on)(struct mpu_platform_data *);
117 int (*power_off)(struct mpu_platform_data *);
118 struct regulator *vdd_ana;
119 struct regulator *vdd_i2c;
123 #endif /* __MPU_H_ */