linux/include/media/rc-map.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * rc-map.h - define RC map names used by RC drivers
 *
 * Copyright (c) 2010 by Mauro Carvalho Chehab
 */

#ifndef _MEDIA_RC_MAP_H
#define _MEDIA_RC_MAP_H

#include <linux/input.h>
#include <uapi/linux/lirc.h>

#define RC_PROTO_BIT_NONE
#define RC_PROTO_BIT_UNKNOWN
#define RC_PROTO_BIT_OTHER
#define RC_PROTO_BIT_RC5
#define RC_PROTO_BIT_RC5X_20
#define RC_PROTO_BIT_RC5_SZ
#define RC_PROTO_BIT_JVC
#define RC_PROTO_BIT_SONY12
#define RC_PROTO_BIT_SONY15
#define RC_PROTO_BIT_SONY20
#define RC_PROTO_BIT_NEC
#define RC_PROTO_BIT_NECX
#define RC_PROTO_BIT_NEC32
#define RC_PROTO_BIT_SANYO
#define RC_PROTO_BIT_MCIR2_KBD
#define RC_PROTO_BIT_MCIR2_MSE
#define RC_PROTO_BIT_RC6_0
#define RC_PROTO_BIT_RC6_6A_20
#define RC_PROTO_BIT_RC6_6A_24
#define RC_PROTO_BIT_RC6_6A_32
#define RC_PROTO_BIT_RC6_MCE
#define RC_PROTO_BIT_SHARP
#define RC_PROTO_BIT_XMP
#define RC_PROTO_BIT_CEC
#define RC_PROTO_BIT_IMON
#define RC_PROTO_BIT_RCMM12
#define RC_PROTO_BIT_RCMM24
#define RC_PROTO_BIT_RCMM32
#define RC_PROTO_BIT_XBOX_DVD

#if IS_ENABLED(CONFIG_IR_RC5_DECODER)
#define __RC_PROTO_RC5_CODEC
#else
#define __RC_PROTO_RC5_CODEC
#endif

#if IS_ENABLED(CONFIG_IR_JVC_DECODER)
#define __RC_PROTO_JVC_CODEC
#else
#define __RC_PROTO_JVC_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_SONY_DECODER)
#define __RC_PROTO_SONY_CODEC
#else
#define __RC_PROTO_SONY_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_NEC_DECODER)
#define __RC_PROTO_NEC_CODEC
#else
#define __RC_PROTO_NEC_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_SANYO_DECODER)
#define __RC_PROTO_SANYO_CODEC
#else
#define __RC_PROTO_SANYO_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_MCE_KBD_DECODER)
#define __RC_PROTO_MCE_KBD_CODEC
#else
#define __RC_PROTO_MCE_KBD_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_RC6_DECODER)
#define __RC_PROTO_RC6_CODEC
#else
#define __RC_PROTO_RC6_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_SHARP_DECODER)
#define __RC_PROTO_SHARP_CODEC
#else
#define __RC_PROTO_SHARP_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_XMP_DECODER)
#define __RC_PROTO_XMP_CODEC
#else
#define __RC_PROTO_XMP_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_IMON_DECODER)
#define __RC_PROTO_IMON_CODEC
#else
#define __RC_PROTO_IMON_CODEC
#endif
#if IS_ENABLED(CONFIG_IR_RCMM_DECODER)
#define __RC_PROTO_RCMM_CODEC
#else
#define __RC_PROTO_RCMM_CODEC
#endif

/* All kernel-based codecs have encoders and decoders */
#define RC_PROTO_BIT_ALL_IR_DECODER

#define RC_PROTO_BIT_ALL_IR_ENCODER

#define RC_SCANCODE_UNKNOWN(x)
#define RC_SCANCODE_OTHER(x)
#define RC_SCANCODE_NEC(addr, cmd)
#define RC_SCANCODE_NECX(addr, cmd)
#define RC_SCANCODE_NEC32(data)
#define RC_SCANCODE_RC5(sys, cmd)
#define RC_SCANCODE_RC5_SZ(sys, cmd)
#define RC_SCANCODE_RC6_0(sys, cmd)
#define RC_SCANCODE_RC6_6A(vendor, sys, cmd)

/**
 * struct rc_map_table - represents a scancode/keycode pair
 *
 * @scancode: scan code (u64)
 * @keycode: Linux input keycode
 */
struct rc_map_table {};

