linux/drivers/iio/light/tcs3472.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * tcs3472.c - Support for TAOS TCS3472 color light-to-digital converter
 *
 * Copyright (c) 2013 Peter Meerwald <[email protected]>
 *
 * Color light sensor with 16-bit channels for red, green, blue, clear);
 * 7-bit I2C slave address 0x39 (TCS34721, TCS34723) or 0x29 (TCS34725,
 * TCS34727)
 *
 * Datasheet: http://ams.com/eng/content/download/319364/1117183/file/TCS3472_Datasheet_EN_v2.pdf
 *
 * TODO: wait time
 */

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

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/events.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/buffer.h>
#include <linux/iio/triggered_buffer.h>

#define TCS3472_DRV_NAME

#define TCS3472_COMMAND
#define TCS3472_AUTO_INCR
#define TCS3472_SPECIAL_FUNC

#define TCS3472_INTR_CLEAR

#define TCS3472_ENABLE
#define TCS3472_ATIME
#define TCS3472_WTIME
#define TCS3472_AILT
#define TCS3472_AIHT
#define TCS3472_PERS
#define TCS3472_CONFIG
#define TCS3472_CONTROL
#define TCS3472_ID
#define TCS3472_STATUS
#define TCS3472_CDATA
#define TCS3472_RDATA
#define TCS3472_GDATA
#define TCS3472_BDATA

#define TCS3472_STATUS_AINT
#define TCS3472_STATUS_AVALID
#define TCS3472_ENABLE_AIEN
#define TCS3472_ENABLE_AEN
#define TCS3472_ENABLE_PON
#define TCS3472_CONTROL_AGAIN_MASK

struct tcs3472_data {};

static const struct iio_event_spec tcs3472_events[] =;

#define TCS3472_CHANNEL(_color, _si, _addr)

static const int tcs3472_agains[] =;

static const struct iio_chan_spec tcs3472_channels[] =;

static int tcs3472_req_data(struct tcs3472_data *data)
{}

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

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

/*
 * Translation from APERS field value to the number of consecutive out-of-range
 * clear channel values before an interrupt is generated
 */
static const int tcs3472_intr_pers[] =;

static int tcs3472_read_event(struct iio_dev *indio_dev,
	const struct iio_chan_spec *chan, enum iio_event_type type,
	enum iio_event_direction dir, enum iio_event_info info, int *val,
	int *val2)
{}

static int tcs3472_write_event(struct iio_dev *indio_dev,
	const struct iio_chan_spec *chan, enum iio_event_type type,
	enum iio_event_direction dir, enum iio_event_info info, int val,
	int val2)
{}

static int tcs3472_read_event_config(struct iio_dev *indio_dev,
	const struct iio_chan_spec *chan, enum iio_event_type type,
	enum iio_event_direction dir)
{}

static int tcs3472_write_event_config(struct iio_dev *indio_dev,
	const struct iio_chan_spec *chan, enum iio_event_type type,
	enum iio_event_direction dir, int state)
{}

static irqreturn_t tcs3472_event_handler(int irq, void *priv)
{}

static irqreturn_t tcs3472_trigger_handler(int irq, void *p)
{}

static ssize_t tcs3472_show_int_time_available(struct device *dev,
					struct device_attribute *attr,
					char *buf)
{}

static IIO_CONST_ATTR(calibscale_available, "1 4 16 60");
static IIO_DEV_ATTR_INT_TIME_AVAIL(tcs3472_show_int_time_available);

static struct attribute *tcs3472_attributes[] =;

static const struct attribute_group tcs3472_attribute_group =;

static const struct iio_info tcs3472_info =;

static int tcs3472_probe(struct i2c_client *client)
{}

static int tcs3472_powerdown(struct tcs3472_data *data)
{}

static void tcs3472_remove(struct i2c_client *client)
{}

static int tcs3472_suspend(struct device *dev)
{}

static int tcs3472_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(tcs3472_pm_ops, tcs3472_suspend,
				tcs3472_resume);

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

static struct i2c_driver tcs3472_driver =;
module_i2c_driver();

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