Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* drivers/input/touchscreen/gt1x.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * 2010 - 2013 Goodix Technology.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * This program is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * it under the terms of the GNU General Public License as published by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * the Free Software Foundation; either version 2 of the License, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  * (at your option) any later version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)  * This program is distributed in the hope that it will be a reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)  * to you, when you are integrating the GOODiX's CTP IC into your system,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)  * but WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)  * General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)  * Version: 1.4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)  * Release Date:  2015/07/10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #ifndef _GOODIX_GT1X_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define _GOODIX_GT1X_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include "gt1x_generic.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #ifdef GTP_CONFIG_OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <linux/of_gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <linux/regulator/consumer.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #ifdef CONFIG_FB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include <linux/notifier.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <linux/fb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #ifdef CONFIG_HAS_EARLYSUSPEND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #include <linux/earlysuspend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define IIC_MAX_TRANSFER_SIZE       250
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) /* Customize your I/O ports & I/O operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #ifdef GTP_CONFIG_OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) extern bool gt1x_gt5688;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) extern int gt1x_rst_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern int gt1x_int_gpio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) extern struct regulator *gt1x_supply;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #define GTP_RST_PORT gt1x_rst_gpio
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define GTP_INT_PORT gt1x_int_gpio
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define GTP_RST_PORT    102
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define GTP_INT_PORT    52
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #define GTP_INT_IRQ     gpio_to_irq(GTP_INT_PORT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) /*#define GTP_INT_CFG     S3C_GPIO_SFN(0xF)*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define GTP_GPIO_AS_INPUT(pin)          do {\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	gpio_direction_input(pin);\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define GTP_GPIO_AS_INT(pin)            do {\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	GTP_GPIO_AS_INPUT(pin);\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) } while (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define GTP_GPIO_GET_VALUE(pin)         gpio_get_value(pin)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define GTP_GPIO_OUTPUT(pin, level)      gpio_direction_output(pin, level)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define GTP_IRQ_TAB                     {IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, IRQ_TYPE_LEVEL_LOW, IRQ_TYPE_LEVEL_HIGH}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #endif /* _GOODIX_GT1X_H_ */