Skip to content

Commit 90d1862

Browse files
Wen Dingxianrkhuangtao
authored andcommitted
camera: rockchip: camsys_drv: v0.0x22.7 camsys_head: v0.e.0
read MRV_MIPI_FRAME register in camsys_mrv_irq, and pass the value fs_id and fe_id into isp library. Change-Id: I98c43f1cac25c74c5058b90dbf25937ceb924f84 Signed-off-by: Wen Dingxian <shawn.wen@rock-chips.com>
1 parent a4d023c commit 90d1862

4 files changed

Lines changed: 27 additions & 3 deletions

File tree

drivers/media/video/rk_camsys/camsys_internal.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,12 @@
180180
1) gpio base start from 1000,adapt to it.
181181
*v0.0x22.6:
182182
1) revert v0.0x22.3.
183+
*v0.0x22.7:
184+
1) read MRV_MIPI_FRAME register in camsys_mrv_irq, and pass the value
185+
fs_id and fe_id into isp library.
183186
*/
184187

185-
#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0, 0x22, 6)
188+
#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0, 0x22, 7)
186189

187190
#define CAMSYS_PLATFORM_DRV_NAME "RockChip-CamSys"
188191
#define CAMSYS_PLATFORM_MARVIN_NAME "Platform_MarvinDev"

drivers/media/video/rk_camsys/camsys_marvin.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ static irqreturn_t camsys_mrv_irq(int irq, void *data)
713713
camsys_irqpool_t *irqpool;
714714
unsigned int isp_mis, mipi_mis, mi_mis, *mis, jpg_mis, jpg_err_mis;
715715
unsigned int mi_ris, mi_imis;
716+
static unsigned int mipi_frame;
716717

717718
isp_mis = __raw_readl((void volatile *)
718719
(camsys_dev->devmems.registermem->vir_base +
@@ -751,6 +752,13 @@ static irqreturn_t camsys_mrv_irq(int irq, void *data)
751752
MRV_MI_IMIS));
752753
}
753754

755+
if (isp_mis & MIS_V_START) {
756+
mipi_frame = __raw_readl((void *)
757+
(camsys_dev->devmems.registermem->vir_base +
758+
MRV_MIPI_FRAME));
759+
camsys_trace(2, "mipi_frame: 0x%08x \r\n", mipi_frame);
760+
}
761+
754762
__raw_writel(isp_mis, (void volatile *)
755763
(camsys_dev->devmems.registermem->vir_base +
756764
MRV_ISP_ICR));
@@ -819,6 +827,11 @@ static irqreturn_t camsys_mrv_irq(int irq, void *data)
819827
camsys_irqstas_t,
820828
list);
821829
irqsta->sta.mis = *mis;
830+
irqsta->sta.fs_id =
831+
mipi_frame & 0xFFFF;
832+
irqsta->sta.fe_id =
833+
(mipi_frame >> 16)
834+
& 0xFFFF;
822835
list_del_init(&irqsta->list);
823836
list_add_tail(&irqsta->list,
824837
&irqpool->active);

drivers/media/video/rk_camsys/camsys_marvin.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#define CAMSYS_MARVIN_IRQNAME "MarvinIrq"
77

8+
#define MIS_V_START BIT(6)
9+
810
#define MRV_ISP_BASE 0x400
911
#define MRV_ISP_RIS (MRV_ISP_BASE + 0x1c0)
1012
#define MRV_ISP_MIS (MRV_ISP_BASE + 0x1c4)
@@ -13,6 +15,7 @@
1315
#define MRV_MIPI_BASE 0x1C00
1416
#define MRV_MIPI_MIS (MRV_MIPI_BASE + 0x10)
1517
#define MRV_MIPI_ICR (MRV_MIPI_BASE + 0x14)
18+
#define MRV_MIPI_FRAME (MRV_MIPI_BASE + 0x40)
1619

1720
#define MRV_MI_BASE (0x1400)
1821

include/media/camsys_head.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
1) support sensor powerup sequence configurable.
3434
*v0.d.0:
3535
1) powerup sequence type moved to common_head.h.
36+
*v0.e.0:
37+
1) add fs_id, fe_id and some reserved bytes in struct camsys_irqsta_s.
3638
*/
37-
#define CAMSYS_HEAD_VERSION KERNEL_VERSION(0,0xd,0)
39+
#define CAMSYS_HEAD_VERSION KERNEL_VERSION(0, 0xe, 0)
3840

3941
#define CAMSYS_MARVIN_DEVNAME "camsys_marvin"
4042
#define CAMSYS_CIF0_DEVNAME "camsys_cif0"
@@ -60,14 +62,17 @@
6062
typedef struct camsys_irqsta_s {
6163
unsigned int ris; //Raw interrupt status
6264
unsigned int mis; //Masked interrupt status
65+
unsigned int fs_id; // frame number from Frame Start (FS) short packet
66+
unsigned int fe_id; // frame number from Frame End (FE) short packet
67+
unsigned int reserved[4];
6368
} camsys_irqsta_t;
6469

6570
typedef struct camsys_irqcnnt_s {
6671
int pid;
6772
unsigned int timeout; //us
6873

6974
unsigned int mis;
70-
unsigned int icr;
75+
unsigned int icr;
7176
} camsys_irqcnnt_t;
7277

7378
typedef enum camsys_mmap_type_e { //this type can be filled in mmap offset argument

0 commit comments

Comments
 (0)