aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/s5c73m3
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 05:12:35 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 05:12:35 -0400
commit676ee36be04985062522804c2de04f0764212be6 (patch)
tree781df135c5a91a04decad1b7d53b5a925dc11522 /drivers/media/i2c/s5c73m3
parentb18042a673e88c9457a6d1716219c2367ca447b0 (diff)
parente183201b9e917daf2530b637b2f34f1d5afb934d (diff)
Merge branch 'patchwork' into v4l_for_linus
* patchwork: (404 commits) [media] uvcvideo: add support for VIDIOC_QUERY_EXT_CTRL [media] uvcvideo: fix cropcap v4l2-compliance failure [media] media: omap3isp: remove unused clkdev [media] coda: Add tracing support [media] coda: drop dma_sync_single_for_device in coda_bitstream_queue [media] coda: fix fill bitstream errors in nonstreaming case [media] coda: call SEQ_END when the first queue is stopped [media] coda: fail to start streaming if userspace set invalid formats [media] coda: remove duplicate error messages for buffer allocations [media] coda: move parameter buffer in together with context buffer allocation [media] coda: allocate bitstream buffer from REQBUFS, size depends on the format [media] coda: allocate per-context buffers from REQBUFS [media] coda: use strlcpy instead of snprintf [media] coda: bitstream payload is unsigned [media] coda: fix double call to debugfs_remove [media] coda: check kasprintf return value in coda_open [media] coda: bitrate can only be set in kbps steps [media] v4l2-mem2mem: no need to initialize b in v4l2_m2m_next_buf and v4l2_m2m_buf_remove [media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init [media] coda: set allow_zero_bytesused flag for vb2_queue_init ...
Diffstat (limited to 'drivers/media/i2c/s5c73m3')
-rw-r--r--drivers/media/i2c/s5c73m3/s5c73m3-core.c72
-rw-r--r--drivers/media/i2c/s5c73m3/s5c73m3-spi.c2
2 files changed, 45 insertions, 29 deletions
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index ee0f57e01b56..08b234bd2962 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -824,10 +824,11 @@ static const struct s5c73m3_frame_size *s5c73m3_find_frame_size(
824} 824}
825 825
826static void s5c73m3_oif_try_format(struct s5c73m3 *state, 826static void s5c73m3_oif_try_format(struct s5c73m3 *state,
827 struct v4l2_subdev_fh *fh, 827 struct v4l2_subdev_pad_config *cfg,
828 struct v4l2_subdev_format *fmt, 828 struct v4l2_subdev_format *fmt,
829 const struct s5c73m3_frame_size **fs) 829 const struct s5c73m3_frame_size **fs)
830{ 830{
831 struct v4l2_subdev *sd = &state->sensor_sd;
831 u32 code; 832 u32 code;
832 833
833 switch (fmt->pad) { 834 switch (fmt->pad) {
@@ -850,7 +851,7 @@ static void s5c73m3_oif_try_format(struct s5c73m3 *state,
850 *fs = state->oif_pix_size[RES_ISP]; 851 *fs = state->oif_pix_size[RES_ISP];
851 else 852 else
852 *fs = s5c73m3_find_frame_size( 853 *fs = s5c73m3_find_frame_size(
853 v4l2_subdev_get_try_format(fh, 854 v4l2_subdev_get_try_format(sd, cfg,
854 OIF_ISP_PAD), 855 OIF_ISP_PAD),
855 RES_ISP); 856 RES_ISP);
856 break; 857 break;
@@ -860,7 +861,7 @@ static void s5c73m3_oif_try_format(struct s5c73m3 *state,
860} 861}
861 862
862static void s5c73m3_try_format(struct s5c73m3 *state, 863static void s5c73m3_try_format(struct s5c73m3 *state,
863 struct v4l2_subdev_fh *fh, 864 struct v4l2_subdev_pad_config *cfg,
864 struct v4l2_subdev_format *fmt, 865 struct v4l2_subdev_format *fmt,
865 const struct s5c73m3_frame_size **fs) 866 const struct s5c73m3_frame_size **fs)
866{ 867{
@@ -952,7 +953,7 @@ static int s5c73m3_oif_s_frame_interval(struct v4l2_subdev *sd,
952} 953}
953 954
954static int s5c73m3_oif_enum_frame_interval(struct v4l2_subdev *sd, 955static int s5c73m3_oif_enum_frame_interval(struct v4l2_subdev *sd,
955 struct v4l2_subdev_fh *fh, 956 struct v4l2_subdev_pad_config *cfg,
956 struct v4l2_subdev_frame_interval_enum *fie) 957 struct v4l2_subdev_frame_interval_enum *fie)
957{ 958{
958 struct s5c73m3 *state = oif_sd_to_s5c73m3(sd); 959 struct s5c73m3 *state = oif_sd_to_s5c73m3(sd);
@@ -990,7 +991,7 @@ static int s5c73m3_oif_get_pad_code(int pad, int index)
990} 991}
991 992
992static int s5c73m3_get_fmt(struct v4l2_subdev *sd, 993static int s5c73m3_get_fmt(struct v4l2_subdev *sd,
993 struct v4l2_subdev_fh *fh, 994 struct v4l2_subdev_pad_config *cfg,
994 struct v4l2_subdev_format *fmt) 995 struct v4l2_subdev_format *fmt)
995{ 996{
996 struct s5c73m3 *state = sensor_sd_to_s5c73m3(sd); 997 struct s5c73m3 *state = sensor_sd_to_s5c73m3(sd);
@@ -998,7 +999,7 @@ static int s5c73m3_get_fmt(struct v4l2_subdev *sd,
998 u32 code; 999 u32 code;
999 1000
1000 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { 1001 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
1001 fmt->format = *v4l2_subdev_get_try_format(fh, fmt->pad); 1002 fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
1002 return 0; 1003 return 0;
1003 } 1004 }
1004 1005
@@ -1024,7 +1025,7 @@ static int s5c73m3_get_fmt(struct v4l2_subdev *sd,
1024} 1025}
1025 1026
1026static int s5c73m3_oif_get_fmt(struct v4l2_subdev *sd, 1027static int s5c73m3_oif_get_fmt(struct v4l2_subdev *sd,
1027 struct v4l2_subdev_fh *fh, 1028 struct v4l2_subdev_pad_config *cfg,
1028 struct v4l2_subdev_format *fmt) 1029 struct v4l2_subdev_format *fmt)
1029{ 1030{
1030 struct s5c73m3 *state = oif_sd_to_s5c73m3(sd); 1031 struct s5c73m3 *state = oif_sd_to_s5c73m3(sd);
@@ -1032,7 +1033,7 @@ static int s5c73m3_oif_get_fmt(struct v4l2_subdev *sd,
1032 u32 code; 1033 u32 code;
1033 1034
1034 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { 1035 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
1035 fmt->format = *v4l2_subdev_get_try_format(fh, fmt->pad); 1036 fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
1036 return 0; 1037 return 0;
1037 } 1038 }
1038 1039
@@ -1062,7 +1063,7 @@ static int s5c73m3_oif_get_fmt(struct v4l2_subdev *sd,
1062} 1063}
1063 1064
1064static int s5c73m3_set_fmt(struct v4l2_subdev *sd, 1065static int s5c73m3_set_fmt(struct v4l2_subdev *sd,
1065 struct v4l2_subdev_fh *fh, 1066 struct v4l2_subdev_pad_config *cfg,
1066 struct v4l2_subdev_format *fmt) 1067 struct v4l2_subdev_format *fmt)
1067{ 1068{
1068 const struct s5c73m3_frame_size *frame_size = NULL; 1069 const struct s5c73m3_frame_size *frame_size = NULL;
@@ -1072,10 +1073,10 @@ static int s5c73m3_set_fmt(struct v4l2_subdev *sd,
1072 1073
1073 mutex_lock(&state->lock); 1074 mutex_lock(&state->lock);
1074 1075
1075 s5c73m3_try_format(state, fh, fmt, &frame_size); 1076 s5c73m3_try_format(state, cfg, fmt, &frame_size);
1076 1077
1077 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { 1078 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
1078 mf = v4l2_subdev_get_try_format(fh, fmt->pad); 1079 mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
1079 *mf = fmt->format; 1080 *mf = fmt->format;
1080 } else { 1081 } else {
1081 switch (fmt->pad) { 1082 switch (fmt->pad) {
@@ -1101,7 +1102,7 @@ static int s5c73m3_set_fmt(struct v4l2_subdev *sd,
1101} 1102}
1102 1103
1103static int s5c73m3_oif_set_fmt(struct v4l2_subdev *sd, 1104static int s5c73m3_oif_set_fmt(struct v4l2_subdev *sd,
1104 struct v4l2_subdev_fh *fh, 1105 struct v4l2_subdev_pad_config *cfg,
1105 struct v4l2_subdev_format *fmt) 1106 struct v4l2_subdev_format *fmt)
1106{ 1107{
1107 const struct s5c73m3_frame_size *frame_size = NULL; 1108 const struct s5c73m3_frame_size *frame_size = NULL;
@@ -1111,13 +1112,13 @@ static int s5c73m3_oif_set_fmt(struct v4l2_subdev *sd,
1111 1112
1112 mutex_lock(&state->lock); 1113 mutex_lock(&state->lock);
1113 1114
1114 s5c73m3_oif_try_format(state, fh, fmt, &frame_size); 1115 s5c73m3_oif_try_format(state, cfg, fmt, &frame_size);
1115 1116
1116 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { 1117 if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
1117 mf = v4l2_subdev_get_try_format(fh, fmt->pad); 1118 mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
1118 *mf = fmt->format; 1119 *mf = fmt->format;
1119 if (fmt->pad == OIF_ISP_PAD) { 1120 if (fmt->pad == OIF_ISP_PAD) {
1120 mf = v4l2_subdev_get_try_format(fh, OIF_SOURCE_PAD); 1121 mf = v4l2_subdev_get_try_format(sd, cfg, OIF_SOURCE_PAD);
1121 mf->width = fmt->format.width; 1122 mf->width = fmt->format.width;
1122 mf->height = fmt->format.height; 1123 mf->height = fmt->format.height;
1123 } 1124 }
@@ -1189,7 +1190,7 @@ static int s5c73m3_oif_set_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
1189} 1190}
1190 1191
1191static int s5c73m3_enum_mbus_code(struct v4l2_subdev *sd, 1192static int s5c73m3_enum_mbus_code(struct v4l2_subdev *sd,
1192 struct v4l2_subdev_fh *fh, 1193 struct v4l2_subdev_pad_config *cfg,
1193 struct v4l2_subdev_mbus_code_enum *code) 1194 struct v4l2_subdev_mbus_code_enum *code)
1194{ 1195{
1195 static const int codes[] = { 1196 static const int codes[] = {
@@ -1205,7 +1206,7 @@ static int s5c73m3_enum_mbus_code(struct v4l2_subdev *sd,
1205} 1206}
1206 1207
1207static int s5c73m3_oif_enum_mbus_code(struct v4l2_subdev *sd, 1208static int s5c73m3_oif_enum_mbus_code(struct v4l2_subdev *sd,
1208 struct v4l2_subdev_fh *fh, 1209 struct v4l2_subdev_pad_config *cfg,
1209 struct v4l2_subdev_mbus_code_enum *code) 1210 struct v4l2_subdev_mbus_code_enum *code)
1210{ 1211{
1211 int ret; 1212 int ret;
@@ -1220,7 +1221,7 @@ static int s5c73m3_oif_enum_mbus_code(struct v4l2_subdev *sd,
1220} 1221}
1221 1222
1222static int s5c73m3_enum_frame_size(struct v4l2_subdev *sd, 1223static int s5c73m3_enum_frame_size(struct v4l2_subdev *sd,
1223 struct v4l2_subdev_fh *fh, 1224 struct v4l2_subdev_pad_config *cfg,
1224 struct v4l2_subdev_frame_size_enum *fse) 1225 struct v4l2_subdev_frame_size_enum *fse)
1225{ 1226{
1226 int idx; 1227 int idx;
@@ -1247,9 +1248,10 @@ static int s5c73m3_enum_frame_size(struct v4l2_subdev *sd,
1247} 1248}
1248 1249
1249static int s5c73m3_oif_enum_frame_size(struct v4l2_subdev *sd, 1250static int s5c73m3_oif_enum_frame_size(struct v4l2_subdev *sd,
1250 struct v4l2_subdev_fh *fh, 1251 struct v4l2_subdev_pad_config *cfg,
1251 struct v4l2_subdev_frame_size_enum *fse) 1252 struct v4l2_subdev_frame_size_enum *fse)
1252{ 1253{
1254 struct s5c73m3 *state = oif_sd_to_s5c73m3(sd);
1253 int idx; 1255 int idx;
1254 1256
1255 if (fse->pad == OIF_SOURCE_PAD) { 1257 if (fse->pad == OIF_SOURCE_PAD) {
@@ -1259,11 +1261,25 @@ static int s5c73m3_oif_enum_frame_size(struct v4l2_subdev *sd,
1259 switch (fse->code) { 1261 switch (fse->code) {
1260 case S5C73M3_JPEG_FMT: 1262 case S5C73M3_JPEG_FMT:
1261 case S5C73M3_ISP_FMT: { 1263 case S5C73M3_ISP_FMT: {
1262 struct v4l2_mbus_framefmt *mf = 1264 unsigned w, h;
1263 v4l2_subdev_get_try_format(fh, OIF_ISP_PAD); 1265
1266 if (fse->which == V4L2_SUBDEV_FORMAT_TRY) {
1267 struct v4l2_mbus_framefmt *mf;
1268
1269 mf = v4l2_subdev_get_try_format(sd, cfg,
1270 OIF_ISP_PAD);
1271
1272 w = mf->width;
1273 h = mf->height;
1274 } else {
1275 const struct s5c73m3_frame_size *fs;
1264 1276
1265 fse->max_width = fse->min_width = mf->width; 1277 fs = state->oif_pix_size[RES_ISP];
1266 fse->max_height = fse->min_height = mf->height; 1278 w = fs->width;
1279 h = fs->height;
1280 }
1281 fse->max_width = fse->min_width = w;
1282 fse->max_height = fse->min_height = h;
1267 return 0; 1283 return 0;
1268 } 1284 }
1269 default: 1285 default:
@@ -1306,11 +1322,11 @@ static int s5c73m3_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
1306{ 1322{
1307 struct v4l2_mbus_framefmt *mf; 1323 struct v4l2_mbus_framefmt *mf;
1308 1324
1309 mf = v4l2_subdev_get_try_format(fh, S5C73M3_ISP_PAD); 1325 mf = v4l2_subdev_get_try_format(sd, fh->pad, S5C73M3_ISP_PAD);
1310 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_isp_resolutions[1], 1326 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_isp_resolutions[1],
1311 S5C73M3_ISP_FMT); 1327 S5C73M3_ISP_FMT);
1312 1328
1313 mf = v4l2_subdev_get_try_format(fh, S5C73M3_JPEG_PAD); 1329 mf = v4l2_subdev_get_try_format(sd, fh->pad, S5C73M3_JPEG_PAD);
1314 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_jpeg_resolutions[1], 1330 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_jpeg_resolutions[1],
1315 S5C73M3_JPEG_FMT); 1331 S5C73M3_JPEG_FMT);
1316 1332
@@ -1321,15 +1337,15 @@ static int s5c73m3_oif_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
1321{ 1337{
1322 struct v4l2_mbus_framefmt *mf; 1338 struct v4l2_mbus_framefmt *mf;
1323 1339
1324 mf = v4l2_subdev_get_try_format(fh, OIF_ISP_PAD); 1340 mf = v4l2_subdev_get_try_format(sd, fh->pad, OIF_ISP_PAD);
1325 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_isp_resolutions[1], 1341 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_isp_resolutions[1],
1326 S5C73M3_ISP_FMT); 1342 S5C73M3_ISP_FMT);
1327 1343
1328 mf = v4l2_subdev_get_try_format(fh, OIF_JPEG_PAD); 1344 mf = v4l2_subdev_get_try_format(sd, fh->pad, OIF_JPEG_PAD);
1329 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_jpeg_resolutions[1], 1345 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_jpeg_resolutions[1],
1330 S5C73M3_JPEG_FMT); 1346 S5C73M3_JPEG_FMT);
1331 1347
1332 mf = v4l2_subdev_get_try_format(fh, OIF_SOURCE_PAD); 1348 mf = v4l2_subdev_get_try_format(sd, fh->pad, OIF_SOURCE_PAD);
1333 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_isp_resolutions[1], 1349 s5c73m3_fill_mbus_fmt(mf, &s5c73m3_isp_resolutions[1],
1334 S5C73M3_ISP_FMT); 1350 S5C73M3_ISP_FMT);
1335 return 0; 1351 return 0;
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-spi.c b/drivers/media/i2c/s5c73m3/s5c73m3-spi.c
index f60b265b4da1..63eb19093381 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-spi.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-spi.c
@@ -52,7 +52,7 @@ static int spi_xmit(struct spi_device *spi_dev, void *addr, const int len,
52 xfer.rx_buf = addr; 52 xfer.rx_buf = addr;
53 53
54 if (spi_dev == NULL) { 54 if (spi_dev == NULL) {
55 dev_err(&spi_dev->dev, "SPI device is uninitialized\n"); 55 pr_err("SPI device is uninitialized\n");
56 return -ENODEV; 56 return -ENODEV;
57 } 57 }
58 58