1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>struct rc_dev</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="ch06s03.html" title="Remote Controller devices"><link rel="prev" href="API-enum-rc-filter-type.html" title="enum rc_filter_type"><link rel="next" href="API-struct-lirc-driver.html" title="struct lirc_driver"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct rc_dev</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-enum-rc-filter-type.html">Prev</a> </td><th width="60%" align="center">Remote Controller devices</th><td width="20%" align="right"> <a accesskey="n" href="API-struct-lirc-driver.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-rc-dev"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct rc_dev — 2 represents a remote control device 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct rc_dev { 5 struct device dev; 6 const struct attribute_group * sysfs_groups[5]; 7 const char * input_name; 8 const char * input_phys; 9 struct input_id input_id; 10 char * driver_name; 11 const char * map_name; 12 struct rc_map rc_map; 13 struct mutex lock; 14 unsigned int minor; 15 struct ir_raw_event_ctrl * raw; 16 struct input_dev * input_dev; 17 enum rc_driver_type driver_type; 18 bool idle; 19 u64 allowed_protocols; 20 u64 enabled_protocols; 21 u64 allowed_wakeup_protocols; 22 u64 enabled_wakeup_protocols; 23 struct rc_scancode_filter scancode_filter; 24 struct rc_scancode_filter scancode_wakeup_filter; 25 u32 scancode_mask; 26 u32 users; 27 void * priv; 28 spinlock_t keylock; 29 bool keypressed; 30 unsigned long keyup_jiffies; 31 struct timer_list timer_keyup; 32 u32 last_keycode; 33 enum rc_type last_protocol; 34 u32 last_scancode; 35 u8 last_toggle; 36 u32 timeout; 37 u32 min_timeout; 38 u32 max_timeout; 39 u32 rx_resolution; 40 u32 tx_resolution; 41 int (* change_protocol) (struct rc_dev *dev, u64 *rc_type); 42 int (* change_wakeup_protocol) (struct rc_dev *dev, u64 *rc_type); 43 int (* open) (struct rc_dev *dev); 44 void (* close) (struct rc_dev *dev); 45 int (* s_tx_mask) (struct rc_dev *dev, u32 mask); 46 int (* s_tx_carrier) (struct rc_dev *dev, u32 carrier); 47 int (* s_tx_duty_cycle) (struct rc_dev *dev, u32 duty_cycle); 48 int (* s_rx_carrier_range) (struct rc_dev *dev, u32 min, u32 max); 49 int (* tx_ir) (struct rc_dev *dev, unsigned *txbuf, unsigned n); 50 void (* s_idle) (struct rc_dev *dev, bool enable); 51 int (* s_learning_mode) (struct rc_dev *dev, int enable); 52 int (* s_carrier_report) (struct rc_dev *dev, int enable); 53 int (* s_filter) (struct rc_dev *dev,struct rc_scancode_filter *filter); 54 int (* s_wakeup_filter) (struct rc_dev *dev,struct rc_scancode_filter *filter); 55}; </pre></div><div class="refsect1"><a name="id-1.8.4.4.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">dev</span></dt><dd><p> 56 driver model's view of this device 57 </p></dd><dt><span class="term">sysfs_groups[5]</span></dt><dd><p> 58 sysfs attribute groups 59 </p></dd><dt><span class="term">input_name</span></dt><dd><p> 60 name of the input child device 61 </p></dd><dt><span class="term">input_phys</span></dt><dd><p> 62 physical path to the input child device 63 </p></dd><dt><span class="term">input_id</span></dt><dd><p> 64 id of the input child device (struct input_id) 65 </p></dd><dt><span class="term">driver_name</span></dt><dd><p> 66 name of the hardware driver which registered this device 67 </p></dd><dt><span class="term">map_name</span></dt><dd><p> 68 name of the default keymap 69 </p></dd><dt><span class="term">rc_map</span></dt><dd><p> 70 current scan/key table 71 </p></dd><dt><span class="term">lock</span></dt><dd><p> 72 used to ensure we've filled in all protocol details before 73 anyone can call show_protocols or store_protocols 74 </p></dd><dt><span class="term">minor</span></dt><dd><p> 75 unique minor remote control device number 76 </p></dd><dt><span class="term">raw</span></dt><dd><p> 77 additional data for raw pulse/space devices 78 </p></dd><dt><span class="term">input_dev</span></dt><dd><p> 79 the input child device used to communicate events to userspace 80 </p></dd><dt><span class="term">driver_type</span></dt><dd><p> 81 specifies if protocol decoding is done in hardware or software 82 </p></dd><dt><span class="term">idle</span></dt><dd><p> 83 used to keep track of RX state 84 </p></dd><dt><span class="term">allowed_protocols</span></dt><dd><p> 85 bitmask with the supported RC_BIT_* protocols 86 </p></dd><dt><span class="term">enabled_protocols</span></dt><dd><p> 87 bitmask with the enabled RC_BIT_* protocols 88 </p></dd><dt><span class="term">allowed_wakeup_protocols</span></dt><dd><p> 89 bitmask with the supported RC_BIT_* wakeup protocols 90 </p></dd><dt><span class="term">enabled_wakeup_protocols</span></dt><dd><p> 91 bitmask with the enabled RC_BIT_* wakeup protocols 92 </p></dd><dt><span class="term">scancode_filter</span></dt><dd><p> 93 scancode filter 94 </p></dd><dt><span class="term">scancode_wakeup_filter</span></dt><dd><p> 95 scancode wakeup filters 96 </p></dd><dt><span class="term">scancode_mask</span></dt><dd><p> 97 some hardware decoders are not capable of providing the full 98 scancode to the application. As this is a hardware limit, we can't do 99 anything with it. Yet, as the same keycode table can be used with other 100 devices, a mask is provided to allow its usage. Drivers should generally 101 leave this field in blank 102 </p></dd><dt><span class="term">users</span></dt><dd><p> 103 number of current users of the device 104 </p></dd><dt><span class="term">priv</span></dt><dd><p> 105 driver-specific data 106 </p></dd><dt><span class="term">keylock</span></dt><dd><p> 107 protects the remaining members of the struct 108 </p></dd><dt><span class="term">keypressed</span></dt><dd><p> 109 whether a key is currently pressed 110 </p></dd><dt><span class="term">keyup_jiffies</span></dt><dd><p> 111 time (in jiffies) when the current keypress should be released 112 </p></dd><dt><span class="term">timer_keyup</span></dt><dd><p> 113 timer for releasing a keypress 114 </p></dd><dt><span class="term">last_keycode</span></dt><dd><p> 115 keycode of last keypress 116 </p></dd><dt><span class="term">last_protocol</span></dt><dd><p> 117 protocol of last keypress 118 </p></dd><dt><span class="term">last_scancode</span></dt><dd><p> 119 scancode of last keypress 120 </p></dd><dt><span class="term">last_toggle</span></dt><dd><p> 121 toggle value of last command 122 </p></dd><dt><span class="term">timeout</span></dt><dd><p> 123 optional time after which device stops sending data 124 </p></dd><dt><span class="term">min_timeout</span></dt><dd><p> 125 minimum timeout supported by device 126 </p></dd><dt><span class="term">max_timeout</span></dt><dd><p> 127 maximum timeout supported by device 128 </p></dd><dt><span class="term">rx_resolution</span></dt><dd><p> 129 resolution (in ns) of input sampler 130 </p></dd><dt><span class="term">tx_resolution</span></dt><dd><p> 131 resolution (in ns) of output sampler 132 </p></dd><dt><span class="term">change_protocol</span></dt><dd><p> 133 allow changing the protocol used on hardware decoders 134 </p></dd><dt><span class="term">change_wakeup_protocol</span></dt><dd><p> 135 allow changing the protocol used for wakeup 136 filtering 137 </p></dd><dt><span class="term">open</span></dt><dd><p> 138 callback to allow drivers to enable polling/irq when IR input device 139 is opened. 140 </p></dd><dt><span class="term">close</span></dt><dd><p> 141 callback to allow drivers to disable polling/irq when IR input device 142 is opened. 143 </p></dd><dt><span class="term">s_tx_mask</span></dt><dd><p> 144 set transmitter mask (for devices with multiple tx outputs) 145 </p></dd><dt><span class="term">s_tx_carrier</span></dt><dd><p> 146 set transmit carrier frequency 147 </p></dd><dt><span class="term">s_tx_duty_cycle</span></dt><dd><p> 148 set transmit duty cycle (0% - 100%) 149 </p></dd><dt><span class="term">s_rx_carrier_range</span></dt><dd><p> 150 inform driver about carrier it is expected to handle 151 </p></dd><dt><span class="term">tx_ir</span></dt><dd><p> 152 transmit IR 153 </p></dd><dt><span class="term">s_idle</span></dt><dd><p> 154 enable/disable hardware idle mode, upon which, 155 device doesn't interrupt host until it sees IR pulses 156 </p></dd><dt><span class="term">s_learning_mode</span></dt><dd><p> 157 enable wide band receiver used for learning 158 </p></dd><dt><span class="term">s_carrier_report</span></dt><dd><p> 159 enable carrier reports 160 </p></dd><dt><span class="term">s_filter</span></dt><dd><p> 161 set the scancode filter 162 </p></dd><dt><span class="term">s_wakeup_filter</span></dt><dd><p> 163 set the wakeup scancode filter 164 </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-enum-rc-filter-type.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch06s03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-lirc-driver.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">enum rc_filter_type</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">struct lirc_driver</span></td></tr></table></div></body></html> 165