linux/drivers/iio/light/cm3605.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * CM3605 Ambient Light and Proximity Sensor
 *
 * Copyright (C) 2016 Linaro Ltd.
 * Author: Linus Walleij <[email protected]>
 *
 * This hardware was found in the very first Nexus One handset from Google/HTC
 * and an early endavour into mobile light and proximity sensors.
 */

#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/events.h>
#include <linux/iio/consumer.h> /* To get our ADC channel */
#include <linux/iio/types.h> /* To deal with our ADC channel */
#include <linux/init.h>
#include <linux/leds.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/math64.h>
#include <linux/pm.h>

#define CM3605_PROX_CHANNEL
#define CM3605_ALS_CHANNEL
#define CM3605_AOUT_TYP_MAX_MV
/* It should not go above 1.650V according to the data sheet */
#define CM3605_AOUT_MAX_MV

/**
 * struct cm3605 - CM3605 state
 * @dev: pointer to parent device
 * @vdd: regulator controlling VDD
 * @aset: sleep enable GPIO, high = sleep
 * @aout: IIO ADC channel to convert the AOUT signal
 * @als_max: maximum LUX detection (depends on RSET)
 * @dir: proximity direction: start as FALLING
 * @led: trigger for the infrared LED used by the proximity sensor
 */
struct cm3605 {};

static irqreturn_t cm3605_prox_irq(int irq, void *d)
{}

static int cm3605_get_lux(struct cm3605 *cm3605)
{}

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

static const struct iio_info cm3605_info =;

static const struct iio_event_spec cm3605_events[] =;

static const struct iio_chan_spec cm3605_channels[] =;

static int cm3605_probe(struct platform_device *pdev)
{}

static void cm3605_remove(struct platform_device *pdev)
{}

static int cm3605_pm_suspend(struct device *dev)
{}

static int cm3605_pm_resume(struct device *dev)
{}
static DEFINE_SIMPLE_DEV_PM_OPS(cm3605_dev_pm_ops, cm3605_pm_suspend,
				cm3605_pm_resume);

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

static struct platform_driver cm3605_driver =;
module_platform_driver();

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