mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-10 06:58:08 +09:00
camera: rockchip: camsys driver v0.0x23.0
Change-Id: Ia4f527488f588c3adb6c3ea6cd1be868fe006d14 Signed-off-by: zhangyunlong <dalon.zhang@rock-chips.com>
This commit is contained in:
@@ -643,7 +643,7 @@ static int camsys_irq_wait(camsys_irqsta_t *irqsta, camsys_dev_t *camsys_dev)
|
||||
spin_lock_irqsave(&camsys_dev->irq.lock, flags);
|
||||
if (!list_empty(&camsys_dev->irq.irq_pool)) {
|
||||
list_for_each_entry(irqpool, &camsys_dev->irq.irq_pool, list) {
|
||||
if (irqpool->pid == current->pid) {
|
||||
if (irqpool->pid == irqsta->pid) {
|
||||
find_pool = true;
|
||||
break;
|
||||
}
|
||||
@@ -654,7 +654,7 @@ static int camsys_irq_wait(camsys_irqsta_t *irqsta, camsys_dev_t *camsys_dev)
|
||||
if (find_pool == false) {
|
||||
camsys_err(
|
||||
"this thread(pid: %d) hasn't been connect irq, so wait irq failed!",
|
||||
current->pid);
|
||||
irqsta->pid);
|
||||
err = -EINVAL;
|
||||
goto end;
|
||||
}
|
||||
@@ -674,7 +674,7 @@ static int camsys_irq_wait(camsys_irqsta_t *irqsta, camsys_dev_t *camsys_dev)
|
||||
active_list_isnot_empty(irqpool),
|
||||
usecs_to_jiffies(irqpool->timeout));
|
||||
|
||||
if (irqpool->pid == current->pid) {
|
||||
if (irqpool->pid == irqsta->pid) {
|
||||
if (active_list_isnot_empty(irqpool)) {
|
||||
spin_lock_irqsave(&irqpool->lock, flags);
|
||||
irqstas = list_first_entry(
|
||||
@@ -692,7 +692,7 @@ static int camsys_irq_wait(camsys_irqsta_t *irqsta, camsys_dev_t *camsys_dev)
|
||||
} else {
|
||||
camsys_warn(
|
||||
"Thread(pid: %d) has been disconnect!",
|
||||
current->pid);
|
||||
irqsta->pid);
|
||||
err = -EAGAIN;
|
||||
}
|
||||
}
|
||||
@@ -700,7 +700,7 @@ static int camsys_irq_wait(camsys_irqsta_t *irqsta, camsys_dev_t *camsys_dev)
|
||||
if (err == 0) {
|
||||
camsys_trace(3,
|
||||
"Thread(pid: %d) has been wake up for irq(mis: 0x%x ris:0x%x)!",
|
||||
current->pid, irqsta->mis, irqsta->ris);
|
||||
irqsta->pid, irqsta->mis, irqsta->ris);
|
||||
}
|
||||
|
||||
end:
|
||||
@@ -1052,7 +1052,9 @@ static long camsys_ioctl_compat(struct file *filp, unsigned int cmd, unsigned
|
||||
|
||||
case CAMSYS_IRQWAIT: {
|
||||
camsys_irqsta_t irqsta;
|
||||
|
||||
if (copy_from_user((void *)&irqsta, (void __user *)arg,
|
||||
sizeof(camsys_irqsta_t)))
|
||||
return -EFAULT;
|
||||
err = camsys_irq_wait(&irqsta, camsys_dev);
|
||||
if (err == 0) {
|
||||
if (copy_to_user((void __user *)arg, (void *)&irqsta,
|
||||
@@ -1263,7 +1265,9 @@ static long camsys_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
case CAMSYS_IRQWAIT:
|
||||
{
|
||||
camsys_irqsta_t irqsta;
|
||||
|
||||
if (copy_from_user((void *)&irqsta, (void __user *)arg,
|
||||
sizeof(camsys_irqsta_t)))
|
||||
return -EFAULT;
|
||||
err = camsys_irq_wait(&irqsta, camsys_dev);
|
||||
if (err == 0) {
|
||||
if (copy_to_user((void __user *)arg, (void *)&irqsta,
|
||||
|
||||
@@ -185,9 +185,11 @@
|
||||
fs_id and fe_id into isp library.
|
||||
*v0.0x22.8:
|
||||
1) 3399 power management is wrong, correct it.
|
||||
*v0.0x23.0:
|
||||
1) replace current->pid with irqsta->pid.
|
||||
*/
|
||||
|
||||
#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0, 0x22, 8)
|
||||
#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0, 0x23, 0)
|
||||
|
||||
#define CAMSYS_PLATFORM_DRV_NAME "RockChip-CamSys"
|
||||
#define CAMSYS_PLATFORM_MARVIN_NAME "Platform_MarvinDev"
|
||||
|
||||
@@ -35,8 +35,11 @@
|
||||
1) powerup sequence type moved to common_head.h.
|
||||
*v0.e.0:
|
||||
1) add fs_id, fe_id and some reserved bytes in struct camsys_irqsta_s.
|
||||
*v0.f.0:
|
||||
1) add pid in struct camsys_irqsta_s.
|
||||
*/
|
||||
#define CAMSYS_HEAD_VERSION KERNEL_VERSION(0, 0xe, 0)
|
||||
|
||||
#define CAMSYS_HEAD_VERSION KERNEL_VERSION(0, 0xf, 0)
|
||||
|
||||
#define CAMSYS_MARVIN_DEVNAME "camsys_marvin"
|
||||
#define CAMSYS_CIF0_DEVNAME "camsys_cif0"
|
||||
@@ -64,7 +67,8 @@ typedef struct camsys_irqsta_s {
|
||||
unsigned int mis; //Masked interrupt status
|
||||
unsigned int fs_id; // frame number from Frame Start (FS) short packet
|
||||
unsigned int fe_id; // frame number from Frame End (FE) short packet
|
||||
unsigned int reserved[4];
|
||||
int pid;
|
||||
unsigned int reserved[3];
|
||||
} camsys_irqsta_t;
|
||||
|
||||
typedef struct camsys_irqcnnt_s {
|
||||
|
||||
Reference in New Issue
Block a user