/**
 * struct rc_map - represents a keycode map table
 *
 * @scan: pointer to struct &rc_map_table
 * @size: Max number of entries
 * @len: Number of entries that are in use
 * @alloc: size of \*scan, in bytes
 * @rc_proto: type of the remote controller protocol, as defined at
 *	     enum &rc_proto
 * @name: name of the key map table
 * @lock: lock to protect access to this structure
 */
struct rc_map {};

/**
 * struct rc_map_list - list of the registered &rc_map maps
 *
 * @list: pointer to struct &list_head
 * @map: pointer to struct &rc_map
 */
struct rc_map_list {};

#ifdef CONFIG_MEDIA_CEC_RC
/*
 * rc_map_list from rc-cec.c
 */
extern struct rc_map_list cec_map;
#endif

/* Routines from rc-map.c */

/**
 * rc_map_register() - Registers a Remote Controller scancode map
 *
 * @map:	pointer to struct rc_map_list
 */
int rc_map_register(struct rc_map_list *map);

/**
 * rc_map_unregister() - Unregisters a Remote Controller scancode map
 *
 * @map:	pointer to struct rc_map_list
 */
void rc_map_unregister(struct rc_map_list *map);

/**
 * rc_map_get - gets an RC map from its name
 * @name: name of the RC scancode map
 */
struct rc_map *rc_map_get(const char *name);

/* Names of the several keytables defined in-kernel */

