diff options
author | Steven Toth <stoth@kernellabs.com> | 2010-07-31 23:18:35 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 13:55:14 +0400 |
commit | 1247ff5c0acb0fb50b076e390bb770acc95d1d7e (patch) | |
tree | 8b59af2d7df57c5675de0d103b22a667c1a951c8 /drivers/media/video/saa7164/saa7164-api.c | |
parent | 0b62ceb03545099f0ab43a787cef5307b34b2fe4 (diff) | |
download | linux-1247ff5c0acb0fb50b076e390bb770acc95d1d7e.tar.xz |
[media] saa7164: monitor the RISC cpu load via a thread
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164/saa7164-api.c')
-rw-r--r-- | drivers/media/video/saa7164/saa7164-api.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/media/video/saa7164/saa7164-api.c b/drivers/media/video/saa7164/saa7164-api.c index cf8337dd7bdf..0a2fdcde2f96 100644 --- a/drivers/media/video/saa7164/saa7164-api.c +++ b/drivers/media/video/saa7164/saa7164-api.c @@ -24,6 +24,31 @@ #include "saa7164.h" +int saa7164_api_get_load_info(struct saa7164_dev *dev, tmFwInfoStruct_t *i) +{ + int ret, debug; + + if (!(debug & DBGLVL_CPU)) + return 0; + + dprintk(DBGLVL_API, "%s()\n", __func__); + + i->deviceinst = 0; + i->devicespec = 0; + i->mode = 0; + i->status = 0; + + ret = saa7164_cmd_send(dev, 0, GET_CUR, + GET_FW_STATUS_CONTROL, sizeof(tmFwInfoStruct_t), i); + if (ret != SAA_OK) { + printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); + } + + printk(KERN_INFO "saa7164[%d]-CPU: %d percent", dev->nr, i->CPULoad); + + return ret; +} + int saa7164_api_collect_debug(struct saa7164_dev *dev) { tmComResDebugGetData_t d; |