linux/drivers/input/joystick/adafruit-seesaw.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2023 Anshul Dalal <[email protected]>
 *
 * Driver for Adafruit Mini I2C Gamepad
 *
 * Based on the work of:
 *	Oleh Kravchenko (Sparkfun Qwiic Joystick driver)
 *
 * Datasheet: https://cdn-learn.adafruit.com/downloads/pdf/gamepad-qt.pdf
 * Product page: https://www.adafruit.com/product/5743
 * Firmware and hardware sources: https://github.com/adafruit/Adafruit_Seesaw
 *
 * TODO:
 *	- Add interrupt support
 */

#include <linux/unaligned.h>
#include <linux/bits.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/kernel.h>
#include <linux/module.h>

#define SEESAW_DEVICE_NAME

#define SEESAW_ADC_BASE

#define SEESAW_GPIO_DIRCLR_BULK
#define SEESAW_GPIO_BULK
#define SEESAW_GPIO_BULK_SET
#define SEESAW_GPIO_PULLENSET

#define SEESAW_STATUS_HW_ID
#define SEESAW_STATUS_SWRST

#define SEESAW_ADC_OFFSET

#define SEESAW_BUTTON_A
#define SEESAW_BUTTON_B
#define SEESAW_BUTTON_X
#define SEESAW_BUTTON_Y
#define SEESAW_BUTTON_START
#define SEESAW_BUTTON_SELECT

#define SEESAW_ANALOG_X
#define SEESAW_ANALOG_Y

#define SEESAW_JOYSTICK_MAX_AXIS
#define SEESAW_JOYSTICK_FUZZ
#define SEESAW_JOYSTICK_FLAT

#define SEESAW_GAMEPAD_POLL_INTERVAL_MS
#define SEESAW_GAMEPAD_POLL_MIN
#define SEESAW_GAMEPAD_POLL_MAX

static const u32 SEESAW_BUTTON_MASK =;

struct seesaw_gamepad {};

struct seesaw_data {};

static const struct key_entry seesaw_buttons_new[] =;

static int seesaw_register_read(struct i2c_client *client, u16 reg, void *buf,
				int count)
{}

static int seesaw_register_write_u8(struct i2c_client *client, u16 reg,
				    u8 value)
{}

static int seesaw_register_write_u32(struct i2c_client *client, u16 reg,
				     u32 value)
{}

static int seesaw_read_data(struct i2c_client *client, struct seesaw_data *data)
{}

static int seesaw_open(struct input_dev *input)
{}

static void seesaw_poll(struct input_dev *input)
{}

static int seesaw_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver seesaw_driver =;
module_i2c_driver();

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