Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
99218fe4
Commit
99218fe4
authored
Jan 25, 2007
by
Mauro Carvalho Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L/DVB (5148): Convert radio-aztech to use video_ioctl2
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@infradead.org
>
parent
b50e7fe9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
122 additions
and
118 deletions
+122
-118
drivers/media/radio/radio-aztech.c
drivers/media/radio/radio-aztech.c
+122
-118
No files found.
drivers/media/radio/radio-aztech.c
View file @
99218fe4
...
...
@@ -180,34 +180,26 @@ static int az_setfreq(struct az_device *dev, unsigned long frequency)
return
0
;
}
static
int
az_do_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
void
*
arg
)
static
int
vidioc_querycap
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_capability
*
v
)
{
struct
video_device
*
dev
=
video_devdata
(
file
);
struct
az_device
*
az
=
dev
->
priv
;
switch
(
cmd
)
{
case
VIDIOC_QUERYCAP
:
{
struct
v4l2_capability
*
v
=
arg
;
memset
(
v
,
0
,
sizeof
(
*
v
));
strlcpy
(
v
->
driver
,
"radio-aztech"
,
sizeof
(
v
->
driver
));
strlcpy
(
v
->
card
,
"Aztech Radio"
,
sizeof
(
v
->
card
));
sprintf
(
v
->
bus_info
,
"ISA"
);
v
->
version
=
RADIO_VERSION
;
v
->
capabilities
=
V4L2_CAP_TUNER
;
return
0
;
}
case
VIDIOC_G_TUNER
:
{
struct
v4l2_tuner
*
v
=
arg
;
}
static
int
vidioc_g_tuner
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_tuner
*
v
)
{
struct
video_device
*
dev
=
video_devdata
(
file
);
struct
az_device
*
az
=
dev
->
priv
;
if
(
v
->
index
>
0
)
return
-
EINVAL
;
memset
(
v
,
0
,
sizeof
(
*
v
));
strcpy
(
v
->
name
,
"FM"
);
v
->
type
=
V4L2_TUNER_RADIO
;
...
...
@@ -222,37 +214,44 @@ static int az_do_ioctl(struct inode *inode, struct file *file,
v
->
signal
=
0xFFFF
*
az_getsigstr
(
az
);
return
0
;
}
case
VIDIOC_S_TUNER
:
{
struct
v4l2_tuner
*
v
=
arg
;
}
static
int
vidioc_s_tuner
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_tuner
*
v
)
{
if
(
v
->
index
>
0
)
return
-
EINVAL
;
return
0
;
}
case
VIDIOC_S_FREQUENCY
:
{
struct
v4l2_frequency
*
f
=
arg
;
}
static
int
vidioc_s_frequency
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_frequency
*
f
)
{
struct
video_device
*
dev
=
video_devdata
(
file
);
struct
az_device
*
az
=
dev
->
priv
;
az
->
curfreq
=
f
->
frequency
;
az_setfreq
(
az
,
az
->
curfreq
);
return
0
;
}
case
VIDIOC_G_FREQUENCY
:
{
struct
v4l2_frequency
*
f
=
arg
;
}
static
int
vidioc_g_frequency
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_frequency
*
f
)
{
struct
video_device
*
dev
=
video_devdata
(
file
);
struct
az_device
*
az
=
dev
->
priv
;
f
->
type
=
V4L2_TUNER_RADIO
;
f
->
frequency
=
az
->
curfreq
;
return
0
;
}
}
case
VIDIOC_QUERYCTRL
:
{
struct
v4l2_queryctrl
*
qc
=
arg
;
static
int
vidioc_queryctrl
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_queryctrl
*
qc
)
{
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
radio_qctrl
);
i
++
)
{
...
...
@@ -263,10 +262,13 @@ static int az_do_ioctl(struct inode *inode, struct file *file,
}
}
return
-
EINVAL
;
}
case
VIDIOC_G_CTRL
:
{
struct
v4l2_control
*
ctrl
=
arg
;
}
static
int
vidioc_g_ctrl
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_control
*
ctrl
)
{
struct
video_device
*
dev
=
video_devdata
(
file
);
struct
az_device
*
az
=
dev
->
priv
;
switch
(
ctrl
->
id
)
{
case
V4L2_CID_AUDIO_MUTE
:
...
...
@@ -280,10 +282,13 @@ static int az_do_ioctl(struct inode *inode, struct file *file,
return
(
0
);
}
return
-
EINVAL
;
}
case
VIDIOC_S_CTRL
:
{
struct
v4l2_control
*
ctrl
=
arg
;
}
static
int
vidioc_s_ctrl
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_control
*
ctrl
)
{
struct
video_device
*
dev
=
video_devdata
(
file
);
struct
az_device
*
az
=
dev
->
priv
;
switch
(
ctrl
->
id
)
{
case
V4L2_CID_AUDIO_MUTE
:
...
...
@@ -298,18 +303,6 @@ static int az_do_ioctl(struct inode *inode, struct file *file,
return
(
0
);
}
return
-
EINVAL
;
}
default:
return
v4l_compat_translate_ioctl
(
inode
,
file
,
cmd
,
arg
,
az_do_ioctl
);
}
}
static
int
az_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
return
video_usercopy
(
inode
,
file
,
cmd
,
arg
,
az_do_ioctl
);
}
static
struct
az_device
aztech_unit
;
...
...
@@ -318,7 +311,7 @@ static const struct file_operations aztech_fops = {
.
owner
=
THIS_MODULE
,
.
open
=
video_exclusive_open
,
.
release
=
video_exclusive_release
,
.
ioctl
=
az_ioctl
,
.
ioctl
=
video_ioctl2
,
.
compat_ioctl
=
v4l_compat_ioctl32
,
.
llseek
=
no_llseek
,
};
...
...
@@ -330,8 +323,19 @@ static struct video_device aztech_radio=
.
type
=
VID_TYPE_TUNER
,
.
hardware
=
0
,
.
fops
=
&
aztech_fops
,
.
vidioc_querycap
=
vidioc_querycap
,
.
vidioc_g_tuner
=
vidioc_g_tuner
,
.
vidioc_s_tuner
=
vidioc_s_tuner
,
.
vidioc_g_frequency
=
vidioc_g_frequency
,
.
vidioc_s_frequency
=
vidioc_s_frequency
,
.
vidioc_queryctrl
=
vidioc_queryctrl
,
.
vidioc_g_ctrl
=
vidioc_g_ctrl
,
.
vidioc_s_ctrl
=
vidioc_s_ctrl
,
};
module_param_named
(
debug
,
aztech_radio
.
debug
,
int
,
0644
);
MODULE_PARM_DESC
(
debug
,
"activates debug info"
);
static
int
__init
aztech_init
(
void
)
{
if
(
io
==-
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment