Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201941
b: refs/heads/master
c: b17b869
h: refs/heads/master
i:
  201939: 188fce3
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Aug 2, 2010
1 parent 5caabdd commit 47aa1ed
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39e1256bc4b85145b9db392e49a71cad43f6903b
refs/heads/master: b17b86991a6a17560ddd97ed9a970fc38427217d
16 changes: 16 additions & 0 deletions trunk/drivers/staging/tm6000/tm6000-alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,21 @@ static int snd_tm6000_close(struct snd_pcm_substream *substream)
return 0;
}

static int tm6000_fillbuf(struct tm6000_core *core, char *buf, int size)
{
int i;

/* Need to add a real code to copy audio buffer */
printk("Audio (%i bytes): ", size);
for (i = 0; i < size - 3; i +=4)
printk("(0x%04x, 0x%04x), ",
*(u16 *)(buf + i), *(u16 *)(buf + i + 2));

printk("\n");

return 0;
}

/*
* hw_params callback
*/
Expand Down Expand Up @@ -396,6 +411,7 @@ struct tm6000_ops audio_ops = {
.name = "TM6000 Audio Extension",
.init = tm6000_audio_init,
.fini = tm6000_audio_fini,
.fillbuf = tm6000_fillbuf,
};

static int __init tm6000_alsa_register(void)
Expand Down
17 changes: 17 additions & 0 deletions trunk/drivers/staging/tm6000/tm6000-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,23 @@ void tm6000_add_into_devlist(struct tm6000_core *dev)
static LIST_HEAD(tm6000_extension_devlist);
static DEFINE_MUTEX(tm6000_extension_devlist_lock);

int tm6000_call_fillbuf(struct tm6000_core *dev, enum tm6000_ops_type type,
char *buf, int size)
{
struct tm6000_ops *ops = NULL;

/* FIXME: tm6000_extension_devlist_lock should be a spinlock */

if (!list_empty(&tm6000_extension_devlist)) {
list_for_each_entry(ops, &tm6000_extension_devlist, next) {
if (ops->fillbuf && ops->type == type)
ops->fillbuf(dev, buf, size);
}
}

return 0;
}

int tm6000_register_extension(struct tm6000_ops *ops)
{
struct tm6000_core *dev = NULL;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/tm6000/tm6000-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ static int copy_streams(u8 *data, unsigned long len,
memcpy (&voutp[pos], ptr, cpysize);
break;
case TM6000_URB_MSG_AUDIO:
/* Need some code to copy audio buffer */
tm6000_call_fillbuf(dev, TM6000_AUDIO, ptr, cpysize);
break;
case TM6000_URB_MSG_VBI:
/* Need some code to copy vbi buffer */
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/staging/tm6000/tm6000.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ struct tm6000_ops {
enum tm6000_ops_type type;
int (*init)(struct tm6000_core *);
int (*fini)(struct tm6000_core *);
int (*fillbuf)(struct tm6000_core *, char *buf, int size);
};

struct tm6000_fh {
Expand Down Expand Up @@ -278,6 +279,9 @@ int tm6000_register_extension(struct tm6000_ops *ops);
void tm6000_unregister_extension(struct tm6000_ops *ops);
void tm6000_init_extension(struct tm6000_core *dev);
void tm6000_close_extension(struct tm6000_core *dev);
int tm6000_call_fillbuf(struct tm6000_core *dev, enum tm6000_ops_type type,
char *buf, int size);


/* In tm6000-stds.c */
void tm6000_get_std_res(struct tm6000_core *dev);
Expand Down

0 comments on commit 47aa1ed

Please sign in to comment.