linux/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2020 Invensense, Inc.
 */

#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/regulator/consumer.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/regmap.h>

#include <linux/iio/iio.h>

#include "inv_icm42600.h"
#include "inv_icm42600_buffer.h"

static const struct regmap_range_cfg inv_icm42600_regmap_ranges[] =;

static const struct regmap_range inv_icm42600_regmap_volatile_yes_ranges[] =;

static const struct regmap_range inv_icm42600_regmap_volatile_no_ranges[] =;

static const struct regmap_access_table inv_icm42600_regmap_volatile_accesses[] =;

static const struct regmap_range inv_icm42600_regmap_rd_noinc_no_ranges[] =;

static const struct regmap_access_table inv_icm42600_regmap_rd_noinc_accesses[] =;

const struct regmap_config inv_icm42600_regmap_config =;
EXPORT_SYMBOL_NS_GPL();

struct inv_icm42600_hw {};

/* chip initial default configuration */
static const struct inv_icm42600_conf inv_icm42600_default_conf =;

static const struct inv_icm42600_conf inv_icm42686_default_conf =;

static const struct inv_icm42600_hw inv_icm42600_hw[INV_CHIP_NB] =;

const struct iio_mount_matrix *
inv_icm42600_get_mount_matrix(const struct iio_dev *indio_dev,
			      const struct iio_chan_spec *chan)
{}

uint32_t inv_icm42600_odr_to_period(enum inv_icm42600_odr odr)
{}

static int inv_icm42600_set_pwr_mgmt0(struct inv_icm42600_state *st,
				      enum inv_icm42600_sensor_mode gyro,
				      enum inv_icm42600_sensor_mode accel,
				      bool temp, unsigned int *sleep_ms)
{}

int inv_icm42600_set_accel_conf(struct inv_icm42600_state *st,
				struct inv_icm42600_sensor_conf *conf,
				unsigned int *sleep_ms)
{}

int inv_icm42600_set_gyro_conf(struct inv_icm42600_state *st,
			       struct inv_icm42600_sensor_conf *conf,
			       unsigned int *sleep_ms)
{}

int inv_icm42600_set_temp_conf(struct inv_icm42600_state *st, bool enable,
			       unsigned int *sleep_ms)
{}

int inv_icm42600_debugfs_reg(struct iio_dev *indio_dev, unsigned int reg,
			     unsigned int writeval, unsigned int *readval)
{}

static int inv_icm42600_set_conf(struct inv_icm42600_state *st,
				 const struct inv_icm42600_conf *conf)
{}

/**
 *  inv_icm42600_setup() - check and setup chip
 *  @st:	driver internal state
 *  @bus_setup:	callback for setting up bus specific registers
 *
 *  Returns 0 on success, a negative error code otherwise.
 */
static int inv_icm42600_setup(struct inv_icm42600_state *st,
			      inv_icm42600_bus_setup bus_setup)
{}

static irqreturn_t inv_icm42600_irq_timestamp(int irq, void *_data)
{}

static irqreturn_t inv_icm42600_irq_handler(int irq, void *_data)
{}

/**
 * inv_icm42600_irq_init() - initialize int pin and interrupt handler
 * @st:		driver internal state
 * @irq:	irq number
 * @irq_type:	irq trigger type
 * @open_drain:	true if irq is open drain, false for push-pull
 *
 * Returns 0 on success, a negative error code otherwise.
 */
static int inv_icm42600_irq_init(struct inv_icm42600_state *st, int irq,
				 int irq_type, bool open_drain)
{}

static int inv_icm42600_timestamp_setup(struct inv_icm42600_state *st)
{}

static int inv_icm42600_enable_regulator_vddio(struct inv_icm42600_state *st)
{}

static void inv_icm42600_disable_vdd_reg(void *_data)
{}

static void inv_icm42600_disable_vddio_reg(void *_data)
{}

static void inv_icm42600_disable_pm(void *_data)
{}

int inv_icm42600_core_probe(struct regmap *regmap, int chip, int irq,
			    inv_icm42600_bus_setup bus_setup)
{}
EXPORT_SYMBOL_NS_GPL();

/*
 * Suspend saves sensors state and turns everything off.
 * Check first if runtime suspend has not already done the job.
 */
static int inv_icm42600_suspend(struct device *dev)
{}

/*
 * System resume gets the system back on and restores the sensors state.
 * Manually put runtime power management in system active state.
 */
static int inv_icm42600_resume(struct device *dev)
{}

/* Runtime suspend will turn off sensors that are enabled by iio devices. */
static int inv_icm42600_runtime_suspend(struct device *dev)
{}

/* Sensors are enabled by iio devices, no need to turn them back on here. */
static int inv_icm42600_runtime_resume(struct device *dev)
{}

EXPORT_NS_GPL_DEV_PM_OPS(inv_icm42600_pm_ops, IIO_ICM42600) =;

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_IMPORT_NS();