summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci/av7110_hw.c
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2004-01-08 15:40:29 +0000
committerJohannes Stezenbach <devnull@localhost>2004-01-08 15:40:29 +0000
commita5a25009a36bcd196d7cf698a27fcd582258271d (patch)
treea4259300bd82346e63a719243b9e2c969cc7664a /linux/drivers/media/dvb/ttpci/av7110_hw.c
parentac2dbac8e069b0c2296830363fd475e63cc20cdc (diff)
downloadmediapointer-dvb-s2-a5a25009a36bcd196d7cf698a27fcd582258271d.tar.gz
mediapointer-dvb-s2-a5a25009a36bcd196d7cf698a27fcd582258271d.tar.bz2
rename some non-static functions to enhance readability
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110_hw.c')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.c128
1 files changed, 65 insertions, 63 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c
index 028607312..9fc7652d4 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c
@@ -97,7 +97,7 @@ u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, int count)
/* av7110 ARM core boot stuff */
-void reset_arm(struct av7110 *av7110)
+void av7110_reset_arm(struct av7110 *av7110)
{
saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTLO);
@@ -209,7 +209,7 @@ static u8 bootcode[] = {
0x2c, 0x00, 0x03, 0xf8, 0x2c, 0x00, 0x04, 0x00,
};
-int bootarm(struct av7110 *av7110)
+int av7110_bootarm(struct av7110 *av7110)
{
struct saa7146_dev *dev = av7110->dev;
u32 ret;
@@ -231,17 +231,17 @@ int bootarm(struct av7110 *av7110)
/* test DEBI */
iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) {
- printk(KERN_ERR "dvb: debi test in bootarm() failed: "
+ printk(KERN_ERR "dvb: debi test in av7110_bootarm() failed: "
"%08x != %08x (check your BIOS notplug settings)\n",
ret, 0x10325476);
return -1;
}
for (i = 0; i < 8192; i += 4)
iwdebi(av7110, DEBISWAP, DPRAM_BASE + i, 0x00, 4);
- DEB_D(("bootarm: debi test OK\n"));
+ DEB_D(("av7110_bootarm: debi test OK\n"));
/* boot */
- DEB_D(("bootarm: load boot code\n"));
+ DEB_D(("av7110_bootarm: load boot code\n"));
saa7146_setgpio(dev, ARM_IRQ_LINE, SAA7146_GPIO_IRQLO);
//saa7146_setgpio(dev, DEBI_DONE_LINE, SAA7146_GPIO_INPUT);
//saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);
@@ -255,14 +255,14 @@ int bootarm(struct av7110 *av7110)
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
- DEB_D(("bootarm: load dram code\n"));
+ DEB_D(("av7110_bootarm: load dram code\n"));
if (load_dram(av7110, (u32 *)av7110->bin_root, av7110->size_root) < 0)
return -1;
saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO);
mdelay(1);
- DEB_D(("bootarm: load dpram code\n"));
+ DEB_D(("av7110_bootarm: load dpram code\n"));
mwdebi(av7110, DEBISWAB, DPRAM_BASE, av7110->bin_dpram, av7110->size_dpram);
saa7146_wait_for_debi_done(av7110->dev);
@@ -285,7 +285,7 @@ int bootarm(struct av7110 *av7110)
* DEBI command polling
****************************************************************************/
-int OutCommand(struct av7110 *av7110, u16* buf, int length)
+int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
{
int i;
unsigned long start;
@@ -363,7 +363,7 @@ int OutCommand(struct av7110 *av7110, u16* buf, int length)
return 0;
}
-int SOutCommand(struct av7110 *av7110, u16* buf, int length)
+int av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
{
int ret;
@@ -376,14 +376,14 @@ int SOutCommand(struct av7110 *av7110, u16* buf, int length)
if (down_interruptible(&av7110->dcomlock))
return -ERESTARTSYS;
- ret = OutCommand(av7110, buf, length);
+ ret = __av7110_send_fw_cmd(av7110, buf, length);
up(&av7110->dcomlock);
if (ret)
- printk("SOutCommand error\n");
+ printk("av7110_send_fw_cmd error\n");
return ret;
}
-int outcom(struct av7110 *av7110, int type, int com, int num, ...)
+int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...)
{
va_list args;
u16 buf[num + 2];
@@ -401,35 +401,36 @@ int outcom(struct av7110 *av7110, int type, int com, int num, ...)
va_end(args);
}
- ret = SOutCommand(av7110, buf, num + 2);
+ ret = av7110_send_fw_cmd(av7110, buf, num + 2);
if (ret)
- printk("outcom error\n");
+ printk("av7110_fw_cmd error\n");
return ret;
}
-int SendCICommand(struct av7110 *av7110, u8 subcom, u8 *Params, u8 ParamLen)
+int av7110_send_ci_cmd(struct av7110 *av7110, u8 subcom, u8 *buf, u8 len)
{
int i, ret;
- u16 CommandBuffer[18] = { ((COMTYPE_COMMON_IF << 8) + subcom),
- 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ u16 cmd[18] = { ((COMTYPE_COMMON_IF << 8) + subcom),
+ 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
DEB_EE(("av7110: %p\n", av7110));
- for(i = 0; i < ParamLen && i < 32; i++)
+ for(i = 0; i < len && i < 32; i++)
{
if(i % 2 == 0)
- CommandBuffer[(i / 2) + 2] = (u16)(Params[i]) << 8;
+ cmd[(i / 2) + 2] = (u16)(buf[i]) << 8;
else
- CommandBuffer[(i / 2) + 2] |= Params[i];
+ cmd[(i / 2) + 2] |= buf[i];
}
- ret = SOutCommand(av7110, CommandBuffer, 18);
+ ret = av7110_send_fw_cmd(av7110, cmd, 18);
if (ret)
- printk("SendCICommand error\n");
+ printk("av7110_send_ci_cmd error\n");
return ret;
}
-int CommandRequest(struct av7110 *av7110, u16 *Buff, int length, u16 *buf, int n)
+int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
+ int request_buf_len, u16 *reply_buf, int reply_buf_len)
{
int err;
s16 i;
@@ -448,9 +449,9 @@ int CommandRequest(struct av7110 *av7110, u16 *Buff, int length, u16 *buf, int n
if (down_interruptible(&av7110->dcomlock))
return -ERESTARTSYS;
- if ((err = OutCommand(av7110, Buff, length)) < 0) {
+ if ((err = __av7110_send_fw_cmd(av7110, request_buf, request_buf_len)) < 0) {
up(&av7110->dcomlock);
- printk("CommandRequest error\n");
+ printk("av7110_fw_request error\n");
return err;
}
@@ -492,19 +493,19 @@ int CommandRequest(struct av7110 *av7110, u16 *Buff, int length, u16 *buf, int n
}
#endif
- for (i = 0; i < n; i++)
- buf[i] = rdebi(av7110, DEBINOSWAP, COM_BUFF + 2 * i, 0, 2);
+ for (i = 0; i < reply_buf_len; i++)
+ reply_buf[i] = rdebi(av7110, DEBINOSWAP, COM_BUFF + 2 * i, 0, 2);
up(&av7110->dcomlock);
return 0;
}
-int RequestParameter(struct av7110 *av7110, u16 tag, u16* Buff, s16 length)
+int av7110_fw_query(struct av7110 *av7110, u16 tag, u16* buf, s16 length)
{
int ret;
- ret = CommandRequest(av7110, &tag, 0, Buff, length);
+ ret = av7110_fw_request(av7110, &tag, 0, buf, length);
if (ret)
- printk("RequestParameter error\n");
+ printk("av7110_fw_query error\n");
return ret;
}
@@ -514,14 +515,14 @@ int RequestParameter(struct av7110 *av7110, u16 tag, u16* Buff, s16 length)
****************************************************************************/
/* get version of the firmware ROM, RTSL, video ucode and ARM application */
-void firmversion(struct av7110 *av7110)
+void av7110_firmversion(struct av7110 *av7110)
{
u16 buf[20];
u16 tag = ((COMTYPE_REQUEST << 8) + ReqVersion);
DEB_EE(("av7110: %p\n", av7110));
- RequestParameter(av7110, tag, buf, 16);
+ av7110_fw_query(av7110, tag, buf, 16);
av7110->arm_fw = (buf[0] << 16) + buf[1];
av7110->arm_rtsl = (buf[2] << 16) + buf[3];
@@ -545,7 +546,7 @@ void firmversion(struct av7110 *av7110)
}
-int SendDiSEqCMsg(struct av7110 *av7110, int len, u8 *msg, unsigned long burst)
+int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long burst)
{
int i;
u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) + SendDiSEqC),
@@ -567,8 +568,8 @@ int SendDiSEqCMsg(struct av7110 *av7110, int len, u8 *msg, unsigned long burst)
for (i = 0; i < len; i++)
buf[i + 4] = msg[i];
- if (SOutCommand(av7110, buf, 18))
- printk("SendDiSEqCMsg error\n");
+ if (av7110_send_fw_cmd(av7110, buf, 18))
+ printk("av7110_diseqc_send error\n");
return 0;
}
@@ -578,43 +579,43 @@ int SendDiSEqCMsg(struct av7110 *av7110, int len, u8 *msg, unsigned long burst)
static inline int ResetBlend(struct av7110 *av7110, u8 windownr)
{
- return outcom(av7110, COMTYPE_OSD, SetNonBlend, 1, windownr);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, SetNonBlend, 1, windownr);
}
static inline int SetColorBlend(struct av7110 *av7110, u8 windownr)
{
- return outcom(av7110, COMTYPE_OSD, SetCBlend, 1, windownr);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, SetCBlend, 1, windownr);
}
static inline int SetWindowBlend(struct av7110 *av7110, u8 windownr, u8 blending)
{
- return outcom(av7110, COMTYPE_OSD, SetWBlend, 2, windownr, blending);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, SetWBlend, 2, windownr, blending);
}
static inline int SetBlend_(struct av7110 *av7110, u8 windownr,
enum av7110_osd_palette_type colordepth, u16 index, u8 blending)
{
- return outcom(av7110, COMTYPE_OSD, SetBlend, 4,
- windownr, colordepth, index, blending);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, SetBlend, 4,
+ windownr, colordepth, index, blending);
}
static inline int SetColor_(struct av7110 *av7110, u8 windownr,
enum av7110_osd_palette_type colordepth, u16 index, u16 colorhi, u16 colorlo)
{
- return outcom(av7110, COMTYPE_OSD, SetColor, 5,
- windownr, colordepth, index, colorhi, colorlo);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, SetColor, 5,
+ windownr, colordepth, index, colorhi, colorlo);
}
static inline int BringToTop(struct av7110 *av7110, u8 windownr)
{
- return outcom(av7110, COMTYPE_OSD, WTop, 1, windownr);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, WTop, 1, windownr);
}
static inline int SetFont(struct av7110 *av7110, u8 windownr, u8 fontsize,
u16 colorfg, u16 colorbg)
{
- return outcom(av7110, COMTYPE_OSD, Set_Font, 4,
- windownr, fontsize, colorfg, colorbg);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, Set_Font, 4,
+ windownr, fontsize, colorfg, colorbg);
}
static int FlushText(struct av7110 *av7110)
@@ -674,7 +675,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
swab16(*(u16 *)(buf + 2 * i)), 2);
if (length & 1)
wdebi(av7110, DEBINOSWAP, BUFF1_BASE + i * 2, 0, 2);
- ret = OutCommand(av7110, cbuf, 5);
+ ret = __av7110_send_fw_cmd(av7110, cbuf, 5);
up(&av7110->dcomlock);
if (ret)
printk("WriteText error\n");
@@ -684,43 +685,43 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
static inline int DrawLine(struct av7110 *av7110, u8 windownr,
u16 x, u16 y, u16 dx, u16 dy, u16 color)
{
- return outcom(av7110, COMTYPE_OSD, DLine, 6,
- windownr, x, y, dx, dy, color);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, DLine, 6,
+ windownr, x, y, dx, dy, color);
}
static inline int DrawBlock(struct av7110 *av7110, u8 windownr,
u16 x, u16 y, u16 dx, u16 dy, u16 color)
{
- return outcom(av7110, COMTYPE_OSD, DBox, 6,
- windownr, x, y, dx, dy, color);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, DBox, 6,
+ windownr, x, y, dx, dy, color);
}
static inline int HideWindow(struct av7110 *av7110, u8 windownr)
{
- return outcom(av7110, COMTYPE_OSD, WHide, 1, windownr);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, WHide, 1, windownr);
}
static inline int MoveWindowRel(struct av7110 *av7110, u8 windownr, u16 x, u16 y)
{
- return outcom(av7110, COMTYPE_OSD, WMoveD, 3, windownr, x, y);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, WMoveD, 3, windownr, x, y);
}
static inline int MoveWindowAbs(struct av7110 *av7110, u8 windownr, u16 x, u16 y)
{
- return outcom(av7110, COMTYPE_OSD, WMoveA, 3, windownr, x, y);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, WMoveA, 3, windownr, x, y);
}
static inline int DestroyOSDWindow(struct av7110 *av7110, u8 windownr)
{
- return outcom(av7110, COMTYPE_OSD, WDestroy, 1, windownr);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, WDestroy, 1, windownr);
}
static inline int CreateOSDWindow(struct av7110 *av7110, u8 windownr,
enum av7110_window_display_type disptype,
u16 width, u16 height)
{
- return outcom(av7110, COMTYPE_OSD, WCreate, 4,
- windownr, disptype, width, height);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, WCreate, 4,
+ windownr, disptype, width, height);
}
@@ -792,7 +793,7 @@ static inline int LoadBitmap(struct av7110 *av7110, u16 format,
}
}
av7110->bmplen += 1024;
- return outcom(av7110, COMTYPE_OSD, LoadBmp, 3, format, dx, dy);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, LoadBmp, 3, format, dx, dy);
}
static int BlitBitmap(struct av7110 *av7110, u16 win, u16 x, u16 y, u16 trans)
@@ -816,7 +817,7 @@ static int BlitBitmap(struct av7110 *av7110, u16 win, u16 x, u16 y, u16 trans)
remove_wait_queue(&av7110->bmpq, &wait);
}
if (av7110->bmp_state == BMP_LOADED)
- return outcom(av7110, COMTYPE_OSD, BlitBmp, 4, win, x, y, trans);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, BlitBmp, 4, win, x, y, trans);
return -1;
}
@@ -827,7 +828,7 @@ static inline int ReleaseBitmap(struct av7110 *av7110)
if (av7110->bmp_state != BMP_LOADED)
return -1;
av7110->bmp_state = BMP_NONE;
- return outcom(av7110, COMTYPE_OSD, ReleaseBmp, 0);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, ReleaseBmp, 0);
}
static u32 RGB2YUV(u16 R, u16 G, u16 B)
@@ -875,9 +876,10 @@ static int OSDSetPalette(struct av7110 *av7110, u32 *colors, u8 first, u8 last)
yuv = ((yuv & 0xFFFF0000) >> 16) | ((yuv & 0x0000FFFF) << 16);
wdebi(av7110, DEBINOSWAP, DATA_BUFF3_BASE + i * 4, yuv, 4);
}
- return outcom(av7110, COMTYPE_OSD, Set_Palette, 4,
- av7110->osdwin, bpp2pal[av7110->osdbpp[av7110->osdwin]],
- first, last);
+ return av7110_fw_cmd(av7110, COMTYPE_OSD, Set_Palette, 4,
+ av7110->osdwin,
+ bpp2pal[av7110->osdbpp[av7110->osdwin]],
+ first, last);
}
static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
@@ -914,7 +916,7 @@ static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
return 0;
}
-int OSD_DrawCommand(struct av7110 *av7110, osd_cmd_t *dc)
+int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
{
switch (dc->cmd) {
case OSD_Close: