linux/drivers/input/misc/kxtj9.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2011 Kionix, Inc.
 * Written by Chris Hudson <[email protected]>
 */

#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/input/kxtj9.h>

#define NAME
#define G_MAX
/* OUTPUT REGISTERS */
#define XOUT_L
#define WHO_AM_I
/* CONTROL REGISTERS */
#define INT_REL
#define CTRL_REG1
#define INT_CTRL1
#define DATA_CTRL
/* CONTROL REGISTER 1 BITS */
#define PC1_OFF
#define PC1_ON
/* Data ready funtion enable bit: set during probe if using irq mode */
#define DRDYE
/* DATA CONTROL REGISTER BITS */
#define ODR12_5F
#define ODR25F
#define ODR50F
#define ODR100F
#define ODR200F
#define ODR400F
#define ODR800F
/* INTERRUPT CONTROL REGISTER 1 BITS */
/* Set these during probe if using irq mode */
#define KXTJ9_IEL
#define KXTJ9_IEA
#define KXTJ9_IEN
/* INPUT_ABS CONSTANTS */
#define FUZZ
#define FLAT
/* RESUME STATE INDICES */
#define RES_DATA_CTRL
#define RES_CTRL_REG1
#define RES_INT_CTRL1
#define RESUME_ENTRIES

/*
 * The following table lists the maximum appropriate poll interval for each
 * available output data rate.
 */
static const struct {} kxtj9_odr_table[] =;

struct kxtj9_data {};

static int kxtj9_i2c_read(struct kxtj9_data *tj9, u8 addr, u8 *data, int len)
{}

static void kxtj9_report_acceleration_data(struct kxtj9_data *tj9)
{}

static irqreturn_t kxtj9_isr(int irq, void *dev)
{}

static int kxtj9_update_g_range(struct kxtj9_data *tj9, u8 new_g_range)
{}

static int kxtj9_update_odr(struct kxtj9_data *tj9, unsigned int poll_interval)
{}

static int kxtj9_device_power_on(struct kxtj9_data *tj9)
{}

static void kxtj9_device_power_off(struct kxtj9_data *tj9)
{}

static int kxtj9_enable(struct kxtj9_data *tj9)
{}

static void kxtj9_disable(struct kxtj9_data *tj9)
{}

static int kxtj9_input_open(struct input_dev *input)
{}

static void kxtj9_input_close(struct input_dev *dev)
{}

/*
 * When IRQ mode is selected, we need to provide an interface to allow the user
 * to change the output data rate of the part.  For consistency, we are using
 * the set_poll method, which accepts a poll interval in milliseconds, and then
 * calls update_odr() while passing this value as an argument.  In IRQ mode, the
 * data outputs will not be read AT the requested poll interval, rather, the
 * lowest ODR that can support the requested interval.  The client application
 * will be responsible for retrieving data from the input node at the desired
 * interval.
 */

/* Returns currently selected poll interval (in ms) */
static ssize_t kxtj9_get_poll(struct device *dev,
				struct device_attribute *attr, char *buf)
{}

/* Allow users to select a new poll interval (in ms) */
static ssize_t kxtj9_set_poll(struct device *dev, struct device_attribute *attr,
						const char *buf, size_t count)
{}

static DEVICE_ATTR(poll, S_IRUGO|S_IWUSR, kxtj9_get_poll, kxtj9_set_poll);

static struct attribute *kxtj9_attrs[] =;

static umode_t kxtj9_attr_is_visible(struct kobject *kobj,
				     struct attribute *attr, int n)
{}

static struct attribute_group kxtj9_group =;
__ATTRIBUTE_GROUPS();

static void kxtj9_poll(struct input_dev *input)
{}

static void kxtj9_platform_exit(void *data)
{}

static int kxtj9_verify(struct kxtj9_data *tj9)
{}

static int kxtj9_probe(struct i2c_client *client)
{}

static int kxtj9_suspend(struct device *dev)
{}

static int kxtj9_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(kxtj9_pm_ops, kxtj9_suspend, kxtj9_resume);

static const struct i2c_device_id kxtj9_id[] =;

MODULE_DEVICE_TABLE(i2c, kxtj9_id);

static struct i2c_driver kxtj9_driver =;

module_i2c_driver();

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