summaryrefslogtreecommitdiff
path: root/linux/include/media
diff options
context:
space:
mode:
Diffstat (limited to 'linux/include/media')
-rw-r--r--linux/include/media/ir-kbd-i2c.h3
-rw-r--r--linux/include/media/sh_mobile_ceu.h12
-rw-r--r--linux/include/media/soc_camera.h16
-rw-r--r--linux/include/media/soc_camera_platform.h15
-rw-r--r--linux/include/media/v4l2-dev.h28
-rw-r--r--linux/include/media/v4l2-i2c-drv-legacy.h22
-rw-r--r--linux/include/media/v4l2-i2c-drv.h14
-rw-r--r--linux/include/media/videobuf-dma-contig.h32
-rw-r--r--linux/include/media/videobuf-dma-sg.h2
-rw-r--r--linux/include/media/videobuf-vmalloc.h2
10 files changed, 109 insertions, 37 deletions
diff --git a/linux/include/media/ir-kbd-i2c.h b/linux/include/media/ir-kbd-i2c.h
index a455f7ce5..00fa57eb9 100644
--- a/linux/include/media/ir-kbd-i2c.h
+++ b/linux/include/media/ir-kbd-i2c.h
@@ -19,7 +19,4 @@ struct IR_i2c {
char phys[32];
int (*get_key)(struct IR_i2c*, u32*, u32*);
};
-
-int get_key_pinnacle_grey(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
-int get_key_pinnacle_color(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
#endif
diff --git a/linux/include/media/sh_mobile_ceu.h b/linux/include/media/sh_mobile_ceu.h
new file mode 100644
index 000000000..234a4711d
--- /dev/null
+++ b/linux/include/media/sh_mobile_ceu.h
@@ -0,0 +1,12 @@
+#ifndef __ASM_SH_MOBILE_CEU_H__
+#define __ASM_SH_MOBILE_CEU_H__
+
+#include <media/soc_camera.h>
+
+struct sh_mobile_ceu_info {
+ unsigned long flags; /* SOCAM_... */
+ void (*enable_camera)(void);
+ void (*disable_camera)(void);
+};
+
+#endif /* __ASM_SH_MOBILE_CEU_H__ */
diff --git a/linux/include/media/soc_camera.h b/linux/include/media/soc_camera.h
index 6a8c8be7a..1de98f150 100644
--- a/linux/include/media/soc_camera.h
+++ b/linux/include/media/soc_camera.h
@@ -13,7 +13,7 @@
#define SOC_CAMERA_H
#include <linux/videodev2.h>
-#include <media/videobuf-dma-sg.h>
+#include <media/videobuf-core.h>
struct soc_camera_device {
struct list_head list;
@@ -48,15 +48,12 @@ struct soc_camera_device {
struct soc_camera_file {
struct soc_camera_device *icd;
struct videobuf_queue vb_vidq;
- spinlock_t *lock;
};
struct soc_camera_host {
struct list_head list;
struct device dev;
unsigned char nr; /* Host number */
- size_t msize;
- struct videobuf_queue_ops *vbq_ops;
void *priv;
char *drv_name;
struct soc_camera_host_ops *ops;
@@ -69,13 +66,13 @@ struct soc_camera_host_ops {
int (*set_fmt_cap)(struct soc_camera_device *, __u32,
struct v4l2_rect *);
int (*try_fmt_cap)(struct soc_camera_device *, struct v4l2_format *);
+ void (*init_videobuf)(struct videobuf_queue *,
+ struct soc_camera_device *);
int (*reqbufs)(struct soc_camera_file *, struct v4l2_requestbuffers *);
int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
int (*try_bus_param)(struct soc_camera_device *, __u32);
int (*set_bus_param)(struct soc_camera_device *, __u32);
unsigned int (*poll)(struct file *, poll_table *);
- spinlock_t* (*spinlock_alloc)(struct soc_camera_file *);
- void (*spinlock_free)(spinlock_t *);
};
struct soc_camera_link {
@@ -156,11 +153,12 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl(
#define SOCAM_DATAWIDTH_8 (1 << 6)
#define SOCAM_DATAWIDTH_9 (1 << 7)
#define SOCAM_DATAWIDTH_10 (1 << 8)
-#define SOCAM_PCLK_SAMPLE_RISING (1 << 9)
-#define SOCAM_PCLK_SAMPLE_FALLING (1 << 10)
+#define SOCAM_DATAWIDTH_16 (1 << 9)
+#define SOCAM_PCLK_SAMPLE_RISING (1 << 10)
+#define SOCAM_PCLK_SAMPLE_FALLING (1 << 11)
#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_8 | SOCAM_DATAWIDTH_9 | \
- SOCAM_DATAWIDTH_10)
+ SOCAM_DATAWIDTH_10 | SOCAM_DATAWIDTH_16)
static inline unsigned long soc_camera_bus_param_compatible(
unsigned long camera_flags, unsigned long bus_flags)
diff --git a/linux/include/media/soc_camera_platform.h b/linux/include/media/soc_camera_platform.h
new file mode 100644
index 000000000..851f18220
--- /dev/null
+++ b/linux/include/media/soc_camera_platform.h
@@ -0,0 +1,15 @@
+#ifndef __SOC_CAMERA_H__
+#define __SOC_CAMERA_H__
+
+#include <linux/videodev2.h>
+
+struct soc_camera_platform_info {
+ int iface;
+ char *format_name;
+ unsigned long format_depth;
+ struct v4l2_pix_format format;
+ unsigned long bus_param;
+ int (*set_capture)(struct soc_camera_platform_info *info, int enable);
+};
+
+#endif /* __SOC_CAMERA_H__ */
diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h
index aa0fd8c94..798622258 100644
--- a/linux/include/media/v4l2-dev.h
+++ b/linux/include/media/v4l2-dev.h
@@ -85,14 +85,14 @@ extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
struct video_device
{
/* device ops */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
const struct file_operations *fops;
-#else
- struct file_operations *fops;
-#endif
/* sysfs */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
struct device class_dev; /* v4l device */
+#else
+ struct class_device class_dev;
+#endif
struct device *dev; /* device parent */
/* device info */
@@ -383,13 +383,30 @@ extern int video_usercopy(struct inode *inode, struct file *file,
#ifdef CONFIG_VIDEO_V4L1_COMPAT
#include <linux/mm.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
+static inline int __must_check
+video_device_create_file(struct video_device *vfd,
+ struct class_device_attribute *attr)
+{
+ int ret = class_device_create_file(&vfd->class_dev, attr);
+ if (ret < 0)
+ printk(KERN_WARNING "%s error: %d\n", __func__, ret);
+ return ret;
+}
+static inline void
+video_device_remove_file(struct video_device *vfd,
+ struct class_device_attribute *attr)
+{
+ class_device_remove_file(&vfd->class_dev, attr);
+}
+#else
static inline int __must_check
video_device_create_file(struct video_device *vfd,
struct device_attribute *attr)
{
int ret = device_create_file(&vfd->class_dev, attr);
if (ret < 0)
- printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
+ printk(KERN_WARNING "%s error: %d\n", __func__, ret);
return ret;
}
static inline void
@@ -398,6 +415,7 @@ video_device_remove_file(struct video_device *vfd,
{
device_remove_file(&vfd->class_dev, attr);
}
+#endif
#endif /* CONFIG_VIDEO_V4L1_COMPAT */
diff --git a/linux/include/media/v4l2-i2c-drv-legacy.h b/linux/include/media/v4l2-i2c-drv-legacy.h
index 31d6e103c..299b1c344 100644
--- a/linux/include/media/v4l2-i2c-drv-legacy.h
+++ b/linux/include/media/v4l2-i2c-drv-legacy.h
@@ -37,7 +37,7 @@ struct v4l2_i2c_driver_data {
};
static struct v4l2_i2c_driver_data v4l2_i2c_data;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
static const struct i2c_client_address_data addr_data;
#else
static struct i2c_client_address_data addr_data;
@@ -77,25 +77,25 @@ static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client)
return 0;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
static int v4l2_i2c_drv_suspend_helper(struct i2c_client *client, pm_message_t state)
#else
static int v4l2_i2c_drv_suspend_helper(struct device * dev, pm_message_t state)
#endif
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
#endif
return v4l2_i2c_data.suspend ? v4l2_i2c_data.suspend(client, state) : 0;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
static int v4l2_i2c_drv_resume_helper(struct i2c_client *client)
#else
static int v4l2_i2c_drv_resume_helper(struct device * dev)
#endif
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
#endif
return v4l2_i2c_data.resume ? v4l2_i2c_data.resume(client) : 0;
@@ -107,14 +107,14 @@ static int v4l2_i2c_drv_resume_helper(struct device * dev)
static struct i2c_driver v4l2_i2c_driver_legacy = {
.driver = {
.owner = THIS_MODULE,
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)
.suspend = v4l2_i2c_drv_suspend_helper,
.resume = v4l2_i2c_drv_resume_helper,
#endif
},
.attach_adapter = v4l2_i2c_drv_probe_legacy,
.detach_client = v4l2_i2c_drv_detach_legacy,
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
.suspend = v4l2_i2c_drv_suspend_helper,
.resume = v4l2_i2c_drv_resume_helper,
#endif
@@ -123,18 +123,18 @@ static struct i2c_driver v4l2_i2c_driver_legacy = {
/* ----------------------------------------------------------------------- */
/* i2c implementation */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
static struct i2c_driver v4l2_i2c_driver = {
.suspend = v4l2_i2c_drv_suspend_helper,
.resume = v4l2_i2c_drv_resume_helper,
};
-#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
static int compat_legacy_probe(struct i2c_client *client)
{
return v4l2_i2c_data.probe(client, NULL);
}
#endif
+#endif
static int __init v4l2_i2c_drv_init(void)
{
@@ -151,7 +151,7 @@ static int __init v4l2_i2c_drv_init(void)
v4l2_i2c_driver_legacy.command = v4l2_i2c_data.command;
err = i2c_add_driver(&v4l2_i2c_driver_legacy);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
if (err)
return err;
v4l2_i2c_driver.driver.name = v4l2_i2c_data.name;
@@ -176,7 +176,7 @@ static int __init v4l2_i2c_drv_init(void)
static void __exit v4l2_i2c_drv_cleanup(void)
{
i2c_del_driver(&v4l2_i2c_driver_legacy);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
i2c_del_driver(&v4l2_i2c_driver);
#endif
}
diff --git a/linux/include/media/v4l2-i2c-drv.h b/linux/include/media/v4l2-i2c-drv.h
index 9333e56b3..1feadb6c1 100644
--- a/linux/include/media/v4l2-i2c-drv.h
+++ b/linux/include/media/v4l2-i2c-drv.h
@@ -44,13 +44,13 @@ struct v4l2_i2c_driver_data {
static struct v4l2_i2c_driver_data v4l2_i2c_data;
static struct i2c_driver v4l2_i2c_driver;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
static int compat_legacy_probe(struct i2c_client *client)
{
return v4l2_i2c_data.probe(client, NULL);
}
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
/* Bus-based I2C implementation for kernels >= 2.6.22 */
@@ -111,25 +111,25 @@ static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client)
return 0;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
static int v4l2_i2c_drv_suspend_helper(struct i2c_client *client, pm_message_t state)
#else
static int v4l2_i2c_drv_suspend_helper(struct device * dev, pm_message_t state)
#endif
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
#endif
return v4l2_i2c_data.suspend ? v4l2_i2c_data.suspend(client, state) : 0;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
static int v4l2_i2c_drv_resume_helper(struct i2c_client *client)
#else
static int v4l2_i2c_drv_resume_helper(struct device * dev)
#endif
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
#endif
return v4l2_i2c_data.resume ? v4l2_i2c_data.resume(client) : 0;
@@ -140,14 +140,14 @@ static int v4l2_i2c_drv_resume_helper(struct device * dev)
static struct i2c_driver v4l2_i2c_driver = {
.driver = {
.owner = THIS_MODULE,
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)
.suspend = v4l2_i2c_drv_suspend_helper,
.resume = v4l2_i2c_drv_resume_helper,
#endif
},
.attach_adapter = v4l2_i2c_drv_probe_legacy,
.detach_client = v4l2_i2c_drv_detach_legacy,
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20)
.suspend = v4l2_i2c_drv_suspend_helper,
.resume = v4l2_i2c_drv_resume_helper,
#endif
diff --git a/linux/include/media/videobuf-dma-contig.h b/linux/include/media/videobuf-dma-contig.h
new file mode 100644
index 000000000..549386681
--- /dev/null
+++ b/linux/include/media/videobuf-dma-contig.h
@@ -0,0 +1,32 @@
+/*
+ * helper functions for physically contiguous capture buffers
+ *
+ * The functions support hardware lacking scatter gather support
+ * (i.e. the buffers must be linear in physical memory)
+ *
+ * Copyright (c) 2008 Magnus Damm
+ *
+ * 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 2
+ */
+#ifndef _VIDEOBUF_DMA_CONTIG_H
+#define _VIDEOBUF_DMA_CONTIG_H
+
+#include <linux/dma-mapping.h>
+#include <media/videobuf-core.h>
+
+void videobuf_queue_dma_contig_init(struct videobuf_queue *q,
+ struct videobuf_queue_ops *ops,
+ struct device *dev,
+ spinlock_t *irqlock,
+ enum v4l2_buf_type type,
+ enum v4l2_field field,
+ unsigned int msize,
+ void *priv);
+
+dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf);
+void videobuf_dma_contig_free(struct videobuf_queue *q,
+ struct videobuf_buffer *buf);
+
+#endif /* _VIDEOBUF_DMA_CONTIG_H */
diff --git a/linux/include/media/videobuf-dma-sg.h b/linux/include/media/videobuf-dma-sg.h
index be8da269e..90edd22d3 100644
--- a/linux/include/media/videobuf-dma-sg.h
+++ b/linux/include/media/videobuf-dma-sg.h
@@ -1,7 +1,7 @@
/*
* helper functions for SG DMA video4linux capture buffers
*
- * The functions expect the hardware being able to scatter gatter
+ * The functions expect the hardware being able to scatter gather
* (i.e. the buffers are not linear in physical memory, but fragmented
* into PAGE_SIZE chunks). They also assume the driver does not need
* to touch the video data.
diff --git a/linux/include/media/videobuf-vmalloc.h b/linux/include/media/videobuf-vmalloc.h
index aed39460c..e87222c6a 100644
--- a/linux/include/media/videobuf-vmalloc.h
+++ b/linux/include/media/videobuf-vmalloc.h
@@ -1,7 +1,7 @@
/*
* helper functions for vmalloc capture buffers
*
- * The functions expect the hardware being able to scatter gatter
+ * The functions expect the hardware being able to scatter gather
* (i.e. the buffers are not linear in physical memory, but fragmented
* into PAGE_SIZE chunks). They also assume the driver does not need
* to touch the video data.