linux/include/linux/input/adp5589.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Analog Devices ADP5589/ADP5585 I/O Expander and QWERTY Keypad Controller
 *
 * Copyright 2010-2011 Analog Devices Inc.
 */

#ifndef _ADP5589_H
#define _ADP5589_H

/*
 * ADP5589 specific GPI and Keymap defines
 */

#define ADP5589_KEYMAPSIZE

#define ADP5589_GPI_PIN_ROW0
#define ADP5589_GPI_PIN_ROW1
#define ADP5589_GPI_PIN_ROW2
#define ADP5589_GPI_PIN_ROW3
#define ADP5589_GPI_PIN_ROW4
#define ADP5589_GPI_PIN_ROW5
#define ADP5589_GPI_PIN_ROW6
#define ADP5589_GPI_PIN_ROW7
#define ADP5589_GPI_PIN_COL0
#define ADP5589_GPI_PIN_COL1
#define ADP5589_GPI_PIN_COL2
#define ADP5589_GPI_PIN_COL3
#define ADP5589_GPI_PIN_COL4
#define ADP5589_GPI_PIN_COL5
#define ADP5589_GPI_PIN_COL6
#define ADP5589_GPI_PIN_COL7
#define ADP5589_GPI_PIN_COL8
#define ADP5589_GPI_PIN_COL9
#define ADP5589_GPI_PIN_COL10
#define GPI_LOGIC1
#define GPI_LOGIC2

#define ADP5589_GPI_PIN_ROW_BASE
#define ADP5589_GPI_PIN_ROW_END
#define ADP5589_GPI_PIN_COL_BASE
#define ADP5589_GPI_PIN_COL_END

#define ADP5589_GPI_PIN_BASE
#define ADP5589_GPI_PIN_END

#define ADP5589_GPIMAPSIZE_MAX

/*
 * ADP5585 specific GPI and Keymap defines
 */

#define ADP5585_KEYMAPSIZE

#define ADP5585_GPI_PIN_ROW0
#define ADP5585_GPI_PIN_ROW1
#define ADP5585_GPI_PIN_ROW2
#define ADP5585_GPI_PIN_ROW3
#define ADP5585_GPI_PIN_ROW4
#define ADP5585_GPI_PIN_ROW5
#define ADP5585_GPI_PIN_COL0
#define ADP5585_GPI_PIN_COL1
#define ADP5585_GPI_PIN_COL2
#define ADP5585_GPI_PIN_COL3
#define ADP5585_GPI_PIN_COL4
#define GPI_LOGIC

#define ADP5585_GPI_PIN_ROW_BASE
#define ADP5585_GPI_PIN_ROW_END
#define ADP5585_GPI_PIN_COL_BASE
#define ADP5585_GPI_PIN_COL_END

#define ADP5585_GPI_PIN_BASE
#define ADP5585_GPI_PIN_END

#define ADP5585_GPIMAPSIZE_MAX

struct adp5589_gpi_map {};

/* scan_cycle_time */
#define ADP5589_SCAN_CYCLE_10ms
#define ADP5589_SCAN_CYCLE_20ms
#define ADP5589_SCAN_CYCLE_30ms
#define ADP5589_SCAN_CYCLE_40ms

/* RESET_CFG */
#define RESET_PULSE_WIDTH_500us
#define RESET_PULSE_WIDTH_1ms
#define RESET_PULSE_WIDTH_2ms
#define RESET_PULSE_WIDTH_10ms

#define RESET_TRIG_TIME_0ms
#define RESET_TRIG_TIME_1000ms
#define RESET_TRIG_TIME_1500ms
#define RESET_TRIG_TIME_2000ms
#define RESET_TRIG_TIME_2500ms
#define RESET_TRIG_TIME_3000ms
#define RESET_TRIG_TIME_3500ms
#define RESET_TRIG_TIME_4000ms

#define RESET_PASSTHRU_EN
#define RESET1_POL_HIGH
#define RESET1_POL_LOW
#define RESET2_POL_HIGH
#define RESET2_POL_LOW

/* ADP5589 Mask Bits:
 * C C C C C C C C C C C | R R R R R R R R
 * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0
 * 0
 * ---------------- BIT ------------------
 * 1 1 1 1 1 1 1 1 1 0 0 | 0 0 0 0 0 0 0 0
 * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0
 */

#define ADP_ROW(x)
#define ADP_COL(x)
#define ADP5589_ROW_MASK
#define ADP5589_COL_MASK
#define ADP5589_COL_SHIFT
#define ADP5589_MAX_ROW_NUM
#define ADP5589_MAX_COL_NUM

/* ADP5585 Mask Bits:
 * C C C C C | R R R R R R
 * 4 3 2 1 0 | 5 4 3 2 1 0
 *
 * ---- BIT -- -----------
 * 1 0 0 0 0 | 0 0 0 0 0 0
 * 0 9 8 7 6 | 5 4 3 2 1 0
 */

#define ADP5585_ROW_MASK
#define ADP5585_COL_MASK
#define ADP5585_ROW_SHIFT
#define ADP5585_COL_SHIFT
#define ADP5585_MAX_ROW_NUM
#define ADP5585_MAX_COL_NUM

#define ADP5585_ROW(x)
#define ADP5585_COL(x)

/* Put one of these structures in i2c_board_info platform_data */

struct adp5589_kpad_platform_data {};

struct i2c_client; /* forward declaration */

struct adp5589_gpio_platform_data {};

#endif