^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * @File ctimap.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * @Brief
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * This file contains the definition of generic input mapper operations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * for input mapper management.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * @Author Liu Chun
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * @Date May 23 2008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #ifndef CTIMAP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define CTIMAP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct imapper {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) unsigned short slot; /* the id of the slot containing input data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) unsigned short user; /* the id of the user resource consuming data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) unsigned short addr; /* the input mapper ram id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) unsigned short next; /* the next input mapper ram id */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) int input_mapper_add(struct list_head *mappers, struct imapper *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) int (*map_op)(void *, struct imapper *), void *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) int input_mapper_delete(struct list_head *mappers, struct imapper *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) int (*map_op)(void *, struct imapper *), void *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) void free_input_mapper_list(struct list_head *mappers);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif /* CTIMAP_H */