180503b23SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 231a62963SBryan Wu /* 331a62963SBryan Wu * include/linux/input/ad714x.h 431a62963SBryan Wu * 531a62963SBryan Wu * AD714x is very flexible, it can be used as buttons, scrollwheel, 631a62963SBryan Wu * slider, touchpad at the same time. That depends on the boards. 731a62963SBryan Wu * The platform_data for the device's "struct device" holds this 831a62963SBryan Wu * information. 931a62963SBryan Wu * 103532cb0cSMichael Hennerich * Copyright 2009-2011 Analog Devices Inc. 1131a62963SBryan Wu */ 1231a62963SBryan Wu 1331a62963SBryan Wu #ifndef __LINUX_INPUT_AD714X_H__ 1431a62963SBryan Wu #define __LINUX_INPUT_AD714X_H__ 1531a62963SBryan Wu 1631a62963SBryan Wu #define STAGE_NUM 12 1731a62963SBryan Wu #define STAGE_CFGREG_NUM 8 1831a62963SBryan Wu #define SYS_CFGREG_NUM 8 1931a62963SBryan Wu 2031a62963SBryan Wu /* board information which need be initialized in arch/mach... */ 2131a62963SBryan Wu struct ad714x_slider_plat { 2231a62963SBryan Wu int start_stage; 2331a62963SBryan Wu int end_stage; 2431a62963SBryan Wu int max_coord; 2531a62963SBryan Wu }; 2631a62963SBryan Wu 2731a62963SBryan Wu struct ad714x_wheel_plat { 2831a62963SBryan Wu int start_stage; 2931a62963SBryan Wu int end_stage; 3031a62963SBryan Wu int max_coord; 3131a62963SBryan Wu }; 3231a62963SBryan Wu 3331a62963SBryan Wu struct ad714x_touchpad_plat { 3431a62963SBryan Wu int x_start_stage; 3531a62963SBryan Wu int x_end_stage; 3631a62963SBryan Wu int x_max_coord; 3731a62963SBryan Wu 3831a62963SBryan Wu int y_start_stage; 3931a62963SBryan Wu int y_end_stage; 4031a62963SBryan Wu int y_max_coord; 4131a62963SBryan Wu }; 4231a62963SBryan Wu 4331a62963SBryan Wu struct ad714x_button_plat { 4431a62963SBryan Wu int keycode; 4531a62963SBryan Wu unsigned short l_mask; 4631a62963SBryan Wu unsigned short h_mask; 4731a62963SBryan Wu }; 4831a62963SBryan Wu 4931a62963SBryan Wu struct ad714x_platform_data { 5031a62963SBryan Wu int slider_num; 5131a62963SBryan Wu int wheel_num; 5231a62963SBryan Wu int touchpad_num; 5331a62963SBryan Wu int button_num; 5431a62963SBryan Wu struct ad714x_slider_plat *slider; 5531a62963SBryan Wu struct ad714x_wheel_plat *wheel; 5631a62963SBryan Wu struct ad714x_touchpad_plat *touchpad; 5731a62963SBryan Wu struct ad714x_button_plat *button; 5831a62963SBryan Wu unsigned short stage_cfg_reg[STAGE_NUM][STAGE_CFGREG_NUM]; 5931a62963SBryan Wu unsigned short sys_cfg_reg[SYS_CFGREG_NUM]; 603532cb0cSMichael Hennerich unsigned long irqflags; 6131a62963SBryan Wu }; 6231a62963SBryan Wu 6331a62963SBryan Wu #endif 64