Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: davinci/vpfe_capture.c: drop unused format descriptions

Simplify vpfe_pixel_format to just contain the pixelformat and bpp fields.
All others are unused.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
ee484875 610fce53

+10 -43
+9 -42
drivers/media/platform/davinci/vpfe_capture.c
··· 119 119 /* Used when raw Bayer image from ccdc is directly captured to SDRAM */ 120 120 static const struct vpfe_pixel_format vpfe_pix_fmts[] = { 121 121 { 122 - .fmtdesc = { 123 - .index = 0, 124 - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, 125 - .description = "Bayer GrRBGb 8bit A-Law compr.", 126 - .pixelformat = V4L2_PIX_FMT_SBGGR8, 127 - }, 122 + .pixelformat = V4L2_PIX_FMT_SBGGR8, 128 123 .bpp = 1, 129 124 }, 130 125 { 131 - .fmtdesc = { 132 - .index = 1, 133 - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, 134 - .description = "Bayer GrRBGb - 16bit", 135 - .pixelformat = V4L2_PIX_FMT_SBGGR16, 136 - }, 126 + .pixelformat = V4L2_PIX_FMT_SBGGR16, 137 127 .bpp = 2, 138 128 }, 139 129 { 140 - .fmtdesc = { 141 - .index = 2, 142 - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, 143 - .description = "Bayer GrRBGb 8bit DPCM compr.", 144 - .pixelformat = V4L2_PIX_FMT_SGRBG10DPCM8, 145 - }, 130 + .pixelformat = V4L2_PIX_FMT_SGRBG10DPCM8, 146 131 .bpp = 1, 147 132 }, 148 133 { 149 - .fmtdesc = { 150 - .index = 3, 151 - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, 152 - .description = "YCbCr 4:2:2 Interleaved UYVY", 153 - .pixelformat = V4L2_PIX_FMT_UYVY, 154 - }, 134 + .pixelformat = V4L2_PIX_FMT_UYVY, 155 135 .bpp = 2, 156 136 }, 157 137 { 158 - .fmtdesc = { 159 - .index = 4, 160 - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, 161 - .description = "YCbCr 4:2:2 Interleaved YUYV", 162 - .pixelformat = V4L2_PIX_FMT_YUYV, 163 - }, 138 + .pixelformat = V4L2_PIX_FMT_YUYV, 164 139 .bpp = 2, 165 140 }, 166 141 { 167 - .fmtdesc = { 168 - .index = 5, 169 - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, 170 - .description = "Y/CbCr 4:2:0 - Semi planar", 171 - .pixelformat = V4L2_PIX_FMT_NV12, 172 - }, 142 + .pixelformat = V4L2_PIX_FMT_NV12, 173 143 .bpp = 1, 174 144 }, 175 145 }; ··· 153 183 int i; 154 184 155 185 for (i = 0; i < ARRAY_SIZE(vpfe_pix_fmts); i++) { 156 - if (pix_format == vpfe_pix_fmts[i].fmtdesc.pixelformat) 186 + if (pix_format == vpfe_pix_fmts[i].pixelformat) 157 187 return &vpfe_pix_fmts[i]; 158 188 } 159 189 return NULL; ··· 752 782 temp = 0; 753 783 found = 0; 754 784 while (ccdc_dev->hw_ops.enum_pix(&pix, temp) >= 0) { 755 - if (vpfe_pix_fmt->fmtdesc.pixelformat == pix) { 785 + if (vpfe_pix_fmt->pixelformat == pix) { 756 786 found = 1; 757 787 break; 758 788 } ··· 869 899 { 870 900 struct vpfe_device *vpfe_dev = video_drvdata(file); 871 901 const struct vpfe_pixel_format *pix_fmt; 872 - int temp_index; 873 902 u32 pix; 874 903 875 904 v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_enum_fmt_vid_cap\n"); ··· 879 910 /* Fill in the information about format */ 880 911 pix_fmt = vpfe_lookup_pix_format(pix); 881 912 if (pix_fmt) { 882 - temp_index = fmt->index; 883 - *fmt = pix_fmt->fmtdesc; 884 - fmt->index = temp_index; 913 + fmt->pixelformat = fmt->pixelformat; 885 914 return 0; 886 915 } 887 916 return -EINVAL;
+1 -1
include/media/davinci/vpfe_capture.h
··· 32 32 #define CAPTURE_DRV_NAME "vpfe-capture" 33 33 34 34 struct vpfe_pixel_format { 35 - struct v4l2_fmtdesc fmtdesc; 35 + u32 pixelformat; 36 36 /* bytes per pixel */ 37 37 int bpp; 38 38 };