linux/drivers/iio/light/tcs3414.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * tcs3414.c - Support for TAOS TCS3414 digital color sensor
 *
 * Copyright (c) 2014 Peter Meerwald <[email protected]>
 *
 * Digital color sensor with 16-bit channels for red, green, blue, clear);
 * 7-bit I2C slave address 0x39 (TCS3414) or 0x29, 0x49, 0x59 (TCS3413,
 * TCS3415, TCS3416, resp.)
 *
 * TODO: sync, interrupt support, thresholds, prescaler
 */

#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/trigger_consumer.h>
#include <linux/iio/buffer.h>
#include <linux/iio/triggered_buffer.h>

#define TCS3414_DRV_NAME

#define TCS3414_COMMAND
#define TCS3414_COMMAND_WORD

#define TCS3414_CONTROL
#define TCS3414_TIMING
#define TCS3414_ID
#define TCS3414_GAIN
#define TCS3414_DATA_GREEN
#define TCS3414_DATA_RED
#define TCS3414_DATA_BLUE
#define TCS3414_DATA_CLEAR

#define TCS3414_CONTROL_ADC_VALID
#define TCS3414_CONTROL_ADC_EN
#define TCS3414_CONTROL_POWER

#define TCS3414_INTEG_MASK
#define TCS3414_INTEG_12MS
#define TCS3414_INTEG_100MS
#define TCS3414_INTEG_400MS

#define TCS3414_GAIN_MASK
#define TCS3414_GAIN_SHIFT

struct tcs3414_data {};

#define TCS3414_CHANNEL(_color, _si, _addr)

/* scale factors: 1/gain */
static const int tcs3414_scales[][2] =;

/* integration time in ms */
static const int tcs3414_times[] =;

static const struct iio_chan_spec tcs3414_channels[] =;

static int tcs3414_req_data(struct tcs3414_data *data)
{}

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

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

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

static IIO_CONST_ATTR(scale_available, "1 0.25 0.0625 0.015625");
static IIO_CONST_ATTR_INT_TIME_AVAIL("0.012 0.1 0.4");

static struct attribute *tcs3414_attributes[] =;

static const struct attribute_group tcs3414_attribute_group =;

static const struct iio_info tcs3414_info =;

static int tcs3414_buffer_postenable(struct iio_dev *indio_dev)
{}

static int tcs3414_buffer_predisable(struct iio_dev *indio_dev)
{}

static const struct iio_buffer_setup_ops tcs3414_buffer_setup_ops =;

static int tcs3414_powerdown(struct tcs3414_data *data)
{}

static void tcs3414_powerdown_cleanup(void *data)
{}

static int tcs3414_probe(struct i2c_client *client)
{}

static int tcs3414_suspend(struct device *dev)
{}

static int tcs3414_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(tcs3414_pm_ops, tcs3414_suspend,
				tcs3414_resume);

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

static struct i2c_driver tcs3414_driver =;
module_i2c_driver();

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