18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/** 38c2ecf20Sopenharmony_ci * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * @File ctimap.h 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * @Brief 88c2ecf20Sopenharmony_ci * This file contains the definition of generic input mapper operations 98c2ecf20Sopenharmony_ci * for input mapper management. 108c2ecf20Sopenharmony_ci * 118c2ecf20Sopenharmony_ci * @Author Liu Chun 128c2ecf20Sopenharmony_ci * @Date May 23 2008 138c2ecf20Sopenharmony_ci */ 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#ifndef CTIMAP_H 168c2ecf20Sopenharmony_ci#define CTIMAP_H 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#include <linux/list.h> 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_cistruct imapper { 218c2ecf20Sopenharmony_ci unsigned short slot; /* the id of the slot containing input data */ 228c2ecf20Sopenharmony_ci unsigned short user; /* the id of the user resource consuming data */ 238c2ecf20Sopenharmony_ci unsigned short addr; /* the input mapper ram id */ 248c2ecf20Sopenharmony_ci unsigned short next; /* the next input mapper ram id */ 258c2ecf20Sopenharmony_ci struct list_head list; 268c2ecf20Sopenharmony_ci}; 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ciint input_mapper_add(struct list_head *mappers, struct imapper *entry, 298c2ecf20Sopenharmony_ci int (*map_op)(void *, struct imapper *), void *data); 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciint input_mapper_delete(struct list_head *mappers, struct imapper *entry, 328c2ecf20Sopenharmony_ci int (*map_op)(void *, struct imapper *), void *data); 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_civoid free_input_mapper_list(struct list_head *mappers); 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#endif /* CTIMAP_H */ 37