#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/firmware.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include "vpdma.h"
#include "vpdma_priv.h"
#define VPDMA_FIRMWARE …
const struct vpdma_data_format vpdma_yuv_fmts[] = …;
EXPORT_SYMBOL(…);
const struct vpdma_data_format vpdma_rgb_fmts[] = …;
EXPORT_SYMBOL(…);
const struct vpdma_data_format vpdma_raw_fmts[] = …;
EXPORT_SYMBOL(…);
const struct vpdma_data_format vpdma_misc_fmts[] = …;
EXPORT_SYMBOL(…);
struct vpdma_channel_info { … };
static const struct vpdma_channel_info chan_info[] = …;
static u32 read_reg(struct vpdma_data *vpdma, int offset)
{ … }
static void write_reg(struct vpdma_data *vpdma, int offset, u32 value)
{ … }
static int read_field_reg(struct vpdma_data *vpdma, int offset,
u32 mask, int shift)
{ … }
static void write_field_reg(struct vpdma_data *vpdma, int offset, u32 field,
u32 mask, int shift)
{ … }
void vpdma_dump_regs(struct vpdma_data *vpdma)
{ … }
EXPORT_SYMBOL(…);
int vpdma_alloc_desc_buf(struct vpdma_buf *buf, size_t size)
{ … }
EXPORT_SYMBOL(…);
void vpdma_free_desc_buf(struct vpdma_buf *buf)
{ … }
EXPORT_SYMBOL(…);
int vpdma_map_desc_buf(struct vpdma_data *vpdma, struct vpdma_buf *buf)
{ … }
EXPORT_SYMBOL(…);
void vpdma_unmap_desc_buf(struct vpdma_data *vpdma, struct vpdma_buf *buf)
{ … }
EXPORT_SYMBOL(…);
int vpdma_list_cleanup(struct vpdma_data *vpdma, int list_num,
int *channels, int size)
{ … }
EXPORT_SYMBOL(…);
int vpdma_create_desc_list(struct vpdma_desc_list *list, size_t size, int type)
{ … }
EXPORT_SYMBOL(…);
void vpdma_reset_desc_list(struct vpdma_desc_list *list)
{ … }
EXPORT_SYMBOL(…);
void vpdma_free_desc_list(struct vpdma_desc_list *list)
{ … }
EXPORT_SYMBOL(…);
bool vpdma_list_busy(struct vpdma_data *vpdma, int list_num)
{ … }
EXPORT_SYMBOL(…);
int vpdma_submit_descs(struct vpdma_data *vpdma,
struct vpdma_desc_list *list, int list_num)
{ … }
EXPORT_SYMBOL(…);
static void dump_dtd(struct vpdma_dtd *dtd);
void vpdma_update_dma_addr(struct vpdma_data *vpdma,
struct vpdma_desc_list *list, dma_addr_t dma_addr,
void *write_dtd, int drop, int idx)
{ … }
EXPORT_SYMBOL(…);
void vpdma_set_max_size(struct vpdma_data *vpdma, int reg_addr,
u32 width, u32 height)
{ … }
EXPORT_SYMBOL(…);
static void dump_cfd(struct vpdma_cfd *cfd)
{ … }
void vpdma_add_cfd_block(struct vpdma_desc_list *list, int client,
struct vpdma_buf *blk, u32 dest_offset)
{ … }
EXPORT_SYMBOL(…);
void vpdma_add_cfd_adb(struct vpdma_desc_list *list, int client,
struct vpdma_buf *adb)
{
struct vpdma_cfd *cfd;
unsigned int len = adb->size;
WARN_ON(len & VPDMA_ADB_SIZE_ALIGN);
WARN_ON(adb->dma_addr & VPDMA_DESC_ALIGN);
cfd = list->next;
BUG_ON((void *)(cfd + 1) > (list->buf.addr + list->buf.size));
cfd->w0 = 0;
cfd->w1 = 0;
cfd->payload_addr = (u32) adb->dma_addr;
cfd->ctl_payload_len = cfd_pkt_payload_len(CFD_INDIRECT, CFD_CLS_ADB,
client, len >> 4);
list->next = cfd + 1;
dump_cfd(cfd);
};
EXPORT_SYMBOL(…);
static void dump_ctd(struct vpdma_ctd *ctd)
{ … }
void vpdma_add_sync_on_channel_ctd(struct vpdma_desc_list *list,
enum vpdma_channel chan)
{ … }
EXPORT_SYMBOL(…);
void vpdma_add_abort_channel_ctd(struct vpdma_desc_list *list,
int chan_num)
{ … }
EXPORT_SYMBOL(…);
static void dump_dtd(struct vpdma_dtd *dtd)
{ … }
void vpdma_add_out_dtd(struct vpdma_desc_list *list, int width,
int stride, const struct v4l2_rect *c_rect,
const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
int max_w, int max_h, enum vpdma_channel chan, u32 flags)
{ … }
EXPORT_SYMBOL(…);
void vpdma_rawchan_add_out_dtd(struct vpdma_desc_list *list, int width,
int stride, const struct v4l2_rect *c_rect,
const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
int max_w, int max_h, int raw_vpdma_chan, u32 flags)
{ … }
EXPORT_SYMBOL(…);
void vpdma_add_in_dtd(struct vpdma_desc_list *list, int width,
int stride, const struct v4l2_rect *c_rect,
const struct vpdma_data_format *fmt, dma_addr_t dma_addr,
enum vpdma_channel chan, int field, u32 flags, int frame_width,
int frame_height, int start_h, int start_v)
{ … }
EXPORT_SYMBOL(…);
int vpdma_hwlist_alloc(struct vpdma_data *vpdma, void *priv)
{ … }
EXPORT_SYMBOL(…);
void *vpdma_hwlist_get_priv(struct vpdma_data *vpdma, int list_num)
{ … }
EXPORT_SYMBOL(…);
void *vpdma_hwlist_release(struct vpdma_data *vpdma, int list_num)
{ … }
EXPORT_SYMBOL(…);
void vpdma_enable_list_complete_irq(struct vpdma_data *vpdma, int irq_num,
int list_num, bool enable)
{ … }
EXPORT_SYMBOL(…);
unsigned int vpdma_get_list_stat(struct vpdma_data *vpdma, int irq_num)
{ … }
EXPORT_SYMBOL(…);
unsigned int vpdma_get_list_mask(struct vpdma_data *vpdma, int irq_num)
{ … }
EXPORT_SYMBOL(…);
void vpdma_clear_list_stat(struct vpdma_data *vpdma, int irq_num,
int list_num)
{ … }
EXPORT_SYMBOL(…);
void vpdma_set_bg_color(struct vpdma_data *vpdma,
struct vpdma_data_format *fmt, u32 color)
{ … }
EXPORT_SYMBOL(…);
void vpdma_set_line_mode(struct vpdma_data *vpdma, int line_mode,
enum vpdma_channel chan)
{ … }
EXPORT_SYMBOL(…);
void vpdma_set_frame_start_event(struct vpdma_data *vpdma,
enum vpdma_frame_start_event fs_event,
enum vpdma_channel chan)
{ … }
EXPORT_SYMBOL(…);
static void vpdma_firmware_cb(const struct firmware *f, void *context)
{ … }
static int vpdma_load_firmware(struct vpdma_data *vpdma)
{ … }
int vpdma_create(struct platform_device *pdev, struct vpdma_data *vpdma,
void (*cb)(struct platform_device *pdev))
{ … }
EXPORT_SYMBOL(…);
MODULE_AUTHOR(…) …;
MODULE_FIRMWARE(…);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;