This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Changing TVP7002 gain from userspace

Other Parts Discussed in Thread: TVP7002

Hi,

We are using the TVP7002 to convert 1080i HD component video to YCbCr 4:2:2 to input into the DM8168.  We would like to be able to adjust the digital(fine) gain of the TVP7002 during runtime from the userspace.  In the tvp7002.c driver I see that there are two functions (tvp7002_s_ctrl, tvp7002_g_ctrl) that appear to read and set the gain.  

Reading through more documentation I find that the V4L2 API has a couple ioctls (VIDIOC_G_CTRL, VIDIOC_S_CTRL) which look like what I need.  However, I'm not sure how to access these functions.

  • Am I on the right track?
  • How do I set the gain from userspace?
  • Do I need to modify the tvp7002.c driver to export the s_ctrl and g_ctrl functions?
Any help would be appreciated.
Thanks,
Aaron
(I posted this in the Legacy Video Converters forum but didn't get a response for weeks, hoping this is a better forum to post in.
  • Hi Aaron,

    This is the only way available to you currently. Other wise you'll have to modify the HDVPSS firmware's code to change TVP7002 parameters. Which is the software package that you use?

  • Hi Renjith,

    Thanks for the response.  We are currently using the Z3-RPS-20121103 release for our development.

    If I modify the HDVPSS firmware code, then I can set the TVP7002 parameters during system initialization, but not during run time from user space?

    Is there a recommended method to export the s_ctrl and g_ctrl functions from the TVP7002 driver?  I have used IO_MAGIC in the past for exporting functions to the userspace, but I am not that familiar with writing linux drivers so I'm not sure if that will work for this case or is even advisable.

    Thanks,

    Aaron                                                                                                                                  

  • Hi Aaron,

    If you modify HDVPSS firmware you can set the parameters during initalization as well as run time. 

    Aaron Ridinger said:
    Is there a recommended method to export the s_ctrl and g_ctrl functions from the TVP7002 driver?  I have used IO_MAGIC in the past for exporting functions to the userspace, but I am not that familiar with writing linux drivers so I'm not sure if that will work for this case or is even advisable.

    I think the s_ctrl and g_ctrl API can be accessed from user space directly using standard V4L2 IOCTLs. But the support for adjusting gains might not be supported in TVP7002 driver. 

  • Hi Renjith,

    Thanks for your help.  We're working on accessing the s_ctrl and g_ctrl using V4L2 IOCTLs now, I'll let you know if we have any more questions.

    Thanks!

    Aaron