#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <media/omap1_camera.h>
#include <media/soc_camera.h>
#include <media/soc_mediabus.h>
#include <media/videobuf-dma-contig.h>
#include <media/videobuf-dma-sg.h>
#include <plat/dma.h>
Go to the source code of this file.
|
#define | DRIVER_NAME "omap1-camera" |
|
#define | DRIVER_VERSION "0.0.2" |
|
#define | REG_CTRLCLOCK 0x00 |
|
#define | REG_IT_STATUS 0x04 |
|
#define | REG_MODE 0x08 |
|
#define | REG_STATUS 0x0C |
|
#define | REG_CAMDATA 0x10 |
|
#define | REG_GPIO 0x14 |
|
#define | REG_PEAK_COUNTER 0x18 |
|
#define | LCLK_EN BIT(7) |
|
#define | DPLL_EN BIT(6) |
|
#define | MCLK_EN BIT(5) |
|
#define | CAMEXCLK_EN BIT(4) |
|
#define | POLCLK BIT(3) |
|
#define | FOSCMOD_SHIFT 0 |
|
#define | FOSCMOD_MASK (0x7 << FOSCMOD_SHIFT) |
|
#define | FOSCMOD_12MHz 0x0 |
|
#define | FOSCMOD_6MHz 0x2 |
|
#define | FOSCMOD_9_6MHz 0x4 |
|
#define | FOSCMOD_24MHz 0x5 |
|
#define | FOSCMOD_8MHz 0x6 |
|
#define | DATA_TRANSFER BIT(5) |
|
#define | FIFO_FULL BIT(4) |
|
#define | H_DOWN BIT(3) |
|
#define | H_UP BIT(2) |
|
#define | V_DOWN BIT(1) |
|
#define | V_UP BIT(0) |
|
#define | RAZ_FIFO BIT(18) |
|
#define | EN_FIFO_FULL BIT(17) |
|
#define | EN_NIRQ BIT(16) |
|
#define | THRESHOLD_SHIFT 9 |
|
#define | THRESHOLD_MASK (0x7f << THRESHOLD_SHIFT) |
|
#define | DMA BIT(8) |
|
#define | EN_H_DOWN BIT(7) |
|
#define | EN_H_UP BIT(6) |
|
#define | EN_V_DOWN BIT(5) |
|
#define | EN_V_UP BIT(4) |
|
#define | ORDERCAMD BIT(3) |
|
#define | IRQ_MASK |
|
#define | HSTATUS BIT(1) |
|
#define | VSTATUS BIT(0) |
|
#define | CAM_RST BIT(0) |
|
#define | SOCAM_BUS_FLAGS |
|
#define | FIFO_SIZE ((THRESHOLD_MASK >> THRESHOLD_SHIFT) + 1) |
|
#define | FIFO_SHIFT __fls(FIFO_SIZE) |
|
#define | DMA_BURST_SHIFT (1 + OMAP_DMA_DATA_BURST_4) |
|
#define | DMA_BURST_SIZE (1 << DMA_BURST_SHIFT) |
|
#define | DMA_ELEMENT_SHIFT OMAP_DMA_DATA_TYPE_S32 |
|
#define | DMA_ELEMENT_SIZE (1 << DMA_ELEMENT_SHIFT) |
|
#define | DMA_FRAME_SHIFT_CONTIG (FIFO_SHIFT - 1) |
|
#define | DMA_FRAME_SHIFT_SG DMA_BURST_SHIFT |
|
#define | DMA_FRAME_SHIFT(x) |
|
#define | DMA_FRAME_SIZE(x) (1 << DMA_FRAME_SHIFT(x)) |
|
#define | DMA_SYNC OMAP_DMA_SYNC_FRAME |
|
#define | THRESHOLD_LEVEL DMA_FRAME_SIZE |
|
#define | MAX_VIDEO_MEM 4 /* arbitrary video memory limit in MB */ |
|
#define | CAM_READ(pcdev, reg) cam_read(pcdev, REG_##reg, false) |
|
#define | CAM_WRITE(pcdev, reg, val) cam_write(pcdev, REG_##reg, val) |
|
#define | CAM_READ_CACHE(pcdev, reg) cam_read(pcdev, REG_##reg, true) |
|
#define | subdev_call_with_sense(pcdev, dev, icd, sd, function, args...) |
|
#define CAM_READ_CACHE |
( |
|
pcdev, |
|
|
|
reg |
|
) |
| cam_read(pcdev, REG_##reg, true) |
#define CAMEXCLK_EN BIT(4) |
#define DATA_TRANSFER BIT(5) |
#define DMA_FRAME_SHIFT |
( |
|
x | ) |
|
#define DRIVER_NAME "omap1-camera" |
#define DRIVER_VERSION "0.0.2" |
#define EN_FIFO_FULL BIT(17) |
#define FOSCMOD_12MHz 0x0 |
#define FOSCMOD_24MHz 0x5 |
#define FOSCMOD_9_6MHz 0x4 |
#define FOSCMOD_MASK (0x7 << FOSCMOD_SHIFT) |
#define REG_CTRLCLOCK 0x00 |
#define REG_IT_STATUS 0x04 |
#define REG_PEAK_COUNTER 0x18 |
#define subdev_call_with_sense |
( |
|
pcdev, |
|
|
|
dev, |
|
|
|
icd, |
|
|
|
sd, |
|
|
|
function, |
|
|
|
args... |
|
) |
| |
Value:
.master_clock = pcdev->camexclk, \
.pixel_clock_max = 0, \
}; \
sense.pixel_clock_max = pcdev->pdata->lclk_khz_max * 1000; \
if (sense.flags & SOCAM_SENSE_PCLK_CHANGED) { \
if (sense.pixel_clock > sense.pixel_clock_max) { \
"%s: pixel clock %lu set by the camera too high!\n", \
__func__, sense.pixel_clock); \
} \
} \
__ret; \
})
Definition at line 1159 of file omap1_camera.c.
#define THRESHOLD_MASK (0x7f << THRESHOLD_SHIFT) |
#define THRESHOLD_SHIFT 9 |
MODULE_ALIAS |
( |
"platform:" |
DRIVER_NAME | ) |
|
MODULE_AUTHOR |
( |
"Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>" |
| ) |
|
MODULE_LICENSE |
( |
"GPL v2" |
| ) |
|
module_param |
( |
sg_mode |
, |
|
|
bool |
, |
|
|
0644 |
|
|
) |
| |
MODULE_PARM_DESC |
( |
sg_mode |
, |
|
|
"videobuf |
mode, |
|
|
0:dma- |
contigdefault, |
|
|
1:dma-sg" |
|
|
) |
| |
module_platform_driver |
( |
omap1_cam_driver |
| ) |
|