Skip to content

Commit 6d741bf

Browse files
seanyoungmchehab
authored andcommitted
media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_*
RC_TYPE is confusing and it's just the protocol. So rename it. Suggested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sean Young <sean@mess.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1 parent a9a249a commit 6d741bf

200 files changed

Lines changed: 1204 additions & 1158 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/hid/hid-picolcd_cir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ int picolcd_init_cir(struct picolcd_data *data, struct hid_report *report)
113113
return -ENOMEM;
114114

115115
rdev->priv = data;
116-
rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
116+
rdev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER;
117117
rdev->open = picolcd_cir_open;
118118
rdev->close = picolcd_cir_close;
119119
rdev->device_name = data->hdev->name;

‎drivers/media/cec/cec-adap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
18971897
}
18981898

18991899
/* Send key press */
1900-
rc_keydown(adap->rc, RC_TYPE_CEC, scancode, 0);
1900+
rc_keydown(adap->rc, RC_PROTO_CEC, scancode, 0);
19011901

19021902
/* When in repeating mode, we're done */
19031903
if (adap->rc_repeating)

‎drivers/media/cec/cec-core.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
275275
adap->rc->input_id.product = 0;
276276
adap->rc->input_id.version = 1;
277277
adap->rc->driver_name = CEC_NAME;
278-
adap->rc->allowed_protocols = RC_BIT_CEC;
279-
adap->rc->enabled_protocols = RC_BIT_CEC;
278+
adap->rc->allowed_protocols = RC_PROTO_BIT_CEC;
279+
adap->rc->enabled_protocols = RC_PROTO_BIT_CEC;
280280
adap->rc->priv = adap;
281281
adap->rc->map_name = RC_MAP_CEC;
282282
adap->rc->timeout = MS_TO_NS(100);

‎drivers/media/common/siano/smsir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
8686
#endif
8787

8888
dev->priv = coredev;
89-
dev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
89+
dev->allowed_protocols = RC_PROTO_BIT_ALL_IR_DECODER;
9090
dev->map_name = sms_get_board(board_id)->rc_codes;
9191
dev->driver_name = MODULE_NAME;
9292

‎drivers/media/i2c/ir-kbd-i2c.c‎

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ module_param(debug, int, 0644); /* debug level (0,1,2) */
5959

6060
/* ----------------------------------------------------------------------- */
6161

