linux/drivers/iio/light/adjd_s311.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * adjd_s311.c - Support for ADJD-S311-CR999 digital color sensor
 *
 * Copyright (C) 2012 Peter Meerwald <[email protected]>
 *
 * driver for ADJD-S311-CR999 digital color sensor (10-bit channels for
 * red, green, blue, clear); 7-bit I2C slave address 0x74
 *
 * limitations: no calibration, no offset mode, no sleep mode
 */

#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/bitmap.h>
#include <linux/err.h>
#include <linux/irq.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 ADJD_S311_DRV_NAME

#define ADJD_S311_CTRL
#define ADJD_S311_CONFIG
#define ADJD_S311_CAP_RED
#define ADJD_S311_CAP_GREEN
#define ADJD_S311_CAP_BLUE
#define ADJD_S311_CAP_CLEAR
#define ADJD_S311_INT_RED
#define ADJD_S311_INT_GREEN
#define ADJD_S311_INT_BLUE
#define ADJD_S311_INT_CLEAR
#define ADJD_S311_DATA_RED
#define ADJD_S311_DATA_GREEN
#define ADJD_S311_DATA_BLUE
#define ADJD_S311_DATA_CLEAR
#define ADJD_S311_OFFSET_RED
#define ADJD_S311_OFFSET_GREEN
#define ADJD_S311_OFFSET_BLUE
#define ADJD_S311_OFFSET_CLEAR

#define ADJD_S311_CTRL_GOFS
#define ADJD_S311_CTRL_GSSR
#define ADJD_S311_CAP_MASK
#define ADJD_S311_INT_MASK
#define ADJD_S311_DATA_MASK

struct adjd_s311_data {};

enum adjd_s311_channel_idx {};

#define ADJD_S311_DATA_REG(chan)
#define ADJD_S311_INT_REG(chan)
#define ADJD_S311_CAP_REG(chan)

static int adjd_s311_req_data(struct iio_dev *indio_dev)
{}

static int adjd_s311_read_data(struct iio_dev *indio_dev, u8 reg, int *val)
{}

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

#define ADJD_S311_CHANNEL(_color, _scan_idx)

static const struct iio_chan_spec adjd_s311_channels[] =;

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

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

static const struct iio_info adjd_s311_info =;

static int adjd_s311_probe(struct i2c_client *client)
{}

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

static struct i2c_driver adjd_s311_driver =;
module_i2c_driver();

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