/* 2009-08-20: File added by Sony Corporation */

#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <asm/arch/avc_common_info.h>
#include "avc_debug.h"


const char *AVC_VERSION = "H.264/AVC Driver for EM1 v0.0.1 2008/6/5";
const struct avc_driver_version_t avc_driver_version = {0,0,1};

#define AVC_PROC_NAME "driver/avc"
//#define AVC_PROC_ENABLE

#ifdef AVC_PROC_ENABLE
static int avc_proc_read(char* page, char** start, off_t offset, int count, int* eof, void* data)
{
    int len = 0;
    len += snprintf(page, count, "%s\n", AVC_VERSION);
    *eof = 1;
    return len;
}
#endif

int avc_create_proc(void)
{
#ifdef AVC_PROC_ENABLE
    struct proc_dir_entry* entry;

    entry = create_proc_entry(AVC_PROC_NAME, S_IFREG | S_IRUGO, NULL);
    if (entry == NULL) {
        debug0("create_proc_entry failed %s", AVC_PROC_NAME);
        return -1;
    }

    entry->read_proc = avc_proc_read;
#endif
    return 0;
}

int avc_remove_proc(void)
{
#ifdef AVC_PROC_ENABLE
    remove_proc_entry(AVC_PROC_NAME, NULL);
#endif
    return 0;
}
