linux/drivers/input/keyboard/max7359_keypad.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * max7359_keypad.c - MAX7359 Key Switch Controller Driver
 *
 * Copyright (C) 2009 Samsung Electronics
 * Kim Kyuwon <[email protected]>
 *
 * Based on pxa27x_keypad.c
 *
 * Datasheet: http://www.maxim-ic.com/quick_view2.cfm/qv_pk/5456
 */

#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/input.h>
#include <linux/input/matrix_keypad.h>

#define MAX7359_MAX_KEY_ROWS
#define MAX7359_MAX_KEY_COLS
#define MAX7359_MAX_KEY_NUM
#define MAX7359_ROW_SHIFT

/*
 * MAX7359 registers
 */
#define MAX7359_REG_KEYFIFO
#define MAX7359_REG_CONFIG
#define MAX7359_REG_DEBOUNCE
#define MAX7359_REG_INTERRUPT
#define MAX7359_REG_PORTS
#define MAX7359_REG_KEYREP
#define MAX7359_REG_SLEEP

/*
 * Configuration register bits
 */
#define MAX7359_CFG_SLEEP
#define MAX7359_CFG_INTERRUPT
#define MAX7359_CFG_KEY_RELEASE
#define MAX7359_CFG_WAKEUP
#define MAX7359_CFG_TIMEOUT

/*
 * Autosleep register values (ms)
 */
#define MAX7359_AUTOSLEEP_8192
#define MAX7359_AUTOSLEEP_4096
#define MAX7359_AUTOSLEEP_2048
#define MAX7359_AUTOSLEEP_1024
#define MAX7359_AUTOSLEEP_512
#define MAX7359_AUTOSLEEP_256

struct max7359_keypad {};

static int max7359_write_reg(struct i2c_client *client, u8 reg, u8 val)
{}

static int max7359_read_reg(struct i2c_client *client, int reg)
{}

/* runs in an IRQ thread -- can (and will!) sleep */
static irqreturn_t max7359_interrupt(int irq, void *dev_id)
{}

/*
 * Let MAX7359 fall into a deep sleep:
 * If no keys are pressed, enter sleep mode for 8192 ms. And if any
 * key is pressed, the MAX7359 returns to normal operating mode.
 */
static inline void max7359_fall_deepsleep(struct i2c_client *client)
{}

/*
 * Let MAX7359 take a catnap:
 * Autosleep just for 256 ms.
 */
static inline void max7359_take_catnap(struct i2c_client *client)
{}

static int max7359_open(struct input_dev *dev)
{}

static void max7359_close(struct input_dev *dev)
{}

static void max7359_initialize(struct i2c_client *client)
{}

static int max7359_probe(struct i2c_client *client)
{}

static int max7359_suspend(struct device *dev)
{}

static int max7359_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);

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

static struct i2c_driver max7359_i2c_driver =;

module_i2c_driver();

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