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
nexedi
linux
Commits
c13dd704
Commit
c13dd704
authored
Sep 19, 2007
by
Mauro Carvalho Chehab
Committed by
Mauro Carvalho Chehab
May 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L/DVB (12797): tm6000: Allow selecting audio bitrate
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
7e2fdf02
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
10 deletions
+30
-10
drivers/staging/tm6000/tm6000-core.c
drivers/staging/tm6000/tm6000-core.c
+2
-0
drivers/staging/tm6000/tm6000-video.c
drivers/staging/tm6000/tm6000-video.c
+27
-10
drivers/staging/tm6000/tm6000.h
drivers/staging/tm6000/tm6000.h
+1
-0
No files found.
drivers/staging/tm6000/tm6000-core.c
View file @
c13dd704
...
@@ -722,9 +722,11 @@ printk("Original value=%d\n",val);
...
@@ -722,9 +722,11 @@ printk("Original value=%d\n",val);
switch
(
bitrate
)
{
switch
(
bitrate
)
{
case
44100
:
case
44100
:
val
|=
0xd0
;
val
|=
0xd0
;
dev
->
audio_bitrate
=
bitrate
;
break
;
break
;
case
48000
:
case
48000
:
val
|=
0x60
;
val
|=
0x60
;
dev
->
audio_bitrate
=
bitrate
;
break
;
break
;
}
}
val
=
tm6000_set_reg
(
dev
,
REQ_07_SET_GET_AVREG
,
0xeb
,
val
);
val
=
tm6000_set_reg
(
dev
,
REQ_07_SET_GET_AVREG
,
0xeb
,
val
);
...
...
drivers/staging/tm6000/tm6000-video.c
View file @
c13dd704
...
@@ -566,8 +566,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev,
...
@@ -566,8 +566,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev,
dev
->
isoc_ctl
.
urb
[
i
]
=
urb
;
dev
->
isoc_ctl
.
urb
[
i
]
=
urb
;
dev
->
isoc_ctl
.
transfer_buffer
[
i
]
=
usb_buffer_alloc
(
dev
->
udev
,
dev
->
isoc_ctl
.
transfer_buffer
[
i
]
=
usb_buffer_alloc
(
dev
->
udev
,
sb_size
,
GFP_KERNEL
,
sb_size
,
GFP_KERNEL
,
&
urb
->
transfer_dma
);
&
dev
->
isoc_ctl
.
urb
[
i
]
->
transfer_dma
);
if
(
!
dev
->
isoc_ctl
.
transfer_buffer
[
i
])
{
if
(
!
dev
->
isoc_ctl
.
transfer_buffer
[
i
])
{
tm6000_err
(
"unable to allocate %i bytes for transfer"
tm6000_err
(
"unable to allocate %i bytes for transfer"
" buffer %i
\n
"
,
sb_size
,
i
);
" buffer %i
\n
"
,
sb_size
,
i
);
...
@@ -787,14 +786,32 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
...
@@ -787,14 +786,32 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
urb_init
=
1
;
urb_init
=
1
;
if
(
urb_init
)
{
if
(
urb_init
)
{
/* Should allocate/request at least h
/* memory for video
res x v res x 2 bytes/pixel */
Should be at least
urbsize
=
(
buf
->
vb
.
size
+
dev
->
max_isoc_in
-
1
)
/
dev
->
max_isoc_in
;
Vres x Vres x 2 bytes/pixel by frame */
urbsize
=
buf
->
vb
.
size
;
/* Hack to allocate memory for Video + Audio */
/* FIXME: should also consider header ovehead of
/* memory for audio
4 bytes/180 bytes */
Should be at least
urbsize
+=
((
48000
*
4
+
24
)
/
25
+
dev
->
max_isoc_in
-
1
)
/
dev
->
max_isoc_in
;
bitrate * 2 channels * 2 bytes / frame rate */
if
(
dev
->
norm
&
V4L2_STD_525_60
)
{
urbsize
+=
(
dev
->
audio_bitrate
*
4
+
29
)
/
30
;
}
else
{
urbsize
+=
(
dev
->
audio_bitrate
*
4
+
24
)
/
25
;
}
/* each audio frame seeems to have a frame number
with 2 bytes */
urbsize
+=
2
;
/* Add 4 bytes by each 180 bytes frame */
urbsize
+=
((
urbsize
+
179
)
/
180
)
*
4
;
/* Round to an enough number of URBs */
urbsize
=
(
urbsize
+
dev
->
max_isoc_in
-
1
)
/
dev
->
max_isoc_in
;
printk
(
"Allocating %d packets to handle %lu size
\n
"
,
urbsize
,
buf
->
vb
.
size
);
dprintk
(
dev
,
V4L2_DEBUG_QUEUE
,
"Allocating %d packets to handle "
dprintk
(
dev
,
V4L2_DEBUG_QUEUE
,
"Allocating %d packets to handle "
"%lu size
\n
"
,
urbsize
,
buf
->
vb
.
size
);
"%lu size
\n
"
,
urbsize
,
buf
->
vb
.
size
);
...
...
drivers/staging/tm6000/tm6000.h
View file @
c13dd704
...
@@ -137,6 +137,7 @@ struct tm6000_core {
...
@@ -137,6 +137,7 @@ struct tm6000_core {
/* Demodulator configuration */
/* Demodulator configuration */
int
demod_addr
;
/* demodulator address */
int
demod_addr
;
/* demodulator address */
int
audio_bitrate
;
/* i2c i/o */
/* i2c i/o */
struct
i2c_adapter
i2c_adap
;
struct
i2c_adapter
i2c_adap
;
struct
i2c_client
i2c_client
;
struct
i2c_client
i2c_client
;
...
...
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