• Srinivas Kandagatla's avatar
    [media] media: rc: Add rc_open/close and use count to rc_dev · 8b2ff320
    Srinivas Kandagatla authored
    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: default avatarSrinivas Kandagatla <srinivas.kandagatla@st.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
    8b2ff320
rc-main.c 31.1 KB