Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
70d72c8a
Commit
70d72c8a
authored
Mar 12, 2002
by
Gerd Knorr
Committed by
Linus Torvalds
Mar 12, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] v4l: aimslab radio update
Here comes the aimslab radio driver update.
parent
52003ba3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
66 deletions
+47
-66
drivers/media/radio/radio-aimslab.c
drivers/media/radio/radio-aimslab.c
+47
-66
No files found.
drivers/media/radio/radio-aimslab.c
View file @
70d72c8a
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
static
int
io
=
CONFIG_RADIO_RTRACK_PORT
;
static
int
io
=
CONFIG_RADIO_RTRACK_PORT
;
static
int
radio_nr
=
-
1
;
static
int
radio_nr
=
-
1
;
static
int
users
=
0
;
static
struct
semaphore
lock
;
static
struct
semaphore
lock
;
struct
rt_device
struct
rt_device
...
@@ -214,89 +213,77 @@ static int rt_getsigstr(struct rt_device *dev)
...
@@ -214,89 +213,77 @@ static int rt_getsigstr(struct rt_device *dev)
return
1
;
/* signal present */
return
1
;
/* signal present */
}
}
static
int
rt_ioctl
(
struct
video_device
*
dev
,
unsigned
int
cmd
,
void
*
arg
)
static
int
rt_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
void
*
arg
)
{
{
struct
video_device
*
dev
=
video_devdata
(
file
);
struct
rt_device
*
rt
=
dev
->
priv
;
struct
rt_device
*
rt
=
dev
->
priv
;
switch
(
cmd
)
switch
(
cmd
)
{
{
case
VIDIOCGCAP
:
case
VIDIOCGCAP
:
{
{
struct
video_capability
v
;
struct
video_capability
*
v
=
arg
;
v
.
type
=
VID_TYPE_TUNER
;
memset
(
v
,
0
,
sizeof
(
*
v
));
v
.
channels
=
1
;
v
->
type
=
VID_TYPE_TUNER
;
v
.
audios
=
1
;
v
->
channels
=
1
;
/* No we don't do pictures */
v
->
audios
=
1
;
v
.
maxwidth
=
0
;
strcpy
(
v
->
name
,
"RadioTrack"
);
v
.
maxheight
=
0
;
v
.
minwidth
=
0
;
v
.
minheight
=
0
;
strcpy
(
v
.
name
,
"RadioTrack"
);
if
(
copy_to_user
(
arg
,
&
v
,
sizeof
(
v
)))
return
-
EFAULT
;
return
0
;
return
0
;
}
}
case
VIDIOCGTUNER
:
case
VIDIOCGTUNER
:
{
{
struct
video_tuner
v
;
struct
video_tuner
*
v
=
arg
;
if
(
copy_from_user
(
&
v
,
arg
,
sizeof
(
v
))
!=
0
)
if
(
v
->
tuner
)
/* Only 1 tuner */
return
-
EFAULT
;
if
(
v
.
tuner
)
/* Only 1 tuner */
return
-
EINVAL
;
return
-
EINVAL
;
v
.
rangelow
=
(
87
*
16000
);
v
->
rangelow
=
(
87
*
16000
);
v
.
rangehigh
=
(
108
*
16000
);
v
->
rangehigh
=
(
108
*
16000
);
v
.
flags
=
VIDEO_TUNER_LOW
;
v
->
flags
=
VIDEO_TUNER_LOW
;
v
.
mode
=
VIDEO_MODE_AUTO
;
v
->
mode
=
VIDEO_MODE_AUTO
;
strcpy
(
v
.
name
,
"FM"
);
strcpy
(
v
->
name
,
"FM"
);
v
.
signal
=
0xFFFF
*
rt_getsigstr
(
rt
);
v
->
signal
=
0xFFFF
*
rt_getsigstr
(
rt
);
if
(
copy_to_user
(
arg
,
&
v
,
sizeof
(
v
)))
return
-
EFAULT
;
return
0
;
return
0
;
}
}
case
VIDIOCSTUNER
:
case
VIDIOCSTUNER
:
{
{
struct
video_tuner
v
;
struct
video_tuner
*
v
=
arg
;
if
(
copy_from_user
(
&
v
,
arg
,
sizeof
(
v
)))
if
(
v
->
tuner
!=
0
)
return
-
EFAULT
;
if
(
v
.
tuner
!=
0
)
return
-
EINVAL
;
return
-
EINVAL
;
/* Only 1 tuner so no setting needed ! */
/* Only 1 tuner so no setting needed ! */
return
0
;
return
0
;
}
}
case
VIDIOCGFREQ
:
case
VIDIOCGFREQ
:
if
(
copy_to_user
(
arg
,
&
rt
->
curfreq
,
sizeof
(
rt
->
curfreq
)))
{
return
-
EFAULT
;
unsigned
long
*
freq
=
arg
;
*
freq
=
rt
->
curfreq
;
return
0
;
return
0
;
}
case
VIDIOCSFREQ
:
case
VIDIOCSFREQ
:
if
(
copy_from_user
(
&
rt
->
curfreq
,
arg
,
sizeof
(
rt
->
curfreq
)))
{
return
-
EFAULT
;
unsigned
long
*
freq
=
arg
;
rt
->
curfreq
=
*
freq
;
rt_setfreq
(
rt
,
rt
->
curfreq
);
rt_setfreq
(
rt
,
rt
->
curfreq
);
return
0
;
return
0
;
}
case
VIDIOCGAUDIO
:
case
VIDIOCGAUDIO
:
{
{
struct
video_audio
v
;
struct
video_audio
*
v
=
arg
;
memset
(
&
v
,
0
,
sizeof
(
v
));
memset
(
v
,
0
,
sizeof
(
*
v
));
v
.
flags
|=
VIDEO_AUDIO_MUTABLE
|
VIDEO_AUDIO_VOLUME
;
v
->
flags
|=
VIDEO_AUDIO_MUTABLE
|
VIDEO_AUDIO_VOLUME
;
v
.
volume
=
rt
->
curvol
*
6554
;
v
->
volume
=
rt
->
curvol
*
6554
;
v
.
step
=
6554
;
v
->
step
=
6554
;
strcpy
(
v
.
name
,
"Radio"
);
strcpy
(
v
->
name
,
"Radio"
);
if
(
copy_to_user
(
arg
,
&
v
,
sizeof
(
v
)))
return
-
EFAULT
;
return
0
;
return
0
;
}
}
case
VIDIOCSAUDIO
:
case
VIDIOCSAUDIO
:
{
{
struct
video_audio
v
;
struct
video_audio
*
v
=
arg
;
if
(
copy_from_user
(
&
v
,
arg
,
sizeof
(
v
)))
if
(
v
->
audio
)
return
-
EFAULT
;
if
(
v
.
audio
)
return
-
EINVAL
;
return
-
EINVAL
;
if
(
v
->
flags
&
VIDEO_AUDIO_MUTE
)
if
(
v
.
flags
&
VIDEO_AUDIO_MUTE
)
rt_mute
(
rt
);
rt_mute
(
rt
);
else
else
rt_setvol
(
rt
,
v
.
volume
/
6554
);
rt_setvol
(
rt
,
v
->
volume
/
6554
);
return
0
;
return
0
;
}
}
default:
default:
...
@@ -304,30 +291,24 @@ static int rt_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
...
@@ -304,30 +291,24 @@ static int rt_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
}
}
}
}
static
int
rt_open
(
struct
video_device
*
dev
,
int
flags
)
{
if
(
users
)
return
-
EBUSY
;
users
++
;
return
0
;
}
static
void
rt_close
(
struct
video_device
*
dev
)
{
users
--
;
}
static
struct
rt_device
rtrack_unit
;
static
struct
rt_device
rtrack_unit
;
static
struct
file_operations
rtrack_fops
=
{
owner:
THIS_MODULE
,
open:
video_exclusive_open
,
release:
video_exclusive_release
,
ioctl:
video_generic_ioctl
,
llseek:
no_llseek
,
};
static
struct
video_device
rtrack_radio
=
static
struct
video_device
rtrack_radio
=
{
{
owner:
THIS_MODULE
,
owner:
THIS_MODULE
,
name:
"RadioTrack radio"
,
name:
"RadioTrack radio"
,
type:
VID_TYPE_TUNER
,
type:
VID_TYPE_TUNER
,
hardware:
VID_HARDWARE_RTRACK
,
hardware:
VID_HARDWARE_RTRACK
,
open:
rt_open
,
fops:
&
rtrack_fops
,
close:
rt_close
,
kernel_ioctl:
rt_ioctl
,
ioctl:
rt_ioctl
,
};
};
static
int
__init
rtrack_init
(
void
)
static
int
__init
rtrack_init
(
void
)
...
...
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