62-
static int get_key_haup_common(struct IR_i2c *ir, enum rc_type *protocol,
63-
u32 *scancode, u8 *ptoggle, int size)
62+
static int get_key_haup_common(struct IR_i2c *ir, enum rc_proto *protocol,
63+
u32 *scancode, u8 *ptoggle, int size)
6464
{
6565
unsigned char buf[6];
6666
int start, range, toggle, dev, code, ircode, vendor;
@@ -99,7 +99,7 @@ static int get_key_haup_common(struct IR_i2c *ir, enum rc_type *protocol,
9999
dprintk(1, "ir hauppauge (rc5): s%d r%d t%d dev=%d code=%d\n",
100100
start, range, toggle, dev, code);
101101

102-
*protocol = RC_TYPE_RC5;
102+
*protocol = RC_PROTO_RC5;
103103
*scancode = RC_SCANCODE_RC5(dev, code);
104104
*ptoggle = toggle;
105105

@@ -111,13 +111,13 @@ static int get_key_haup_common(struct IR_i2c *ir, enum rc_type *protocol,
111111

112112
if (vendor == 0x800f) {
113113
*ptoggle = (dev & 0x80) != 0;
114-
*protocol = RC_TYPE_RC6_MCE;
114+
*protocol = RC_PROTO_RC6_MCE;
115115
dev &= 0x7f;
116116
dprintk(1, "ir hauppauge (rc6-mce): t%d vendor=%d dev=%d code=%d\n",
117117
*ptoggle, vendor, dev, code);
118118
} else {
119119
*ptoggle = 0;
120-
*protocol = RC_TYPE_RC6_6A_32;
120+
*protocol = RC_PROTO_RC6_6A_32;
121121
dprintk(1, "ir hauppauge (rc6-6a-32): vendor=%d dev=%d code=%d\n",
122122
vendor, dev, code);
123123
}
@@ -130,13 +130,13 @@ static int get_key_haup_common(struct IR_i2c *ir, enum rc_type *protocol,
130130
return 0;
131131
}
132132

133-
static int get_key_haup(struct IR_i2c *ir, enum rc_type *protocol,
133+
static int get_key_haup(struct IR_i2c *ir, enum rc_proto *protocol,
134134
u32 *scancode, u8 *toggle)
135135
{
136136
return get_key_haup_common(ir, protocol, scancode, toggle, 3);
137137
}
138138

139-
static int get_key_haup_xvr(struct IR_i2c *ir, enum rc_type *protocol,
139+
static int get_key_haup_xvr(struct IR_i2c *ir, enum rc_proto *protocol,
140140
u32 *scancode, u8 *toggle)
141141
{
142142
int ret;
@@ -155,7 +155,7 @@ static int get_key_haup_xvr(struct IR_i2c *ir, enum rc_type *protocol,
155155
return get_key_haup_common(ir, protocol, scancode, toggle, 6);
156156
}
157157

158-
static int get_key_pixelview(struct IR_i2c *ir, enum rc_type *protocol,
158+
static int get_key_pixelview(struct IR_i2c *ir, enum rc_proto *protocol,
159159
u32 *scancode, u8 *toggle)
160160
{
161161
unsigned char b;
@@ -166,13 +166,13 @@ static int get_key_pixelview(struct IR_i2c *ir, enum rc_type *protocol,
166166
return -EIO;
167167
}
168168

169-
*protocol = RC_TYPE_OTHER;
169+
*protocol = RC_PROTO_OTHER;
170170
*scancode = b;
171171
*toggle = 0;
172172
return 1;
173173
}
174174

175-
static int get_key_fusionhdtv(struct IR_i2c *ir, enum rc_type *protocol,
175+
static int get_key_fusionhdtv(struct IR_i2c *ir, enum rc_proto *protocol,
176176
u32 *scancode, u8 *toggle)
177177
{
178178
unsigned char buf[4];
@@ -191,13 +191,13 @@ static int get_key_fusionhdtv(struct IR_i2c *ir, enum rc_type *protocol,
191191
if(buf[0] != 0x1 || buf[1] != 0xfe)
192192
return 0;
193193

194-
*protocol = RC_TYPE_UNKNOWN;
194+
*protocol = RC_PROTO_UNKNOWN;
195195
*scancode = buf[2];
196196
*toggle = 0;
197197
return 1;
198198
}
199199

200-
static int get_key_knc1(struct IR_i2c *ir, enum rc_type *protocol,
200+
static int get_key_knc1(struct IR_i2c *ir, enum rc_proto *protocol,
201201
u32 *scancode, u8 *toggle)
202202
{
203203
unsigned char b;
@@ -221,13 +221,13 @@ static int get_key_knc1(struct IR_i2c *ir, enum rc_type *protocol,
221221
/* keep old data */
222222
return 1;
223223

224-
*protocol = RC_TYPE_UNKNOWN;
224+
*protocol = RC_PROTO_UNKNOWN;
225225
*scancode = b;
226226
*toggle = 0;
227227
return 1;
228228
}
229229

230-
static int get_key_avermedia_cardbus(struct IR_i2c *ir, enum rc_type *protocol,
230+
static int get_key_avermedia_cardbus(struct IR_i2c *ir, enum rc_proto *protocol,
231231
u32 *scancode, u8 *toggle)
232232
{
233233
unsigned char subaddr, key, keygroup;
@@ -262,7 +262,7 @@ static int get_key_avermedia_cardbus(struct IR_i2c *ir, enum rc_type *protocol,
262262
}
263263
key |= (keygroup & 1) << 6;
264264

265-
*protocol = RC_TYPE_UNKNOWN;
265+
*protocol = RC_PROTO_UNKNOWN;
266266
*scancode = key;
267267
if (ir->c->addr == 0x41) /* AVerMedia EM78P153 */
268268
*scancode |= keygroup << 8;
@@ -274,7 +274,7 @@ static int get_key_avermedia_cardbus(struct IR_i2c *ir, enum rc_type *protocol,
274274

275275
static int ir_key_poll(struct IR_i2c *ir)
276276
{
277-
enum rc_type protocol;
277+
enum rc_proto protocol;
278278
u32 scancode;
279279
u8 toggle;
280280
int rc;
@@ -315,7 +315,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
315315
{
316316
char *ir_codes = NULL;
317317
const char *name = NULL;
318-
u64 rc_type = RC_BIT_UNKNOWN;
318+
u64 rc_proto = RC_PROTO_BIT_UNKNOWN;
319319
struct IR_i2c *ir;
320320
struct rc_dev *rc = NULL;
321321
struct i2c_adapter *adap = client->adapter;
@@ -334,46 +334,47 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
334334
case 0x64:
335335
name = "Pixelview";
336336
ir->get_key = get_key_pixelview;
337-
rc_type = RC_BIT_OTHER;
337+
rc_proto = RC_PROTO_BIT_OTHER;
338338
ir_codes = RC_MAP_EMPTY;
339339
break;
340340
case 0x18:
341341
case 0x1f:
342342
case 0x1a:
343343
name = "Hauppauge";
344344
ir->get_key = get_key_haup;
345-
rc_type = RC_BIT_RC5;
345+
rc_proto = RC_PROTO_BIT_RC5;
346346
ir_codes = RC_MAP_HAUPPAUGE;
347347
break;
348348
case 0x30:
349349
name = "KNC One";
350350
ir->get_key = get_key_knc1;
351-
rc_type = RC_BIT_OTHER;
351+
rc_proto = RC_PROTO_BIT_OTHER;
352352
ir_codes = RC_MAP_EMPTY;
353353
break;
354354
case 0x6b:
355355
name = "FusionHDTV";
356356
ir->get_key = get_key_fusionhdtv;
357-
rc_type = RC_BIT_UNKNOWN;
357+
rc_proto = RC_PROTO_BIT_UNKNOWN;
358358
ir_codes = RC_MAP_FUSIONHDTV_MCE;
359359
break;
360360
case 0x40:
361361
name = "AVerMedia Cardbus remote";
362362
ir->get_key = get_key_avermedia_cardbus;
363-
rc_type = RC_BIT_OTHER;
363+
rc_proto = RC_PROTO_BIT_OTHER;
364364
ir_codes = RC_MAP_AVERMEDIA_CARDBUS;
365365
break;
366366
case 0x41:
367367
name = "AVerMedia EM78P153";
368368
ir->get_key = get_key_avermedia_cardbus;
369-
rc_type = RC_BIT_OTHER;
369+
rc_proto = RC_PROTO_BIT_OTHER;
370370
/* RM-KV remote, seems to be same as RM-K6 */
371371
ir_codes = RC_MAP_AVERMEDIA_M733A_RM_K6;
372372
break;
373373
case 0x71:
374374
name = "Hauppauge/Zilog Z8";
375375
ir->get_key = get_key_haup_xvr;
376-
rc_type = RC_BIT_RC5 | RC_BIT_RC6_MCE | RC_BIT_RC6_6A_32;
376+
rc_proto = RC_PROTO_BIT_RC5 | RC_PROTO_BIT_RC6_MCE |
377+
RC_PROTO_BIT_RC6_6A_32;
377378
ir_codes = RC_MAP_HAUPPAUGE;
378379
break;
379380
}
@@ -388,7 +389,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
388389

389390
name = init_data->name;
390391
if (init_data->type)
391-
rc_type = init_data->type;
392+
rc_proto = init_data->type;
392393

393394
if (init_data->polling_interval)
394395
ir->polling_interval = init_data->polling_interval;
@@ -431,7 +432,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
431432
ir->rc = rc;
432433

433434
/* Make sure we are all setup before going on */
434-
if (!name || !ir->get_key || !rc_type || !ir_codes) {
435+
if (!name || !ir->get_key || !rc_proto || !ir_codes) {
435436
dprintk(1, ": Unsupported device at address 0x%02x\n",
436437
addr);
437438
err = -ENODEV;
@@ -458,8 +459,8 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
458459
* Initialize the other fields of rc_dev
459460
*/
460461
rc->map_name = ir->ir_codes;
461-
rc->allowed_protocols = rc_type;
462-
rc->enabled_protocols = rc_type;
462+
rc->allowed_protocols = rc_proto;
463+
rc->enabled_protocols = rc_proto;
463464
if (!rc->driver_name)
464465
rc->driver_name = MODULE_NAME;
465466

‎drivers/media/pci/bt8xx/bttv-input.c‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,13 @@ static void ir_handle_key(struct bttv *btv)
6969

7070
if ((ir->mask_keydown && (gpio & ir->mask_keydown)) ||
7171
(ir->mask_keyup && !(gpio & ir->mask_keyup))) {
72-
rc_keydown_notimeout(ir->dev, RC_TYPE_UNKNOWN, data, 0);
72+
rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, 0);
7373
} else {
7474
/* HACK: Probably, ir->mask_keydown is missing
7575
for this board */
7676
if (btv->c.type == BTTV_BOARD_WINFAST2000)
77-
rc_keydown_notimeout(ir->dev, RC_TYPE_UNKNOWN, data, 0);
77+
rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data,
78+
0);
7879

7980
rc_keyup(ir->dev);
8081
}
@@ -99,7 +100,7 @@ static void ir_enltv_handle_key(struct bttv *btv)
99100
gpio, data,
100101
(gpio & ir->mask_keyup) ? " up" : "up/down");
101102

102-
rc_keydown_notimeout(ir->dev, RC_TYPE_UNKNOWN, data, 0);
103+
rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, 0);
103104
if (keyup)
104105
rc_keyup(ir->dev);
105106
} else {
@@ -113,7 +114,8 @@ static void ir_enltv_handle_key(struct bttv *btv)
113114
if (keyup)
114115
rc_keyup(ir->dev);
115116
else
116-
rc_keydown_notimeout(ir->dev, RC_TYPE_UNKNOWN, data, 0);
117+
rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data,
118+
0);
117119
}
118120

119121
ir->last_gpio = data | keyup;
@@ -235,7 +237,7 @@ static void bttv_rc5_timer_end(unsigned long data)
235237
}
236238

237239
scancode = RC_SCANCODE_RC5(system, command);
238-
rc_keydown(ir->dev, RC_TYPE_RC5, scancode, toggle);
240+
rc_keydown(ir->dev, RC_PROTO_RC5, scancode, toggle);
239241
dprintk("scancode %x, toggle %x\n", scancode, toggle);
240242
}
241243

@@ -327,7 +329,7 @@ static void bttv_ir_stop(struct bttv *btv)
327329
* Get_key functions used by I2C remotes
328330
*/
329331

330-
static int get_key_pv951(struct IR_i2c *ir, enum rc_type *protocol,
332+
static int get_key_pv951(struct IR_i2c *ir, enum rc_proto *protocol,
331333
u32 *scancode, u8 *toggle)
332334
{
333335
unsigned char b;
@@ -355,7 +357,7 @@ static int get_key_pv951(struct IR_i2c *ir, enum rc_type *protocol,
355357
* the device is bound to the vendor-provided RC.
356358
*/
357359

358-
*protocol = RC_TYPE_UNKNOWN;
360+
*protocol = RC_PROTO_UNKNOWN;
359361
*scancode = b;
360362
*toggle = 0;
361363
return 1;

‎drivers/media/pci/cx18/cx18-i2c.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,
9393
case CX18_HW_Z8F0811_IR_RX_HAUP:
9494
init_data->ir_codes = RC_MAP_HAUPPAUGE;
9595
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
96-
init_data->type = RC_BIT_RC5 | RC_BIT_RC6_MCE |
97-
RC_BIT_RC6_6A_32;
96+
init_data->type = RC_PROTO_BIT_RC5 | RC_PROTO_BIT_RC6_MCE |
97+
RC_PROTO_BIT_RC6_6A_32;
9898
init_data->name = cx->card_name;
9999
info.platform_data = init_data;
100100
break;

‎drivers/media/pci/cx23885/cx23885-input.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,32 +284,32 @@ int cx23885_input_init(struct cx23885_dev *dev)
284284
case CX23885_BOARD_HAUPPAUGE_HVR1290:
285285
case CX23885_BOARD_HAUPPAUGE_HVR1250:
286286
/* Integrated CX2388[58] IR controller */
287-
allowed_protos = RC_BIT_ALL_IR_DECODER;
287+
allowed_protos = RC_PROTO_BIT_ALL_IR_DECODER;
288288
/* The grey Hauppauge RC-5 remote */
289289
rc_map = RC_MAP_HAUPPAUGE;
290290
break;
291291
case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL:
292292
/* Integrated CX23885 IR controller */
293-
allowed_protos = RC_BIT_ALL_IR_DECODER;
293+
allowed_protos = RC_PROTO_BIT_ALL_IR_DECODER;
294294
/* The grey Terratec remote with orange buttons */
295295
rc_map = RC_MAP_NEC_TERRATEC_CINERGY_XS;
296296
break;
297297
case CX23885_BOARD_TEVII_S470:
298298
/* Integrated CX23885 IR controller */
299-
allowed_protos = RC_BIT_ALL_IR_DECODER;
299+
allowed_protos = RC_PROTO_BIT_ALL_IR_DECODER;
300300
/* A guess at the remote */
301301
rc_map = RC_MAP_TEVII_NEC;
302302
break;
303303
case CX23885_BOARD_MYGICA_X8507:
304304
/* Integrated CX23885 IR controller */
305-
allowed_protos = RC_BIT_ALL_IR_DECODER;
305+
allowed_protos = RC_PROTO_BIT_ALL_IR_DECODER;
306306
/* A guess at the remote */
307307
rc_map = RC_MAP_TOTAL_MEDIA_IN_HAND_02;
308308
break;
309309
case CX23885_BOARD_TBS_6980:
310310
case CX23885_BOARD_TBS_6981:
311311
/* Integrated CX23885 IR controller */
312-
allowed_protos = RC_BIT_ALL_IR_DECODER;
312+
allowed_protos = RC_PROTO_BIT_ALL_IR_DECODER;
313313
/* A guess at the remote */
314314
rc_map = RC_MAP_TBS_NEC;
315315
break;
@@ -320,12 +320,12 @@ int cx23885_input_init(struct cx23885_dev *dev)
320320
case CX23885_BOARD_DVBSKY_S952:
321321
case CX23885_BOARD_DVBSKY_T982:
322322
/* Integrated CX23885 IR controller */
323-
allowed_protos = RC_BIT_ALL_IR_DECODER;
323+
allowed_protos = RC_PROTO_BIT_ALL_IR_DECODER;
324324
rc_map = RC_MAP_DVBSKY;
325325
break;
326326
case CX23885_BOARD_TT_CT2_4500_CI:
327327
/* Integrated CX23885 IR controller */
328-
allowed_protos = RC_BIT_ALL_IR_DECODER;
328+
allowed_protos = RC_PROTO_BIT_ALL_IR_DECODER;
329329
rc_map = RC_MAP_TT_1500;
330330
break;
331331
default:

0 commit comments

Comments
 (0)