aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-04-06 14:58:53 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:57:10 -0400
commitce68025e9f10481b9104c5bdf88b0dac52790757 (patch)
treecb36ce357f1aa32193d3194a186cad4a5cf32670 /drivers/media/video/ivtv
parent6a717883e720f75dec252c8af2a2d6dd049af254 (diff)
V4L/DVB: ivtv: move the _IO() decoder ioctls into vidioc_default
Now that video_ioctl2 no longer clobbers the argument for _IO() ioctls we can move these into vidioc_default where they really belong. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv')
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c65
1 files changed, 32 insertions, 33 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index c29ff983d43e..6422cf8f189d 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1564,6 +1564,7 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
1564 struct ivtv *itv = id->itv; 1564 struct ivtv *itv = id->itv;
1565 int nonblocking = filp->f_flags & O_NONBLOCK; 1565 int nonblocking = filp->f_flags & O_NONBLOCK;
1566 struct ivtv_stream *s = &itv->streams[id->type]; 1566 struct ivtv_stream *s = &itv->streams[id->type];
1567 unsigned long iarg = (unsigned long)arg;
1567 1568
1568 switch (cmd) { 1569 switch (cmd) {
1569 case IVTV_IOC_DMA_FRAME: { 1570 case IVTV_IOC_DMA_FRAME: {
@@ -1745,6 +1746,33 @@ static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *arg)
1745 break; 1746 break;
1746 } 1747 }
1747 1748
1749 case VIDEO_SELECT_SOURCE:
1750 IVTV_DEBUG_IOCTL("VIDEO_SELECT_SOURCE\n");
1751 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT))
1752 return -EINVAL;
1753 return ivtv_passthrough_mode(itv, iarg == VIDEO_SOURCE_DEMUX);
1754
1755 case AUDIO_SET_MUTE:
1756 IVTV_DEBUG_IOCTL("AUDIO_SET_MUTE\n");
1757 itv->speed_mute_audio = iarg;
1758 return 0;
1759
1760 case AUDIO_CHANNEL_SELECT:
1761 IVTV_DEBUG_IOCTL("AUDIO_CHANNEL_SELECT\n");
1762 if (iarg > AUDIO_STEREO_SWAPPED)
1763 return -EINVAL;
1764 itv->audio_stereo_mode = iarg;
1765 ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
1766 return 0;
1767
1768 case AUDIO_BILINGUAL_CHANNEL_SELECT:
1769 IVTV_DEBUG_IOCTL("AUDIO_BILINGUAL_CHANNEL_SELECT\n");
1770 if (iarg > AUDIO_STEREO_SWAPPED)
1771 return -EINVAL;
1772 itv->audio_bilingual_mode = iarg;
1773 ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
1774 return 0;
1775
1748 default: 1776 default:
1749 return -EINVAL; 1777 return -EINVAL;
1750 } 1778 }
@@ -1776,6 +1804,10 @@ static long ivtv_default(struct file *file, void *fh, int cmd, void *arg)
1776 case VIDEO_CONTINUE: 1804 case VIDEO_CONTINUE:
1777 case VIDEO_COMMAND: 1805 case VIDEO_COMMAND:
1778 case VIDEO_TRY_COMMAND: 1806 case VIDEO_TRY_COMMAND:
1807 case VIDEO_SELECT_SOURCE:
1808 case AUDIO_SET_MUTE:
1809 case AUDIO_CHANNEL_SELECT:
1810 case AUDIO_BILINGUAL_CHANNEL_SELECT:
1779 return ivtv_decoder_ioctls(file, cmd, (void *)arg); 1811 return ivtv_decoder_ioctls(file, cmd, (void *)arg);
1780 1812
1781 default: 1813 default:
@@ -1791,39 +1823,6 @@ static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp,
1791 struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data; 1823 struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
1792 long ret; 1824 long ret;
1793 1825
1794 /* Filter dvb ioctls that cannot be handled by the v4l ioctl framework */
1795 switch (cmd) {
1796 case VIDEO_SELECT_SOURCE:
1797 IVTV_DEBUG_IOCTL("VIDEO_SELECT_SOURCE\n");
1798 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT))
1799 return -EINVAL;
1800 return ivtv_passthrough_mode(itv, arg == VIDEO_SOURCE_DEMUX);
1801
1802 case AUDIO_SET_MUTE:
1803 IVTV_DEBUG_IOCTL("AUDIO_SET_MUTE\n");
1804 itv->speed_mute_audio = arg;
1805 return 0;
1806
1807 case AUDIO_CHANNEL_SELECT:
1808 IVTV_DEBUG_IOCTL("AUDIO_CHANNEL_SELECT\n");
1809 if (arg > AUDIO_STEREO_SWAPPED)
1810 return -EINVAL;
1811 itv->audio_stereo_mode = arg;
1812 ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
1813 return 0;
1814
1815 case AUDIO_BILINGUAL_CHANNEL_SELECT:
1816 IVTV_DEBUG_IOCTL("AUDIO_BILINGUAL_CHANNEL_SELECT\n");
1817 if (arg > AUDIO_STEREO_SWAPPED)
1818 return -EINVAL;
1819 itv->audio_bilingual_mode = arg;
1820 ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
1821 return 0;
1822
1823 default:
1824 break;
1825 }
1826
1827 /* check priority */ 1826 /* check priority */
1828 switch (cmd) { 1827 switch (cmd) {
1829 case VIDIOC_S_CTRL: 1828 case VIDIOC_S_CTRL: