diff options
author | Srinivas Kandagatla <srinivas.kandagatla@st.com> | 2013-07-22 04:22:57 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-07-31 16:28:01 -0300 |
commit | 8b2ff3204909687be26f20d63dcddc8e3d7a6c14 (patch) | |
tree | d51ad41ca433a39dcf5a505c57e8637e2b542d86 /include/media | |
parent | 918c66fd41268ec34bba0a82f4221ddc18e9501b (diff) | |
download | op-kernel-dev-8b2ff3204909687be26f20d63dcddc8e3d7a6c14.zip op-kernel-dev-8b2ff3204909687be26f20d63dcddc8e3d7a6c14.tar.gz |
[media] media: rc: Add rc_open/close and use count to rc_dev
This patch adds user count to rc_dev structure, the reason to add this
new member is to allow other code like lirc to open rc device directly.
In the existing code, rc device is only opened by input subsystem which
works ok if we have any input drivers to match. But in case like lirc
where there will be no input driver, rc device will be never opened.
Having this user count variable will be usefull to allow rc device to be
opened from code other than rc-main.
This patch also adds rc_open and rc_close functions for other drivers
like lirc to open and close rc devices. This functions safely increment
and decrement the user count. Other driver wanting to open rc device
should call rc_open and rc_close, rather than directly modifying the
rc_dev structure.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/rc-core.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/media/rc-core.h b/include/media/rc-core.h index 06a75de..2f6f1f7 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h @@ -101,6 +101,7 @@ struct rc_dev { bool idle; u64 allowed_protos; u64 enabled_protocols; + u32 users; u32 scanmask; void *priv; spinlock_t keylock; @@ -142,6 +143,9 @@ void rc_free_device(struct rc_dev *dev); int rc_register_device(struct rc_dev *dev); void rc_unregister_device(struct rc_dev *dev); +int rc_open(struct rc_dev *rdev); +void rc_close(struct rc_dev *rdev); + void rc_repeat(struct rc_dev *dev); void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle); void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle); |