Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E-EXK4 - Operating System Group
projects
Linux
Commits
9c89a181
Commit
9c89a181
authored
15 years ago
by
Mauro Carvalho Chehab
Browse files
Options
Downloads
Patches
Plain Diff
V4L/DVB: ir-core: Export IR name via uevent
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
2915e5ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/media/IR/ir-keytable.c
+1
-0
1 addition, 0 deletions
drivers/media/IR/ir-keytable.c
drivers/media/IR/ir-sysfs.c
+22
-3
22 additions, 3 deletions
drivers/media/IR/ir-sysfs.c
with
23 additions
and
3 deletions
drivers/media/IR/ir-keytable.c
+
1
−
0
View file @
9c89a181
...
@@ -419,6 +419,7 @@ int ir_input_register(struct input_dev *input_dev,
...
@@ -419,6 +419,7 @@ int ir_input_register(struct input_dev *input_dev,
spin_lock_init
(
&
ir_dev
->
rc_tab
.
lock
);
spin_lock_init
(
&
ir_dev
->
rc_tab
.
lock
);
ir_dev
->
rc_tab
.
name
=
rc_tab
->
name
;
ir_dev
->
rc_tab
.
size
=
ir_roundup_tablesize
(
rc_tab
->
size
);
ir_dev
->
rc_tab
.
size
=
ir_roundup_tablesize
(
rc_tab
->
size
);
ir_dev
->
rc_tab
.
scan
=
kzalloc
(
ir_dev
->
rc_tab
.
size
*
ir_dev
->
rc_tab
.
scan
=
kzalloc
(
ir_dev
->
rc_tab
.
size
*
sizeof
(
struct
ir_scancode
),
GFP_KERNEL
);
sizeof
(
struct
ir_scancode
),
GFP_KERNEL
);
...
...
This diff is collapsed.
Click to expand it.
drivers/media/IR/ir-sysfs.c
+
22
−
3
View file @
9c89a181
...
@@ -126,6 +126,24 @@ static ssize_t store_protocol(struct device *d,
...
@@ -126,6 +126,24 @@ static ssize_t store_protocol(struct device *d,
return
len
;
return
len
;
}
}
#define ADD_HOTPLUG_VAR(fmt, val...) \
do { \
int err = add_uevent_var(env, fmt, val); \
if (err) \
return err; \
} while (0)
static
int
ir_dev_uevent
(
struct
device
*
device
,
struct
kobj_uevent_env
*
env
)
{
struct
ir_input_dev
*
ir_dev
=
dev_get_drvdata
(
device
);
if
(
ir_dev
->
rc_tab
.
name
)
ADD_HOTPLUG_VAR
(
"NAME=
\"
%s
\"
"
,
ir_dev
->
rc_tab
.
name
);
return
0
;
}
/*
/*
* Static device attribute struct with the sysfs attributes for IR's
* Static device attribute struct with the sysfs attributes for IR's
*/
*/
...
@@ -148,9 +166,9 @@ static const struct attribute_group *ir_dev_attr_groups[] = {
...
@@ -148,9 +166,9 @@ static const struct attribute_group *ir_dev_attr_groups[] = {
static
struct
device_type
ir_dev_type
=
{
static
struct
device_type
ir_dev_type
=
{
.
groups
=
ir_dev_attr_groups
,
.
groups
=
ir_dev_attr_groups
,
.
uevent
=
ir_dev_uevent
,
};
};
/**
/**
* ir_register_class() - creates the sysfs for /sys/class/irrcv/irrcv?
* ir_register_class() - creates the sysfs for /sys/class/irrcv/irrcv?
* @input_dev: the struct input_dev descriptor of the device
* @input_dev: the struct input_dev descriptor of the device
...
@@ -173,6 +191,7 @@ int ir_register_class(struct input_dev *input_dev)
...
@@ -173,6 +191,7 @@ int ir_register_class(struct input_dev *input_dev)
ir_dev
->
dev
.
class
=
&
ir_input_class
;
ir_dev
->
dev
.
class
=
&
ir_input_class
;
ir_dev
->
dev
.
parent
=
input_dev
->
dev
.
parent
;
ir_dev
->
dev
.
parent
=
input_dev
->
dev
.
parent
;
dev_set_name
(
&
ir_dev
->
dev
,
"irrcv%d"
,
devno
);
dev_set_name
(
&
ir_dev
->
dev
,
"irrcv%d"
,
devno
);
dev_set_drvdata
(
&
ir_dev
->
dev
,
ir_dev
);
rc
=
device_register
(
&
ir_dev
->
dev
);
rc
=
device_register
(
&
ir_dev
->
dev
);
if
(
rc
)
if
(
rc
)
return
rc
;
return
rc
;
...
@@ -187,8 +206,8 @@ int ir_register_class(struct input_dev *input_dev)
...
@@ -187,8 +206,8 @@ int ir_register_class(struct input_dev *input_dev)
__module_get
(
THIS_MODULE
);
__module_get
(
THIS_MODULE
);
path
=
kobject_get_path
(
&
i
nput
_dev
->
dev
.
kobj
,
GFP_KERNEL
);
path
=
kobject_get_path
(
&
i
r
_dev
->
dev
.
kobj
,
GFP_KERNEL
);
printk
(
KERN_INFO
"%s: %s as
sociated with sysfs
%s
\n
"
,
printk
(
KERN_INFO
"%s: %s as %s
\n
"
,
dev_name
(
&
ir_dev
->
dev
),
dev_name
(
&
ir_dev
->
dev
),
input_dev
->
name
?
input_dev
->
name
:
"Unspecified device"
,
input_dev
->
name
?
input_dev
->
name
:
"Unspecified device"
,
path
?
path
:
"N/A"
);
path
?
path
:
"N/A"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment