linux/drivers/input/joystick/as5011.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2010, 2011 Fabien Marteau <[email protected]>
 * Sponsored by ARMadeus Systems
 *
 * Driver for Austria Microsystems joysticks AS5011
 *
 * TODO:
 *	- Power on the chip when open() and power down when close()
 *	- Manage power mode
 */

#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/gpio/consumer.h>
#include <linux/delay.h>
#include <linux/input/as5011.h>
#include <linux/slab.h>
#include <linux/module.h>

#define DRIVER_DESC
#define MODULE_DEVICE_ALIAS

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

/* registers */
#define AS5011_CTRL1
#define AS5011_CTRL2
#define AS5011_XP
#define AS5011_XN
#define AS5011_YP
#define AS5011_YN
#define AS5011_X_REG
#define AS5011_Y_REG
#define AS5011_X_RES_INT
#define AS5011_Y_RES_INT

/* CTRL1 bits */
#define AS5011_CTRL1_LP_PULSED
#define AS5011_CTRL1_LP_ACTIVE
#define AS5011_CTRL1_LP_CONTINUE
#define AS5011_CTRL1_INT_WUP_EN
#define AS5011_CTRL1_INT_ACT_EN
#define AS5011_CTRL1_EXT_CLK_EN
#define AS5011_CTRL1_SOFT_RST
#define AS5011_CTRL1_DATA_VALID

/* CTRL2 bits */
#define AS5011_CTRL2_EXT_SAMPLE_EN
#define AS5011_CTRL2_RC_BIAS_ON
#define AS5011_CTRL2_INV_SPINNING

#define AS5011_MAX_AXIS
#define AS5011_MIN_AXIS
#define AS5011_FUZZ
#define AS5011_FLAT

struct as5011_device {};

static int as5011_i2c_write(struct i2c_client *client,
			    uint8_t aregaddr,
			    uint8_t avalue)
{}

static int as5011_i2c_read(struct i2c_client *client,
			   uint8_t aregaddr, signed char *value)
{}

static irqreturn_t as5011_button_interrupt(int irq, void *dev_id)
{}

static irqreturn_t as5011_axis_interrupt(int irq, void *dev_id)
{}

static int as5011_configure_chip(struct as5011_device *as5011,
				const struct as5011_platform_data *plat_dat)
{}

static int as5011_probe(struct i2c_client *client)
{}

static void as5011_remove(struct i2c_client *client)
{}

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

static struct i2c_driver as5011_driver =;

module_i2c_driver();