Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
rc-core.h File Reference
#include <linux/spinlock.h>
#include <linux/kfifo.h>
#include <linux/time.h>
#include <linux/timer.h>
#include <media/rc-map.h>

Go to the source code of this file.

Data Structures

struct  rc_dev
 
struct  ir_raw_event
 

Macros

#define IR_dprintk(level, fmt,...)
 
#define to_rc_dev(d)   container_of(d, struct rc_dev, dev)
 
#define DEFINE_IR_RAW_EVENT(event)
 
#define IR_MAX_DURATION   0xFFFFFFFF /* a bit more than 4 seconds */
 
#define US_TO_NS(usec)   ((usec) * 1000)
 
#define MS_TO_US(msec)   ((msec) * 1000)
 
#define MS_TO_NS(msec)   ((msec) * 1000 * 1000)
 

Enumerations

enum  rc_driver_type { RC_DRIVER_SCANCODE = 0, RC_DRIVER_IR_RAW }
 
enum  raw_event_type { IR_SPACE = (1 << 0), IR_PULSE = (1 << 1), IR_START_EVENT = (1 << 2), IR_STOP_EVENT = (1 << 3) }
 

Functions

struct rc_devrc_allocate_device (void)
 
void rc_free_device (struct rc_dev *dev)
 
int rc_register_device (struct rc_dev *dev)
 
void rc_unregister_device (struct rc_dev *dev)
 
void rc_repeat (struct rc_dev *dev)
 
void rc_keydown (struct rc_dev *dev, int scancode, u8 toggle)
 
void rc_keydown_notimeout (struct rc_dev *dev, int scancode, u8 toggle)
 
void rc_keyup (struct rc_dev *dev)
 
u32 rc_g_keycode_from_table (struct rc_dev *dev, u32 scancode)
 
void ir_raw_event_handle (struct rc_dev *dev)
 
int ir_raw_event_store (struct rc_dev *dev, struct ir_raw_event *ev)
 
int ir_raw_event_store_edge (struct rc_dev *dev, enum raw_event_type type)
 
int ir_raw_event_store_with_filter (struct rc_dev *dev, struct ir_raw_event *ev)
 
void ir_raw_event_set_idle (struct rc_dev *dev, bool idle)
 

Variables

int rc_core_debug
 

Macro Definition Documentation

#define DEFINE_IR_RAW_EVENT (   event)
Value:
struct ir_raw_event event = { \
{ .duration = 0 } , \
.pulse = 0, \
.reset = 0, \
.timeout = 0, \
.carrier_report = 0 }

Definition at line 178 of file rc-core.h.

#define IR_dprintk (   level,
  fmt,
  ... 
)
Value:
do { \
if (rc_core_debug >= level) \
pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \
} while (0)

Definition at line 26 of file rc-core.h.

#define IR_MAX_DURATION   0xFFFFFFFF /* a bit more than 4 seconds */

Definition at line 191 of file rc-core.h.

#define MS_TO_NS (   msec)    ((msec) * 1000 * 1000)

Definition at line 194 of file rc-core.h.

#define MS_TO_US (   msec)    ((msec) * 1000)

Definition at line 193 of file rc-core.h.

#define to_rc_dev (   d)    container_of(d, struct rc_dev, dev)

Definition at line 129 of file rc-core.h.

#define US_TO_NS (   usec)    ((usec) * 1000)

Definition at line 192 of file rc-core.h.

Enumeration Type Documentation

Enumerator:
IR_SPACE 
IR_PULSE 
IR_START_EVENT 
IR_STOP_EVENT 

Definition at line 155 of file rc-core.h.

Enumerator:
RC_DRIVER_SCANCODE 
RC_DRIVER_IR_RAW 

Definition at line 32 of file rc-core.h.

Function Documentation

void ir_raw_event_handle ( struct rc_dev dev)

ir_raw_event_handle() - schedules the decoding of stored ir data : the struct rc_dev device descriptor

This routine will tell rc-core to start decoding stored ir data.

Definition at line 224 of file ir-raw.c.

void ir_raw_event_set_idle ( struct rc_dev dev,
bool  idle 
)

