linux/drivers/input/keyboard/tca8418_keypad.c

/*
 * Driver for TCA8418 I2C keyboard
 *
 * Copyright (C) 2011 Fuel7, Inc.  All rights reserved.
 *
 * Author: Kyle Manna <[email protected]>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License v2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 021110-1307, USA.
 *
 * If you can't comply with GPLv2, alternative licensing terms may be
 * arranged. Please contact Fuel7, Inc. (http://fuel7.com/) for proprietary
 * alternative licensing inquiries.
 */

#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/input/matrix_keypad.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/types.h>

/* TCA8418 hardware limits */
#define TCA8418_MAX_ROWS
#define TCA8418_MAX_COLS

/* TCA8418 register offsets */
#define REG_CFG
#define REG_INT_STAT
#define REG_KEY_LCK_EC
#define REG_KEY_EVENT_A
#define REG_KEY_EVENT_B
#define REG_KEY_EVENT_C
#define REG_KEY_EVENT_D
#define REG_KEY_EVENT_E
#define REG_KEY_EVENT_F
#define REG_KEY_EVENT_G
#define REG_KEY_EVENT_H
#define REG_KEY_EVENT_I
#define REG_KEY_EVENT_J
#define REG_KP_LCK_TIMER
#define REG_UNLOCK1
#define REG_UNLOCK2
#define REG_GPIO_INT_STAT1
#define REG_GPIO_INT_STAT2
#define REG_GPIO_INT_STAT3
#define REG_GPIO_DAT_STAT1
#define REG_GPIO_DAT_STAT2
#define REG_GPIO_DAT_STAT3
#define REG_GPIO_DAT_OUT1
#define REG_GPIO_DAT_OUT2
#define REG_GPIO_DAT_OUT3
#define REG_GPIO_INT_EN1
#define REG_GPIO_INT_EN2
#define REG_GPIO_INT_EN3
#define REG_KP_GPIO1
#define REG_KP_GPIO2
#define REG_KP_GPIO3
#define REG_GPI_EM1
#define REG_GPI_EM2
#define REG_GPI_EM3
#define REG_GPIO_DIR1
#define REG_GPIO_DIR2
#define REG_GPIO_DIR3
#define REG_GPIO_INT_LVL1
#define REG_GPIO_INT_LVL2
#define REG_GPIO_INT_LVL3
#define REG_DEBOUNCE_DIS1
#define REG_DEBOUNCE_DIS2
#define REG_DEBOUNCE_DIS3
#define REG_GPIO_PULL1
#define REG_GPIO_PULL2
#define REG_GPIO_PULL3

/* TCA8418 bit definitions */
#define CFG_AI
#define CFG_GPI_E_CFG
#define CFG_OVR_FLOW_M
#define CFG_INT_CFG
#define CFG_OVR_FLOW_IEN
#define CFG_K_LCK_IEN
#define CFG_GPI_IEN
#define CFG_KE_IEN

#define INT_STAT_CAD_INT
#define INT_STAT_OVR_FLOW_INT
#define INT_STAT_K_LCK_INT
#define INT_STAT_GPI_INT
#define INT_STAT_K_INT

/* TCA8418 register masks */
#define KEY_LCK_EC_KEC
#define KEY_EVENT_CODE
#define KEY_EVENT_VALUE

struct tca8418_keypad {};

/*
 * Write a byte to the TCA8418
 */
static int tca8418_write_byte(struct tca8418_keypad *keypad_data,
			      int reg, u8 val)
{}

/*
 * Read a byte from the TCA8418
 */
static int tca8418_read_byte(struct tca8418_keypad *keypad_data,
			     int reg, u8 *val)
{}

static void tca8418_read_keypad(struct tca8418_keypad *keypad_data)
{}

/*
 * Threaded IRQ handler and this can (and will) sleep.
 */
static irqreturn_t tca8418_irq_handler(int irq, void *dev_id)
{}

/*
 * Configure the TCA8418 for keypad operation
 */
static int tca8418_configure(struct tca8418_keypad *keypad_data,
			     u32 rows, u32 cols)
{}

static int tca8418_keypad_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver tca8418_keypad_driver =;

static int __init tca8418_keypad_init(void)
{}
subsys_initcall(tca8418_keypad_init);

static void __exit tca8418_keypad_exit(void)
{}
module_exit(tca8418_keypad_exit);

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