diff options
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-core.c')
-rw-r--r-- | drivers/media/video/s5p-fimc/fimc-core.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index e0fe9748ec57..917eef412566 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c | |||
@@ -188,7 +188,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
188 | }, | 188 | }, |
189 | }; | 189 | }; |
190 | 190 | ||
191 | struct fimc_fmt * fimc_get_format(unsigned int index) | 191 | struct fimc_fmt *fimc_get_format(unsigned int index) |
192 | { | 192 | { |
193 | if (index >= ARRAY_SIZE(fimc_formats)) | 193 | if (index >= ARRAY_SIZE(fimc_formats)) |
194 | return NULL; | 194 | return NULL; |
@@ -231,7 +231,7 @@ static int fimc_get_scaler_factor(u32 src, u32 tar, u32 *ratio, u32 *shift) | |||
231 | 231 | ||
232 | int fimc_set_scaler_info(struct fimc_ctx *ctx) | 232 | int fimc_set_scaler_info(struct fimc_ctx *ctx) |
233 | { | 233 | { |
234 | struct samsung_fimc_variant *variant = ctx->fimc_dev->variant; | 234 | struct fimc_variant *variant = ctx->fimc_dev->variant; |
235 | struct device *dev = &ctx->fimc_dev->pdev->dev; | 235 | struct device *dev = &ctx->fimc_dev->pdev->dev; |
236 | struct fimc_scaler *sc = &ctx->scaler; | 236 | struct fimc_scaler *sc = &ctx->scaler; |
237 | struct fimc_frame *s_frame = &ctx->s_frame; | 237 | struct fimc_frame *s_frame = &ctx->s_frame; |
@@ -430,7 +430,7 @@ void fimc_set_yuv_order(struct fimc_ctx *ctx) | |||
430 | 430 | ||
431 | void fimc_prepare_dma_offset(struct fimc_ctx *ctx, struct fimc_frame *f) | 431 | void fimc_prepare_dma_offset(struct fimc_ctx *ctx, struct fimc_frame *f) |
432 | { | 432 | { |
433 | struct samsung_fimc_variant *variant = ctx->fimc_dev->variant; | 433 | struct fimc_variant *variant = ctx->fimc_dev->variant; |
434 | u32 i, depth = 0; | 434 | u32 i, depth = 0; |
435 | 435 | ||
436 | for (i = 0; i < f->fmt->colplanes; i++) | 436 | for (i = 0; i < f->fmt->colplanes; i++) |
@@ -472,7 +472,7 @@ void fimc_prepare_dma_offset(struct fimc_ctx *ctx, struct fimc_frame *f) | |||
472 | static int __fimc_s_ctrl(struct fimc_ctx *ctx, struct v4l2_ctrl *ctrl) | 472 | static int __fimc_s_ctrl(struct fimc_ctx *ctx, struct v4l2_ctrl *ctrl) |
473 | { | 473 | { |
474 | struct fimc_dev *fimc = ctx->fimc_dev; | 474 | struct fimc_dev *fimc = ctx->fimc_dev; |
475 | struct samsung_fimc_variant *variant = fimc->variant; | 475 | struct fimc_variant *variant = fimc->variant; |
476 | unsigned int flags = FIMC_DST_FMT | FIMC_SRC_FMT; | 476 | unsigned int flags = FIMC_DST_FMT | FIMC_SRC_FMT; |
477 | int ret = 0; | 477 | int ret = 0; |
478 | 478 | ||
@@ -532,7 +532,7 @@ static const struct v4l2_ctrl_ops fimc_ctrl_ops = { | |||
532 | 532 | ||
533 | int fimc_ctrls_create(struct fimc_ctx *ctx) | 533 | int fimc_ctrls_create(struct fimc_ctx *ctx) |
534 | { | 534 | { |
535 | struct samsung_fimc_variant *variant = ctx->fimc_dev->variant; | 535 | struct fimc_variant *variant = ctx->fimc_dev->variant; |
536 | unsigned int max_alpha = fimc_get_alpha_mask(ctx->d_frame.fmt); | 536 | unsigned int max_alpha = fimc_get_alpha_mask(ctx->d_frame.fmt); |
537 | 537 | ||
538 | if (ctx->ctrls_rdy) | 538 | if (ctx->ctrls_rdy) |
@@ -794,15 +794,12 @@ static int fimc_m2m_resume(struct fimc_dev *fimc) | |||
794 | 794 | ||
795 | static int fimc_probe(struct platform_device *pdev) | 795 | static int fimc_probe(struct platform_device *pdev) |
796 | { | 796 | { |
797 | struct fimc_drvdata *drv_data = fimc_get_drvdata(pdev); | ||
798 | struct s5p_platform_fimc *pdata; | ||
797 | struct fimc_dev *fimc; | 799 | struct fimc_dev *fimc; |
798 | struct resource *res; | 800 | struct resource *res; |
799 | struct samsung_fimc_driverdata *drv_data; | ||
800 | struct s5p_platform_fimc *pdata; | ||
801 | int ret = 0; | 801 | int ret = 0; |
802 | 802 | ||
803 | drv_data = (struct samsung_fimc_driverdata *) | ||
804 | platform_get_device_id(pdev)->driver_data; | ||
805 | |||
806 | if (pdev->id >= drv_data->num_entities) { | 803 | if (pdev->id >= drv_data->num_entities) { |
807 | dev_err(&pdev->dev, "Invalid platform device id: %d\n", | 804 | dev_err(&pdev->dev, "Invalid platform device id: %d\n", |
808 | pdev->id); | 805 | pdev->id); |
@@ -1004,7 +1001,7 @@ static struct fimc_pix_limit s5p_pix_limit[4] = { | |||
1004 | }, | 1001 | }, |
1005 | }; | 1002 | }; |
1006 | 1003 | ||
1007 | static struct samsung_fimc_variant fimc0_variant_s5p = { | 1004 | static struct fimc_variant fimc0_variant_s5p = { |
1008 | .has_inp_rot = 1, | 1005 | .has_inp_rot = 1, |
1009 | .has_out_rot = 1, | 1006 | .has_out_rot = 1, |
1010 | .has_cam_if = 1, | 1007 | .has_cam_if = 1, |
@@ -1016,17 +1013,17 @@ static struct samsung_fimc_variant fimc0_variant_s5p = { | |||
1016 | .pix_limit = &s5p_pix_limit[0], | 1013 | .pix_limit = &s5p_pix_limit[0], |
1017 | }; | 1014 | }; |
1018 | 1015 | ||
1019 | static struct samsung_fimc_variant fimc2_variant_s5p = { | 1016 | static struct fimc_variant fimc2_variant_s5p = { |
1020 | .has_cam_if = 1, | 1017 | .has_cam_if = 1, |
1021 | .min_inp_pixsize = 16, | 1018 | .min_inp_pixsize = 16, |
1022 | .min_out_pixsize = 16, | 1019 | .min_out_pixsize = 16, |
1023 | .hor_offs_align = 8, | 1020 | .hor_offs_align = 8, |
1024 | .min_vsize_align = 16, | 1021 | .min_vsize_align = 16, |
1025 | .out_buf_count = 4, | 1022 | .out_buf_count = 4, |
1026 | .pix_limit = &s5p_pix_limit[1], | 1023 | .pix_limit = &s5p_pix_limit[1], |
1027 | }; | 1024 | }; |
1028 | 1025 | ||
1029 | static struct samsung_fimc_variant fimc0_variant_s5pv210 = { | 1026 | static struct fimc_variant fimc0_variant_s5pv210 = { |
1030 | .pix_hoff = 1, | 1027 | .pix_hoff = 1, |
1031 | .has_inp_rot = 1, | 1028 | .has_inp_rot = 1, |
1032 | .has_out_rot = 1, | 1029 | .has_out_rot = 1, |
@@ -1039,7 +1036,7 @@ static struct samsung_fimc_variant fimc0_variant_s5pv210 = { | |||
1039 | .pix_limit = &s5p_pix_limit[1], | 1036 | .pix_limit = &s5p_pix_limit[1], |
1040 | }; | 1037 | }; |
1041 | 1038 | ||
1042 | static struct samsung_fimc_variant fimc1_variant_s5pv210 = { | 1039 | static struct fimc_variant fimc1_variant_s5pv210 = { |
1043 | .pix_hoff = 1, | 1040 | .pix_hoff = 1, |
1044 | .has_inp_rot = 1, | 1041 | .has_inp_rot = 1, |
1045 | .has_out_rot = 1, | 1042 | .has_out_rot = 1, |
@@ -1053,7 +1050,7 @@ static struct samsung_fimc_variant fimc1_variant_s5pv210 = { | |||
1053 | .pix_limit = &s5p_pix_limit[2], | 1050 | .pix_limit = &s5p_pix_limit[2], |
1054 | }; | 1051 | }; |
1055 | 1052 | ||
1056 | static struct samsung_fimc_variant fimc2_variant_s5pv210 = { | 1053 | static struct fimc_variant fimc2_variant_s5pv210 = { |
1057 | .has_cam_if = 1, | 1054 | .has_cam_if = 1, |
1058 | .pix_hoff = 1, | 1055 | .pix_hoff = 1, |
1059 | .min_inp_pixsize = 16, | 1056 | .min_inp_pixsize = 16, |
@@ -1064,7 +1061,7 @@ static struct samsung_fimc_variant fimc2_variant_s5pv210 = { | |||
1064 | .pix_limit = &s5p_pix_limit[2], | 1061 | .pix_limit = &s5p_pix_limit[2], |
1065 | }; | 1062 | }; |
1066 | 1063 | ||
1067 | static struct samsung_fimc_variant fimc0_variant_exynos4 = { | 1064 | static struct fimc_variant fimc0_variant_exynos4 = { |
1068 | .pix_hoff = 1, | 1065 | .pix_hoff = 1, |
1069 | .has_inp_rot = 1, | 1066 | .has_inp_rot = 1, |
1070 | .has_out_rot = 1, | 1067 | .has_out_rot = 1, |
@@ -1080,7 +1077,7 @@ static struct samsung_fimc_variant fimc0_variant_exynos4 = { | |||
1080 | .pix_limit = &s5p_pix_limit[1], | 1077 | .pix_limit = &s5p_pix_limit[1], |
1081 | }; | 1078 | }; |
1082 | 1079 | ||
1083 | static struct samsung_fimc_variant fimc3_variant_exynos4 = { | 1080 | static struct fimc_variant fimc3_variant_exynos4 = { |
1084 | .pix_hoff = 1, | 1081 | .pix_hoff = 1, |
1085 | .has_cam_if = 1, | 1082 | .has_cam_if = 1, |
1086 | .has_cistatus2 = 1, | 1083 | .has_cistatus2 = 1, |
@@ -1095,7 +1092,7 @@ static struct samsung_fimc_variant fimc3_variant_exynos4 = { | |||
1095 | }; | 1092 | }; |
1096 | 1093 | ||
1097 | /* S5PC100 */ | 1094 | /* S5PC100 */ |
1098 | static struct samsung_fimc_driverdata fimc_drvdata_s5p = { | 1095 | static struct fimc_drvdata fimc_drvdata_s5p = { |
1099 | .variant = { | 1096 | .variant = { |
1100 | [0] = &fimc0_variant_s5p, | 1097 | [0] = &fimc0_variant_s5p, |
1101 | [1] = &fimc0_variant_s5p, | 1098 | [1] = &fimc0_variant_s5p, |
@@ -1106,7 +1103,7 @@ static struct samsung_fimc_driverdata fimc_drvdata_s5p = { | |||
1106 | }; | 1103 | }; |
1107 | 1104 | ||
1108 | /* S5PV210, S5PC110 */ | 1105 | /* S5PV210, S5PC110 */ |
1109 | static struct samsung_fimc_driverdata fimc_drvdata_s5pv210 = { | 1106 | static struct fimc_drvdata fimc_drvdata_s5pv210 = { |
1110 | .variant = { | 1107 | .variant = { |
1111 | [0] = &fimc0_variant_s5pv210, | 1108 | [0] = &fimc0_variant_s5pv210, |
1112 | [1] = &fimc1_variant_s5pv210, | 1109 | [1] = &fimc1_variant_s5pv210, |
@@ -1116,8 +1113,8 @@ static struct samsung_fimc_driverdata fimc_drvdata_s5pv210 = { | |||
1116 | .lclk_frequency = 166000000UL, | 1113 | .lclk_frequency = 166000000UL, |
1117 | }; | 1114 | }; |
1118 | 1115 | ||
1119 | /* S5PV310, S5PC210 */ | 1116 | /* EXYNOS4210, S5PV310, S5PC210 */ |
1120 | static struct samsung_fimc_driverdata fimc_drvdata_exynos4 = { | 1117 | static struct fimc_drvdata fimc_drvdata_exynos4 = { |
1121 | .variant = { | 1118 | .variant = { |
1122 | [0] = &fimc0_variant_exynos4, | 1119 | [0] = &fimc0_variant_exynos4, |
1123 | [1] = &fimc0_variant_exynos4, | 1120 | [1] = &fimc0_variant_exynos4, |