ir_raw_event_set_idle() - provide hint to rc-core when the device is idle or not : the struct rc_dev device descriptor : whether the device is idle or not

Definition at line 198 of file ir-raw.c.

int ir_raw_event_store ( struct rc_dev dev,
struct ir_raw_event ev 
)

ir_raw_event_store() - pass a pulse/space duration to the raw ir decoders : the struct rc_dev device descriptor : the struct ir_raw_event descriptor of the pulse/space

This routine (which may be called from an interrupt context) stores a pulse/space duration for the raw ir decoding state machines. Pulses are signalled as positive values and spaces as negative values. A zero value will reset the decoding state machines.

Definition at line 85 of file ir-raw.c.

int ir_raw_event_store_edge ( struct rc_dev dev,
enum raw_event_type  type 
)

ir_raw_event_store_edge() - notify raw ir decoders of the start of a pulse/space : the struct rc_dev device descriptor : the type of the event that has occurred

This routine (which may be called from an interrupt context) is used to store the beginning of an ir pulse or space (or the start/end of ir reception) for the raw ir decoding state machines. This is used by hardware which does not provide durations directly but only interrupts (or similar events) on state change.

Definition at line 111 of file ir-raw.c.

int ir_raw_event_store_with_filter ( struct rc_dev dev,
struct ir_raw_event ev 
)

ir_raw_event_store_with_filter() - pass next pulse/space to decoders with some processing : the struct rc_dev device descriptor : the type of the event that has occurred

This routine (which may be called from an interrupt context) works in similar manner to ir_raw_event_store_edge. This routine is intended for devices with limited internal buffer It automerges samples of same type, and handles timeouts. Returns non-zero if the event was added, and zero if the event was ignored due to idle processing.

Definition at line 164 of file ir-raw.c.

struct rc_dev* rc_allocate_device ( void  )
read

Definition at line 984 of file rc-main.c.

void rc_free_device ( struct rc_dev dev)

Definition at line 1016 of file rc-main.c.

u32 rc_g_keycode_from_table ( struct rc_dev dev,
u32  scancode 
)

rc_g_keycode_from_table() - gets the keycode that corresponds to a scancode : the struct rc_dev descriptor of the device : the scancode to look for

Returns
: the corresponding keycode, or KEY_RESERVED

This routine is used by drivers which need to convert a scancode to a keycode. Normally it should not be used since drivers should have no interest in keycodes.

Definition at line 500 of file rc-main.c.

void rc_keydown ( struct rc_dev dev,
int  scancode,
u8  toggle 
)

rc_keydown() - generates input event for a key press : the struct rc_dev descriptor of the device : the scancode that we're seeking : the toggle value (protocol dependent, if the protocol doesn't support toggle values, this should be set to zero)

This routine is used to signal that a key has been pressed on the remote control.

Definition at line 664 of file rc-main.c.

void rc_keydown_notimeout ( struct rc_dev dev,
int  scancode,
u8  toggle 
)

rc_keydown_notimeout() - generates input event for a key press without an automatic keyup event at a later time : the struct rc_dev descriptor of the device : the scancode that we're seeking : the toggle value (protocol dependent, if the protocol doesn't support toggle values, this should be set to zero)

This routine is used to signal that a key has been pressed on the remote control. The driver must manually call rc_keyup() at a later stage.

Definition at line 691 of file rc-main.c.

void rc_keyup ( struct rc_dev dev)

rc_keyup() - signals the release of a keypress : the struct rc_dev descriptor of the device

This routine is used to signal that a key has been released on the remote control.

Definition at line 550 of file rc-main.c.

int rc_register_device ( struct rc_dev dev)

Definition at line 1031 of file rc-main.c.

void rc_repeat ( struct rc_dev dev)

rc_repeat() - signals that a key is still pressed : the struct rc_dev descriptor of the device

This routine is used by IR decoders when a repeat message which does not include the necessary bits to reproduce the scancode has been received.

Definition at line 596 of file rc-main.c.

void rc_unregister_device ( struct rc_dev dev)

Definition at line 1151 of file rc-main.c.

Variable Documentation

int rc_core_debug

Definition at line 1201 of file rc-main.c.