diff options
| -rw-r--r-- | drivers/input/touchscreen/maxim_sti.c | 22 | ||||
| -rw-r--r-- | include/uapi/linux/Kbuild | 1 | ||||
| -rw-r--r-- | include/uapi/linux/maxim_sti.h (renamed from include/linux/input/maxim_sti.h) | 34 |
3 files changed, 25 insertions, 32 deletions
diff --git a/drivers/input/touchscreen/maxim_sti.c b/drivers/input/touchscreen/maxim_sti.c index c97615923802..0ab796f305ae 100644 --- a/drivers/input/touchscreen/maxim_sti.c +++ b/drivers/input/touchscreen/maxim_sti.c @@ -27,7 +27,9 @@ #include <linux/interrupt.h> #include <linux/input.h> #include <linux/regulator/consumer.h> -#include <linux/input/maxim_sti.h> +#include <net/genetlink.h> +#include <net/sock.h> +#include <uapi/linux/maxim_sti.h> #include <asm/byteorder.h> /* MUST include this header to get byte order */ #ifdef CONFIG_OF #include <linux/gpio.h> @@ -57,6 +59,24 @@ /****************************************************************************\ * Device context structure, globals, and macros * \****************************************************************************/ +#define MAXIM_STI_NAME "maxim_sti" + +struct maxim_sti_pdata { + char *touch_fusion; + char *config_file; + char *nl_family; + char *fw_name; + u32 nl_mc_groups; + u32 chip_access_method; + u32 default_reset_state; + u32 tx_buf_size; + u32 rx_buf_size; + int gpio_reset; + int gpio_irq; + int (*init)(struct maxim_sti_pdata *pdata, bool init); + void (*reset)(struct maxim_sti_pdata *pdata, int value); + int (*irq)(struct maxim_sti_pdata *pdata); +}; struct dev_data; diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 1edbc56bfa3f..671e98bf2496 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -258,6 +258,7 @@ header-y += magic.h header-y += major.h header-y += map_to_7segment.h header-y += matroxfb.h +header-y += maxim_sti.h header-y += mdio.h header-y += mdss_rotator.h header-y += media.h diff --git a/include/linux/input/maxim_sti.h b/include/uapi/linux/maxim_sti.h index 8cfc1f4ffd4c..77ae564d1548 100644 --- a/include/linux/input/maxim_sti.h +++ b/include/uapi/linux/maxim_sti.h @@ -20,10 +20,7 @@ #ifndef __MAXIM_STI_H__ #define __MAXIM_STI_H__ -#ifdef __KERNEL__ -#include <net/genetlink.h> -#include <net/sock.h> -#else +#ifndef __KERNEL__ #include <stdlib.h> #include "genetlink.h" #endif @@ -61,7 +58,7 @@ ((struct nlattr *)((void *)aptr + \ NLA_ALIGN(((struct nlattr *)aptr)->nla_len))) #define GENL_CMP(name1, name2) strncmp(name1, name2, GENL_NAMSIZ) -#define GENL_COPY(name1, name2) strncpy(name1, name2, GENL_NAMSIZ) +#define GENL_COPY(name1, name2) strlcpy(name1, name2, GENL_NAMSIZ) #define GENL_CHK(name) (strlen(name) > (GENL_NAMSIZ - 1)) #define MSG_TYPE(nptr) NL_ATTR_FIRST(nptr)->nla_type #define MSG_PAYLOAD(nptr) NL_ATTR_VAL(NL_ATTR_FIRST(nptr), void) @@ -106,7 +103,7 @@ nl_add_attr(void *buf, __u16 type, void *ptr, __u16 len) a_ptr = nl_alloc_attr(buf, type, len); if (a_ptr == NULL) - return -1; + return -EPERM; memcpy(a_ptr, ptr, len); return 0; } @@ -329,30 +326,5 @@ struct __attribute__ ((__packed__)) fu_sysfs_info { __u16 lcd_fps_value; }; -#ifdef __KERNEL__ -/****************************************************************************\ -* Kernel platform data structure * -\****************************************************************************/ - -#define MAXIM_STI_NAME "maxim_sti" - -struct maxim_sti_pdata { - char *touch_fusion; - char *config_file; - char *nl_family; - char *fw_name; - u32 nl_mc_groups; - u32 chip_access_method; - u32 default_reset_state; - u32 tx_buf_size; - u32 rx_buf_size; - int gpio_reset; - int gpio_irq; - int (*init)(struct maxim_sti_pdata *pdata, bool init); - void (*reset)(struct maxim_sti_pdata *pdata, int value); - int (*irq)(struct maxim_sti_pdata *pdata); -}; -#endif - #endif |
