upstream: [media] media: rc: Add rc_open/close and use count to rc_dev
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>
Mon, 22 Jul 2013 07:22:57 +0000 (04:22 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:51:32 +0000 (11:51 +0900)
commit9d4ea62b59567839f833b9f74cfc756d06199bf7
treec9f63f53c812501959a3e964b540d45155b55c71
parent5c5a1474f095f8eb8877b1f82f423c3a170f1eb4
upstream: [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>
drivers/media/rc/rc-main.c
include/media/rc-core.h