#define RC_MAP_ADSTECH_DVB_T_PCI
#define RC_MAP_ALINK_DTU_M
#define RC_MAP_ANYSEE
#define RC_MAP_APAC_VIEWCOMP
#define RC_MAP_ASTROMETA_T2HYBRID
#define RC_MAP_ASUS_PC39
#define RC_MAP_ASUS_PS3_100
#define RC_MAP_ATI_TV_WONDER_HD_600
#define RC_MAP_ATI_X10
#define RC_MAP_AVERMEDIA
#define RC_MAP_AVERMEDIA_A16D
#define RC_MAP_AVERMEDIA_CARDBUS
#define RC_MAP_AVERMEDIA_DVBT
#define RC_MAP_AVERMEDIA_M135A
#define RC_MAP_AVERMEDIA_M733A_RM_K6
#define RC_MAP_AVERMEDIA_RM_KS
#define RC_MAP_AVERTV_303
#define RC_MAP_AZUREWAVE_AD_TU700
#define RC_MAP_BEELINK_GS1
#define RC_MAP_BEELINK_MXIII
#define RC_MAP_BEHOLD
#define RC_MAP_BEHOLD_COLUMBUS
#define RC_MAP_BUDGET_CI_OLD
#define RC_MAP_CEC
#define RC_MAP_CINERGY
#define RC_MAP_CINERGY_1400
#define RC_MAP_CT_90405
#define RC_MAP_D680_DMB
#define RC_MAP_DELOCK_61959
#define RC_MAP_DIB0700_NEC_TABLE
#define RC_MAP_DIB0700_RC5_TABLE
#define RC_MAP_DIGITALNOW_TINYTWIN
#define RC_MAP_DIGITTRADE
#define RC_MAP_DM1105_NEC
#define RC_MAP_DNTV_LIVE_DVB_T
#define RC_MAP_DNTV_LIVE_DVBT_PRO
#define RC_MAP_DREAMBOX
#define RC_MAP_DTT200U
#define RC_MAP_DVBSKY
#define RC_MAP_DVICO_MCE
#define RC_MAP_DVICO_PORTABLE
#define RC_MAP_EMPTY
#define RC_MAP_EM_TERRATEC
#define RC_MAP_ENCORE_ENLTV
#define RC_MAP_ENCORE_ENLTV2
#define RC_MAP_ENCORE_ENLTV_FM53
#define RC_MAP_EVGA_INDTUBE
#define RC_MAP_EZTV
#define RC_MAP_FLYDVB
#define RC_MAP_FLYVIDEO
#define RC_MAP_FUSIONHDTV_MCE
#define RC_MAP_GADMEI_RM008Z
#define RC_MAP_GEEKBOX
#define RC_MAP_GENIUS_TVGO_A11MCE
#define RC_MAP_GOTVIEW7135
#define RC_MAP_HAUPPAUGE
#define RC_MAP_HAUPPAUGE_NEW
#define RC_MAP_HISI_POPLAR
#define RC_MAP_HISI_TV_DEMO
#define RC_MAP_IMON_MCE
#define RC_MAP_IMON_PAD
#define RC_MAP_IMON_RSC
#define RC_MAP_IODATA_BCTV7E
#define RC_MAP_IT913X_V1
#define RC_MAP_IT913X_V2
#define RC_MAP_KAIOMY
#define RC_MAP_KHADAS
#define RC_MAP_KHAMSIN
#define RC_MAP_KWORLD_315U
#define RC_MAP_KWORLD_PC150U
#define RC_MAP_KWORLD_PLUS_TV_ANALOG
#define RC_MAP_LEADTEK_Y04G0051
#define RC_MAP_LME2510
#define RC_MAP_MANLI
#define RC_MAP_MECOOL_KII_PRO
#define RC_MAP_MECOOL_KIII_PRO
#define RC_MAP_MEDION_X10
#define RC_MAP_MEDION_X10_DIGITAINER
#define RC_MAP_MEDION_X10_OR2X
#define RC_MAP_MINIX_NEO
#define RC_MAP_MSI_DIGIVOX_II
#define RC_MAP_MSI_DIGIVOX_III
#define RC_MAP_MSI_TVANYWHERE
#define RC_MAP_MSI_TVANYWHERE_PLUS
#define RC_MAP_MYGICA_UTV3
#define RC_MAP_NEBULA
#define RC_MAP_NEC_TERRATEC_CINERGY_XS
#define RC_MAP_NORWOOD
#define RC_MAP_NPGTECH
#define RC_MAP_ODROID
#define RC_MAP_PCTV_SEDNA
#define RC_MAP_PINE64
#define RC_MAP_PINNACLE_COLOR
#define RC_MAP_PINNACLE_GREY
#define RC_MAP_PINNACLE_PCTV_HD
#define RC_MAP_PIXELVIEW
#define RC_MAP_PIXELVIEW_002T
#define RC_MAP_PIXELVIEW_MK12
#define RC_MAP_PIXELVIEW_NEW
#define RC_MAP_POWERCOLOR_REAL_ANGEL
#define RC_MAP_PROTEUS_2309
#define RC_MAP_PURPLETV
#define RC_MAP_PV951
#define RC_MAP_RC5_TV
#define RC_MAP_RC6_MCE
#define RC_MAP_REAL_AUDIO_220_32_KEYS
#define RC_MAP_REDDO
#define RC_MAP_SNAPSTREAM_FIREFLY
#define RC_MAP_STREAMZAP
#define RC_MAP_SU3000
#define RC_MAP_TANIX_TX3MINI
#define RC_MAP_TANIX_TX5MAX
#define RC_MAP_TBS_NEC
#define RC_MAP_TECHNISAT_TS35
#define RC_MAP_TECHNISAT_USB2
#define RC_MAP_TERRATEC_CINERGY_C_PCI
#define RC_MAP_TERRATEC_CINERGY_S2_HD
#define RC_MAP_TERRATEC_CINERGY_XS
#define RC_MAP_TERRATEC_SLIM
#define RC_MAP_TERRATEC_SLIM_2
#define RC_MAP_TEVII_NEC
#define RC_MAP_TIVO
#define RC_MAP_TOTAL_MEDIA_IN_HAND
#define RC_MAP_TOTAL_MEDIA_IN_HAND_02
#define RC_MAP_TREKSTOR
#define RC_MAP_TT_1500
#define RC_MAP_TWINHAN_DTV_CAB_CI
#define RC_MAP_TWINHAN_VP1027_DVBS
#define RC_MAP_VEGA_S9X
#define RC_MAP_VIDEOMATE_K100
#define RC_MAP_VIDEOMATE_S350
#define RC_MAP_VIDEOMATE_TV_PVR
#define RC_MAP_KII_PRO
#define RC_MAP_WETEK_HUB
#define RC_MAP_WETEK_PLAY2
#define RC_MAP_WINFAST
#define RC_MAP_WINFAST_USBII_DELUXE
#define RC_MAP_X96MAX
#define RC_MAP_XBOX_360
#define RC_MAP_XBOX_DVD
#define RC_MAP_ZX_IRDEC

/*
 * Please, do not just append newer Remote Controller names at the end.
 * The names should be ordered in alphabetical order
 */

#endif /* _MEDIA_RC_MAP_H */