From: Pantelis Koukousoulas Date: Thu, 28 Dec 2006 02:06:04 +0000 (-0300) Subject: V4L/DVB (5035): Pvrusb2: Enable radio mode round #2 X-Git-Tag: v2.6.21-rc2~66^2~165 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25d8527a441760c333c41ec7197ba0750780b371;p=pandora-kernel.git V4L/DVB (5035): Pvrusb2: Enable radio mode round #2 This is the logic that: a) Ensures /sys/class/pvrusb2/sn-*/ctl_frequency/{max,min}_val are "automagically" reset to sane values on each mode change. b) Allows tuning to a radio frequency by something like: echo `perl -e "print int(94.9*16000 + 0.5)"` \ > /sys/class/pvrusb2/sn-*/ctl_input/cur_val The trick was to take advantage of the already existing .get_{min,max}_value function pointers in pvr2_ctrl, to "dynamically override" the hardcoded values for min/max frequency at runtime. For a moment I thought to dispose of the hardcoded MIN/MAX_FREQ and use the hirange/lowrange fields of the v4l2_tuner struct instead, but then I see that tuner-core.c kinda hardcodes these as well, so I decided to not bother. Signed-off-by: Pantelis Koukousoulas Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed