Commit 408d0244 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: rc: no need for decoder state if decoder not enabled

One struct ir_raw_event_ctrl is allocated per raw IR device; reduce the
amount allocated if not all decoders are enabled.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent c4ed27cf
...@@ -64,6 +64,7 @@ struct ir_raw_event_ctrl { ...@@ -64,6 +64,7 @@ struct ir_raw_event_ctrl {
u32 bpf_sample; u32 bpf_sample;
struct bpf_prog_array __rcu *progs; struct bpf_prog_array __rcu *progs;
#endif #endif
#if IS_ENABLED(CONFIG_IR_NEC_DECODER)
struct nec_dec { struct nec_dec {
int state; int state;
unsigned count; unsigned count;
...@@ -71,12 +72,16 @@ struct ir_raw_event_ctrl { ...@@ -71,12 +72,16 @@ struct ir_raw_event_ctrl {
bool is_nec_x; bool is_nec_x;
bool necx_repeat; bool necx_repeat;
} nec; } nec;
#endif
#if IS_ENABLED(CONFIG_IR_RC5_DECODER)
struct rc5_dec { struct rc5_dec {
int state; int state;
u32 bits; u32 bits;
unsigned count; unsigned count;
bool is_rc5x; bool is_rc5x;
} rc5; } rc5;
#endif
#if IS_ENABLED(CONFIG_IR_RC6_DECODER)
struct rc6_dec { struct rc6_dec {
int state; int state;
u8 header; u8 header;
...@@ -85,11 +90,15 @@ struct ir_raw_event_ctrl { ...@@ -85,11 +90,15 @@ struct ir_raw_event_ctrl {
unsigned count; unsigned count;
unsigned wanted_bits; unsigned wanted_bits;
} rc6; } rc6;
#endif
#if IS_ENABLED(CONFIG_IR_SONY_DECODER)
struct sony_dec { struct sony_dec {
int state; int state;
u32 bits; u32 bits;
unsigned count; unsigned count;
} sony; } sony;
#endif
#if IS_ENABLED(CONFIG_IR_JVC_DECODER)
struct jvc_dec { struct jvc_dec {
int state; int state;
u16 bits; u16 bits;
...@@ -98,17 +107,23 @@ struct ir_raw_event_ctrl { ...@@ -98,17 +107,23 @@ struct ir_raw_event_ctrl {
bool first; bool first;
bool toggle; bool toggle;
} jvc; } jvc;
#endif
#if IS_ENABLED(CONFIG_IR_SANYO_DECODER)
struct sanyo_dec { struct sanyo_dec {
int state; int state;
unsigned count; unsigned count;
u64 bits; u64 bits;
} sanyo; } sanyo;
#endif
#if IS_ENABLED(CONFIG_IR_SHARP_DECODER)
struct sharp_dec { struct sharp_dec {
int state; int state;
unsigned count; unsigned count;
u32 bits; u32 bits;
unsigned int pulse_len; unsigned int pulse_len;
} sharp; } sharp;
#endif
#if IS_ENABLED(CONFIG_IR_MCE_KBD_DECODER)
struct mce_kbd_dec { struct mce_kbd_dec {
/* locks key up timer */ /* locks key up timer */
spinlock_t keylock; spinlock_t keylock;
...@@ -119,11 +134,15 @@ struct ir_raw_event_ctrl { ...@@ -119,11 +134,15 @@ struct ir_raw_event_ctrl {
unsigned count; unsigned count;
unsigned wanted_bits; unsigned wanted_bits;
} mce_kbd; } mce_kbd;
#endif
#if IS_ENABLED(CONFIG_IR_XMP_DECODER)
struct xmp_dec { struct xmp_dec {
int state; int state;
unsigned count; unsigned count;
u32 durations[16]; u32 durations[16];
} xmp; } xmp;
#endif
#if IS_ENABLED(CONFIG_IR_IMON_DECODER)
struct imon_dec { struct imon_dec {
int state; int state;
int count; int count;
...@@ -131,11 +150,14 @@ struct ir_raw_event_ctrl { ...@@ -131,11 +150,14 @@ struct ir_raw_event_ctrl {
unsigned int bits; unsigned int bits;
bool stick_keyboard; bool stick_keyboard;
} imon; } imon;
#endif
#if IS_ENABLED(CONFIG_IR_RCMM_DECODER)
struct rcmm_dec { struct rcmm_dec {
int state; int state;
unsigned int count; unsigned int count;
u32 bits; u32 bits;
} rcmm; } rcmm;
#endif
}; };
/* Mutex for locking raw IR processing and handler change */ /* Mutex for locking raw IR processing and handler change */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment