diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mpu_iio.h | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/include/linux/mpu_iio.h b/include/linux/mpu_iio.h index 73c8940ad..6bf8e5dfa 100644 --- a/include/linux/mpu_iio.h +++ b/include/linux/mpu_iio.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2012 Invensense, Inc. | 2 | * Copyright (C) 2012 Invensense, Inc. |
| 3 | * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved. | 3 | * Copyright (c) 2013-2016, NVIDIA CORPORATION. All rights reserved. |
| 4 | * | 4 | * |
| 5 | * This software is licensed under the terms of the GNU General Public | 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 | 6 | * License version 2, as published by the Free Software Foundation, and |
| @@ -174,8 +174,12 @@ struct mpu_platform_data { | |||
| 174 | * - *ext_driver: A generic pointer that can be used by the | 174 | * - *ext_driver: A generic pointer that can be used by the |
| 175 | * external driver. Note that this is specifically for the | 175 | * external driver. Note that this is specifically for the |
| 176 | * external driver and not used by the MPU. | 176 | * external driver and not used by the MPU. |
| 177 | * - matrix: device orientation on platform. | ||
| 178 | * Needed by the DMP. | ||
| 177 | * - type: Define if device is to be used by the MPU DMP. | 179 | * - type: Define if device is to be used by the MPU DMP. |
| 178 | * - id: Define if device is to be used by the MPU DMP. | 180 | * - id: Define if device is to be used by the MPU DMP. |
| 181 | * - asa: compass axis sensitivity adjustment. | ||
| 182 | * Needed by the DMP. | ||
| 179 | */ | 183 | */ |
| 180 | struct nvi_mpu_port { | 184 | struct nvi_mpu_port { |
| 181 | u8 addr; | 185 | u8 addr; |
| @@ -188,8 +192,10 @@ struct nvi_mpu_port { | |||
| 188 | void (*handler)(u8 *data, unsigned int len, | 192 | void (*handler)(u8 *data, unsigned int len, |
| 189 | long long timestamp, void *ext_driver); | 193 | long long timestamp, void *ext_driver); |
| 190 | void *ext_driver; | 194 | void *ext_driver; |
| 195 | signed char matrix[9]; | ||
| 191 | enum secondary_slave_type type; | 196 | enum secondary_slave_type type; |
| 192 | enum ext_slave_id id; | 197 | enum ext_slave_id id; |
| 198 | u8 asa[3]; | ||
| 193 | int rate_scale; | 199 | int rate_scale; |
| 194 | }; | 200 | }; |
| 195 | 201 | ||
| @@ -313,28 +319,6 @@ int nvi_mpu_port_free(int port); | |||
| 313 | int nvi_mpu_enable(int port, bool enable); | 319 | int nvi_mpu_enable(int port, bool enable); |
| 314 | 320 | ||
| 315 | /** | 321 | /** |
| 316 | * Use to change the ports sampling delay in microseconds. The | ||
| 317 | * hardware only supports one sampling rate so the shortest time | ||
| 318 | * is used among all enabled ports, accelerometer, and gyro. If | ||
| 319 | * the requested rate is longer than the actual rate and the | ||
| 320 | * port is configured for reads, the data will be reported at | ||
| 321 | * the requested rate skipping the data polled at the faster | ||
| 322 | * rate. Setting this to zero causes other enabled devices to | ||
| 323 | * determine the sampling rate. If there are no other enabled | ||
| 324 | * devices, then the MPU default rate is used. | ||
| 325 | * @param port | ||
| 326 | * @param delay_us | ||
| 327 | * @return int error | ||
| 328 | * Possible errors are: | ||
| 329 | * - -EAGAIN: MPU is not initialized yet. | ||
| 330 | * - -EPERM: MPU is shutdown. MPU API won't be | ||
| 331 | * available until a system restart. | ||
| 332 | * - -EBUSY: MPU is busy with another request. | ||
| 333 | * - -EINVAL: Problem with input parameters. | ||
| 334 | */ | ||
| 335 | int nvi_mpu_delay_us(int port, unsigned long delay_us); | ||
| 336 | |||
| 337 | /** | ||
| 338 | * Use to change the ports polling delay in milliseconds. | 322 | * Use to change the ports polling delay in milliseconds. |
| 339 | * A delay value of 0 disables the delay for that port. The | 323 | * A delay value of 0 disables the delay for that port. The |
| 340 | * hardware only supports one delay value so the largest request | 324 | * hardware only supports one delay value so the largest request |
| @@ -372,22 +356,17 @@ int nvi_mpu_data_out(int port, u8 data_out); | |||
| 372 | /** | 356 | /** |
| 373 | * batch mode. | 357 | * batch mode. |
| 374 | * @param port | 358 | * @param port |
| 375 | * @param flags | ||
| 376 | * @param period_us | 359 | * @param period_us |
| 377 | * @param timeout_us | 360 | * @param timeout_us |
| 378 | * @return int error | 361 | * @return int error |
| 379 | * if return >= 0 then this is the supported batch | ||
| 380 | * flags. If batch is not supported then 0 is | ||
| 381 | * returned. | ||
| 382 | * Possible errors are: | 362 | * Possible errors are: |
| 383 | * - -EAGAIN: MPU is not initialized yet. | 363 | * - -EAGAIN: MPU is not initialized yet. |
| 384 | * - -EPERM: MPU is shutdown. MPU API won't be | 364 | * - -EPERM: MPU is shutdown. MPU API won't be |
| 385 | * available until a system restart. | 365 | * available until a system restart. |
| 386 | * - -EBUSY: MPU is busy with another request. | 366 | * - -EBUSY: MPU is busy with another request. |
| 387 | * - -EINVAL: Problem with input parameters. | 367 | * - -EINVAL: timeout_us not supported if > 0. |
| 388 | */ | 368 | */ |
| 389 | int nvi_mpu_batch(int port, unsigned int flags, | 369 | int nvi_mpu_batch(int port, unsigned int period_us, unsigned int timeout_us); |
| 390 | unsigned int period_us, unsigned int timeout_us); | ||
| 391 | 370 | ||
| 392 | /** | 371 | /** |
| 393 | * batch flush. | 372 | * batch flush. |
