linux/drivers/iio/proximity/rfd77402.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * rfd77402.c - Support for RF Digital RFD77402 Time-of-Flight (distance) sensor
 *
 * Copyright 2017 Peter Meerwald-Stadler <[email protected]>
 *
 * 7-bit I2C slave address 0x4c
 *
 * TODO: interrupt
 * https://media.digikey.com/pdf/Data%20Sheets/RF%20Digital%20PDFs/RFD77402.pdf
 */

#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/delay.h>

#include <linux/iio/iio.h>

#define RFD77402_DRV_NAME

#define RFD77402_ICSR
#define RFD77402_ICSR_INT_MODE
#define RFD77402_ICSR_INT_POL
#define RFD77402_ICSR_RESULT
#define RFD77402_ICSR_M2H_MSG
#define RFD77402_ICSR_H2M_MSG
#define RFD77402_ICSR_RESET

#define RFD77402_CMD_R
#define RFD77402_CMD_SINGLE
#define RFD77402_CMD_STANDBY
#define RFD77402_CMD_MCPU_OFF
#define RFD77402_CMD_MCPU_ON
#define RFD77402_CMD_RESET
#define RFD77402_CMD_VALID

#define RFD77402_STATUS_R
#define RFD77402_STATUS_PM_MASK
#define RFD77402_STATUS_STANDBY
#define RFD77402_STATUS_MCPU_OFF
#define RFD77402_STATUS_MCPU_ON

#define RFD77402_RESULT_R
#define RFD77402_RESULT_DIST_MASK
#define RFD77402_RESULT_ERR_MASK
#define RFD77402_RESULT_VALID

#define RFD77402_PMU_CFG
#define RFD77402_PMU_MCPU_INIT

#define RFD77402_I2C_INIT_CFG
#define RFD77402_I2C_ADDR_INCR
#define RFD77402_I2C_DATA_INCR
#define RFD77402_I2C_HOST_DEBUG
#define RFD77402_I2C_MCPU_DEBUG

#define RFD77402_CMD_CFGR_A
#define RFD77402_CMD_CFGR_B
#define RFD77402_HFCFG_0
#define RFD77402_HFCFG_1
#define RFD77402_HFCFG_2
#define RFD77402_HFCFG_3

#define RFD77402_MOD_CHIP_ID

/* magic configuration values from datasheet */
static const struct {} rf77402_tof_config[] =;

struct rfd77402_data {};

static const struct iio_chan_spec rfd77402_channels[] =;

static int rfd77402_set_state(struct i2c_client *client, u8 state, u16 check)
{}

static int rfd77402_measure(struct i2c_client *client)
{}

static int rfd77402_read_raw(struct iio_dev *indio_dev,
			     struct iio_chan_spec const *chan,
			     int *val, int *val2, long mask)
{}

static const struct iio_info rfd77402_info =;

static int rfd77402_init(struct i2c_client *client)
{}

static int rfd77402_powerdown(struct i2c_client *client)
{}

static void rfd77402_disable(void *client)
{}

static int rfd77402_probe(struct i2c_client *client)
{}

static int rfd77402_suspend(struct device *dev)
{}

static int rfd77402_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(rfd77402_pm_ops, rfd77402_suspend,
				rfd77402_resume);

static const struct i2c_device_id rfd77402_id[] =;
MODULE_DEVICE_TABLE(i2c, rfd77402_id);

static struct i2c_driver rfd77402_driver =;

module_i2c_driver();

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