| /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ |
| * Copyright (c) 2019 Amlogic, Inc. All rights reserved. |
| #ifndef __LINUX_ADC_KEYPAD_H |
| #define __LINUX_ADC_KEYPAD_H |
| #include <linux/kobject.h> |
| #include <linux/workqueue.h> |
| #include <linux/iio/consumer.h> |
| #ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND |
| #include <linux/amlogic/pm.h> |
| #define DRIVE_NAME "adc_keypad" |
| enum SAMPLE_VALUE_RANGE { |
| SAM_MAX = 4095 /*12bit adc*/ |
| unsigned int code; /* input key code */ |
| int value; /* voltage/3.3v * 1023 */ |
| unsigned char chan_num; /*number of channel exclude duplicate*/ |
| unsigned int report_code; |
| unsigned int poll_period; /*key scan period*/ |
| struct list_head adckey_head; |
| struct input_polled_dev *poll_dev; |
| struct iio_channel *pchan[8]; |
| #ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND |
| struct early_suspend early_suspend; |