linux-loongson/include/linux/input/touch-overlay.h
Javier Carrasco ea4d331050 Input: touch-overlay - add touchscreen overlay handling
Some touch devices provide mechanical overlays with different objects
like buttons or clipped touchscreen surfaces.

In order to support these objects, add a series of helper functions
to the input subsystem to transform them into overlay objects via
device tree nodes.

These overlay objects consume the raw touch events and report the
expected input events depending on the object properties.

Note that the current implementation allows for multiple definitions
of touchscreen areas (regions that report touch events), but only the
first one will be used for the touchscreen device that the consumers
typically provide.
Should the need for multiple touchscreen areas arise, additional
touchscreen devices would be required at the consumer side.
There is no limitation in the number of touch areas defined as buttons.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
Link: https://lore.kernel.org/r/20241016-feature-ts_virtobj_patch-v11-2-b292a1bbb0a1@wolfvision.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2025-07-27 01:41:21 -07:00

26 lines
657 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2023 Javier Carrasco <javier.carrasco@wolfvision.net>
*/
#ifndef _TOUCH_OVERLAY
#define _TOUCH_OVERLAY
#include <linux/types.h>
struct input_dev;
int touch_overlay_map(struct list_head *list, struct input_dev *input);
void touch_overlay_get_touchscreen_abs(struct list_head *list, u16 *x, u16 *y);
bool touch_overlay_mapped_touchscreen(struct list_head *list);
bool touch_overlay_process_contact(struct list_head *list,
struct input_dev *input,
struct input_mt_pos *pos, int slot);
void touch_overlay_sync_frame(struct list_head *list, struct input_dev *input);
#endif