linux/drivers/input/misc/drv2667.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * DRV2667 haptics driver family
 *
 * Author: Dan Murphy <[email protected]>
 *
 * Copyright: (C) 2014 Texas Instruments, Inc.
 */

#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/regulator/consumer.h>

/* Contol registers */
#define DRV2667_STATUS
#define DRV2667_CTRL_1
#define DRV2667_CTRL_2
/* Waveform sequencer */
#define DRV2667_WV_SEQ_0
#define DRV2667_WV_SEQ_1
#define DRV2667_WV_SEQ_2
#define DRV2667_WV_SEQ_3
#define DRV2667_WV_SEQ_4
#define DRV2667_WV_SEQ_5
#define DRV2667_WV_SEQ_6
#define DRV2667_WV_SEQ_7
#define DRV2667_FIFO
#define DRV2667_PAGE
#define DRV2667_MAX_REG

#define DRV2667_PAGE_0
#define DRV2667_PAGE_1
#define DRV2667_PAGE_2
#define DRV2667_PAGE_3
#define DRV2667_PAGE_4
#define DRV2667_PAGE_5
#define DRV2667_PAGE_6
#define DRV2667_PAGE_7
#define DRV2667_PAGE_8

/* RAM fields */
#define DRV2667_RAM_HDR_SZ
/* RAM Header addresses */
#define DRV2667_RAM_START_HI
#define DRV2667_RAM_START_LO
#define DRV2667_RAM_STOP_HI
#define DRV2667_RAM_STOP_LO
#define DRV2667_RAM_REPEAT_CT
/* RAM data addresses */
#define DRV2667_RAM_AMP
#define DRV2667_RAM_FREQ
#define DRV2667_RAM_DURATION
#define DRV2667_RAM_ENVELOPE

/* Control 1 Register */
#define DRV2667_25_VPP_GAIN
#define DRV2667_50_VPP_GAIN
#define DRV2667_75_VPP_GAIN
#define DRV2667_100_VPP_GAIN
#define DRV2667_DIGITAL_IN
#define DRV2667_ANALOG_IN

/* Control 2 Register */
#define DRV2667_GO
#define DRV2667_STANDBY
#define DRV2667_DEV_RST

/* RAM Envelope settings */
#define DRV2667_NO_ENV
#define DRV2667_32_MS_ENV
#define DRV2667_64_MS_ENV
#define DRV2667_96_MS_ENV
#define DRV2667_128_MS_ENV
#define DRV2667_160_MS_ENV
#define DRV2667_192_MS_ENV
#define DRV2667_224_MS_ENV
#define DRV2667_256_MS_ENV
#define DRV2667_512_MS_ENV
#define DRV2667_768_MS_ENV
#define DRV2667_1024_MS_ENV
#define DRV2667_1280_MS_ENV
#define DRV2667_1536_MS_ENV
#define DRV2667_1792_MS_ENV
#define DRV2667_2048_MS_ENV

/**
 * struct drv2667_data -
 * @input_dev: Pointer to the input device
 * @client: Pointer to the I2C client
 * @regmap: Register map of the device
 * @work: Work item used to off load the enable/disable of the vibration
 * @regulator: Pointer to the regulator for the IC
 * @page: Page number
 * @magnitude: Magnitude of the vibration event
 * @frequency: Frequency of the vibration event
**/
struct drv2667_data {};

static const struct reg_default drv2667_reg_defs[] =;

static int drv2667_set_waveform_freq(struct drv2667_data *haptics)
{}

static void drv2667_worker(struct work_struct *work)
{}

static int drv2667_haptics_play(struct input_dev *input, void *data,
				struct ff_effect *effect)
{}

static void drv2667_close(struct input_dev *input)
{}

static const struct reg_sequence drv2667_init_regs[] =;

static const struct reg_sequence drv2667_page1_init[] =;

static int drv2667_init(struct drv2667_data *haptics)
{}

static const struct regmap_config drv2667_regmap_config =;

static int drv2667_probe(struct i2c_client *client)
{}

static int drv2667_suspend(struct device *dev)
{}

static int drv2667_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(drv2667_pm_ops, drv2667_suspend, drv2667_resume);

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

#ifdef CONFIG_OF
static const struct of_device_id drv2667_of_match[] =;
MODULE_DEVICE_TABLE(of, drv2667_of_match);
#endif

static struct i2c_driver drv2667_driver =;
module_i2c_driver();

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