// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 TDK-InvenSense, Inc. */ #include <linux/kernel.h> #include <linux/device.h> #include <linux/regmap.h> #include <linux/delay.h> #include "inv_mpu_aux.h" #include "inv_mpu_iio.h" /* * i2c master auxiliary bus transfer function. * Requires the i2c operations to be correctly setup before. */ static int inv_mpu_i2c_master_xfer(const struct inv_mpu6050_state *st) { … } /** * inv_mpu_aux_init() - init i2c auxiliary bus * @st: driver internal state * * Returns 0 on success, a negative error code otherwise. */ int inv_mpu_aux_init(const struct inv_mpu6050_state *st) { … } /** * inv_mpu_aux_read() - read register function for i2c auxiliary bus * @st: driver internal state. * @addr: chip i2c Address * @reg: chip register address * @val: buffer for storing read bytes * @size: number of bytes to read * * Returns 0 on success, a negative error code otherwise. */ int inv_mpu_aux_read(const struct inv_mpu6050_state *st, uint8_t addr, uint8_t reg, uint8_t *val, size_t size) { … } /** * inv_mpu_aux_write() - write register function for i2c auxiliary bus * @st: driver internal state. * @addr: chip i2c Address * @reg: chip register address * @val: 1 byte value to write * * Returns 0 on success, a negative error code otherwise. */ int inv_mpu_aux_write(const struct inv_mpu6050_state *st, uint8_t addr, uint8_t reg, uint8_t val) { … }