linux/drivers/iio/light/bh1750.c

// SPDX-License-Identifier: GPL-2.0
/*
 * ROHM BH1710/BH1715/BH1721/BH1750/BH1751 ambient light sensor driver
 *
 * Copyright (c) Tomasz Duszynski <[email protected]>
 *
 * Data sheets:
 *  http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1710fvc-e.pdf
 *  http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1715fvc-e.pdf
 *  http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1721fvc-e.pdf
 *  http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf
 *  http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1751fvi-e.pdf
 *
 * 7-bit I2C slave addresses:
 *  0x23 (ADDR pin low)
 *  0x5C (ADDR pin high)
 *
 */

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

#define BH1750_POWER_DOWN
#define BH1750_ONE_TIME_H_RES_MODE
#define BH1750_CHANGE_INT_TIME_H_BIT
#define BH1750_CHANGE_INT_TIME_L_BIT

enum {};

struct bh1750_chip_info;
struct bh1750_data {};

struct bh1750_chip_info {};

static const struct bh1750_chip_info bh1750_chip_info_tbl[] =;

static int bh1750_change_int_time(struct bh1750_data *data, int usec)
{}

static int bh1750_read(struct bh1750_data *data, int *val)
{}

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

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

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

static IIO_DEV_ATTR_INT_TIME_AVAIL(bh1750_show_int_time_available);

static struct attribute *bh1750_attributes[] =;

static const struct attribute_group bh1750_attribute_group =;

static const struct iio_info bh1750_info =;

static const struct iio_chan_spec bh1750_channels[] =;

static int bh1750_probe(struct i2c_client *client)
{}

static void bh1750_remove(struct i2c_client *client)
{}

static int bh1750_suspend(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(bh1750_pm_ops, bh1750_suspend, NULL);

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

static const struct of_device_id bh1750_of_match[] =;
MODULE_DEVICE_TABLE(of, bh1750_of_match);

static struct i2c_driver bh1750_driver =;
module_i2c_driver();

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