drivers/media/rc/img-ir/img-ir-jvc.c
Source file repositories/reference/linux-study-clean/drivers/media/rc/img-ir/img-ir-jvc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/rc/img-ir/img-ir-jvc.c- Extension
.c- Size
- 1885 bytes
- Lines
- 85
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
img-ir-hw.h
Detected Declarations
function img_ir_jvc_scancodefunction img_ir_jvc_filter
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* ImgTec IR Decoder setup for JVC protocol.
*
* Copyright 2012-2014 Imagination Technologies Ltd.
*/
#include "img-ir-hw.h"
/* Convert JVC data to a scancode */
static int img_ir_jvc_scancode(int len, u64 raw, u64 enabled_protocols,
struct img_ir_scancode_req *request)
{
unsigned int cust, data;
if (len != 16)
return -EINVAL;
cust = (raw >> 0) & 0xff;
data = (raw >> 8) & 0xff;
request->protocol = RC_PROTO_JVC;
request->scancode = cust << 8 | data;
return IMG_IR_SCANCODE;
}
/* Convert JVC scancode to JVC data filter */
static int img_ir_jvc_filter(const struct rc_scancode_filter *in,
struct img_ir_filter *out, u64 protocols)
{
unsigned int cust, data;
unsigned int cust_m, data_m;
cust = (in->data >> 8) & 0xff;
cust_m = (in->mask >> 8) & 0xff;
data = (in->data >> 0) & 0xff;
data_m = (in->mask >> 0) & 0xff;
out->data = cust | data << 8;
out->mask = cust_m | data_m << 8;
return 0;
}
/*
* JVC decoder
* See also http://www.sbprojects.com/knowledge/ir/jvc.php
* http://support.jvc.com/consumer/support/documents/RemoteCodes.pdf
*/
struct img_ir_decoder img_ir_jvc = {
.type = RC_PROTO_BIT_JVC,
.control = {
.decoden = 1,
.code_type = IMG_IR_CODETYPE_PULSEDIST,
},
/* main timings */
.unit = 527500, /* 527.5 us */
.timings = {
/* leader symbol */
.ldr = {
.pulse = { 16 /* 8.44 ms */ },
.space = { 8 /* 4.22 ms */ },
},
/* 0 symbol */
.s00 = {
.pulse = { 1 /* 527.5 us +-60 us */ },
.space = { 1 /* 527.5 us */ },
},
/* 1 symbol */
.s01 = {
.pulse = { 1 /* 527.5 us +-60 us */ },
.space = { 3 /* 1.5825 ms +-40 us */ },
},
/* free time */
.ft = {
.minlen = 16,
.maxlen = 16,
.ft_min = 10, /* 5.275 ms */
},
},
/* scancode logic */
.scancode = img_ir_jvc_scancode,
.filter = img_ir_jvc_filter,
};
Annotation
- Immediate include surface: `img-ir-hw.h`.
- Detected declarations: `function img_ir_jvc_scancode`, `function img_ir_jvc_filter`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.