linux/drivers/staging/media/av7110/av7110_hw.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * driver for the SAA7146 based AV110 cards
 * - av7110 low level hardware access and firmware interface
 *
 * Copyright (C) 1999-2002 Ralph  Metzler
 *                       & Marcus Metzler for convergence integrated media GmbH
 *
 * originally based on code by:
 * Copyright (C) 1998,1999 Christian Theiss <[email protected]>
 *
 * the project's page is at https://linuxtv.org
 */

/* for debugging ARM communication: */
//#define COM_DEBUG

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/delay.h>
#include <linux/fs.h>

#include "av7110.h"
#include "av7110_hw.h"

#define _NOHANDSHAKE

/*
 * Max transfer size done by av7110_fw_cmd()
 *
 * The maximum size passed to this function is 6 bytes. The buffer also
 * uses two additional ones for type and size. So, 8 bytes is enough.
 */
#define MAX_XFER_SIZE

/****************************************************************************
 * DEBI functions
 ****************************************************************************/

/* This DEBI code is based on the Stradis driver
 * by Nathan Laredo <[email protected]>
 */

int av7110_debiwrite(struct av7110 *av7110, u32 config,
		     int addr, u32 val, unsigned int count)
{}

u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, unsigned int count)
{}

/* av7110 ARM core boot stuff */
#if 0
void av7110_reset_arm(struct av7110 *av7110)
{
	saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTLO);

	/* Disable DEBI and GPIO irq */
	SAA7146_IER_DISABLE(av7110->dev, MASK_19 | MASK_03);
	SAA7146_ISR_CLEAR(av7110->dev, MASK_19 | MASK_03);

	saa7146_setgpio(av7110->dev, RESET_LINE, SAA7146_GPIO_OUTHI);
	msleep(30);	/* the firmware needs some time to initialize */

	ARM_ResetMailBox(av7110);

	SAA7146_ISR_CLEAR(av7110->dev, MASK_19 | MASK_03);
	SAA7146_IER_ENABLE(av7110->dev, MASK_03);

	av7110->arm_ready = 1;
	dprintk(1, "reset ARM\n");
}
#endif  /*  0  */

static int waitdebi(struct av7110 *av7110, int adr, int state)
{}

static int load_dram(struct av7110 *av7110, u32 *data, int len)
{}

/* we cannot write av7110 DRAM directly, so load a bootloader into
 * the DPRAM which implements a simple boot protocol
 */
int av7110_bootarm(struct av7110 *av7110)
{}
MODULE_FIRMWARE();

/****************************************************************************
 * DEBI command polling
 ****************************************************************************/

int av7110_wait_msgstate(struct av7110 *av7110, u16 flags)
{}

static int __av7110_send_fw_cmd(struct av7110 *av7110, u16 *buf, int length)
{}

static int av7110_send_fw_cmd(struct av7110 *av7110, u16 *buf, int length)
{}

int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...)
{}

#if 0
int av7110_send_ci_cmd(struct av7110 *av7110, u8 subcom, u8 *buf, u8 len)
{
	int i, ret;
	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 };

	dprintk(4, "%p\n", av7110);

	for (i = 0; i < len && i < 32; i++) {
		if (i % 2 == 0)
			cmd[(i / 2) + 2] = (u16)(buf[i]) << 8;
		else
			cmd[(i / 2) + 2] |= buf[i];
	}

	ret = av7110_send_fw_cmd(av7110, cmd, 18);
	if (ret && ret != -ERESTARTSYS)
		pr_err("%s(): error %d\n", __func__, ret);
	return ret;
}
#endif  /*  0  */

int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
		      int request_buf_len, u16 *reply_buf, int reply_buf_len)
{}

static int av7110_fw_query(struct av7110 *av7110, u16 tag, u16 *buf, s16 length)
{}

/****************************************************************************
 * Firmware commands
 ****************************************************************************/

/* get version of the firmware ROM, RTSL, video ucode and ARM application  */
int av7110_firmversion(struct av7110 *av7110)
{}

int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long burst)
{}

#ifdef CONFIG_DVB_AV7110_OSD

static inline int SetColorBlend(struct av7110 *av7110, u8 windownr)
{}

static inline int SetBlend_(struct av7110 *av7110, u8 windownr,
			    enum av7110_osd_palette_type colordepth, u16 index, u8 blending)
{}

static inline int SetColor_(struct av7110 *av7110, u8 windownr,
			    enum av7110_osd_palette_type colordepth, u16 index, u16 colorhi, u16 colorlo)
{}

static inline int SetFont(struct av7110 *av7110, u8 windownr, u8 fontsize,
			  u16 colorfg, u16 colorbg)
{}

static int FlushText(struct av7110 *av7110)
{}

static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, char *buf)
{}

static inline int DrawLine(struct av7110 *av7110, u8 windownr,
			   u16 x, u16 y, u16 dx, u16 dy, u16 color)
{}

static inline int DrawBlock(struct av7110 *av7110, u8 windownr,
			    u16 x, u16 y, u16 dx, u16 dy, u16 color)
{}

static inline int HideWindow(struct av7110 *av7110, u8 windownr)
{}

static inline int MoveWindowRel(struct av7110 *av7110, u8 windownr, u16 x, u16 y)
{}

static inline int MoveWindowAbs(struct av7110 *av7110, u8 windownr, u16 x, u16 y)
{}

static inline int DestroyOSDWindow(struct av7110 *av7110, u8 windownr)
{}

static inline int CreateOSDWindow(struct av7110 *av7110, u8 windownr,
				  osd_raw_window_t disptype,
				  u16 width, u16 height)
{}

static enum av7110_osd_palette_type bpp2pal[8] =;

static osd_raw_window_t bpp2bit[8] =;

static inline int WaitUntilBmpLoaded(struct av7110 *av7110)
{}

static inline int LoadBitmap(struct av7110 *av7110,
			     u16 dx, u16 dy, int inc, u8 __user *data)
{}

static int BlitBitmap(struct av7110 *av7110, u16 x, u16 y)
{}

static inline int ReleaseBitmap(struct av7110 *av7110)
{}

static u32 RGB2YUV(u16 R, u16 G, u16 B)
{}

static int OSDSetColor(struct av7110 *av7110, u8 color, u8 r, u8 g, u8 b, u8 blend)
{}

static int OSDSetPalette(struct av7110 *av7110, u32 __user *colors, u8 first, u8 last)
{}

static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
		       int x1, int y1, int inc, u8 __user *data)
{}

int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
{}

int av7110_osd_capability(struct av7110 *av7110, osd_cap_t *cap)
{}
#endif /* CONFIG_DVB_AV7110_OSD */