#include <linux/module.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/autoconf.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/delay.h>
#include <asm/uaccess.h>
#include <asm/elphel/driver_numbers.h>
#include <asm/elphel/c313a.h>
#include "fpgactrl.h"
#include "framepars.h"
#include "x3x3.h"
#include "cxsdram.h"
Include dependency graph for cxsdram.c:
Go to the source code of this file.
Defines | |
#define | FULL_WIDTH ( get_imageParamsThis(P_ACTUAL_WIDTH)+4 ) |
#define | FULL_HEIGHT ( get_imageParamsThis(P_ACTUAL_HEIGHT)+4 ) |
#define | D(x) |
#define | MDF(x) |
#define | IMAGERAW_MODULE_DESCRIPTION "Raw image access driver for Elphel 353 camera" |
#define | IMAGERAW_DRIVER_NAME "Raw image access driver" |
Functions | |
int * | x353raw_fpn_readline (int line, int ignore) |
hardware does not support concurrent accesses, so the driver will be locked for one user | |
int | x353raw_fpn_writeline (void) |
ssize_t | x353raw_fpn_read (struct file *file, char *buf, size_t count, loff_t *off) |
ssize_t | x353raw_fpn_write (struct file *file, const char *buf, size_t count, loff_t *off) |
int * | x353raw_frame_readline (int line, int ignore) |
int | x353raw_frame_writeline (void) |
ssize_t | x353raw_frame_read (struct file *file, char *buf, size_t count, loff_t *off) |
ssize_t | x353raw_frame_write (struct file *file, const char *buf, size_t count, loff_t *off) |
loff_t | x353raw_frame_lseek (struct file *file, loff_t offset, int orig) |
void | x353raw_frame_release (void) |
int | x353raw_frame_open (struct inode *inode, struct file *filp) |
int | x353raw_fpn_open (struct inode *inode, struct file *filp) |
loff_t | x353raw_fpn_lseek (struct file *file, loff_t offset, int orig) |
void | x353raw_fpn_release (void) |
void | x353raw_f_invalidate (void) |
int | x353raw_open (struct inode *inode, struct file *filp) |
int | x353raw_release (struct inode *inode, struct file *filp) |
loff_t | x353raw_lseek (struct file *file, loff_t offset, int orig) |
ssize_t | x353raw_write (struct file *file, const char *buf, size_t count, loff_t *off) |
ssize_t | x353raw_read (struct file *file, char *buf, size_t count, loff_t *off) |
static int __init | x353raw_init (void) |
module_init (x353raw_init) | |
MODULE_LICENSE ("GPLv3.0") | |
MODULE_AUTHOR ("Andrey Filippov <andrey@elphel.com>.") | |
MODULE_DESCRIPTION (IMAGERAW_MODULE_DESCRIPTION) | |
Variables | |
static const char | x353raw_name [] = "elphel_raw353" |
static int | linebuf_fpn [4096] |
static int | lineinbuf_fpn |
static int | linebufdirty_fpn = 0 |
static int | linebuf_img [4096] |
static int | lineinbuf_img |
static int | linebufdirty_img = 0 |
static int | minor_lock = 0 |
static struct file_operations | x353raw_fops |
File operations - top. |
#define FULL_HEIGHT ( get_imageParamsThis(P_ACTUAL_HEIGHT)+4 ) |
Definition at line 87 of file cxsdram.c.
Referenced by x353raw_fpn_lseek(), x353raw_fpn_open(), x353raw_fpn_read(), x353raw_fpn_write(), x353raw_frame_lseek(), x353raw_frame_open(), x353raw_frame_read(), and x353raw_frame_write().
#define FULL_WIDTH ( get_imageParamsThis(P_ACTUAL_WIDTH)+4 ) |
*************************************************************************** ! FILE NAME : cxsdram353.c ! DESCRIPTION: TBD ! Copyright (C) 2002-2008 Elphel, Inc ! -----------------------------------------------------------------------------** ! ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** !
FULL_WIDTH and FULL_HEIGHT increased by 4 each to include 1
Definition at line 86 of file cxsdram.c.
Referenced by x353raw_fpn_lseek(), x353raw_fpn_open(), x353raw_fpn_read(), x353raw_fpn_readline(), x353raw_fpn_write(), x353raw_fpn_writeline(), x353raw_frame_lseek(), x353raw_frame_open(), x353raw_frame_read(), x353raw_frame_readline(), x353raw_frame_write(), and x353raw_frame_writeline().
#define IMAGERAW_DRIVER_NAME "Raw image access driver" |
#define IMAGERAW_MODULE_DESCRIPTION "Raw image access driver for Elphel 353 camera" |
MODULE_AUTHOR | ( | "Andrey Filippov <andrey@elphel.com>." | ) |
MODULE_DESCRIPTION | ( | IMAGERAW_MODULE_DESCRIPTION | ) |
module_init | ( | x353raw_init | ) |
MODULE_LICENSE | ( | "GPLv3.0" | ) |
void x353raw_f_invalidate | ( | void | ) |
Definition at line 709 of file cxsdram.c.
References linebufdirty_fpn, linebufdirty_img, lineinbuf_fpn, and lineinbuf_img.
loff_t x353raw_fpn_lseek | ( | struct file * | file, | |
loff_t | offset, | |||
int | orig | |||
) |
Definition at line 335 of file cxsdram.c.
References FULL_HEIGHT, FULL_WIDTH, MDF, and printk.
Referenced by x353raw_lseek().
int x353raw_fpn_open | ( | struct inode * | inode, | |
struct file * | filp | |||
) |
Definition at line 694 of file cxsdram.c.
References FULL_HEIGHT, FULL_WIDTH, linebufdirty_fpn, lineinbuf_fpn, MDF, and printk.
Referenced by x353raw_open().
ssize_t x353raw_fpn_read | ( | struct file * | file, | |
char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 255 of file cxsdram.c.
References FULL_HEIGHT, FULL_WIDTH, MDF, printk, and x353raw_fpn_readline().
Referenced by x353raw_read().
int * x353raw_fpn_readline | ( | int | line, | |
int | ignore | |||
) |
hardware does not support concurrent accesses, so the driver will be locked for one user
Definition at line 168 of file cxsdram.c.
References D, FULL_WIDTH, linebuf_fpn, linebufdirty_fpn, lineinbuf_fpn, n, port_csp0_addr, printk, RD_SD_PIOWIN, sa, udelay, X313_CHN_EN, X313_INIT_SDCHAN, X313_MAP_FPN, X313_SR, X313_WA_SD_MODE, X313_WA_SDPIO_NEXT, and x353raw_fpn_writeline().
Referenced by x353raw_fpn_read(), and x353raw_fpn_write().
void x353raw_fpn_release | ( | void | ) |
Definition at line 702 of file cxsdram.c.
References linebufdirty_fpn, MDF, printk, and x353raw_fpn_writeline().
Referenced by x353raw_release().
ssize_t x353raw_fpn_write | ( | struct file * | file, | |
const char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 295 of file cxsdram.c.
References FULL_HEIGHT, FULL_WIDTH, linebufdirty_fpn, and x353raw_fpn_readline().
Referenced by x353raw_write().
int x353raw_fpn_writeline | ( | void | ) |
Definition at line 209 of file cxsdram.c.
References D, FULL_WIDTH, linebuf_fpn, linebufdirty_fpn, lineinbuf_fpn, n, port_csp0_addr, printk, sa, udelay, X313_CHN_EN, X313_INIT_SDCHAN, X313_MAP_FPN, X313_SR, X313_WA_SD_MODE, X313_WA_SD_PIOWIN, and X313_WA_SDPIO_NEXT.
Referenced by x353raw_fpn_readline(), and x353raw_fpn_release().
loff_t x353raw_frame_lseek | ( | struct file * | file, | |
loff_t | offset, | |||
int | orig | |||
) |
Definition at line 640 of file cxsdram.c.
References FULL_HEIGHT, FULL_WIDTH, get_imageParamsThis, P_BGFRAME, and P_BITS.
Referenced by x353raw_lseek().
int x353raw_frame_open | ( | struct inode * | inode, | |
struct file * | filp | |||
) |
Definition at line 679 of file cxsdram.c.
References FULL_HEIGHT, FULL_WIDTH, get_imageParamsThis, linebufdirty_fpn, lineinbuf_img, P_BGFRAME, and P_BITS.
Referenced by x353raw_open().
ssize_t x353raw_frame_read | ( | struct file * | file, | |
char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 548 of file cxsdram.c.
References FULL_HEIGHT, FULL_WIDTH, get_imageParamsThis, MDF, P_BGFRAME, P_BITS, P_PAGE_READ, printk, and x353raw_frame_readline().
Referenced by x353raw_read().
int * x353raw_frame_readline | ( | int | line, | |
int | ignore | |||
) |
Definition at line 376 of file cxsdram.c.
References D, FULL_WIDTH, get_imageParamsThis, linebuf_img, linebufdirty_img, lineinbuf_img, n, P_BGFRAME, P_BITS, port_csp0_addr, printk, RD_SD_PIOWIN, sa, udelay, X313_CHN_EN, X313_INIT_SDCHAN, X313_MAP_FRAME, X313_SR, X313_WA_SD_MODE, X313_WA_SDPIO_NEXT, and x353raw_frame_writeline().
Referenced by x353raw_frame_read(), and x353raw_frame_write().
void x353raw_frame_release | ( | void | ) |
Definition at line 688 of file cxsdram.c.
References linebufdirty_img, MDF, printk, and x353raw_frame_writeline().
Referenced by x353raw_release().
ssize_t x353raw_frame_write | ( | struct file * | file, | |
const char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 594 of file cxsdram.c.
References FULL_HEIGHT, FULL_WIDTH, get_imageParamsThis, linebufdirty_img, MDF, P_BGFRAME, P_BITS, printk, and x353raw_frame_readline().
Referenced by x353raw_write().
int x353raw_frame_writeline | ( | void | ) |
Definition at line 498 of file cxsdram.c.
References FULL_WIDTH, get_imageParamsThis, linebuf_img, linebufdirty_img, lineinbuf_img, MDF, n, P_BGFRAME, P_BITS, port_csp0_addr, printk, sa, udelay, X313_CHN_EN, X313_INIT_SDCHAN, X313_MAP_FRAME, X313_SR, X313_WA_SD_MODE, X313_WA_SD_PIOWIN, and X313_WA_SDPIO_NEXT.
Referenced by x353raw_frame_readline(), and x353raw_frame_release().
static int __init x353raw_init | ( | void | ) | [static] |
Definition at line 728 of file cxsdram.c.
References IMAGERAW_DRIVER_NAME, IMAGERAW_MAJOR, KERN_ERR, printk, x353raw_fops, and x353raw_name.
loff_t x353raw_lseek | ( | struct file * | file, | |
loff_t | offset, | |||
int | orig | |||
) |
Definition at line 782 of file cxsdram.c.
References IMAGERAW_MINOR_FPN, IMAGERAW_MINOR_FRAME, minor_lock, x353raw_fpn_lseek(), and x353raw_frame_lseek().
int x353raw_open | ( | struct inode * | inode, | |
struct file * | filp | |||
) |
Definition at line 744 of file cxsdram.c.
References IMAGERAW_MINOR_FPN, IMAGERAW_MINOR_FRAME, IMAGERAW_MINOR_UNLOCK, minor_lock, x353raw_fpn_open(), and x353raw_frame_open().
ssize_t x353raw_read | ( | struct file * | file, | |
char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 798 of file cxsdram.c.
References IMAGERAW_MINOR_FPN, IMAGERAW_MINOR_FRAME, minor_lock, x353raw_fpn_read(), and x353raw_frame_read().
int x353raw_release | ( | struct inode * | inode, | |
struct file * | filp | |||
) |
Definition at line 765 of file cxsdram.c.
References IMAGERAW_MINOR_FPN, IMAGERAW_MINOR_FRAME, IMAGERAW_MINOR_UNLOCK, minor_lock, x353raw_fpn_release(), and x353raw_frame_release().
ssize_t x353raw_write | ( | struct file * | file, | |
const char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 790 of file cxsdram.c.
References IMAGERAW_MINOR_FPN, IMAGERAW_MINOR_FRAME, minor_lock, x353raw_fpn_write(), and x353raw_frame_write().
int linebuf_fpn[4096] [static] |
Definition at line 132 of file cxsdram.c.
Referenced by x353raw_fpn_readline(), and x353raw_fpn_writeline().
int linebuf_img[4096] [static] |
Definition at line 135 of file cxsdram.c.
Referenced by x353raw_frame_readline(), and x353raw_frame_writeline().
int linebufdirty_fpn = 0 [static] |
Definition at line 134 of file cxsdram.c.
Referenced by x353raw_f_invalidate(), x353raw_fpn_open(), x353raw_fpn_readline(), x353raw_fpn_release(), x353raw_fpn_write(), x353raw_fpn_writeline(), and x353raw_frame_open().
int linebufdirty_img = 0 [static] |
Definition at line 137 of file cxsdram.c.
Referenced by x353raw_f_invalidate(), x353raw_frame_readline(), x353raw_frame_release(), x353raw_frame_write(), and x353raw_frame_writeline().
int lineinbuf_fpn [static] |
Definition at line 133 of file cxsdram.c.
Referenced by x353raw_f_invalidate(), x353raw_fpn_open(), x353raw_fpn_readline(), and x353raw_fpn_writeline().
int lineinbuf_img [static] |
Definition at line 136 of file cxsdram.c.
Referenced by x353raw_f_invalidate(), x353raw_frame_open(), x353raw_frame_readline(), and x353raw_frame_writeline().
int minor_lock = 0 [static] |
Definition at line 139 of file cxsdram.c.
Referenced by x353raw_lseek(), x353raw_open(), x353raw_read(), x353raw_release(), and x353raw_write().
struct file_operations x353raw_fops [static] |
Initial value:
{ owner: THIS_MODULE, llseek: x353raw_lseek, read: x353raw_read, write: x353raw_write, open: x353raw_open, release: x353raw_release }
Definition at line 719 of file cxsdram.c.
Referenced by x353raw_init().
const char x353raw_name[] = "elphel_raw353" [static] |