Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
53f87022
Commit
53f87022
authored
Dec 14, 2009
by
Mauro Carvalho Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L/DVB (13635): ir-core: Implement protocol table type reading
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
e93854da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
drivers/media/IR/ir-sysfs.c
drivers/media/IR/ir-sysfs.c
+28
-2
include/media/ir-core.h
include/media/ir-core.h
+3
-1
No files found.
drivers/media/IR/ir-sysfs.c
View file @
53f87022
...
...
@@ -22,10 +22,36 @@ unsigned long ir_core_dev_number;
static
struct
class
*
ir_input_class
;
static
DEVICE_ATTR
(
ir_protocol
,
S_IRUGO
|
S_IWUSR
,
NULL
,
NULL
);
static
ssize_t
show_protocol
(
struct
device
*
d
,
struct
device_attribute
*
mattr
,
char
*
buf
)
{
char
*
s
;
struct
ir_input_dev
*
ir_dev
=
dev_get_drvdata
(
d
);
enum
ir_type
ir_type
=
ir_dev
->
rc_tab
.
ir_type
;
IR_dprintk
(
1
,
"Current protocol is %ld
\n
"
,
ir_type
);
/* FIXME: doesn't support multiple protocols at the same time */
if
(
ir_type
==
IR_TYPE_UNKNOWN
)
s
=
"Unknown"
;
else
if
(
ir_type
==
IR_TYPE_RC5
)
s
=
"RC-5"
;
else
if
(
ir_type
==
IR_TYPE_PD
)
s
=
"Pulse/distance"
;
else
if
(
ir_type
==
IR_TYPE_NEC
)
s
=
"NEC"
;
else
s
=
"Other"
;
return
sprintf
(
buf
,
"%s
\n
"
,
s
);
}
static
DEVICE_ATTR
(
current_protocol
,
S_IRUGO
|
S_IWUSR
,
show_protocol
,
NULL
);
static
struct
attribute
*
ir_dev_attrs
[]
=
{
&
dev_attr_
ir
_protocol
.
attr
,
&
dev_attr_
current
_protocol
.
attr
,
};
int
ir_register_class
(
struct
input_dev
*
input_dev
)
...
...
include/media/ir-core.h
View file @
53f87022
...
...
@@ -44,9 +44,10 @@ struct ir_scancode_table {
struct
ir_dev_props
{
unsigned
long
allowed_protos
;
void
*
priv
;
int
(
*
change_protocol
)(
void
*
priv
,
unsigned
long
protocol
);
int
(
*
change_protocol
)(
void
*
priv
,
enum
ir_type
ir_type
);
};
struct
ir_input_dev
{
struct
input_dev
*
dev
;
/* Input device*/
struct
ir_scancode_table
rc_tab
;
/* scan/key table */
...
...
@@ -55,6 +56,7 @@ struct ir_input_dev {
struct
device
*
class_dev
;
/* virtual class dev */
const
struct
ir_dev_props
*
props
;
/* Device properties */
};
#define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr)
/* Routines from ir-keytable.c */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment