linux/drivers/iio/light/pa12203001.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015 Intel Corporation
 *
 * Driver for TXC PA12203001 Proximity and Ambient Light Sensor.
 *
 * To do: Interrupt support.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/mutex.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>

#define PA12203001_DRIVER_NAME

#define PA12203001_REG_CFG0
#define PA12203001_REG_CFG1
#define PA12203001_REG_CFG2
#define PA12203001_REG_CFG3

#define PA12203001_REG_ADL
#define PA12203001_REG_PDH

#define PA12203001_REG_POFS
#define PA12203001_REG_PSET

#define PA12203001_ALS_EN_MASK
#define PA12203001_PX_EN_MASK
#define PA12203001_PX_NORMAL_MODE_MASK
#define PA12203001_AFSR_MASK
#define PA12203001_AFSR_SHIFT

#define PA12203001_PSCAN

/* als range 31000, ps, als disabled */
#define PA12203001_REG_CFG0_DEFAULT

/* led current: 100 mA */
#define PA12203001_REG_CFG1_DEFAULT

/* ps mode: normal, interrupts not active */
#define PA12203001_REG_CFG2_DEFAULT

#define PA12203001_REG_CFG3_DEFAULT

#define PA12203001_SLEEP_DELAY_MS

#define PA12203001_CHIP_ENABLE
#define PA12203001_CHIP_DISABLE

/* available scales: corresponding to [500, 4000, 7000, 31000]  lux */
static const int pa12203001_scales[] =;

struct pa12203001_data {};

static const struct {} regvals[] =;

static IIO_CONST_ATTR(in_illuminance_scale_available,
		      "0.007629 0.061036 0.106813 0.473029");

static struct attribute *pa12203001_attrs[] =;

static const struct attribute_group pa12203001_attr_group =;

static const struct iio_chan_spec pa12203001_channels[] =;

static const struct regmap_range pa12203001_volatile_regs_ranges[] =;

static const struct regmap_access_table pa12203001_volatile_regs =;

static const struct regmap_config pa12203001_regmap_config =;

static inline int pa12203001_als_enable(struct pa12203001_data *data, u8 enable)
{}

static inline int pa12203001_px_enable(struct pa12203001_data *data, u8 enable)
{}

static int pa12203001_set_power_state(struct pa12203001_data *data, bool on,
				      u8 mask)
{}

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

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

static const struct iio_info pa12203001_info =;

static int pa12203001_init(struct iio_dev *indio_dev)
{}

static int pa12203001_power_chip(struct iio_dev *indio_dev, u8 state)
{}

static int pa12203001_probe(struct i2c_client *client)
{}

static void pa12203001_remove(struct i2c_client *client)
{}

#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM)
static int pa12203001_suspend(struct device *dev)
{}
#endif

#ifdef CONFIG_PM_SLEEP
static int pa12203001_resume(struct device *dev)
{}
#endif

#ifdef CONFIG_PM
static int pa12203001_runtime_resume(struct device *dev)
{}
#endif

static const struct dev_pm_ops pa12203001_pm_ops =;

static const struct acpi_device_id pa12203001_acpi_match[] =;

MODULE_DEVICE_TABLE(acpi, pa12203001_acpi_match);

static const struct i2c_device_id pa12203001_id[] =;

MODULE_DEVICE_TABLE(i2c, pa12203001_id);

static struct i2c_driver pa12203001_driver =;
module_i2c_driver();

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