From a47959fbd5808890963fe8475a7c436bfd60d8c3 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 26 Sep 2014 15:37:38 -0300 Subject: [media] Documentation: FE_SET_PROPERTY requires R/W FE_SET_PROPERTY requires to open the devnode on R/W mode, or otherwise it will fail. Document it. Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/dvb/dvbproperty.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml index 948ddaab592e..3018564ddfd9 100644 --- a/Documentation/DocBook/media/dvb/dvbproperty.xml +++ b/Documentation/DocBook/media/dvb/dvbproperty.xml @@ -120,8 +120,8 @@ struct dtv_properties { -This ioctl call sets one or more frontend properties. This call only - requires read-only access to the device. +This ioctl call sets one or more frontend properties. This call + requires read/write access to the device. SYNOPSIS -- cgit v1.2.3-59-g8ed1b From 8d6d514941d37bd3625bc8ab99a042fbccdaa0da Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 3 Nov 2014 11:35:01 -0200 Subject: [media] Update Documentation cardlist Some new devices got added. Update cardlists. Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/CARDLIST.cx23885 | 2 ++ Documentation/video4linux/CARDLIST.em28xx | 1 + Documentation/video4linux/CARDLIST.saa7134 | 1 + 3 files changed, 4 insertions(+) (limited to 'Documentation') diff --git a/Documentation/video4linux/CARDLIST.cx23885 b/Documentation/video4linux/CARDLIST.cx23885 index a74eeccfe700..4c84ec853265 100644 --- a/Documentation/video4linux/CARDLIST.cx23885 +++ b/Documentation/video4linux/CARDLIST.cx23885 @@ -43,3 +43,5 @@ 42 -> Leadtek Winfast PxPVR2200 [107d:6f21] 43 -> Hauppauge ImpactVCB-e [0070:7133] 44 -> DViCO FusionHDTV DVB-T Dual Express2 [18ac:db98] + 45 -> DVBSky T9580 [4254:9580] + 46 -> DVBSky T980C [4254:980c] diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx index bc3351bb48b4..3700edb81db2 100644 --- a/Documentation/video4linux/CARDLIST.em28xx +++ b/Documentation/video4linux/CARDLIST.em28xx @@ -93,3 +93,4 @@ 92 -> PCTV DVB-S2 Stick (461e) (em28178) 93 -> KWorld USB ATSC TV Stick UB435-Q V3 (em2874) [1b80:e34c] 94 -> PCTV tripleStick (292e) (em28178) + 95 -> Leadtek VC100 (em2861) [0413:6f07] diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 8df17d063499..a93d86455233 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 @@ -191,3 +191,4 @@ 190 -> Asus My Cinema PS3-100 [1043:48cd] 191 -> Hawell HW-9004V1 192 -> AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055] +193 -> WIS Voyager or compatible [1905:7007] -- cgit v1.2.3-59-g8ed1b From 9fd1f310a13ab16034cbda4f874eafadc8f80caf Mon Sep 17 00:00:00 2001 From: Simon Farnsworth Date: Fri, 31 Oct 2014 12:48:42 -0300 Subject: [media] DocBook media: Clarify V4L2_FIELD_ANY for drivers Documentation for enum v4l2_field did not make it clear that V4L2_FIELD_ANY is only acceptable as input to the kernel, not as a response from the driver. Make it clear, to stop userspace developers like me assuming it can be returned by the driver. Signed-off-by: Simon Farnsworth Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/v4l/io.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/media/v4l/io.xml b/Documentation/DocBook/media/v4l/io.xml index e5e8325aa3d7..1c17f802b471 100644 --- a/Documentation/DocBook/media/v4l/io.xml +++ b/Documentation/DocBook/media/v4l/io.xml @@ -1422,7 +1422,10 @@ one of the V4L2_FIELD_NONE, V4L2_FIELD_BOTTOM, or V4L2_FIELD_INTERLACED formats is acceptable. Drivers choose depending on hardware capabilities or e. g. the -requested image size, and return the actual field order. &v4l2-buffer; +requested image size, and return the actual field order. Drivers must +never return V4L2_FIELD_ANY. If multiple +field orders are possible the driver must choose one of the possible +field orders during &VIDIOC-S-FMT; or &VIDIOC-TRY-FMT;. &v4l2-buffer; field can never be V4L2_FIELD_ANY. -- cgit v1.2.3-59-g8ed1b From 55b8cbf75fe714f283073048b560d30a0af13473 Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Mon, 10 Nov 2014 14:28:27 -0300 Subject: [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed them with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Update the v4l documentation accordingly. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/v4l/subdev-formats.xml | 308 ++++++++++----------- 1 file changed, 154 insertions(+), 154 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml index b2d5a0363cba..18730b96e1e6 100644 --- a/Documentation/DocBook/media/v4l/subdev-formats.xml +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml @@ -86,7 +86,7 @@ green and 5-bit blue values padded on the high bit, transferred as 2 8-bit samples per pixel with the most significant bits (padding, red and half of the green value) transferred first will be named - V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE. + MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE. The following tables list existing packed RGB formats. @@ -176,8 +176,8 @@ - - V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE + + MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001 &dash-ent-24; @@ -204,8 +204,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE + + MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002 &dash-ent-24; @@ -232,8 +232,8 @@ r1 r0 - - V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE + + MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003 &dash-ent-24; @@ -260,8 +260,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE + + MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004 &dash-ent-24; @@ -288,8 +288,8 @@ g4 g3 - - V4L2_MBUS_FMT_BGR565_2X8_BE + + MEDIA_BUS_FMT_BGR565_2X8_BE 0x1005 &dash-ent-24; @@ -316,8 +316,8 @@ r1 r0 - - V4L2_MBUS_FMT_BGR565_2X8_LE + + MEDIA_BUS_FMT_BGR565_2X8_LE 0x1006 &dash-ent-24; @@ -344,8 +344,8 @@ g4 g3 - - V4L2_MBUS_FMT_RGB565_2X8_BE + + MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007 &dash-ent-24; @@ -372,8 +372,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB565_2X8_LE + + MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008 &dash-ent-24; @@ -400,8 +400,8 @@ g4 g3 - - V4L2_MBUS_FMT_RGB666_1X18 + + MEDIA_BUS_FMT_RGB666_1X18 0x1009 &dash-ent-14; @@ -424,8 +424,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_1X24 + + MEDIA_BUS_FMT_RGB888_1X24 0x100a &dash-ent-8; @@ -454,8 +454,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_2X12_BE + + MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b &dash-ent-20; @@ -490,8 +490,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_2X12_LE + + MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c &dash-ent-20; @@ -526,8 +526,8 @@ g5 g4 - - V4L2_MBUS_FMT_ARGB888_1X32 + + MEDIA_BUS_FMT_ARGB888_1X32 0x100d a7 @@ -600,7 +600,7 @@ For instance, a format with uncompressed 10-bit Bayer components arranged in a red, green, green, blue pattern transferred as 2 8-bit samples per pixel with the least significant bits transferred first will - be named V4L2_MBUS_FMT_SRGGB10_2X8_PADHI_LE. + be named MEDIA_BUS_FMT_SRGGB10_2X8_PADHI_LE.
@@ -663,8 +663,8 @@ - - V4L2_MBUS_FMT_SBGGR8_1X8 + + MEDIA_BUS_FMT_SBGGR8_1X8 0x3001 - @@ -680,8 +680,8 @@ b1 b0 - - V4L2_MBUS_FMT_SGBRG8_1X8 + + MEDIA_BUS_FMT_SGBRG8_1X8 0x3013 - @@ -697,8 +697,8 @@ g1 g0 - - V4L2_MBUS_FMT_SGRBG8_1X8 + + MEDIA_BUS_FMT_SGRBG8_1X8 0x3002 - @@ -714,8 +714,8 @@ g1 g0 - - V4L2_MBUS_FMT_SRGGB8_1X8 + + MEDIA_BUS_FMT_SRGGB8_1X8 0x3014 - @@ -731,8 +731,8 @@ r1 r0 - - V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 + + MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8 0x3015 - @@ -748,8 +748,8 @@ b1 b0 - - V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8 + + MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8 0x3016 - @@ -765,8 +765,8 @@ g1 g0 - - V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8 + + MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8 0x3017 - @@ -782,8 +782,8 @@ g1 g0 - - V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8 + + MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8 0x3018 - @@ -799,8 +799,8 @@ r1 r0 - - V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 + + MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8 0x300b - @@ -816,8 +816,8 @@ b1 b0 - - V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 + + MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8 0x300c - @@ -833,8 +833,8 @@ g1 g0 - - V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 + + MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8 0x3009 - @@ -850,8 +850,8 @@ g1 g0 - - V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8 + + MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8 0x300d - @@ -867,8 +867,8 @@ r1 r0 - - V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE + + MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE 0x3003 - @@ -901,8 +901,8 @@ b1 b0 - - V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE + + MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE 0x3004 - @@ -935,8 +935,8 @@ b9 b8 - - V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE + + MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE 0x3005 - @@ -969,8 +969,8 @@ 0 0 - - V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE + + MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE 0x3006 - @@ -1003,8 +1003,8 @@ b3 b2 - - V4L2_MBUS_FMT_SBGGR10_1X10 + + MEDIA_BUS_FMT_SBGGR10_1X10 0x3007 - @@ -1020,8 +1020,8 @@ b1 b0 - - V4L2_MBUS_FMT_SGBRG10_1X10 + + MEDIA_BUS_FMT_SGBRG10_1X10 0x300e - @@ -1037,8 +1037,8 @@ g1 g0 - - V4L2_MBUS_FMT_SGRBG10_1X10 + + MEDIA_BUS_FMT_SGRBG10_1X10 0x300a - @@ -1054,8 +1054,8 @@ g1 g0 - - V4L2_MBUS_FMT_SRGGB10_1X10 + + MEDIA_BUS_FMT_SRGGB10_1X10 0x300f - @@ -1071,8 +1071,8 @@ r1 r0 - - V4L2_MBUS_FMT_SBGGR12_1X12 + + MEDIA_BUS_FMT_SBGGR12_1X12 0x3008 b11 @@ -1088,8 +1088,8 @@ b1 b0 - - V4L2_MBUS_FMT_SGBRG12_1X12 + + MEDIA_BUS_FMT_SGBRG12_1X12 0x3010 g11 @@ -1105,8 +1105,8 @@ g1 g0 - - V4L2_MBUS_FMT_SGRBG12_1X12 + + MEDIA_BUS_FMT_SGRBG12_1X12 0x3011 g11 @@ -1122,8 +1122,8 @@ g1 g0 - - V4L2_MBUS_FMT_SRGGB12_1X12 + + MEDIA_BUS_FMT_SRGGB12_1X12 0x3012 r11 @@ -1175,7 +1175,7 @@ For instance, a format where pixels are encoded as 8-bit YUV values downsampled to 4:2:2 and transferred as 2 8-bit bus samples per pixel in the - U, Y, V, Y order will be named V4L2_MBUS_FMT_UYVY8_2X8. + U, Y, V, Y order will be named MEDIA_BUS_FMT_UYVY8_2X8. lists existing packed YUV @@ -1280,8 +1280,8 @@ - - V4L2_MBUS_FMT_Y8_1X8 + + MEDIA_BUS_FMT_Y8_1X8 0x2001 &dash-ent-24; @@ -1294,8 +1294,8 @@ y1 y0 - - V4L2_MBUS_FMT_UV8_1X8 + + MEDIA_BUS_FMT_UV8_1X8 0x2015 &dash-ent-24; @@ -1322,8 +1322,8 @@ v1 v0 - - V4L2_MBUS_FMT_UYVY8_1_5X8 + + MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002 &dash-ent-24; @@ -1406,8 +1406,8 @@ y1 y0 - - V4L2_MBUS_FMT_VYUY8_1_5X8 + + MEDIA_BUS_FMT_VYUY8_1_5X8 0x2003 &dash-ent-24; @@ -1490,8 +1490,8 @@ y1 y0 - - V4L2_MBUS_FMT_YUYV8_1_5X8 + + MEDIA_BUS_FMT_YUYV8_1_5X8 0x2004 &dash-ent-24; @@ -1574,8 +1574,8 @@ v1 v0 - - V4L2_MBUS_FMT_YVYU8_1_5X8 + + MEDIA_BUS_FMT_YVYU8_1_5X8 0x2005 &dash-ent-24; @@ -1658,8 +1658,8 @@ u1 u0 - - V4L2_MBUS_FMT_UYVY8_2X8 + + MEDIA_BUS_FMT_UYVY8_2X8 0x2006 &dash-ent-24; @@ -1714,8 +1714,8 @@ y1 y0 - - V4L2_MBUS_FMT_VYUY8_2X8 + + MEDIA_BUS_FMT_VYUY8_2X8 0x2007 &dash-ent-24; @@ -1770,8 +1770,8 @@ y1 y0 - - V4L2_MBUS_FMT_YUYV8_2X8 + + MEDIA_BUS_FMT_YUYV8_2X8 0x2008 &dash-ent-24; @@ -1826,8 +1826,8 @@ v1 v0 - - V4L2_MBUS_FMT_YVYU8_2X8 + + MEDIA_BUS_FMT_YVYU8_2X8 0x2009 &dash-ent-24; @@ -1882,8 +1882,8 @@ u1 u0 - - V4L2_MBUS_FMT_Y10_1X10 + + MEDIA_BUS_FMT_Y10_1X10 0x200a &dash-ent-22; @@ -1898,8 +1898,8 @@ y1 y0 - - V4L2_MBUS_FMT_UYVY10_2X10 + + MEDIA_BUS_FMT_UYVY10_2X10 0x2018 &dash-ent-22; @@ -1962,8 +1962,8 @@ y1 y0 - - V4L2_MBUS_FMT_VYUY10_2X10 + + MEDIA_BUS_FMT_VYUY10_2X10 0x2019 &dash-ent-22; @@ -2026,8 +2026,8 @@ y1 y0 - - V4L2_MBUS_FMT_YUYV10_2X10 + + MEDIA_BUS_FMT_YUYV10_2X10 0x200b &dash-ent-22; @@ -2090,8 +2090,8 @@ v1 v0 - - V4L2_MBUS_FMT_YVYU10_2X10 + + MEDIA_BUS_FMT_YVYU10_2X10 0x200c &dash-ent-22; @@ -2154,8 +2154,8 @@ u1 u0 - - V4L2_MBUS_FMT_Y12_1X12 + + MEDIA_BUS_FMT_Y12_1X12 0x2013 &dash-ent-20; @@ -2172,8 +2172,8 @@ y1 y0 - - V4L2_MBUS_FMT_UYVY8_1X16 + + MEDIA_BUS_FMT_UYVY8_1X16 0x200f &dash-ent-16; @@ -2216,8 +2216,8 @@ y1 y0 - - V4L2_MBUS_FMT_VYUY8_1X16 + + MEDIA_BUS_FMT_VYUY8_1X16 0x2010 &dash-ent-16; @@ -2260,8 +2260,8 @@ y1 y0 - - V4L2_MBUS_FMT_YUYV8_1X16 + + MEDIA_BUS_FMT_YUYV8_1X16 0x2011 &dash-ent-16; @@ -2304,8 +2304,8 @@ v1 v0 - - V4L2_MBUS_FMT_YVYU8_1X16 + + MEDIA_BUS_FMT_YVYU8_1X16 0x2012 &dash-ent-16; @@ -2348,8 +2348,8 @@ u1 u0 - - V4L2_MBUS_FMT_YDYUYDYV8_1X16 + + MEDIA_BUS_FMT_YDYUYDYV8_1X16 0x2014 &dash-ent-16; @@ -2436,8 +2436,8 @@ v1 v0 - - V4L2_MBUS_FMT_UYVY10_1X20 + + MEDIA_BUS_FMT_UYVY10_1X20 0x201a &dash-ent-12; @@ -2488,8 +2488,8 @@ y1 y0 - - V4L2_MBUS_FMT_VYUY10_1X20 + + MEDIA_BUS_FMT_VYUY10_1X20 0x201b &dash-ent-12; @@ -2540,8 +2540,8 @@ y1 y0 - - V4L2_MBUS_FMT_YUYV10_1X20 + + MEDIA_BUS_FMT_YUYV10_1X20 0x200d &dash-ent-12; @@ -2592,8 +2592,8 @@ v1 v0 - - V4L2_MBUS_FMT_YVYU10_1X20 + + MEDIA_BUS_FMT_YVYU10_1X20 0x200e &dash-ent-12; @@ -2644,8 +2644,8 @@ u1 u0 - - V4L2_MBUS_FMT_YUV10_1X30 + + MEDIA_BUS_FMT_YUV10_1X30 0x2016 - @@ -2681,8 +2681,8 @@ v1 v0 - - V4L2_MBUS_FMT_AYUV8_1X32 + + MEDIA_BUS_FMT_AYUV8_1X32 0x2017 a7 @@ -2718,8 +2718,8 @@ v1 v0 - - V4L2_MBUS_FMT_UYVY12_2X12 + + MEDIA_BUS_FMT_UYVY12_2X12 0x201c &dash-ent-20; @@ -2790,8 +2790,8 @@ y1 y0 - - V4L2_MBUS_FMT_VYUY12_2X12 + + MEDIA_BUS_FMT_VYUY12_2X12 0x201d &dash-ent-20; @@ -2862,8 +2862,8 @@ y1 y0 - - V4L2_MBUS_FMT_YUYV12_2X12 + + MEDIA_BUS_FMT_YUYV12_2X12 0x201e &dash-ent-20; @@ -2934,8 +2934,8 @@ v1 v0 - - V4L2_MBUS_FMT_YVYU12_2X12 + + MEDIA_BUS_FMT_YVYU12_2X12 0x201f &dash-ent-20; @@ -3006,8 +3006,8 @@ u1 u0 - - V4L2_MBUS_FMT_UYVY12_1X24 + + MEDIA_BUS_FMT_UYVY12_1X24 0x2020 &dash-ent-8; @@ -3066,8 +3066,8 @@ y1 y0 - - V4L2_MBUS_FMT_VYUY12_1X24 + + MEDIA_BUS_FMT_VYUY12_1X24 0x2021 &dash-ent-8; @@ -3126,8 +3126,8 @@ y1 y0 - - V4L2_MBUS_FMT_YUYV12_1X24 + + MEDIA_BUS_FMT_YUYV12_1X24 0x2022 &dash-ent-8; @@ -3186,8 +3186,8 @@ v1 v0 - - V4L2_MBUS_FMT_YVYU12_1X24 + + MEDIA_BUS_FMT_YVYU12_1X24 0x2023 &dash-ent-8; @@ -3366,8 +3366,8 @@ - - V4L2_MBUS_FMT_AHSV8888_1X32 + + MEDIA_BUS_FMT_AHSV8888_1X32 0x6001 a7 @@ -3422,7 +3422,7 @@ For instance, for a JPEG baseline process and an 8-bit bus width - the format will be named V4L2_MBUS_FMT_JPEG_1X8. + the format will be named MEDIA_BUS_FMT_JPEG_1X8. The following table lists existing JPEG compressed formats. @@ -3441,8 +3441,8 @@ - - V4L2_MBUS_FMT_JPEG_1X8 + + MEDIA_BUS_FMT_JPEG_1X8 0x4001 Besides of its usage for the parallel bus this format is recommended for transmission of JPEG data over MIPI CSI bus @@ -3484,8 +3484,8 @@ interface and may change in the future. - - V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 + + MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8 0x5001 Interleaved raw UYVY and JPEG image format with embedded -- cgit v1.2.3-59-g8ed1b From 27ffaeb0ab160852c87e2dfa505594020e9a3a06 Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Mon, 10 Nov 2014 14:28:31 -0300 Subject: [media] platform: Make use of media_bus_format enum In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all platform drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus Acked-by: Sekhar Nori Acked-by: Lad, Prabhakar Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/soc-camera.txt | 2 +- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 4 +- arch/arm/mach-davinci/dm355.c | 7 +- arch/arm/mach-davinci/dm365.c | 7 +- arch/arm/mach-shmobile/board-mackerel.c | 2 +- arch/sh/boards/mach-ap325rxa/setup.c | 2 +- drivers/media/platform/blackfin/bfin_capture.c | 14 +-- drivers/media/platform/davinci/vpbe.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 4 +- drivers/media/platform/exynos-gsc/gsc-core.c | 8 +- drivers/media/platform/exynos-gsc/gsc-core.h | 2 +- drivers/media/platform/exynos4-is/fimc-capture.c | 2 +- drivers/media/platform/exynos4-is/fimc-core.c | 14 +-- drivers/media/platform/exynos4-is/fimc-core.h | 4 +- drivers/media/platform/exynos4-is/fimc-isp.c | 16 +-- drivers/media/platform/exynos4-is/fimc-lite-reg.c | 26 ++--- drivers/media/platform/exynos4-is/fimc-lite.c | 14 +-- drivers/media/platform/exynos4-is/fimc-reg.c | 14 +-- drivers/media/platform/exynos4-is/mipi-csis.c | 14 +-- drivers/media/platform/marvell-ccic/mcam-core.c | 21 ++-- drivers/media/platform/marvell-ccic/mcam-core.h | 2 +- drivers/media/platform/omap3isp/ispccdc.c | 112 ++++++++++----------- drivers/media/platform/omap3isp/ispccp2.c | 18 ++-- drivers/media/platform/omap3isp/ispcsi2.c | 42 ++++---- drivers/media/platform/omap3isp/isppreview.c | 60 ++++++----- drivers/media/platform/omap3isp/ispresizer.c | 19 ++-- drivers/media/platform/omap3isp/ispvideo.c | 95 +++++++++-------- drivers/media/platform/omap3isp/ispvideo.h | 10 +- drivers/media/platform/s3c-camif/camif-capture.c | 10 +- drivers/media/platform/s3c-camif/camif-regs.c | 8 +- drivers/media/platform/s5p-tv/hdmi_drv.c | 2 +- drivers/media/platform/s5p-tv/sdo_drv.c | 2 +- drivers/media/platform/sh_vou.c | 8 +- drivers/media/platform/soc_camera/atmel-isi.c | 22 ++-- drivers/media/platform/soc_camera/mx2_camera.c | 26 +++-- drivers/media/platform/soc_camera/mx3_camera.c | 6 +- drivers/media/platform/soc_camera/omap1_camera.c | 36 +++---- drivers/media/platform/soc_camera/pxa_camera.c | 16 +-- drivers/media/platform/soc_camera/rcar_vin.c | 14 +-- .../platform/soc_camera/sh_mobile_ceu_camera.c | 20 ++-- drivers/media/platform/soc_camera/sh_mobile_csi2.c | 38 +++---- drivers/media/platform/soc_camera/soc_camera.c | 2 +- .../platform/soc_camera/soc_camera_platform.c | 2 +- drivers/media/platform/soc_camera/soc_mediabus.c | 78 +++++++------- drivers/media/platform/via-camera.c | 8 +- drivers/media/platform/vsp1/vsp1_bru.c | 14 +-- drivers/media/platform/vsp1/vsp1_hsit.c | 12 +-- drivers/media/platform/vsp1/vsp1_lif.c | 10 +- drivers/media/platform/vsp1/vsp1_lut.c | 14 +-- drivers/media/platform/vsp1/vsp1_rwpf.c | 10 +- drivers/media/platform/vsp1/vsp1_sru.c | 12 +-- drivers/media/platform/vsp1/vsp1_uds.c | 10 +- drivers/media/platform/vsp1/vsp1_video.c | 42 ++++---- include/media/davinci/vpbe.h | 2 +- include/media/davinci/vpbe_venc.h | 5 +- include/media/exynos-fimc.h | 2 +- include/media/soc_camera.h | 2 +- include/media/soc_mediabus.h | 6 +- 59 files changed, 483 insertions(+), 495 deletions(-) (limited to 'Documentation') diff --git a/Documentation/video4linux/soc-camera.txt b/Documentation/video4linux/soc-camera.txt index daa9e2ac162c..84f41cf1f3e8 100644 --- a/Documentation/video4linux/soc-camera.txt +++ b/Documentation/video4linux/soc-camera.txt @@ -151,7 +151,7 @@ they are transferred over a media bus. Soc-camera provides support to conveniently manage these formats. A table of standard transformations is maintained by soc-camera core, which describes, what FOURCC pixel format will be obtained, if a media-bus pixel format is stored in memory according to -certain rules. E.g. if V4L2_MBUS_FMT_YUYV8_2X8 data is sampled with 8 bits per +certain rules. E.g. if MEDIA_BUS_FMT_YUYV8_2X8 data is sampled with 8 bits per sample and stored in memory in the little-endian order with no gaps between bytes, data in memory will represent the V4L2_PIX_FMT_YUYV FOURCC format. These standard transformations will be used by soc-camera or by camera host drivers to diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index 06d63d5651f3..b46b4d25f93e 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c @@ -294,7 +294,7 @@ static struct vpbe_output dm355evm_vpbe_outputs[] = { .default_mode = "ntsc", .num_modes = ARRAY_SIZE(dm355evm_enc_preset_timing), .modes = dm355evm_enc_preset_timing, - .if_params = V4L2_MBUS_FMT_FIXED, + .if_params = MEDIA_BUS_FMT_FIXED, }, }; diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index e08a8684ead2..a756003595e9 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -485,7 +485,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = { .default_mode = "ntsc", .num_modes = ARRAY_SIZE(dm365evm_enc_std_timing), .modes = dm365evm_enc_std_timing, - .if_params = V4L2_MBUS_FMT_FIXED, + .if_params = MEDIA_BUS_FMT_FIXED, }, { .output = { @@ -498,7 +498,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = { .default_mode = "480p59_94", .num_modes = ARRAY_SIZE(dm365evm_enc_preset_timing), .modes = dm365evm_enc_preset_timing, - .if_params = V4L2_MBUS_FMT_FIXED, + .if_params = MEDIA_BUS_FMT_FIXED, }, }; diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 2f3ed3a58d57..9cbeda798584 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -785,14 +785,13 @@ static struct resource dm355_v4l2_disp_resources[] = { }, }; -static int dm355_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type, - int field) +static int dm355_vpbe_setup_pinmux(u32 if_type, int field) { switch (if_type) { - case V4L2_MBUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: davinci_cfg_reg(DM355_VOUT_FIELD_G70); break; - case V4L2_MBUS_FMT_YUYV10_1X20: + case MEDIA_BUS_FMT_YUYV10_1X20: if (field) davinci_cfg_reg(DM355_VOUT_FIELD); else diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 0ae8114f5cc9..e3a3c54b6832 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -1306,16 +1306,15 @@ static struct resource dm365_v4l2_disp_resources[] = { }, }; -static int dm365_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type, - int field) +static int dm365_vpbe_setup_pinmux(u32 if_type, int field) { switch (if_type) { - case V4L2_MBUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: davinci_cfg_reg(DM365_VOUT_FIELD_G81); davinci_cfg_reg(DM365_VOUT_COUTL_EN); davinci_cfg_reg(DM365_VOUT_COUTH_EN); break; - case V4L2_MBUS_FMT_YUYV10_1X20: + case MEDIA_BUS_FMT_YUYV10_1X20: if (field) davinci_cfg_reg(DM365_VOUT_FIELD); else diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index ca5d34b92aa7..a673624878d1 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -1153,7 +1153,7 @@ static struct soc_camera_platform_info camera_info = { .format_name = "UYVY", .format_depth = 16, .format = { - .code = V4L2_MBUS_FMT_UYVY8_2X8, + .code = MEDIA_BUS_FMT_UYVY8_2X8, .colorspace = V4L2_COLORSPACE_SMPTE170M, .field = V4L2_FIELD_NONE, .width = 640, diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index 5620e33c18a0..d4b01d4cc102 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c @@ -338,7 +338,7 @@ static struct soc_camera_platform_info camera_info = { .format_name = "UYVY", .format_depth = 16, .format = { - .code = V4L2_MBUS_FMT_UYVY8_2X8, + .code = MEDIA_BUS_FMT_UYVY8_2X8, .colorspace = V4L2_COLORSPACE_SMPTE170M, .field = V4L2_FIELD_NONE, .width = 640, diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index 9b5daa65841c..b3345b37bb10 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -49,7 +49,7 @@ struct bcap_format { char *desc; u32 pixelformat; - enum v4l2_mbus_pixelcode mbus_code; + u32 mbus_code; int bpp; /* bits per pixel */ int dlen; /* data length for ppi in bits */ }; @@ -116,35 +116,35 @@ static const struct bcap_format bcap_formats[] = { { .desc = "YCbCr 4:2:2 Interleaved UYVY", .pixelformat = V4L2_PIX_FMT_UYVY, - .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8, + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, .bpp = 16, .dlen = 8, }, { .desc = "YCbCr 4:2:2 Interleaved YUYV", .pixelformat = V4L2_PIX_FMT_YUYV, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .bpp = 16, .dlen = 8, }, { .desc = "YCbCr 4:2:2 Interleaved UYVY", .pixelformat = V4L2_PIX_FMT_UYVY, - .mbus_code = V4L2_MBUS_FMT_UYVY8_1X16, + .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16, .bpp = 16, .dlen = 16, }, { .desc = "RGB 565", .pixelformat = V4L2_PIX_FMT_RGB565, - .mbus_code = V4L2_MBUS_FMT_RGB565_2X8_LE, + .mbus_code = MEDIA_BUS_FMT_RGB565_2X8_LE, .bpp = 16, .dlen = 8, }, { .desc = "RGB 444", .pixelformat = V4L2_PIX_FMT_RGB444, - .mbus_code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, + .mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, .bpp = 16, .dlen = 8, }, @@ -161,7 +161,7 @@ static struct bcap_buffer *to_bcap_vb(struct vb2_buffer *vb) static int bcap_init_sensor_formats(struct bcap_device *bcap_dev) { - enum v4l2_mbus_pixelcode code; + u32 code; struct bcap_format *sf; unsigned int num_formats = 0; int i, j; diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c index e5df9916b2a1..244d3d6c244c 100644 --- a/drivers/media/platform/davinci/vpbe.c +++ b/drivers/media/platform/davinci/vpbe.c @@ -227,7 +227,7 @@ static int vpbe_set_output(struct vpbe_device *vpbe_dev, int index) vpbe_current_encoder_info(vpbe_dev); struct vpbe_config *cfg = vpbe_dev->cfg; struct venc_platform_data *venc_device = vpbe_dev->venc_device; - enum v4l2_mbus_pixelcode if_params; + u32 if_params; int enc_out_index; int sd_index; int ret = 0; diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index de55f47a77db..3d0e3ae1795c 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -414,13 +414,13 @@ static int vpfe_config_image_format(struct vpfe_device *vpfe_dev, /* assume V4L2_PIX_FMT_UYVY as default */ pix->pixelformat = V4L2_PIX_FMT_UYVY; v4l2_fill_mbus_format(&mbus_fmt, pix, - V4L2_MBUS_FMT_YUYV10_2X10); + MEDIA_BUS_FMT_YUYV10_2X10); } else { pix->field = V4L2_FIELD_NONE; /* assume V4L2_PIX_FMT_SBGGR8 */ pix->pixelformat = V4L2_PIX_FMT_SBGGR8; v4l2_fill_mbus_format(&mbus_fmt, pix, - V4L2_MBUS_FMT_SBGGR8_1X8); + MEDIA_BUS_FMT_SBGGR8_1X8); } /* if sub device supports g_mbus_fmt, override the defaults */ diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index b4c9f1d08968..91d226b8fe5c 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -54,7 +54,7 @@ static const struct gsc_fmt gsc_formats[] = { .corder = GSC_CBCR, .num_planes = 1, .num_comp = 1, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, }, { .name = "YUV 4:2:2 packed, CbYCrY", .pixelformat = V4L2_PIX_FMT_UYVY, @@ -64,7 +64,7 @@ static const struct gsc_fmt gsc_formats[] = { .corder = GSC_CBCR, .num_planes = 1, .num_comp = 1, - .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8, + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, }, { .name = "YUV 4:2:2 packed, CrYCbY", .pixelformat = V4L2_PIX_FMT_VYUY, @@ -74,7 +74,7 @@ static const struct gsc_fmt gsc_formats[] = { .corder = GSC_CRCB, .num_planes = 1, .num_comp = 1, - .mbus_code = V4L2_MBUS_FMT_VYUY8_2X8, + .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, }, { .name = "YUV 4:2:2 packed, YCrYCb", .pixelformat = V4L2_PIX_FMT_YVYU, @@ -84,7 +84,7 @@ static const struct gsc_fmt gsc_formats[] = { .corder = GSC_CRCB, .num_planes = 1, .num_comp = 1, - .mbus_code = V4L2_MBUS_FMT_YVYU8_2X8, + .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, }, { .name = "YUV 4:4:4 planar, YCbYCr", .pixelformat = V4L2_PIX_FMT_YUV32, diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h b/drivers/media/platform/exynos-gsc/gsc-core.h index ef0a6564cef9..0abdb17fb19c 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.h +++ b/drivers/media/platform/exynos-gsc/gsc-core.h @@ -117,7 +117,7 @@ enum gsc_yuv_fmt { * @flags: flags indicating which operation mode format applies to */ struct gsc_fmt { - enum v4l2_mbus_pixelcode mbus_code; + u32 mbus_code; char *name; u32 pixelformat; u32 color; diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index 3d2babd5067a..8a2fd8c33d42 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c @@ -749,7 +749,7 @@ static int fimc_cap_enum_fmt_mplane(struct file *file, void *priv, return -EINVAL; strncpy(f->description, fmt->name, sizeof(f->description) - 1); f->pixelformat = fmt->fourcc; - if (fmt->fourcc == V4L2_MBUS_FMT_JPEG_1X8) + if (fmt->fourcc == MEDIA_BUS_FMT_JPEG_1X8) f->flags |= V4L2_FMT_FLAG_COMPRESSED; return 0; } diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index aee92d908e49..dbd74d8dc2a8 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -81,7 +81,7 @@ static struct fimc_fmt fimc_formats[] = { .flags = FMT_FLAGS_M2M_OUT | FMT_HAS_ALPHA, }, { .name = "YUV 4:4:4", - .mbus_code = V4L2_MBUS_FMT_YUV10_1X30, + .mbus_code = MEDIA_BUS_FMT_YUV10_1X30, .flags = FMT_FLAGS_WRITEBACK, }, { .name = "YUV 4:2:2 packed, YCbYCr", @@ -90,7 +90,7 @@ static struct fimc_fmt fimc_formats[] = { .color = FIMC_FMT_YCBYCR422, .memplanes = 1, .colplanes = 1, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM, }, { .name = "YUV 4:2:2 packed, CbYCrY", @@ -99,7 +99,7 @@ static struct fimc_fmt fimc_formats[] = { .color = FIMC_FMT_CBYCRY422, .memplanes = 1, .colplanes = 1, - .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8, + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM, }, { .name = "YUV 4:2:2 packed, CrYCbY", @@ -108,7 +108,7 @@ static struct fimc_fmt fimc_formats[] = { .color = FIMC_FMT_CRYCBY422, .memplanes = 1, .colplanes = 1, - .mbus_code = V4L2_MBUS_FMT_VYUY8_2X8, + .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM, }, { .name = "YUV 4:2:2 packed, YCrYCb", @@ -117,7 +117,7 @@ static struct fimc_fmt fimc_formats[] = { .color = FIMC_FMT_YCRYCB422, .memplanes = 1, .colplanes = 1, - .mbus_code = V4L2_MBUS_FMT_YVYU8_2X8, + .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, .flags = FMT_FLAGS_M2M | FMT_FLAGS_CAM, }, { .name = "YUV 4:2:2 planar, Y/Cb/Cr", @@ -190,7 +190,7 @@ static struct fimc_fmt fimc_formats[] = { .depth = { 8 }, .memplanes = 1, .colplanes = 1, - .mbus_code = V4L2_MBUS_FMT_JPEG_1X8, + .mbus_code = MEDIA_BUS_FMT_JPEG_1X8, .flags = FMT_FLAGS_CAM | FMT_FLAGS_COMPRESSED, }, { .name = "S5C73MX interleaved UYVY/JPEG", @@ -200,7 +200,7 @@ static struct fimc_fmt fimc_formats[] = { .memplanes = 2, .colplanes = 1, .mdataplanes = 0x2, /* plane 1 holds frame meta data */ - .mbus_code = V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8, + .mbus_code = MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8, .flags = FMT_FLAGS_CAM | FMT_FLAGS_COMPRESSED, }, }; diff --git a/drivers/media/platform/exynos4-is/fimc-core.h b/drivers/media/platform/exynos4-is/fimc-core.h index 6c75c6ced1f7..7328f0845065 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.h +++ b/drivers/media/platform/exynos4-is/fimc-core.h @@ -579,8 +579,8 @@ static inline bool fimc_jpeg_fourcc(u32 pixelformat) static inline bool fimc_user_defined_mbus_fmt(u32 code) { - return (code == V4L2_MBUS_FMT_JPEG_1X8 || - code == V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8); + return (code == MEDIA_BUS_FMT_JPEG_1X8 || + code == MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8); } /* Return the alpha component bit mask */ diff --git a/drivers/media/platform/exynos4-is/fimc-isp.c b/drivers/media/platform/exynos4-is/fimc-isp.c index be62d6b9ac48..60c744915549 100644 --- a/drivers/media/platform/exynos4-is/fimc-isp.c +++ b/drivers/media/platform/exynos4-is/fimc-isp.c @@ -41,21 +41,21 @@ static const struct fimc_fmt fimc_isp_formats[FIMC_ISP_NUM_FORMATS] = { .depth = { 8 }, .color = FIMC_FMT_RAW8, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_SGRBG8_1X8, + .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8, }, { .name = "RAW10 (GRBG)", .fourcc = V4L2_PIX_FMT_SGRBG10, .depth = { 10 }, .color = FIMC_FMT_RAW10, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_SGRBG10_1X10, + .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10, }, { .name = "RAW12 (GRBG)", .fourcc = V4L2_PIX_FMT_SGRBG12, .depth = { 12 }, .color = FIMC_FMT_RAW12, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_SGRBG12_1X12, + .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12, }, }; @@ -149,7 +149,7 @@ static int fimc_isp_subdev_get_fmt(struct v4l2_subdev *sd, if (fmt->pad == FIMC_ISP_SD_PAD_SRC_FIFO) { mf->colorspace = V4L2_COLORSPACE_JPEG; - mf->code = V4L2_MBUS_FMT_YUV10_1X30; + mf->code = MEDIA_BUS_FMT_YUV10_1X30; } } @@ -175,7 +175,7 @@ static void __isp_subdev_try_format(struct fimc_isp *isp, FIMC_ISP_SINK_WIDTH_MAX, 0, &mf->height, FIMC_ISP_SINK_HEIGHT_MIN, FIMC_ISP_SINK_HEIGHT_MAX, 0, 0); - mf->code = V4L2_MBUS_FMT_SGRBG10_1X10; + mf->code = MEDIA_BUS_FMT_SGRBG10_1X10; } else { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) format = v4l2_subdev_get_try_format(fh, @@ -188,7 +188,7 @@ static void __isp_subdev_try_format(struct fimc_isp *isp, mf->height = format->height - FIMC_ISP_CAC_MARGIN_HEIGHT; if (fmt->pad == FIMC_ISP_SD_PAD_SRC_FIFO) { - mf->code = V4L2_MBUS_FMT_YUV10_1X30; + mf->code = MEDIA_BUS_FMT_YUV10_1X30; mf->colorspace = V4L2_COLORSPACE_JPEG; } else { mf->code = format->code; @@ -680,11 +680,11 @@ static void __isp_subdev_set_default_format(struct fimc_isp *isp) FIMC_ISP_CAC_MARGIN_WIDTH; isp->sink_fmt.height = DEFAULT_PREVIEW_STILL_HEIGHT + FIMC_ISP_CAC_MARGIN_HEIGHT; - isp->sink_fmt.code = V4L2_MBUS_FMT_SGRBG10_1X10; + isp->sink_fmt.code = MEDIA_BUS_FMT_SGRBG10_1X10; isp->src_fmt.width = DEFAULT_PREVIEW_STILL_WIDTH; isp->src_fmt.height = DEFAULT_PREVIEW_STILL_HEIGHT; - isp->src_fmt.code = V4L2_MBUS_FMT_SGRBG10_1X10; + isp->src_fmt.code = MEDIA_BUS_FMT_SGRBG10_1X10; __is_set_frame_size(is, &isp->src_fmt); } diff --git a/drivers/media/platform/exynos4-is/fimc-lite-reg.c b/drivers/media/platform/exynos4-is/fimc-lite-reg.c index bc3ec7d25a32..0477716a20db 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite-reg.c +++ b/drivers/media/platform/exynos4-is/fimc-lite-reg.c @@ -112,24 +112,24 @@ void flite_hw_set_test_pattern(struct fimc_lite *dev, bool on) } static const u32 src_pixfmt_map[8][3] = { - { V4L2_MBUS_FMT_YUYV8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCBYCR, + { MEDIA_BUS_FMT_YUYV8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCBYCR, FLITE_REG_CIGCTRL_YUV422_1P }, - { V4L2_MBUS_FMT_YVYU8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCRYCB, + { MEDIA_BUS_FMT_YVYU8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_YCRYCB, FLITE_REG_CIGCTRL_YUV422_1P }, - { V4L2_MBUS_FMT_UYVY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CBYCRY, + { MEDIA_BUS_FMT_UYVY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CBYCRY, FLITE_REG_CIGCTRL_YUV422_1P }, - { V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CRYCBY, + { MEDIA_BUS_FMT_VYUY8_2X8, FLITE_REG_CISRCSIZE_ORDER422_IN_CRYCBY, FLITE_REG_CIGCTRL_YUV422_1P }, - { V4L2_MBUS_FMT_SGRBG8_1X8, 0, FLITE_REG_CIGCTRL_RAW8 }, - { V4L2_MBUS_FMT_SGRBG10_1X10, 0, FLITE_REG_CIGCTRL_RAW10 }, - { V4L2_MBUS_FMT_SGRBG12_1X12, 0, FLITE_REG_CIGCTRL_RAW12 }, - { V4L2_MBUS_FMT_JPEG_1X8, 0, FLITE_REG_CIGCTRL_USER(1) }, + { MEDIA_BUS_FMT_SGRBG8_1X8, 0, FLITE_REG_CIGCTRL_RAW8 }, + { MEDIA_BUS_FMT_SGRBG10_1X10, 0, FLITE_REG_CIGCTRL_RAW10 }, + { MEDIA_BUS_FMT_SGRBG12_1X12, 0, FLITE_REG_CIGCTRL_RAW12 }, + { MEDIA_BUS_FMT_JPEG_1X8, 0, FLITE_REG_CIGCTRL_USER(1) }, }; /* Set camera input pixel format and resolution */ void flite_hw_set_source_format(struct fimc_lite *dev, struct flite_frame *f) { - enum v4l2_mbus_pixelcode pixelcode = f->fmt->mbus_code; + u32 pixelcode = f->fmt->mbus_code; int i = ARRAY_SIZE(src_pixfmt_map); u32 cfg; @@ -232,10 +232,10 @@ static void flite_hw_set_pack12(struct fimc_lite *dev, int on) static void flite_hw_set_out_order(struct fimc_lite *dev, struct flite_frame *f) { static const u32 pixcode[4][2] = { - { V4L2_MBUS_FMT_YUYV8_2X8, FLITE_REG_CIODMAFMT_YCBYCR }, - { V4L2_MBUS_FMT_YVYU8_2X8, FLITE_REG_CIODMAFMT_YCRYCB }, - { V4L2_MBUS_FMT_UYVY8_2X8, FLITE_REG_CIODMAFMT_CBYCRY }, - { V4L2_MBUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY }, + { MEDIA_BUS_FMT_YUYV8_2X8, FLITE_REG_CIODMAFMT_YCBYCR }, + { MEDIA_BUS_FMT_YVYU8_2X8, FLITE_REG_CIODMAFMT_YCRYCB }, + { MEDIA_BUS_FMT_UYVY8_2X8, FLITE_REG_CIODMAFMT_CBYCRY }, + { MEDIA_BUS_FMT_VYUY8_2X8, FLITE_REG_CIODMAFMT_CRYCBY }, }; u32 cfg = readl(dev->regs + FLITE_REG_CIODMAFMT); int i = ARRAY_SIZE(pixcode); diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index a97d2352f1d7..b7dca8b2d455 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c @@ -48,7 +48,7 @@ static const struct fimc_fmt fimc_lite_formats[] = { .depth = { 16 }, .color = FIMC_FMT_YCBYCR422, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .flags = FMT_FLAGS_YUV, }, { .name = "YUV 4:2:2 packed, CbYCrY", @@ -57,7 +57,7 @@ static const struct fimc_fmt fimc_lite_formats[] = { .depth = { 16 }, .color = FIMC_FMT_CBYCRY422, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_UYVY8_2X8, + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, .flags = FMT_FLAGS_YUV, }, { .name = "YUV 4:2:2 packed, CrYCbY", @@ -66,7 +66,7 @@ static const struct fimc_fmt fimc_lite_formats[] = { .depth = { 16 }, .color = FIMC_FMT_CRYCBY422, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_VYUY8_2X8, + .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, .flags = FMT_FLAGS_YUV, }, { .name = "YUV 4:2:2 packed, YCrYCb", @@ -75,7 +75,7 @@ static const struct fimc_fmt fimc_lite_formats[] = { .depth = { 16 }, .color = FIMC_FMT_YCRYCB422, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_YVYU8_2X8, + .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, .flags = FMT_FLAGS_YUV, }, { .name = "RAW8 (GRBG)", @@ -84,7 +84,7 @@ static const struct fimc_fmt fimc_lite_formats[] = { .depth = { 8 }, .color = FIMC_FMT_RAW8, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_SGRBG8_1X8, + .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8, .flags = FMT_FLAGS_RAW_BAYER, }, { .name = "RAW10 (GRBG)", @@ -93,7 +93,7 @@ static const struct fimc_fmt fimc_lite_formats[] = { .depth = { 16 }, .color = FIMC_FMT_RAW10, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_SGRBG10_1X10, + .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10, .flags = FMT_FLAGS_RAW_BAYER, }, { .name = "RAW12 (GRBG)", @@ -102,7 +102,7 @@ static const struct fimc_fmt fimc_lite_formats[] = { .depth = { 16 }, .color = FIMC_FMT_RAW12, .memplanes = 1, - .mbus_code = V4L2_MBUS_FMT_SGRBG12_1X12, + .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12, .flags = FMT_FLAGS_RAW_BAYER, }, }; diff --git a/drivers/media/platform/exynos4-is/fimc-reg.c b/drivers/media/platform/exynos4-is/fimc-reg.c index 2d77fd8f440a..df0cbcb69b6b 100644 --- a/drivers/media/platform/exynos4-is/fimc-reg.c +++ b/drivers/media/platform/exynos4-is/fimc-reg.c @@ -592,10 +592,10 @@ struct mbus_pixfmt_desc { }; static const struct mbus_pixfmt_desc pix_desc[] = { - { V4L2_MBUS_FMT_YUYV8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCBYCR, 8 }, - { V4L2_MBUS_FMT_YVYU8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCRYCB, 8 }, - { V4L2_MBUS_FMT_VYUY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CRYCBY, 8 }, - { V4L2_MBUS_FMT_UYVY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CBYCRY, 8 }, + { MEDIA_BUS_FMT_YUYV8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCBYCR, 8 }, + { MEDIA_BUS_FMT_YVYU8_2X8, FIMC_REG_CISRCFMT_ORDER422_YCRYCB, 8 }, + { MEDIA_BUS_FMT_VYUY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CRYCBY, 8 }, + { MEDIA_BUS_FMT_UYVY8_2X8, FIMC_REG_CISRCFMT_ORDER422_CBYCRY, 8 }, }; int fimc_hw_set_camera_source(struct fimc_dev *fimc, @@ -689,11 +689,11 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc, /* TODO: add remaining supported formats. */ switch (vid_cap->ci_fmt.code) { - case V4L2_MBUS_FMT_VYUY8_2X8: + case MEDIA_BUS_FMT_VYUY8_2X8: tmp = FIMC_REG_CSIIMGFMT_YCBCR422_8BIT; break; - case V4L2_MBUS_FMT_JPEG_1X8: - case V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8: + case MEDIA_BUS_FMT_JPEG_1X8: + case MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8: tmp = FIMC_REG_CSIIMGFMT_USER(1); cfg |= FIMC_REG_CIGCTRL_CAM_JPEG; break; diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index db6fd14d1936..2f3fdfba1a45 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -238,34 +238,34 @@ struct csis_state { */ struct csis_pix_format { unsigned int pix_width_alignment; - enum v4l2_mbus_pixelcode code; + u32 code; u32 fmt_reg; u8 data_alignment; }; static const struct csis_pix_format s5pcsis_formats[] = { { - .code = V4L2_MBUS_FMT_VYUY8_2X8, + .code = MEDIA_BUS_FMT_VYUY8_2X8, .fmt_reg = S5PCSIS_CFG_FMT_YCBCR422_8BIT, .data_alignment = 32, }, { - .code = V4L2_MBUS_FMT_JPEG_1X8, + .code = MEDIA_BUS_FMT_JPEG_1X8, .fmt_reg = S5PCSIS_CFG_FMT_USER(1), .data_alignment = 32, }, { - .code = V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8, + .code = MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8, .fmt_reg = S5PCSIS_CFG_FMT_USER(1), .data_alignment = 32, }, { - .code = V4L2_MBUS_FMT_SGRBG8_1X8, + .code = MEDIA_BUS_FMT_SGRBG8_1X8, .fmt_reg = S5PCSIS_CFG_FMT_RAW8, .data_alignment = 24, }, { - .code = V4L2_MBUS_FMT_SGRBG10_1X10, + .code = MEDIA_BUS_FMT_SGRBG10_1X10, .fmt_reg = S5PCSIS_CFG_FMT_RAW10, .data_alignment = 24, }, { - .code = V4L2_MBUS_FMT_SGRBG12_1X12, + .code = MEDIA_BUS_FMT_SGRBG12_1X12, .fmt_reg = S5PCSIS_CFG_FMT_RAW12, .data_alignment = 24, } diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c index 7a86c77bffa0..f0eeb6cd262c 100644 --- a/drivers/media/platform/marvell-ccic/mcam-core.c +++ b/drivers/media/platform/marvell-ccic/mcam-core.c @@ -106,61 +106,61 @@ static struct mcam_format_struct { __u32 pixelformat; int bpp; /* Bytes per pixel */ bool planar; - enum v4l2_mbus_pixelcode mbus_code; + u32 mbus_code; } mcam_formats[] = { { .desc = "YUYV 4:2:2", .pixelformat = V4L2_PIX_FMT_YUYV, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .bpp = 2, .planar = false, }, { .desc = "UYVY 4:2:2", .pixelformat = V4L2_PIX_FMT_UYVY, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .bpp = 2, .planar = false, }, { .desc = "YUV 4:2:2 PLANAR", .pixelformat = V4L2_PIX_FMT_YUV422P, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .bpp = 2, .planar = true, }, { .desc = "YUV 4:2:0 PLANAR", .pixelformat = V4L2_PIX_FMT_YUV420, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .bpp = 2, .planar = true, }, { .desc = "YVU 4:2:0 PLANAR", .pixelformat = V4L2_PIX_FMT_YVU420, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .bpp = 2, .planar = true, }, { .desc = "RGB 444", .pixelformat = V4L2_PIX_FMT_RGB444, - .mbus_code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, + .mbus_code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, .bpp = 2, .planar = false, }, { .desc = "RGB 565", .pixelformat = V4L2_PIX_FMT_RGB565, - .mbus_code = V4L2_MBUS_FMT_RGB565_2X8_LE, + .mbus_code = MEDIA_BUS_FMT_RGB565_2X8_LE, .bpp = 2, .planar = false, }, { .desc = "Raw RGB Bayer", .pixelformat = V4L2_PIX_FMT_SBGGR8, - .mbus_code = V4L2_MBUS_FMT_SBGGR8_1X8, + .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8, .bpp = 1, .planar = false, }, @@ -190,8 +190,7 @@ static const struct v4l2_pix_format mcam_def_pix_format = { .sizeimage = VGA_WIDTH*VGA_HEIGHT*2, }; -static const enum v4l2_mbus_pixelcode mcam_def_mbus_code = - V4L2_MBUS_FMT_YUYV8_2X8; +static const u32 mcam_def_mbus_code = MEDIA_BUS_FMT_YUYV8_2X8; /* diff --git a/drivers/media/platform/marvell-ccic/mcam-core.h b/drivers/media/platform/marvell-ccic/mcam-core.h index e0e628cb98f9..60a8e1cfeff7 100644 --- a/drivers/media/platform/marvell-ccic/mcam-core.h +++ b/drivers/media/platform/marvell-ccic/mcam-core.h @@ -183,7 +183,7 @@ struct mcam_camera { /* Current operating parameters */ struct v4l2_pix_format pix_format; - enum v4l2_mbus_pixelcode mbus_code; + u32 mbus_code; /* Locks */ struct mutex s_mutex; /* Access to this structure */ diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index 81a9dc053d58..587489a072d5 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c @@ -36,23 +36,23 @@ __ccdc_get_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, unsigned int pad, enum v4l2_subdev_format_whence which); static const unsigned int ccdc_fmts[] = { - V4L2_MBUS_FMT_Y8_1X8, - V4L2_MBUS_FMT_Y10_1X10, - V4L2_MBUS_FMT_Y12_1X12, - V4L2_MBUS_FMT_SGRBG8_1X8, - V4L2_MBUS_FMT_SRGGB8_1X8, - V4L2_MBUS_FMT_SBGGR8_1X8, - V4L2_MBUS_FMT_SGBRG8_1X8, - V4L2_MBUS_FMT_SGRBG10_1X10, - V4L2_MBUS_FMT_SRGGB10_1X10, - V4L2_MBUS_FMT_SBGGR10_1X10, - V4L2_MBUS_FMT_SGBRG10_1X10, - V4L2_MBUS_FMT_SGRBG12_1X12, - V4L2_MBUS_FMT_SRGGB12_1X12, - V4L2_MBUS_FMT_SBGGR12_1X12, - V4L2_MBUS_FMT_SGBRG12_1X12, - V4L2_MBUS_FMT_YUYV8_2X8, - V4L2_MBUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_Y8_1X8, + MEDIA_BUS_FMT_Y10_1X10, + MEDIA_BUS_FMT_Y12_1X12, + MEDIA_BUS_FMT_SGRBG8_1X8, + MEDIA_BUS_FMT_SRGGB8_1X8, + MEDIA_BUS_FMT_SBGGR8_1X8, + MEDIA_BUS_FMT_SGBRG8_1X8, + MEDIA_BUS_FMT_SGRBG10_1X10, + MEDIA_BUS_FMT_SRGGB10_1X10, + MEDIA_BUS_FMT_SBGGR10_1X10, + MEDIA_BUS_FMT_SGBRG10_1X10, + MEDIA_BUS_FMT_SGRBG12_1X12, + MEDIA_BUS_FMT_SRGGB12_1X12, + MEDIA_BUS_FMT_SBGGR12_1X12, + MEDIA_BUS_FMT_SGBRG12_1X12, + MEDIA_BUS_FMT_YUYV8_2X8, + MEDIA_BUS_FMT_UYVY8_2X8, }; /* @@ -266,10 +266,10 @@ static int __ccdc_lsc_enable(struct isp_ccdc_device *ccdc, int enable) __ccdc_get_format(ccdc, NULL, CCDC_PAD_SINK, V4L2_SUBDEV_FORMAT_ACTIVE); - if ((format->code != V4L2_MBUS_FMT_SGRBG10_1X10) && - (format->code != V4L2_MBUS_FMT_SRGGB10_1X10) && - (format->code != V4L2_MBUS_FMT_SBGGR10_1X10) && - (format->code != V4L2_MBUS_FMT_SGBRG10_1X10)) + if ((format->code != MEDIA_BUS_FMT_SGRBG10_1X10) && + (format->code != MEDIA_BUS_FMT_SRGGB10_1X10) && + (format->code != MEDIA_BUS_FMT_SBGGR10_1X10) && + (format->code != MEDIA_BUS_FMT_SGBRG10_1X10)) return -EINVAL; if (enable) @@ -971,8 +971,8 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, format = &ccdc->formats[CCDC_PAD_SINK]; - if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 || - format->code == V4L2_MBUS_FMT_UYVY8_2X8) { + if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 || + format->code == MEDIA_BUS_FMT_UYVY8_2X8) { /* According to the OMAP3 TRM the input mode only affects SYNC * mode, enabling BT.656 mode should take precedence. However, * in practice setting the input mode to YCbCr data on 8 bits @@ -1020,7 +1020,7 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, /* The CCDC_CFG.Y8POS bit is used in YCbCr8 input mode only. The * hardware seems to ignore it in all other input modes. */ - if (format->code == V4L2_MBUS_FMT_UYVY8_2X8) + if (format->code == MEDIA_BUS_FMT_UYVY8_2X8) isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, ISPCCDC_CFG_Y8POS); else @@ -1168,9 +1168,9 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) if (ccdc->bt656) bridge = ISPCTRL_PAR_BRIDGE_DISABLE; - else if (fmt_info->code == V4L2_MBUS_FMT_YUYV8_2X8) + else if (fmt_info->code == MEDIA_BUS_FMT_YUYV8_2X8) bridge = ISPCTRL_PAR_BRIDGE_LENDIAN; - else if (fmt_info->code == V4L2_MBUS_FMT_UYVY8_2X8) + else if (fmt_info->code == MEDIA_BUS_FMT_UYVY8_2X8) bridge = ISPCTRL_PAR_BRIDGE_BENDIAN; else bridge = ISPCTRL_PAR_BRIDGE_DISABLE; @@ -1199,16 +1199,16 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) /* Mosaic filter */ switch (format->code) { - case V4L2_MBUS_FMT_SRGGB10_1X10: - case V4L2_MBUS_FMT_SRGGB12_1X12: + case MEDIA_BUS_FMT_SRGGB10_1X10: + case MEDIA_BUS_FMT_SRGGB12_1X12: ccdc_pattern = ccdc_srggb_pattern; break; - case V4L2_MBUS_FMT_SBGGR10_1X10: - case V4L2_MBUS_FMT_SBGGR12_1X12: + case MEDIA_BUS_FMT_SBGGR10_1X10: + case MEDIA_BUS_FMT_SBGGR12_1X12: ccdc_pattern = ccdc_sbggr_pattern; break; - case V4L2_MBUS_FMT_SGBRG10_1X10: - case V4L2_MBUS_FMT_SGBRG12_1X12: + case MEDIA_BUS_FMT_SGBRG10_1X10: + case MEDIA_BUS_FMT_SGBRG12_1X12: ccdc_pattern = ccdc_sgbrg_pattern; break; default: @@ -1267,7 +1267,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) /* The CCDC outputs data in UYVY order by default. Swap bytes to get * YUYV. */ - if (format->code == V4L2_MBUS_FMT_YUYV8_1X16) + if (format->code == MEDIA_BUS_FMT_YUYV8_1X16) isp_reg_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_CFG, ISPCCDC_CFG_BSWD); else @@ -1967,7 +1967,7 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, enum v4l2_subdev_format_whence which) { const struct isp_format_info *info; - enum v4l2_mbus_pixelcode pixelcode; + u32 pixelcode; unsigned int width = fmt->width; unsigned int height = fmt->height; struct v4l2_rect *crop; @@ -1983,7 +1983,7 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, /* If not found, use SGRBG10 as default */ if (i >= ARRAY_SIZE(ccdc_fmts)) - fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; + fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; /* Clamp the input size. */ fmt->width = clamp_t(u32, width, 32, 4096); @@ -2007,19 +2007,19 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, * configured to pack bytes in BT.656, hiding the inaccuracy. * In all cases bytes can be swapped. */ - if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8 || - fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) { + if (fmt->code == MEDIA_BUS_FMT_YUYV8_2X8 || + fmt->code == MEDIA_BUS_FMT_UYVY8_2X8) { /* Use the user requested format if YUV. */ - if (pixelcode == V4L2_MBUS_FMT_YUYV8_2X8 || - pixelcode == V4L2_MBUS_FMT_UYVY8_2X8 || - pixelcode == V4L2_MBUS_FMT_YUYV8_1X16 || - pixelcode == V4L2_MBUS_FMT_UYVY8_1X16) + if (pixelcode == MEDIA_BUS_FMT_YUYV8_2X8 || + pixelcode == MEDIA_BUS_FMT_UYVY8_2X8 || + pixelcode == MEDIA_BUS_FMT_YUYV8_1X16 || + pixelcode == MEDIA_BUS_FMT_UYVY8_1X16) fmt->code = pixelcode; - if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8) - fmt->code = V4L2_MBUS_FMT_YUYV8_1X16; - else if (fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) - fmt->code = V4L2_MBUS_FMT_UYVY8_1X16; + if (fmt->code == MEDIA_BUS_FMT_YUYV8_2X8) + fmt->code = MEDIA_BUS_FMT_YUYV8_1X16; + else if (fmt->code == MEDIA_BUS_FMT_UYVY8_2X8) + fmt->code = MEDIA_BUS_FMT_UYVY8_1X16; } /* Hardcode the output size to the crop rectangle size. */ @@ -2047,8 +2047,8 @@ ccdc_try_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, fmt->code = info->truncated; /* YUV formats are not supported by the video port. */ - if (fmt->code == V4L2_MBUS_FMT_YUYV8_2X8 || - fmt->code == V4L2_MBUS_FMT_UYVY8_2X8) + if (fmt->code == MEDIA_BUS_FMT_YUYV8_2X8 || + fmt->code == MEDIA_BUS_FMT_UYVY8_2X8) fmt->code = 0; /* The number of lines that can be clocked out from the video @@ -2083,7 +2083,7 @@ static void ccdc_try_crop(struct isp_ccdc_device *ccdc, * to keep the Bayer pattern. */ info = omap3isp_video_format_info(sink->code); - if (info->flavor != V4L2_MBUS_FMT_Y8_1X8) { + if (info->flavor != MEDIA_BUS_FMT_Y8_1X8) { crop->left &= ~1; crop->top &= ~1; } @@ -2103,7 +2103,7 @@ static void ccdc_try_crop(struct isp_ccdc_device *ccdc, sink->height - crop->top); /* Odd width/height values don't make sense for Bayer formats. */ - if (info->flavor != V4L2_MBUS_FMT_Y8_1X8) { + if (info->flavor != MEDIA_BUS_FMT_Y8_1X8) { crop->width &= ~1; crop->height &= ~1; } @@ -2135,13 +2135,13 @@ static int ccdc_enum_mbus_code(struct v4l2_subdev *sd, format = __ccdc_get_format(ccdc, fh, code->pad, V4L2_SUBDEV_FORMAT_TRY); - if (format->code == V4L2_MBUS_FMT_YUYV8_2X8 || - format->code == V4L2_MBUS_FMT_UYVY8_2X8) { + if (format->code == MEDIA_BUS_FMT_YUYV8_2X8 || + format->code == MEDIA_BUS_FMT_UYVY8_2X8) { /* In YUV mode the CCDC can swap bytes. */ if (code->index == 0) - code->code = V4L2_MBUS_FMT_YUYV8_1X16; + code->code = MEDIA_BUS_FMT_YUYV8_1X16; else if (code->index == 1) - code->code = V4L2_MBUS_FMT_UYVY8_1X16; + code->code = MEDIA_BUS_FMT_UYVY8_1X16; else return -EINVAL; } else { @@ -2383,9 +2383,7 @@ static int ccdc_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, * return true if the combination is possible * return false otherwise */ -static bool ccdc_is_shiftable(enum v4l2_mbus_pixelcode in, - enum v4l2_mbus_pixelcode out, - unsigned int additional_shift) +static bool ccdc_is_shiftable(u32 in, u32 out, unsigned int additional_shift) { const struct isp_format_info *in_info, *out_info; @@ -2452,7 +2450,7 @@ static int ccdc_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) memset(&format, 0, sizeof(format)); format.pad = CCDC_PAD_SINK; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_SGRBG10_1X10; + format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; format.format.width = 4096; format.format.height = 4096; ccdc_set_format(sd, fh, &format); diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c index 9cb49b3c04bd..f4aedb37e41e 100644 --- a/drivers/media/platform/omap3isp/ispccp2.c +++ b/drivers/media/platform/omap3isp/ispccp2.c @@ -289,10 +289,10 @@ static void ccp2_lcx_config(struct isp_ccp2_device *ccp2, u32 val, format; switch (config->format) { - case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8: format = ISPCCP2_LCx_CTRL_FORMAT_RAW8_DPCM10_VP; break; - case V4L2_MBUS_FMT_SGRBG10_1X10: + case MEDIA_BUS_FMT_SGRBG10_1X10: default: format = ISPCCP2_LCx_CTRL_FORMAT_RAW10_VP; /* RAW10+VP */ break; @@ -438,7 +438,7 @@ static void ccp2_mem_configure(struct isp_ccp2_device *ccp2, u32 val, hwords; if (sink_pixcode != source_pixcode && - sink_pixcode == V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8) + sink_pixcode == MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8) dpcm_decompress = 1; ccp2_pwr_cfg(ccp2); @@ -604,8 +604,8 @@ void omap3isp_ccp2_isr(struct isp_ccp2_device *ccp2) */ static const unsigned int ccp2_fmts[] = { - V4L2_MBUS_FMT_SGRBG10_1X10, - V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, + MEDIA_BUS_FMT_SGRBG10_1X10, + MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, }; /* @@ -643,8 +643,8 @@ static void ccp2_try_format(struct isp_ccp2_device *ccp2, switch (pad) { case CCP2_PAD_SINK: - if (fmt->code != V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8) - fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; + if (fmt->code != MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8) + fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; if (ccp2->input == CCP2_INPUT_SENSOR) { fmt->width = clamp_t(u32, fmt->width, @@ -671,7 +671,7 @@ static void ccp2_try_format(struct isp_ccp2_device *ccp2, */ format = __ccp2_get_format(ccp2, fh, CCP2_PAD_SINK, which); memcpy(fmt, format, sizeof(*fmt)); - fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; + fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; break; } @@ -808,7 +808,7 @@ static int ccp2_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) memset(&format, 0, sizeof(format)); format.pad = CCP2_PAD_SINK; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_SGRBG10_1X10; + format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; format.format.width = 4096; format.format.height = 4096; ccp2_set_format(sd, fh, &format); diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c index 6530b255f103..09c686d96ae8 100644 --- a/drivers/media/platform/omap3isp/ispcsi2.c +++ b/drivers/media/platform/omap3isp/ispcsi2.c @@ -78,15 +78,15 @@ static void csi2_recv_config(struct isp_device *isp, } static const unsigned int csi2_input_fmts[] = { - V4L2_MBUS_FMT_SGRBG10_1X10, - V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, - V4L2_MBUS_FMT_SRGGB10_1X10, - V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8, - V4L2_MBUS_FMT_SBGGR10_1X10, - V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8, - V4L2_MBUS_FMT_SGBRG10_1X10, - V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8, - V4L2_MBUS_FMT_YUYV8_2X8, + MEDIA_BUS_FMT_SGRBG10_1X10, + MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, + MEDIA_BUS_FMT_SRGGB10_1X10, + MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, + MEDIA_BUS_FMT_SBGGR10_1X10, + MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, + MEDIA_BUS_FMT_SGBRG10_1X10, + MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, + MEDIA_BUS_FMT_YUYV8_2X8, }; /* To set the format on the CSI2 requires a mapping function that takes @@ -171,19 +171,19 @@ static u16 csi2_ctx_map_format(struct isp_csi2_device *csi2) int fmtidx, destidx, is_3630; switch (fmt->code) { - case V4L2_MBUS_FMT_SGRBG10_1X10: - case V4L2_MBUS_FMT_SRGGB10_1X10: - case V4L2_MBUS_FMT_SBGGR10_1X10: - case V4L2_MBUS_FMT_SGBRG10_1X10: + case MEDIA_BUS_FMT_SGRBG10_1X10: + case MEDIA_BUS_FMT_SRGGB10_1X10: + case MEDIA_BUS_FMT_SBGGR10_1X10: + case MEDIA_BUS_FMT_SGBRG10_1X10: fmtidx = 0; break; - case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8: - case V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8: - case V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8: - case V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8: + case MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8: fmtidx = 1; break; - case V4L2_MBUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: fmtidx = 2; break; default: @@ -843,7 +843,7 @@ csi2_try_format(struct isp_csi2_device *csi2, struct v4l2_subdev_fh *fh, unsigned int pad, struct v4l2_mbus_framefmt *fmt, enum v4l2_subdev_format_whence which) { - enum v4l2_mbus_pixelcode pixelcode; + u32 pixelcode; struct v4l2_mbus_framefmt *format; const struct isp_format_info *info; unsigned int i; @@ -858,7 +858,7 @@ csi2_try_format(struct isp_csi2_device *csi2, struct v4l2_subdev_fh *fh, /* If not found, use SGRBG10 as default */ if (i >= ARRAY_SIZE(csi2_input_fmts)) - fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; + fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; fmt->width = clamp_t(u32, fmt->width, 1, 8191); fmt->height = clamp_t(u32, fmt->height, 1, 8191); @@ -1029,7 +1029,7 @@ static int csi2_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) memset(&format, 0, sizeof(format)); format.pad = CSI2_PAD_SINK; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_SGRBG10_1X10; + format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; format.format.width = 4096; format.format.height = 4096; csi2_set_format(sd, fh, &format); diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c index 605f57ef0a49..dd9eed45d853 100644 --- a/drivers/media/platform/omap3isp/isppreview.c +++ b/drivers/media/platform/omap3isp/isppreview.c @@ -964,18 +964,16 @@ static void preview_setup_hw(struct isp_prev_device *prev, u32 update, * @prev: pointer to previewer private structure * @pixelcode: pixel code */ -static void -preview_config_ycpos(struct isp_prev_device *prev, - enum v4l2_mbus_pixelcode pixelcode) +static void preview_config_ycpos(struct isp_prev_device *prev, u32 pixelcode) { struct isp_device *isp = to_isp_device(prev); enum preview_ycpos_mode mode; switch (pixelcode) { - case V4L2_MBUS_FMT_YUYV8_1X16: + case MEDIA_BUS_FMT_YUYV8_1X16: mode = YCPOS_CrYCbY; break; - case V4L2_MBUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_UYVY8_1X16: mode = YCPOS_YCrYCb; break; default: @@ -1028,16 +1026,16 @@ static void preview_config_input_format(struct isp_prev_device *prev, ISPPRV_PCR_WIDTH); switch (info->flavor) { - case V4L2_MBUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: prev->params.cfa_order = 0; break; - case V4L2_MBUS_FMT_SRGGB8_1X8: + case MEDIA_BUS_FMT_SRGGB8_1X8: prev->params.cfa_order = 1; break; - case V4L2_MBUS_FMT_SBGGR8_1X8: + case MEDIA_BUS_FMT_SBGGR8_1X8: prev->params.cfa_order = 2; break; - case V4L2_MBUS_FMT_SGBRG8_1X8: + case MEDIA_BUS_FMT_SGBRG8_1X8: prev->params.cfa_order = 3; break; default: @@ -1078,8 +1076,8 @@ static void preview_config_input_size(struct isp_prev_device *prev, u32 active) unsigned int elv = prev->crop.top + prev->crop.height - 1; u32 features; - if (format->code != V4L2_MBUS_FMT_Y8_1X8 && - format->code != V4L2_MBUS_FMT_Y10_1X10) { + if (format->code != MEDIA_BUS_FMT_Y8_1X8 && + format->code != MEDIA_BUS_FMT_Y10_1X10) { sph -= 2; eph += 2; slv -= 2; @@ -1709,21 +1707,21 @@ __preview_get_crop(struct isp_prev_device *prev, struct v4l2_subdev_fh *fh, /* previewer format descriptions */ static const unsigned int preview_input_fmts[] = { - V4L2_MBUS_FMT_Y8_1X8, - V4L2_MBUS_FMT_SGRBG8_1X8, - V4L2_MBUS_FMT_SRGGB8_1X8, - V4L2_MBUS_FMT_SBGGR8_1X8, - V4L2_MBUS_FMT_SGBRG8_1X8, - V4L2_MBUS_FMT_Y10_1X10, - V4L2_MBUS_FMT_SGRBG10_1X10, - V4L2_MBUS_FMT_SRGGB10_1X10, - V4L2_MBUS_FMT_SBGGR10_1X10, - V4L2_MBUS_FMT_SGBRG10_1X10, + MEDIA_BUS_FMT_Y8_1X8, + MEDIA_BUS_FMT_SGRBG8_1X8, + MEDIA_BUS_FMT_SRGGB8_1X8, + MEDIA_BUS_FMT_SBGGR8_1X8, + MEDIA_BUS_FMT_SGBRG8_1X8, + MEDIA_BUS_FMT_Y10_1X10, + MEDIA_BUS_FMT_SGRBG10_1X10, + MEDIA_BUS_FMT_SRGGB10_1X10, + MEDIA_BUS_FMT_SBGGR10_1X10, + MEDIA_BUS_FMT_SGBRG10_1X10, }; static const unsigned int preview_output_fmts[] = { - V4L2_MBUS_FMT_UYVY8_1X16, - V4L2_MBUS_FMT_YUYV8_1X16, + MEDIA_BUS_FMT_UYVY8_1X16, + MEDIA_BUS_FMT_YUYV8_1X16, }; /* @@ -1742,7 +1740,7 @@ static void preview_try_format(struct isp_prev_device *prev, struct v4l2_mbus_framefmt *fmt, enum v4l2_subdev_format_whence which) { - enum v4l2_mbus_pixelcode pixelcode; + u32 pixelcode; struct v4l2_rect *crop; unsigned int i; @@ -1774,7 +1772,7 @@ static void preview_try_format(struct isp_prev_device *prev, /* If not found, use SGRBG10 as default */ if (i >= ARRAY_SIZE(preview_input_fmts)) - fmt->code = V4L2_MBUS_FMT_SGRBG10_1X10; + fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10; break; case PREV_PAD_SOURCE: @@ -1782,13 +1780,13 @@ static void preview_try_format(struct isp_prev_device *prev, *fmt = *__preview_get_format(prev, fh, PREV_PAD_SINK, which); switch (pixelcode) { - case V4L2_MBUS_FMT_YUYV8_1X16: - case V4L2_MBUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_YUYV8_1X16: + case MEDIA_BUS_FMT_UYVY8_1X16: fmt->code = pixelcode; break; default: - fmt->code = V4L2_MBUS_FMT_YUYV8_1X16; + fmt->code = MEDIA_BUS_FMT_YUYV8_1X16; break; } @@ -1843,8 +1841,8 @@ static void preview_try_crop(struct isp_prev_device *prev, * and no columns in other modes. Increase the margins based on the sink * format. */ - if (sink->code != V4L2_MBUS_FMT_Y8_1X8 && - sink->code != V4L2_MBUS_FMT_Y10_1X10) { + if (sink->code != MEDIA_BUS_FMT_Y8_1X8 && + sink->code != MEDIA_BUS_FMT_Y10_1X10) { left += 2; right -= 2; top += 2; @@ -2092,7 +2090,7 @@ static int preview_init_formats(struct v4l2_subdev *sd, memset(&format, 0, sizeof(format)); format.pad = PREV_PAD_SINK; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_SGRBG10_1X10; + format.format.code = MEDIA_BUS_FMT_SGRBG10_1X10; format.format.width = 4096; format.format.height = 4096; preview_set_format(sd, fh, &format); diff --git a/drivers/media/platform/omap3isp/ispresizer.c b/drivers/media/platform/omap3isp/ispresizer.c index 05d1ace57451..2b9bc4839876 100644 --- a/drivers/media/platform/omap3isp/ispresizer.c +++ b/drivers/media/platform/omap3isp/ispresizer.c @@ -198,17 +198,16 @@ static void resizer_set_bilinear(struct isp_res_device *res, * @res: Device context. * @pixelcode: pixel code. */ -static void resizer_set_ycpos(struct isp_res_device *res, - enum v4l2_mbus_pixelcode pixelcode) +static void resizer_set_ycpos(struct isp_res_device *res, u32 pixelcode) { struct isp_device *isp = to_isp_device(res); switch (pixelcode) { - case V4L2_MBUS_FMT_YUYV8_1X16: + case MEDIA_BUS_FMT_YUYV8_1X16: isp_reg_set(isp, OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT, ISPRSZ_CNT_YCPOS); break; - case V4L2_MBUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_UYVY8_1X16: isp_reg_clr(isp, OMAP3_ISP_IOMEM_RESZ, ISPRSZ_CNT, ISPRSZ_CNT_YCPOS); break; @@ -1348,8 +1347,8 @@ static int resizer_set_selection(struct v4l2_subdev *sd, /* resizer pixel formats */ static const unsigned int resizer_formats[] = { - V4L2_MBUS_FMT_UYVY8_1X16, - V4L2_MBUS_FMT_YUYV8_1X16, + MEDIA_BUS_FMT_UYVY8_1X16, + MEDIA_BUS_FMT_YUYV8_1X16, }; static unsigned int resizer_max_in_width(struct isp_res_device *res) @@ -1385,9 +1384,9 @@ static void resizer_try_format(struct isp_res_device *res, switch (pad) { case RESZ_PAD_SINK: - if (fmt->code != V4L2_MBUS_FMT_YUYV8_1X16 && - fmt->code != V4L2_MBUS_FMT_UYVY8_1X16) - fmt->code = V4L2_MBUS_FMT_YUYV8_1X16; + if (fmt->code != MEDIA_BUS_FMT_YUYV8_1X16 && + fmt->code != MEDIA_BUS_FMT_UYVY8_1X16) + fmt->code = MEDIA_BUS_FMT_YUYV8_1X16; fmt->width = clamp_t(u32, fmt->width, MIN_IN_WIDTH, resizer_max_in_width(res)); @@ -1571,7 +1570,7 @@ static int resizer_init_formats(struct v4l2_subdev *sd, memset(&format, 0, sizeof(format)); format.pad = RESZ_PAD_SINK; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_YUYV8_1X16; + format.format.code = MEDIA_BUS_FMT_YUYV8_1X16; format.format.width = 4096; format.format.height = 4096; resizer_set_format(sd, fh, &format); diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c index bc38c88c7bd9..b463fe172d16 100644 --- a/drivers/media/platform/omap3isp/ispvideo.c +++ b/drivers/media/platform/omap3isp/ispvideo.c @@ -39,74 +39,74 @@ * corresponding in-memory formats to the table below!!! */ static struct isp_format_info formats[] = { - { V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8, - V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8, + { MEDIA_BUS_FMT_Y8_1X8, MEDIA_BUS_FMT_Y8_1X8, + MEDIA_BUS_FMT_Y8_1X8, MEDIA_BUS_FMT_Y8_1X8, V4L2_PIX_FMT_GREY, 8, 1, }, - { V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y10_1X10, - V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y8_1X8, + { MEDIA_BUS_FMT_Y10_1X10, MEDIA_BUS_FMT_Y10_1X10, + MEDIA_BUS_FMT_Y10_1X10, MEDIA_BUS_FMT_Y8_1X8, V4L2_PIX_FMT_Y10, 10, 2, }, - { V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y10_1X10, - V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y8_1X8, + { MEDIA_BUS_FMT_Y12_1X12, MEDIA_BUS_FMT_Y10_1X10, + MEDIA_BUS_FMT_Y12_1X12, MEDIA_BUS_FMT_Y8_1X8, V4L2_PIX_FMT_Y12, 12, 2, }, - { V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8, - V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8, + { MEDIA_BUS_FMT_SBGGR8_1X8, MEDIA_BUS_FMT_SBGGR8_1X8, + MEDIA_BUS_FMT_SBGGR8_1X8, MEDIA_BUS_FMT_SBGGR8_1X8, V4L2_PIX_FMT_SBGGR8, 8, 1, }, - { V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8, - V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8, + { MEDIA_BUS_FMT_SGBRG8_1X8, MEDIA_BUS_FMT_SGBRG8_1X8, + MEDIA_BUS_FMT_SGBRG8_1X8, MEDIA_BUS_FMT_SGBRG8_1X8, V4L2_PIX_FMT_SGBRG8, 8, 1, }, - { V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8, - V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8, + { MEDIA_BUS_FMT_SGRBG8_1X8, MEDIA_BUS_FMT_SGRBG8_1X8, + MEDIA_BUS_FMT_SGRBG8_1X8, MEDIA_BUS_FMT_SGRBG8_1X8, V4L2_PIX_FMT_SGRBG8, 8, 1, }, - { V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8, - V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8, + { MEDIA_BUS_FMT_SRGGB8_1X8, MEDIA_BUS_FMT_SRGGB8_1X8, + MEDIA_BUS_FMT_SRGGB8_1X8, MEDIA_BUS_FMT_SRGGB8_1X8, V4L2_PIX_FMT_SRGGB8, 8, 1, }, - { V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8, V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8, - V4L2_MBUS_FMT_SBGGR10_1X10, 0, + { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, + MEDIA_BUS_FMT_SBGGR10_1X10, 0, V4L2_PIX_FMT_SBGGR10DPCM8, 8, 1, }, - { V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8, V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8, - V4L2_MBUS_FMT_SGBRG10_1X10, 0, + { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, + MEDIA_BUS_FMT_SGBRG10_1X10, 0, V4L2_PIX_FMT_SGBRG10DPCM8, 8, 1, }, - { V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, - V4L2_MBUS_FMT_SGRBG10_1X10, 0, + { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, + MEDIA_BUS_FMT_SGRBG10_1X10, 0, V4L2_PIX_FMT_SGRBG10DPCM8, 8, 1, }, - { V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8, V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8, - V4L2_MBUS_FMT_SRGGB10_1X10, 0, + { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, + MEDIA_BUS_FMT_SRGGB10_1X10, 0, V4L2_PIX_FMT_SRGGB10DPCM8, 8, 1, }, - { V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10, - V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR8_1X8, + { MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SBGGR10_1X10, + MEDIA_BUS_FMT_SBGGR10_1X10, MEDIA_BUS_FMT_SBGGR8_1X8, V4L2_PIX_FMT_SBGGR10, 10, 2, }, - { V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG10_1X10, - V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG8_1X8, + { MEDIA_BUS_FMT_SGBRG10_1X10, MEDIA_BUS_FMT_SGBRG10_1X10, + MEDIA_BUS_FMT_SGBRG10_1X10, MEDIA_BUS_FMT_SGBRG8_1X8, V4L2_PIX_FMT_SGBRG10, 10, 2, }, - { V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG10_1X10, - V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG8_1X8, + { MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SGRBG10_1X10, + MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SGRBG8_1X8, V4L2_PIX_FMT_SGRBG10, 10, 2, }, - { V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB10_1X10, - V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB8_1X8, + { MEDIA_BUS_FMT_SRGGB10_1X10, MEDIA_BUS_FMT_SRGGB10_1X10, + MEDIA_BUS_FMT_SRGGB10_1X10, MEDIA_BUS_FMT_SRGGB8_1X8, V4L2_PIX_FMT_SRGGB10, 10, 2, }, - { V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR10_1X10, - V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR8_1X8, + { MEDIA_BUS_FMT_SBGGR12_1X12, MEDIA_BUS_FMT_SBGGR10_1X10, + MEDIA_BUS_FMT_SBGGR12_1X12, MEDIA_BUS_FMT_SBGGR8_1X8, V4L2_PIX_FMT_SBGGR12, 12, 2, }, - { V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG10_1X10, - V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG8_1X8, + { MEDIA_BUS_FMT_SGBRG12_1X12, MEDIA_BUS_FMT_SGBRG10_1X10, + MEDIA_BUS_FMT_SGBRG12_1X12, MEDIA_BUS_FMT_SGBRG8_1X8, V4L2_PIX_FMT_SGBRG12, 12, 2, }, - { V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG10_1X10, - V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG8_1X8, + { MEDIA_BUS_FMT_SGRBG12_1X12, MEDIA_BUS_FMT_SGRBG10_1X10, + MEDIA_BUS_FMT_SGRBG12_1X12, MEDIA_BUS_FMT_SGRBG8_1X8, V4L2_PIX_FMT_SGRBG12, 12, 2, }, - { V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB10_1X10, - V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB8_1X8, + { MEDIA_BUS_FMT_SRGGB12_1X12, MEDIA_BUS_FMT_SRGGB10_1X10, + MEDIA_BUS_FMT_SRGGB12_1X12, MEDIA_BUS_FMT_SRGGB8_1X8, V4L2_PIX_FMT_SRGGB12, 12, 2, }, - { V4L2_MBUS_FMT_UYVY8_1X16, V4L2_MBUS_FMT_UYVY8_1X16, - V4L2_MBUS_FMT_UYVY8_1X16, 0, + { MEDIA_BUS_FMT_UYVY8_1X16, MEDIA_BUS_FMT_UYVY8_1X16, + MEDIA_BUS_FMT_UYVY8_1X16, 0, V4L2_PIX_FMT_UYVY, 16, 2, }, - { V4L2_MBUS_FMT_YUYV8_1X16, V4L2_MBUS_FMT_YUYV8_1X16, - V4L2_MBUS_FMT_YUYV8_1X16, 0, + { MEDIA_BUS_FMT_YUYV8_1X16, MEDIA_BUS_FMT_YUYV8_1X16, + MEDIA_BUS_FMT_YUYV8_1X16, 0, V4L2_PIX_FMT_YUYV, 16, 2, }, - { V4L2_MBUS_FMT_UYVY8_2X8, V4L2_MBUS_FMT_UYVY8_2X8, - V4L2_MBUS_FMT_UYVY8_2X8, 0, + { MEDIA_BUS_FMT_UYVY8_2X8, MEDIA_BUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_UYVY8_2X8, 0, V4L2_PIX_FMT_UYVY, 8, 2, }, - { V4L2_MBUS_FMT_YUYV8_2X8, V4L2_MBUS_FMT_YUYV8_2X8, - V4L2_MBUS_FMT_YUYV8_2X8, 0, + { MEDIA_BUS_FMT_YUYV8_2X8, MEDIA_BUS_FMT_YUYV8_2X8, + MEDIA_BUS_FMT_YUYV8_2X8, 0, V4L2_PIX_FMT_YUYV, 8, 2, }, /* Empty entry to catch the unsupported pixel code (0) used by the CCDC * module and avoid NULL pointer dereferences. @@ -114,8 +114,7 @@ static struct isp_format_info formats[] = { { 0, } }; -const struct isp_format_info * -omap3isp_video_format_info(enum v4l2_mbus_pixelcode code) +const struct isp_format_info *omap3isp_video_format_info(u32 code) { unsigned int i; diff --git a/drivers/media/platform/omap3isp/ispvideo.h b/drivers/media/platform/omap3isp/ispvideo.h index 0b7efedc3da9..4071dd7060ea 100644 --- a/drivers/media/platform/omap3isp/ispvideo.h +++ b/drivers/media/platform/omap3isp/ispvideo.h @@ -44,10 +44,10 @@ struct v4l2_pix_format; * @bpp: Bytes per pixel (when stored in memory) */ struct isp_format_info { - enum v4l2_mbus_pixelcode code; - enum v4l2_mbus_pixelcode truncated; - enum v4l2_mbus_pixelcode uncompressed; - enum v4l2_mbus_pixelcode flavor; + u32 code; + u32 truncated; + u32 uncompressed; + u32 flavor; u32 pixelformat; unsigned int width; unsigned int bpp; @@ -206,6 +206,6 @@ void omap3isp_video_resume(struct isp_video *video, int continuous); struct media_pad *omap3isp_video_remote_pad(struct isp_video *video); const struct isp_format_info * -omap3isp_video_format_info(enum v4l2_mbus_pixelcode code); +omap3isp_video_format_info(u32 code); #endif /* OMAP3_ISP_VIDEO_H */ diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c index 4f81b4c9d113..aa40c8269ab8 100644 --- a/drivers/media/platform/s3c-camif/camif-capture.c +++ b/drivers/media/platform/s3c-camif/camif-capture.c @@ -1218,11 +1218,11 @@ void s3c_camif_unregister_video_node(struct camif_dev *camif, int idx) } /* Media bus pixel formats supported at the camif input */ -static const enum v4l2_mbus_pixelcode camif_mbus_formats[] = { - V4L2_MBUS_FMT_YUYV8_2X8, - V4L2_MBUS_FMT_YVYU8_2X8, - V4L2_MBUS_FMT_UYVY8_2X8, - V4L2_MBUS_FMT_VYUY8_2X8, +static const u32 camif_mbus_formats[] = { + MEDIA_BUS_FMT_YUYV8_2X8, + MEDIA_BUS_FMT_YVYU8_2X8, + MEDIA_BUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_VYUY8_2X8, }; /* diff --git a/drivers/media/platform/s3c-camif/camif-regs.c b/drivers/media/platform/s3c-camif/camif-regs.c index 6e0c9988a191..812fb3a7c4e3 100644 --- a/drivers/media/platform/s3c-camif/camif-regs.c +++ b/drivers/media/platform/s3c-camif/camif-regs.c @@ -96,10 +96,10 @@ void camif_hw_set_effect(struct camif_dev *camif, unsigned int effect, } static const u32 src_pixfmt_map[8][2] = { - { V4L2_MBUS_FMT_YUYV8_2X8, CISRCFMT_ORDER422_YCBYCR }, - { V4L2_MBUS_FMT_YVYU8_2X8, CISRCFMT_ORDER422_YCRYCB }, - { V4L2_MBUS_FMT_UYVY8_2X8, CISRCFMT_ORDER422_CBYCRY }, - { V4L2_MBUS_FMT_VYUY8_2X8, CISRCFMT_ORDER422_CRYCBY }, + { MEDIA_BUS_FMT_YUYV8_2X8, CISRCFMT_ORDER422_YCBYCR }, + { MEDIA_BUS_FMT_YVYU8_2X8, CISRCFMT_ORDER422_YCRYCB }, + { MEDIA_BUS_FMT_UYVY8_2X8, CISRCFMT_ORDER422_CBYCRY }, + { MEDIA_BUS_FMT_VYUY8_2X8, CISRCFMT_ORDER422_CRYCBY }, }; /* Set camera input pixel format and resolution */ diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c index 37c8bd694c5f..1d1ef211e113 100644 --- a/drivers/media/platform/s5p-tv/hdmi_drv.c +++ b/drivers/media/platform/s5p-tv/hdmi_drv.c @@ -660,7 +660,7 @@ static int hdmi_g_mbus_fmt(struct v4l2_subdev *sd, memset(fmt, 0, sizeof(*fmt)); fmt->width = t->hact.end - t->hact.beg; fmt->height = t->vact[0].end - t->vact[0].beg; - fmt->code = V4L2_MBUS_FMT_FIXED; /* means RGB888 */ + fmt->code = MEDIA_BUS_FMT_FIXED; /* means RGB888 */ fmt->colorspace = V4L2_COLORSPACE_SRGB; if (t->interlaced) { fmt->field = V4L2_FIELD_INTERLACED; diff --git a/drivers/media/platform/s5p-tv/sdo_drv.c b/drivers/media/platform/s5p-tv/sdo_drv.c index 72cf892dd008..46f4d56aaa1b 100644 --- a/drivers/media/platform/s5p-tv/sdo_drv.c +++ b/drivers/media/platform/s5p-tv/sdo_drv.c @@ -170,7 +170,7 @@ static int sdo_g_mbus_fmt(struct v4l2_subdev *sd, /* all modes are 720 pixels wide */ fmt->width = 720; fmt->height = sdev->fmt->height; - fmt->code = V4L2_MBUS_FMT_FIXED; + fmt->code = MEDIA_BUS_FMT_FIXED; fmt->field = V4L2_FIELD_INTERLACED; fmt->colorspace = V4L2_COLORSPACE_JPEG; return 0; diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c index e5f1d4c14f2c..047669609458 100644 --- a/drivers/media/platform/sh_vou.c +++ b/drivers/media/platform/sh_vou.c @@ -680,7 +680,7 @@ static int sh_vou_s_fmt_vid_out(struct file *file, void *priv, struct sh_vou_geometry geo; struct v4l2_mbus_framefmt mbfmt = { /* Revisit: is this the correct code? */ - .code = V4L2_MBUS_FMT_YUYV8_2X8, + .code = MEDIA_BUS_FMT_YUYV8_2X8, .field = V4L2_FIELD_INTERLACED, .colorspace = V4L2_COLORSPACE_SMPTE170M, }; @@ -733,7 +733,7 @@ static int sh_vou_s_fmt_vid_out(struct file *file, void *priv, /* Sanity checks */ if ((unsigned)mbfmt.width > VOU_MAX_IMAGE_WIDTH || (unsigned)mbfmt.height > img_height_max || - mbfmt.code != V4L2_MBUS_FMT_YUYV8_2X8) + mbfmt.code != MEDIA_BUS_FMT_YUYV8_2X8) return -EIO; if (mbfmt.width != geo.output.width || @@ -943,7 +943,7 @@ static int sh_vou_s_crop(struct file *file, void *fh, const struct v4l2_crop *a) struct sh_vou_geometry geo; struct v4l2_mbus_framefmt mbfmt = { /* Revisit: is this the correct code? */ - .code = V4L2_MBUS_FMT_YUYV8_2X8, + .code = MEDIA_BUS_FMT_YUYV8_2X8, .field = V4L2_FIELD_INTERLACED, .colorspace = V4L2_COLORSPACE_SMPTE170M, }; @@ -994,7 +994,7 @@ static int sh_vou_s_crop(struct file *file, void *fh, const struct v4l2_crop *a) /* Sanity checks */ if ((unsigned)mbfmt.width > VOU_MAX_IMAGE_WIDTH || (unsigned)mbfmt.height > img_height_max || - mbfmt.code != V4L2_MBUS_FMT_YUYV8_2X8) + mbfmt.code != MEDIA_BUS_FMT_YUYV8_2X8) return -EIO; geo.output.width = mbfmt.width; diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c index c5291b001057..ee5650f4ea2d 100644 --- a/drivers/media/platform/soc_camera/atmel-isi.c +++ b/drivers/media/platform/soc_camera/atmel-isi.c @@ -105,25 +105,25 @@ static u32 isi_readl(struct atmel_isi *isi, u32 reg) } static int configure_geometry(struct atmel_isi *isi, u32 width, - u32 height, enum v4l2_mbus_pixelcode code) + u32 height, u32 code) { u32 cfg2, cr; switch (code) { /* YUV, including grey */ - case V4L2_MBUS_FMT_Y8_1X8: + case MEDIA_BUS_FMT_Y8_1X8: cr = ISI_CFG2_GRAYSCALE; break; - case V4L2_MBUS_FMT_VYUY8_2X8: + case MEDIA_BUS_FMT_VYUY8_2X8: cr = ISI_CFG2_YCC_SWAP_MODE_3; break; - case V4L2_MBUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: cr = ISI_CFG2_YCC_SWAP_MODE_2; break; - case V4L2_MBUS_FMT_YVYU8_2X8: + case MEDIA_BUS_FMT_YVYU8_2X8: cr = ISI_CFG2_YCC_SWAP_MODE_1; break; - case V4L2_MBUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: cr = ISI_CFG2_YCC_SWAP_DEFAULT; break; /* RGB, TODO */ @@ -645,7 +645,7 @@ static int isi_camera_get_formats(struct soc_camera_device *icd, struct v4l2_subdev *sd = soc_camera_to_subdev(icd); int formats = 0, ret; /* sensor format */ - enum v4l2_mbus_pixelcode code; + u32 code; /* soc camera host format */ const struct soc_mbus_pixelfmt *fmt; @@ -670,10 +670,10 @@ static int isi_camera_get_formats(struct soc_camera_device *icd, } switch (code) { - case V4L2_MBUS_FMT_UYVY8_2X8: - case V4L2_MBUS_FMT_VYUY8_2X8: - case V4L2_MBUS_FMT_YUYV8_2X8: - case V4L2_MBUS_FMT_YVYU8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_VYUY8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YVYU8_2X8: formats++; if (xlate) { xlate->host_fmt = &isi_camera_formats[0]; diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c index 2347612a4cc1..ce72bd26a6ac 100644 --- a/drivers/media/platform/soc_camera/mx2_camera.c +++ b/drivers/media/platform/soc_camera/mx2_camera.c @@ -211,7 +211,7 @@ struct emma_prp_resize { /* prp configuration for a client-host fmt pair */ struct mx2_fmt_cfg { - enum v4l2_mbus_pixelcode in_fmt; + u32 in_fmt; u32 out_fmt; struct mx2_prp_cfg cfg; }; @@ -309,7 +309,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { } }, { - .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8, + .in_fmt = MEDIA_BUS_FMT_UYVY8_2X8, .out_fmt = V4L2_PIX_FMT_YUYV, .cfg = { .channel = 1, @@ -323,7 +323,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { } }, { - .in_fmt = V4L2_MBUS_FMT_YUYV8_2X8, + .in_fmt = MEDIA_BUS_FMT_YUYV8_2X8, .out_fmt = V4L2_PIX_FMT_YUYV, .cfg = { .channel = 1, @@ -337,7 +337,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { } }, { - .in_fmt = V4L2_MBUS_FMT_YUYV8_2X8, + .in_fmt = MEDIA_BUS_FMT_YUYV8_2X8, .out_fmt = V4L2_PIX_FMT_YUV420, .cfg = { .channel = 2, @@ -351,7 +351,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { } }, { - .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8, + .in_fmt = MEDIA_BUS_FMT_UYVY8_2X8, .out_fmt = V4L2_PIX_FMT_YUV420, .cfg = { .channel = 2, @@ -366,9 +366,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = { }, }; -static struct mx2_fmt_cfg *mx27_emma_prp_get_format( - enum v4l2_mbus_pixelcode in_fmt, - u32 out_fmt) +static struct mx2_fmt_cfg *mx27_emma_prp_get_format(u32 in_fmt, u32 out_fmt) { int i; @@ -945,7 +943,7 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, struct v4l2_subdev *sd = soc_camera_to_subdev(icd); const struct soc_mbus_pixelfmt *fmt; struct device *dev = icd->parent; - enum v4l2_mbus_pixelcode code; + u32 code; int ret, formats = 0; ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); @@ -959,8 +957,8 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, return 0; } - if (code == V4L2_MBUS_FMT_YUYV8_2X8 || - code == V4L2_MBUS_FMT_UYVY8_2X8) { + if (code == MEDIA_BUS_FMT_YUYV8_2X8 || + code == MEDIA_BUS_FMT_UYVY8_2X8) { formats++; if (xlate) { /* @@ -968,7 +966,7 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, * soc_mediabus.c */ xlate->host_fmt = - soc_mbus_get_fmtdesc(V4L2_MBUS_FMT_YUYV8_1_5X8); + soc_mbus_get_fmtdesc(MEDIA_BUS_FMT_YUYV8_1_5X8); xlate->code = code; dev_dbg(dev, "Providing host format %s for sensor code %d\n", xlate->host_fmt->name, code); @@ -976,11 +974,11 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd, } } - if (code == V4L2_MBUS_FMT_UYVY8_2X8) { + if (code == MEDIA_BUS_FMT_UYVY8_2X8) { formats++; if (xlate) { xlate->host_fmt = - soc_mbus_get_fmtdesc(V4L2_MBUS_FMT_YUYV8_2X8); + soc_mbus_get_fmtdesc(MEDIA_BUS_FMT_YUYV8_2X8); xlate->code = code; dev_dbg(dev, "Providing host format %s for sensor code %d\n", xlate->host_fmt->name, code); diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c index 7696a873510d..8e52ccce66de 100644 --- a/drivers/media/platform/soc_camera/mx3_camera.c +++ b/drivers/media/platform/soc_camera/mx3_camera.c @@ -656,7 +656,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id struct v4l2_subdev *sd = soc_camera_to_subdev(icd); struct device *dev = icd->parent; int formats = 0, ret; - enum v4l2_mbus_pixelcode code; + u32 code; const struct soc_mbus_pixelfmt *fmt; ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); @@ -677,7 +677,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id return 0; switch (code) { - case V4L2_MBUS_FMT_SBGGR10_1X10: + case MEDIA_BUS_FMT_SBGGR10_1X10: formats++; if (xlate) { xlate->host_fmt = &mx3_camera_formats[0]; @@ -687,7 +687,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id mx3_camera_formats[0].name, code); } break; - case V4L2_MBUS_FMT_Y10_1X10: + case MEDIA_BUS_FMT_Y10_1X10: formats++; if (xlate) { xlate->host_fmt = &mx3_camera_formats[1]; diff --git a/drivers/media/platform/soc_camera/omap1_camera.c b/drivers/media/platform/soc_camera/omap1_camera.c index 74ce8b6b79fa..e6b93281f246 100644 --- a/drivers/media/platform/soc_camera/omap1_camera.c +++ b/drivers/media/platform/soc_camera/omap1_camera.c @@ -140,7 +140,7 @@ /* buffer for one video frame */ struct omap1_cam_buf { struct videobuf_buffer vb; - enum v4l2_mbus_pixelcode code; + u32 code; int inwork; struct scatterlist *sgbuf; int sgcount; @@ -980,7 +980,7 @@ static void omap1_cam_clock_stop(struct soc_camera_host *ici) /* Duplicate standard formats based on host capability of byte swapping */ static const struct soc_mbus_lookup omap1_cam_formats[] = { { - .code = V4L2_MBUS_FMT_UYVY8_2X8, + .code = MEDIA_BUS_FMT_UYVY8_2X8, .fmt = { .fourcc = V4L2_PIX_FMT_YUYV, .name = "YUYV", @@ -990,7 +990,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_VYUY8_2X8, + .code = MEDIA_BUS_FMT_VYUY8_2X8, .fmt = { .fourcc = V4L2_PIX_FMT_YVYU, .name = "YVYU", @@ -1000,7 +1000,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_YUYV8_2X8, + .code = MEDIA_BUS_FMT_YUYV8_2X8, .fmt = { .fourcc = V4L2_PIX_FMT_UYVY, .name = "UYVY", @@ -1010,7 +1010,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_YVYU8_2X8, + .code = MEDIA_BUS_FMT_YVYU8_2X8, .fmt = { .fourcc = V4L2_PIX_FMT_VYUY, .name = "VYUY", @@ -1020,7 +1020,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB555, .name = "RGB555", @@ -1030,7 +1030,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB555X, .name = "RGB555X", @@ -1040,7 +1040,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB565_2X8_BE, + .code = MEDIA_BUS_FMT_RGB565_2X8_BE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB565, .name = "RGB565", @@ -1050,7 +1050,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB565_2X8_LE, + .code = MEDIA_BUS_FMT_RGB565_2X8_LE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB565X, .name = "RGB565X", @@ -1068,7 +1068,7 @@ static int omap1_cam_get_formats(struct soc_camera_device *icd, struct v4l2_subdev *sd = soc_camera_to_subdev(icd); struct device *dev = icd->parent; int formats = 0, ret; - enum v4l2_mbus_pixelcode code; + u32 code; const struct soc_mbus_pixelfmt *fmt; ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); @@ -1088,14 +1088,14 @@ static int omap1_cam_get_formats(struct soc_camera_device *icd, return 0; switch (code) { - case V4L2_MBUS_FMT_YUYV8_2X8: - case V4L2_MBUS_FMT_YVYU8_2X8: - case V4L2_MBUS_FMT_UYVY8_2X8: - case V4L2_MBUS_FMT_VYUY8_2X8: - case V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE: - case V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE: - case V4L2_MBUS_FMT_RGB565_2X8_BE: - case V4L2_MBUS_FMT_RGB565_2X8_LE: + case MEDIA_BUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YVYU8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_VYUY8_2X8: + case MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE: + case MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE: + case MEDIA_BUS_FMT_RGB565_2X8_BE: + case MEDIA_BUS_FMT_RGB565_2X8_LE: formats++; if (xlate) { xlate->host_fmt = soc_mbus_find_fmtdesc(code, diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c index 66178fc9f9eb..951226af0eba 100644 --- a/drivers/media/platform/soc_camera/pxa_camera.c +++ b/drivers/media/platform/soc_camera/pxa_camera.c @@ -187,7 +187,7 @@ struct pxa_cam_dma { struct pxa_buffer { /* common v4l buffer stuff -- must be first */ struct videobuf_buffer vb; - enum v4l2_mbus_pixelcode code; + u32 code; /* our descriptor lists for Y, U and V channels */ struct pxa_cam_dma dmas[3]; int inwork; @@ -1253,7 +1253,7 @@ static int pxa_camera_get_formats(struct soc_camera_device *icd, unsigned int id struct device *dev = icd->parent; int formats = 0, ret; struct pxa_cam *cam; - enum v4l2_mbus_pixelcode code; + u32 code; const struct soc_mbus_pixelfmt *fmt; ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); @@ -1283,7 +1283,7 @@ static int pxa_camera_get_formats(struct soc_camera_device *icd, unsigned int id } switch (code) { - case V4L2_MBUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: formats++; if (xlate) { xlate->host_fmt = &pxa_camera_formats[0]; @@ -1292,11 +1292,11 @@ static int pxa_camera_get_formats(struct soc_camera_device *icd, unsigned int id dev_dbg(dev, "Providing format %s using code %d\n", pxa_camera_formats[0].name, code); } - case V4L2_MBUS_FMT_VYUY8_2X8: - case V4L2_MBUS_FMT_YUYV8_2X8: - case V4L2_MBUS_FMT_YVYU8_2X8: - case V4L2_MBUS_FMT_RGB565_2X8_LE: - case V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE: + case MEDIA_BUS_FMT_VYUY8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YVYU8_2X8: + case MEDIA_BUS_FMT_RGB565_2X8_LE: + case MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE: if (xlate) dev_dbg(dev, "Providing format %s packed\n", fmt->name); diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 20defcb8b31b..8d8438b10b87 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -272,16 +272,16 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) /* input interface */ switch (icd->current_fmt->code) { - case V4L2_MBUS_FMT_YUYV8_1X16: + case MEDIA_BUS_FMT_YUYV8_1X16: /* BT.601/BT.1358 16bit YCbCr422 */ vnmc |= VNMC_INF_YUV16; break; - case V4L2_MBUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: /* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */ vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ? VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601; break; - case V4L2_MBUS_FMT_YUYV10_2X10: + case MEDIA_BUS_FMT_YUYV10_2X10: /* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */ vnmc |= priv->pdata_flags & RCAR_VIN_BT656 ? VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601; @@ -921,7 +921,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx, int ret, k, n; int formats = 0; struct rcar_vin_cam *cam; - enum v4l2_mbus_pixelcode code; + u32 code; const struct soc_mbus_pixelfmt *fmt; ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); @@ -1010,9 +1010,9 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx, cam->extra_fmt = NULL; switch (code) { - case V4L2_MBUS_FMT_YUYV8_1X16: - case V4L2_MBUS_FMT_YUYV8_2X8: - case V4L2_MBUS_FMT_YUYV10_2X10: + case MEDIA_BUS_FMT_YUYV8_1X16: + case MEDIA_BUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YUYV10_2X10: if (cam->extra_fmt) break; diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c index 20ad4a571d37..5f58ed995320 100644 --- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c +++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c @@ -149,7 +149,7 @@ struct sh_mobile_ceu_cam { /* Camera cropping rectangle */ struct v4l2_rect rect; const struct soc_mbus_pixelfmt *extra_fmt; - enum v4l2_mbus_pixelcode code; + u32 code; }; static struct sh_mobile_ceu_buffer *to_ceu_vb(struct vb2_buffer *vb) @@ -861,16 +861,16 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd) case V4L2_PIX_FMT_NV16: case V4L2_PIX_FMT_NV61: switch (cam->code) { - case V4L2_MBUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: value = 0x00000000; /* Cb0, Y0, Cr0, Y1 */ break; - case V4L2_MBUS_FMT_VYUY8_2X8: + case MEDIA_BUS_FMT_VYUY8_2X8: value = 0x00000100; /* Cr0, Y0, Cb0, Y1 */ break; - case V4L2_MBUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: value = 0x00000200; /* Y0, Cb0, Y1, Cr0 */ break; - case V4L2_MBUS_FMT_YVYU8_2X8: + case MEDIA_BUS_FMT_YVYU8_2X8: value = 0x00000300; /* Y0, Cr0, Y1, Cb0 */ break; default: @@ -1048,7 +1048,7 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, unsigned int int ret, k, n; int formats = 0; struct sh_mobile_ceu_cam *cam; - enum v4l2_mbus_pixelcode code; + u32 code; const struct soc_mbus_pixelfmt *fmt; ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); @@ -1141,10 +1141,10 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, unsigned int cam->extra_fmt = NULL; switch (code) { - case V4L2_MBUS_FMT_UYVY8_2X8: - case V4L2_MBUS_FMT_VYUY8_2X8: - case V4L2_MBUS_FMT_YUYV8_2X8: - case V4L2_MBUS_FMT_YVYU8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_VYUY8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YVYU8_2X8: if (cam->extra_fmt) break; diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c b/drivers/media/platform/soc_camera/sh_mobile_csi2.c index 05dd21a35d63..c738e27a75d7 100644 --- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c +++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c @@ -59,28 +59,28 @@ static int sh_csi2_try_fmt(struct v4l2_subdev *sd, switch (pdata->type) { case SH_CSI2C: switch (mf->code) { - case V4L2_MBUS_FMT_UYVY8_2X8: /* YUV422 */ - case V4L2_MBUS_FMT_YUYV8_1_5X8: /* YUV420 */ - case V4L2_MBUS_FMT_Y8_1X8: /* RAW8 */ - case V4L2_MBUS_FMT_SBGGR8_1X8: - case V4L2_MBUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_UYVY8_2X8: /* YUV422 */ + case MEDIA_BUS_FMT_YUYV8_1_5X8: /* YUV420 */ + case MEDIA_BUS_FMT_Y8_1X8: /* RAW8 */ + case MEDIA_BUS_FMT_SBGGR8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: break; default: /* All MIPI CSI-2 devices must support one of primary formats */ - mf->code = V4L2_MBUS_FMT_YUYV8_2X8; + mf->code = MEDIA_BUS_FMT_YUYV8_2X8; } break; case SH_CSI2I: switch (mf->code) { - case V4L2_MBUS_FMT_Y8_1X8: /* RAW8 */ - case V4L2_MBUS_FMT_SBGGR8_1X8: - case V4L2_MBUS_FMT_SGRBG8_1X8: - case V4L2_MBUS_FMT_SBGGR10_1X10: /* RAW10 */ - case V4L2_MBUS_FMT_SBGGR12_1X12: /* RAW12 */ + case MEDIA_BUS_FMT_Y8_1X8: /* RAW8 */ + case MEDIA_BUS_FMT_SBGGR8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_SBGGR10_1X10: /* RAW10 */ + case MEDIA_BUS_FMT_SBGGR12_1X12: /* RAW12 */ break; default: /* All MIPI CSI-2 devices must support one of primary formats */ - mf->code = V4L2_MBUS_FMT_SBGGR8_1X8; + mf->code = MEDIA_BUS_FMT_SBGGR8_1X8; } break; } @@ -104,21 +104,21 @@ static int sh_csi2_s_fmt(struct v4l2_subdev *sd, return -EINVAL; switch (mf->code) { - case V4L2_MBUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: tmp |= 0x1e; /* YUV422 8 bit */ break; - case V4L2_MBUS_FMT_YUYV8_1_5X8: + case MEDIA_BUS_FMT_YUYV8_1_5X8: tmp |= 0x18; /* YUV420 8 bit */ break; - case V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE: + case MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE: tmp |= 0x21; /* RGB555 */ break; - case V4L2_MBUS_FMT_RGB565_2X8_BE: + case MEDIA_BUS_FMT_RGB565_2X8_BE: tmp |= 0x22; /* RGB565 */ break; - case V4L2_MBUS_FMT_Y8_1X8: - case V4L2_MBUS_FMT_SBGGR8_1X8: - case V4L2_MBUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_Y8_1X8: + case MEDIA_BUS_FMT_SBGGR8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: tmp |= 0x2a; /* RAW8 */ break; default: diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index 8e61b976da19..f4be2a1c659a 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c @@ -460,7 +460,7 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd) struct soc_camera_host *ici = to_soc_camera_host(icd->parent); unsigned int i, fmts = 0, raw_fmts = 0; int ret; - enum v4l2_mbus_pixelcode code; + u32 code; while (!v4l2_subdev_call(sd, video, enum_mbus_fmt, raw_fmts, &code)) raw_fmts++; diff --git a/drivers/media/platform/soc_camera/soc_camera_platform.c b/drivers/media/platform/soc_camera/soc_camera_platform.c index ceaddfb85e49..f2ce1ab06d53 100644 --- a/drivers/media/platform/soc_camera/soc_camera_platform.c +++ b/drivers/media/platform/soc_camera/soc_camera_platform.c @@ -62,7 +62,7 @@ static struct v4l2_subdev_core_ops platform_subdev_core_ops = { }; static int soc_camera_platform_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) + u32 *code) { struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c index dc02deca7563..1dbcd426683c 100644 --- a/drivers/media/platform/soc_camera/soc_mediabus.c +++ b/drivers/media/platform/soc_camera/soc_mediabus.c @@ -17,7 +17,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { { - .code = V4L2_MBUS_FMT_YUYV8_2X8, + .code = MEDIA_BUS_FMT_YUYV8_2X8, .fmt = { .fourcc = V4L2_PIX_FMT_YUYV, .name = "YUYV", @@ -27,7 +27,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_YVYU8_2X8, + .code = MEDIA_BUS_FMT_YVYU8_2X8, .fmt = { .fourcc = V4L2_PIX_FMT_YVYU, .name = "YVYU", @@ -37,7 +37,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_UYVY8_2X8, + .code = MEDIA_BUS_FMT_UYVY8_2X8, .fmt = { .fourcc = V4L2_PIX_FMT_UYVY, .name = "UYVY", @@ -47,7 +47,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_VYUY8_2X8, + .code = MEDIA_BUS_FMT_VYUY8_2X8, .fmt = { .fourcc = V4L2_PIX_FMT_VYUY, .name = "VYUY", @@ -57,7 +57,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB555, .name = "RGB555", @@ -67,7 +67,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB555X, .name = "RGB555X", @@ -77,7 +77,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB565_2X8_LE, + .code = MEDIA_BUS_FMT_RGB565_2X8_LE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB565, .name = "RGB565", @@ -87,7 +87,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB565_2X8_BE, + .code = MEDIA_BUS_FMT_RGB565_2X8_BE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB565X, .name = "RGB565X", @@ -97,7 +97,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB666_1X18, + .code = MEDIA_BUS_FMT_RGB666_1X18, .fmt = { .fourcc = V4L2_PIX_FMT_RGB32, .name = "RGB666/32bpp", @@ -106,7 +106,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .order = SOC_MBUS_ORDER_LE, }, }, { - .code = V4L2_MBUS_FMT_RGB888_1X24, + .code = MEDIA_BUS_FMT_RGB888_1X24, .fmt = { .fourcc = V4L2_PIX_FMT_RGB32, .name = "RGB888/32bpp", @@ -115,7 +115,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .order = SOC_MBUS_ORDER_LE, }, }, { - .code = V4L2_MBUS_FMT_RGB888_2X12_BE, + .code = MEDIA_BUS_FMT_RGB888_2X12_BE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB32, .name = "RGB888/32bpp", @@ -124,7 +124,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .order = SOC_MBUS_ORDER_BE, }, }, { - .code = V4L2_MBUS_FMT_RGB888_2X12_LE, + .code = MEDIA_BUS_FMT_RGB888_2X12_LE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB32, .name = "RGB888/32bpp", @@ -133,7 +133,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .order = SOC_MBUS_ORDER_LE, }, }, { - .code = V4L2_MBUS_FMT_SBGGR8_1X8, + .code = MEDIA_BUS_FMT_SBGGR8_1X8, .fmt = { .fourcc = V4L2_PIX_FMT_SBGGR8, .name = "Bayer 8 BGGR", @@ -143,7 +143,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SBGGR10_1X10, + .code = MEDIA_BUS_FMT_SBGGR10_1X10, .fmt = { .fourcc = V4L2_PIX_FMT_SBGGR10, .name = "Bayer 10 BGGR", @@ -153,7 +153,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_Y8_1X8, + .code = MEDIA_BUS_FMT_Y8_1X8, .fmt = { .fourcc = V4L2_PIX_FMT_GREY, .name = "Grey", @@ -163,7 +163,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_Y10_1X10, + .code = MEDIA_BUS_FMT_Y10_1X10, .fmt = { .fourcc = V4L2_PIX_FMT_Y10, .name = "Grey 10bit", @@ -173,7 +173,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, .fmt = { .fourcc = V4L2_PIX_FMT_SBGGR10, .name = "Bayer 10 BGGR", @@ -183,7 +183,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, .fmt = { .fourcc = V4L2_PIX_FMT_SBGGR10, .name = "Bayer 10 BGGR", @@ -193,7 +193,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, .fmt = { .fourcc = V4L2_PIX_FMT_SBGGR10, .name = "Bayer 10 BGGR", @@ -203,7 +203,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, .fmt = { .fourcc = V4L2_PIX_FMT_SBGGR10, .name = "Bayer 10 BGGR", @@ -213,7 +213,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_JPEG_1X8, + .code = MEDIA_BUS_FMT_JPEG_1X8, .fmt = { .fourcc = V4L2_PIX_FMT_JPEG, .name = "JPEG", @@ -223,7 +223,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE, + .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, .fmt = { .fourcc = V4L2_PIX_FMT_RGB444, .name = "RGB444", @@ -233,7 +233,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_YUYV8_1_5X8, + .code = MEDIA_BUS_FMT_YUYV8_1_5X8, .fmt = { .fourcc = V4L2_PIX_FMT_YUV420, .name = "YUYV 4:2:0", @@ -243,7 +243,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_YVYU8_1_5X8, + .code = MEDIA_BUS_FMT_YVYU8_1_5X8, .fmt = { .fourcc = V4L2_PIX_FMT_YVU420, .name = "YVYU 4:2:0", @@ -253,7 +253,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_UYVY8_1X16, + .code = MEDIA_BUS_FMT_UYVY8_1X16, .fmt = { .fourcc = V4L2_PIX_FMT_UYVY, .name = "UYVY 16bit", @@ -263,7 +263,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_VYUY8_1X16, + .code = MEDIA_BUS_FMT_VYUY8_1X16, .fmt = { .fourcc = V4L2_PIX_FMT_VYUY, .name = "VYUY 16bit", @@ -273,7 +273,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_YUYV8_1X16, + .code = MEDIA_BUS_FMT_YUYV8_1X16, .fmt = { .fourcc = V4L2_PIX_FMT_YUYV, .name = "YUYV 16bit", @@ -283,7 +283,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_YVYU8_1X16, + .code = MEDIA_BUS_FMT_YVYU8_1X16, .fmt = { .fourcc = V4L2_PIX_FMT_YVYU, .name = "YVYU 16bit", @@ -293,7 +293,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SGRBG8_1X8, + .code = MEDIA_BUS_FMT_SGRBG8_1X8, .fmt = { .fourcc = V4L2_PIX_FMT_SGRBG8, .name = "Bayer 8 GRBG", @@ -303,7 +303,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, + .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, .fmt = { .fourcc = V4L2_PIX_FMT_SGRBG10DPCM8, .name = "Bayer 10 BGGR DPCM 8", @@ -313,7 +313,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SGBRG10_1X10, + .code = MEDIA_BUS_FMT_SGBRG10_1X10, .fmt = { .fourcc = V4L2_PIX_FMT_SGBRG10, .name = "Bayer 10 GBRG", @@ -323,7 +323,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SGRBG10_1X10, + .code = MEDIA_BUS_FMT_SGRBG10_1X10, .fmt = { .fourcc = V4L2_PIX_FMT_SGRBG10, .name = "Bayer 10 GRBG", @@ -333,7 +333,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SRGGB10_1X10, + .code = MEDIA_BUS_FMT_SRGGB10_1X10, .fmt = { .fourcc = V4L2_PIX_FMT_SRGGB10, .name = "Bayer 10 RGGB", @@ -343,7 +343,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SBGGR12_1X12, + .code = MEDIA_BUS_FMT_SBGGR12_1X12, .fmt = { .fourcc = V4L2_PIX_FMT_SBGGR12, .name = "Bayer 12 BGGR", @@ -353,7 +353,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SGBRG12_1X12, + .code = MEDIA_BUS_FMT_SGBRG12_1X12, .fmt = { .fourcc = V4L2_PIX_FMT_SGBRG12, .name = "Bayer 12 GBRG", @@ -363,7 +363,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SGRBG12_1X12, + .code = MEDIA_BUS_FMT_SGRBG12_1X12, .fmt = { .fourcc = V4L2_PIX_FMT_SGRBG12, .name = "Bayer 12 GRBG", @@ -373,7 +373,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { - .code = V4L2_MBUS_FMT_SRGGB12_1X12, + .code = MEDIA_BUS_FMT_SRGGB12_1X12, .fmt = { .fourcc = V4L2_PIX_FMT_SRGGB12, .name = "Bayer 12 RGGB", @@ -458,7 +458,7 @@ s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf, EXPORT_SYMBOL(soc_mbus_image_size); const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc( - enum v4l2_mbus_pixelcode code, + u32 code, const struct soc_mbus_lookup *lookup, int n) { @@ -473,7 +473,7 @@ const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc( EXPORT_SYMBOL(soc_mbus_find_fmtdesc); const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( - enum v4l2_mbus_pixelcode code) + u32 code) { return soc_mbus_find_fmtdesc(code, mbus_fmt, ARRAY_SIZE(mbus_fmt)); } diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c index ae6870cb8339..2616483fce0b 100644 --- a/drivers/media/platform/via-camera.c +++ b/drivers/media/platform/via-camera.c @@ -101,7 +101,7 @@ struct via_camera { */ struct v4l2_pix_format sensor_format; struct v4l2_pix_format user_format; - enum v4l2_mbus_pixelcode mbus_code; + u32 mbus_code; }; /* @@ -143,12 +143,12 @@ static struct via_format { __u8 *desc; __u32 pixelformat; int bpp; /* Bytes per pixel */ - enum v4l2_mbus_pixelcode mbus_code; + u32 mbus_code; } via_formats[] = { { .desc = "YUYV 4:2:2", .pixelformat = V4L2_PIX_FMT_YUYV, - .mbus_code = V4L2_MBUS_FMT_YUYV8_2X8, + .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .bpp = 2, }, /* RGB444 and Bayer should be doable, but have never been @@ -849,7 +849,7 @@ static const struct v4l2_pix_format viacam_def_pix_format = { .sizeimage = VGA_WIDTH * VGA_HEIGHT * 2, }; -static const enum v4l2_mbus_pixelcode via_def_mbus_code = V4L2_MBUS_FMT_YUYV8_2X8; +static const u32 via_def_mbus_code = MEDIA_BUS_FMT_YUYV8_2X8; static int viacam_enum_fmt_vid_cap(struct file *filp, void *priv, struct v4l2_fmtdesc *fmt) diff --git a/drivers/media/platform/vsp1/vsp1_bru.c b/drivers/media/platform/vsp1/vsp1_bru.c index a0c1984c733e..b21f381a9862 100644 --- a/drivers/media/platform/vsp1/vsp1_bru.c +++ b/drivers/media/platform/vsp1/vsp1_bru.c @@ -187,8 +187,8 @@ static int bru_enum_mbus_code(struct v4l2_subdev *subdev, struct v4l2_subdev_mbus_code_enum *code) { static const unsigned int codes[] = { - V4L2_MBUS_FMT_ARGB8888_1X32, - V4L2_MBUS_FMT_AYUV8_1X32, + MEDIA_BUS_FMT_ARGB8888_1X32, + MEDIA_BUS_FMT_AYUV8_1X32, }; struct v4l2_mbus_framefmt *format; @@ -215,8 +215,8 @@ static int bru_enum_frame_size(struct v4l2_subdev *subdev, if (fse->index) return -EINVAL; - if (fse->code != V4L2_MBUS_FMT_ARGB8888_1X32 && - fse->code != V4L2_MBUS_FMT_AYUV8_1X32) + if (fse->code != MEDIA_BUS_FMT_ARGB8888_1X32 && + fse->code != MEDIA_BUS_FMT_AYUV8_1X32) return -EINVAL; fse->min_width = BRU_MIN_SIZE; @@ -261,9 +261,9 @@ static void bru_try_format(struct vsp1_bru *bru, struct v4l2_subdev_fh *fh, switch (pad) { case BRU_PAD_SINK(0): /* Default to YUV if the requested format is not supported. */ - if (fmt->code != V4L2_MBUS_FMT_ARGB8888_1X32 && - fmt->code != V4L2_MBUS_FMT_AYUV8_1X32) - fmt->code = V4L2_MBUS_FMT_AYUV8_1X32; + if (fmt->code != MEDIA_BUS_FMT_ARGB8888_1X32 && + fmt->code != MEDIA_BUS_FMT_AYUV8_1X32) + fmt->code = MEDIA_BUS_FMT_AYUV8_1X32; break; default: diff --git a/drivers/media/platform/vsp1/vsp1_hsit.c b/drivers/media/platform/vsp1/vsp1_hsit.c index db2950a73c60..80bedc554ee3 100644 --- a/drivers/media/platform/vsp1/vsp1_hsit.c +++ b/drivers/media/platform/vsp1/vsp1_hsit.c @@ -70,9 +70,9 @@ static int hsit_enum_mbus_code(struct v4l2_subdev *subdev, if ((code->pad == HSIT_PAD_SINK && !hsit->inverse) | (code->pad == HSIT_PAD_SOURCE && hsit->inverse)) - code->code = V4L2_MBUS_FMT_ARGB8888_1X32; + code->code = MEDIA_BUS_FMT_ARGB8888_1X32; else - code->code = V4L2_MBUS_FMT_AHSV8888_1X32; + code->code = MEDIA_BUS_FMT_AHSV8888_1X32; return 0; } @@ -136,8 +136,8 @@ static int hsit_set_format(struct v4l2_subdev *subdev, return 0; } - format->code = hsit->inverse ? V4L2_MBUS_FMT_AHSV8888_1X32 - : V4L2_MBUS_FMT_ARGB8888_1X32; + format->code = hsit->inverse ? MEDIA_BUS_FMT_AHSV8888_1X32 + : MEDIA_BUS_FMT_ARGB8888_1X32; format->width = clamp_t(unsigned int, fmt->format.width, HSIT_MIN_SIZE, HSIT_MAX_SIZE); format->height = clamp_t(unsigned int, fmt->format.height, @@ -151,8 +151,8 @@ static int hsit_set_format(struct v4l2_subdev *subdev, format = vsp1_entity_get_pad_format(&hsit->entity, fh, HSIT_PAD_SOURCE, fmt->which); *format = fmt->format; - format->code = hsit->inverse ? V4L2_MBUS_FMT_ARGB8888_1X32 - : V4L2_MBUS_FMT_AHSV8888_1X32; + format->code = hsit->inverse ? MEDIA_BUS_FMT_ARGB8888_1X32 + : MEDIA_BUS_FMT_AHSV8888_1X32; return 0; } diff --git a/drivers/media/platform/vsp1/vsp1_lif.c b/drivers/media/platform/vsp1/vsp1_lif.c index d4fb23e9c4a8..17a6ca7dafe6 100644 --- a/drivers/media/platform/vsp1/vsp1_lif.c +++ b/drivers/media/platform/vsp1/vsp1_lif.c @@ -78,8 +78,8 @@ static int lif_enum_mbus_code(struct v4l2_subdev *subdev, struct v4l2_subdev_mbus_code_enum *code) { static const unsigned int codes[] = { - V4L2_MBUS_FMT_ARGB8888_1X32, - V4L2_MBUS_FMT_AYUV8_1X32, + MEDIA_BUS_FMT_ARGB8888_1X32, + MEDIA_BUS_FMT_AYUV8_1X32, }; if (code->pad == LIF_PAD_SINK) { @@ -147,9 +147,9 @@ static int lif_set_format(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh, struct v4l2_mbus_framefmt *format; /* Default to YUV if the requested format is not supported. */ - if (fmt->format.code != V4L2_MBUS_FMT_ARGB8888_1X32 && - fmt->format.code != V4L2_MBUS_FMT_AYUV8_1X32) - fmt->format.code = V4L2_MBUS_FMT_AYUV8_1X32; + if (fmt->format.code != MEDIA_BUS_FMT_ARGB8888_1X32 && + fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32) + fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32; format = vsp1_entity_get_pad_format(&lif->entity, fh, fmt->pad, fmt->which); diff --git a/drivers/media/platform/vsp1/vsp1_lut.c b/drivers/media/platform/vsp1/vsp1_lut.c index fea36ebe2565..6f185c3621fe 100644 --- a/drivers/media/platform/vsp1/vsp1_lut.c +++ b/drivers/media/platform/vsp1/vsp1_lut.c @@ -86,9 +86,9 @@ static int lut_enum_mbus_code(struct v4l2_subdev *subdev, struct v4l2_subdev_mbus_code_enum *code) { static const unsigned int codes[] = { - V4L2_MBUS_FMT_ARGB8888_1X32, - V4L2_MBUS_FMT_AHSV8888_1X32, - V4L2_MBUS_FMT_AYUV8_1X32, + MEDIA_BUS_FMT_ARGB8888_1X32, + MEDIA_BUS_FMT_AHSV8888_1X32, + MEDIA_BUS_FMT_AYUV8_1X32, }; struct v4l2_mbus_framefmt *format; @@ -158,10 +158,10 @@ static int lut_set_format(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh, struct v4l2_mbus_framefmt *format; /* Default to YUV if the requested format is not supported. */ - if (fmt->format.code != V4L2_MBUS_FMT_ARGB8888_1X32 && - fmt->format.code != V4L2_MBUS_FMT_AHSV8888_1X32 && - fmt->format.code != V4L2_MBUS_FMT_AYUV8_1X32) - fmt->format.code = V4L2_MBUS_FMT_AYUV8_1X32; + if (fmt->format.code != MEDIA_BUS_FMT_ARGB8888_1X32 && + fmt->format.code != MEDIA_BUS_FMT_AHSV8888_1X32 && + fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32) + fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32; format = vsp1_entity_get_pad_format(&lut->entity, fh, fmt->pad, fmt->which); diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.c b/drivers/media/platform/vsp1/vsp1_rwpf.c index ec3dab6a9b9b..1f1ba26a834a 100644 --- a/drivers/media/platform/vsp1/vsp1_rwpf.c +++ b/drivers/media/platform/vsp1/vsp1_rwpf.c @@ -29,8 +29,8 @@ int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev, struct v4l2_subdev_mbus_code_enum *code) { static const unsigned int codes[] = { - V4L2_MBUS_FMT_ARGB8888_1X32, - V4L2_MBUS_FMT_AYUV8_1X32, + MEDIA_BUS_FMT_ARGB8888_1X32, + MEDIA_BUS_FMT_AYUV8_1X32, }; if (code->index >= ARRAY_SIZE(codes)) @@ -103,9 +103,9 @@ int vsp1_rwpf_set_format(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh, struct v4l2_rect *crop; /* Default to YUV if the requested format is not supported. */ - if (fmt->format.code != V4L2_MBUS_FMT_ARGB8888_1X32 && - fmt->format.code != V4L2_MBUS_FMT_AYUV8_1X32) - fmt->format.code = V4L2_MBUS_FMT_AYUV8_1X32; + if (fmt->format.code != MEDIA_BUS_FMT_ARGB8888_1X32 && + fmt->format.code != MEDIA_BUS_FMT_AYUV8_1X32) + fmt->format.code = MEDIA_BUS_FMT_AYUV8_1X32; format = vsp1_entity_get_pad_format(&rwpf->entity, fh, fmt->pad, fmt->which); diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c index b7d3c8b9f189..1129494c7cfc 100644 --- a/drivers/media/platform/vsp1/vsp1_sru.c +++ b/drivers/media/platform/vsp1/vsp1_sru.c @@ -139,7 +139,7 @@ static int sru_s_stream(struct v4l2_subdev *subdev, int enable) input = &sru->entity.formats[SRU_PAD_SINK]; output = &sru->entity.formats[SRU_PAD_SOURCE]; - if (input->code == V4L2_MBUS_FMT_ARGB8888_1X32) + if (input->code == MEDIA_BUS_FMT_ARGB8888_1X32) ctrl0 = VI6_SRU_CTRL0_PARAM2 | VI6_SRU_CTRL0_PARAM3 | VI6_SRU_CTRL0_PARAM4; else @@ -170,8 +170,8 @@ static int sru_enum_mbus_code(struct v4l2_subdev *subdev, struct v4l2_subdev_mbus_code_enum *code) { static const unsigned int codes[] = { - V4L2_MBUS_FMT_ARGB8888_1X32, - V4L2_MBUS_FMT_AYUV8_1X32, + MEDIA_BUS_FMT_ARGB8888_1X32, + MEDIA_BUS_FMT_AYUV8_1X32, }; struct v4l2_mbus_framefmt *format; @@ -248,9 +248,9 @@ static void sru_try_format(struct vsp1_sru *sru, struct v4l2_subdev_fh *fh, switch (pad) { case SRU_PAD_SINK: /* Default to YUV if the requested format is not supported. */ - if (fmt->code != V4L2_MBUS_FMT_ARGB8888_1X32 && - fmt->code != V4L2_MBUS_FMT_AYUV8_1X32) - fmt->code = V4L2_MBUS_FMT_AYUV8_1X32; + if (fmt->code != MEDIA_BUS_FMT_ARGB8888_1X32 && + fmt->code != MEDIA_BUS_FMT_AYUV8_1X32) + fmt->code = MEDIA_BUS_FMT_AYUV8_1X32; fmt->width = clamp(fmt->width, SRU_MIN_SIZE, SRU_MAX_SIZE); fmt->height = clamp(fmt->height, SRU_MIN_SIZE, SRU_MAX_SIZE); diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c index de92ef4944b3..a4afec133800 100644 --- a/drivers/media/platform/vsp1/vsp1_uds.c +++ b/drivers/media/platform/vsp1/vsp1_uds.c @@ -173,8 +173,8 @@ static int uds_enum_mbus_code(struct v4l2_subdev *subdev, struct v4l2_subdev_mbus_code_enum *code) { static const unsigned int codes[] = { - V4L2_MBUS_FMT_ARGB8888_1X32, - V4L2_MBUS_FMT_AYUV8_1X32, + MEDIA_BUS_FMT_ARGB8888_1X32, + MEDIA_BUS_FMT_AYUV8_1X32, }; if (code->pad == UDS_PAD_SINK) { @@ -246,9 +246,9 @@ static void uds_try_format(struct vsp1_uds *uds, struct v4l2_subdev_fh *fh, switch (pad) { case UDS_PAD_SINK: /* Default to YUV if the requested format is not supported. */ - if (fmt->code != V4L2_MBUS_FMT_ARGB8888_1X32 && - fmt->code != V4L2_MBUS_FMT_AYUV8_1X32) - fmt->code = V4L2_MBUS_FMT_AYUV8_1X32; + if (fmt->code != MEDIA_BUS_FMT_ARGB8888_1X32 && + fmt->code != MEDIA_BUS_FMT_AYUV8_1X32) + fmt->code = MEDIA_BUS_FMT_AYUV8_1X32; fmt->width = clamp(fmt->width, UDS_MIN_SIZE, UDS_MAX_SIZE); fmt->height = clamp(fmt->height, UDS_MIN_SIZE, UDS_MAX_SIZE); diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 915a20eb003e..d91f19a9e1c1 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -48,85 +48,85 @@ */ static const struct vsp1_format_info vsp1_video_formats[] = { - { V4L2_PIX_FMT_RGB332, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_RGB332, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_RGB_332, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 8, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_ARGB444, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_ARGB444, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_ARGB_4444, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS, 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_XRGB444, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_XRGB444, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_XRGB_4444, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS, 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_ARGB555, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_ARGB555, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_ARGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS, 1, { 16, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_XRGB555, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_XRGB555, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_XRGB_1555, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS, 1, { 16, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_RGB565, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_RGB565, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_RGB_565, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS, 1, { 16, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_BGR24, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_BGR24, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_BGR_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 24, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_RGB24, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_RGB24, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_RGB_888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 24, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_ABGR32, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_ABGR32, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS, 1, { 32, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_XBGR32, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_XBGR32, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS, 1, { 32, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_ARGB32, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_ARGB32, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 32, 0, 0 }, false, false, 1, 1, true }, - { V4L2_PIX_FMT_XRGB32, V4L2_MBUS_FMT_ARGB8888_1X32, + { V4L2_PIX_FMT_XRGB32, MEDIA_BUS_FMT_ARGB8888_1X32, VI6_FMT_ARGB_8888, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 32, 0, 0 }, false, false, 1, 1, false }, - { V4L2_PIX_FMT_UYVY, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_UYVY, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 16, 0, 0 }, false, false, 2, 1, false }, - { V4L2_PIX_FMT_VYUY, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_VYUY, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 16, 0, 0 }, false, true, 2, 1, false }, - { V4L2_PIX_FMT_YUYV, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_YUYV, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 16, 0, 0 }, true, false, 2, 1, false }, - { V4L2_PIX_FMT_YVYU, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_YVYU, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_YUYV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 1, { 16, 0, 0 }, true, true, 2, 1, false }, - { V4L2_PIX_FMT_NV12M, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_NV12M, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_Y_UV_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 2, { 8, 16, 0 }, false, false, 2, 2, false }, - { V4L2_PIX_FMT_NV21M, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_NV21M, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_Y_UV_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 2, { 8, 16, 0 }, false, true, 2, 2, false }, - { V4L2_PIX_FMT_NV16M, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_NV16M, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 2, { 8, 16, 0 }, false, false, 2, 1, false }, - { V4L2_PIX_FMT_NV61M, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_NV61M, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_Y_UV_422, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 2, { 8, 16, 0 }, false, true, 2, 1, false }, - { V4L2_PIX_FMT_YUV420M, V4L2_MBUS_FMT_AYUV8_1X32, + { V4L2_PIX_FMT_YUV420M, MEDIA_BUS_FMT_AYUV8_1X32, VI6_FMT_Y_U_V_420, VI6_RPF_DSWAP_P_LLS | VI6_RPF_DSWAP_P_LWS | VI6_RPF_DSWAP_P_WDS | VI6_RPF_DSWAP_P_BTS, 3, { 8, 8, 8 }, false, false, 2, 2, false }, diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h index 57585c7004a4..4376beeb28c2 100644 --- a/include/media/davinci/vpbe.h +++ b/include/media/davinci/vpbe.h @@ -63,7 +63,7 @@ struct vpbe_output { * output basis. If per mode is needed, we may have to move this to * mode_info structure */ - enum v4l2_mbus_pixelcode if_params; + u32 if_params; }; /* encoder configuration info */ diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h index 476fafc2f522..3dbd20026107 100644 --- a/include/media/davinci/vpbe_venc.h +++ b/include/media/davinci/vpbe_venc.h @@ -30,11 +30,10 @@ #define VENC_SECOND_FIELD BIT(2) struct venc_platform_data { - int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type, - int field); + int (*setup_pinmux)(u32 if_type, int field); int (*setup_clock)(enum vpbe_enc_timings_type type, unsigned int pixclock); - int (*setup_if_config)(enum v4l2_mbus_pixelcode pixcode); + int (*setup_if_config)(u32 pixcode); /* Number of LCD outputs supported */ int num_lcd_outputs; struct vpbe_if_params *lcd_if_params; diff --git a/include/media/exynos-fimc.h b/include/media/exynos-fimc.h index aa44660e2041..69bcd2a07d5c 100644 --- a/include/media/exynos-fimc.h +++ b/include/media/exynos-fimc.h @@ -101,7 +101,7 @@ struct fimc_source_info { * @flags: flags indicating which operation mode format applies to */ struct fimc_fmt { - enum v4l2_mbus_pixelcode mbus_code; + u32 mbus_code; char *name; u32 fourcc; u32 color; diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 865246b00127..2f6261f3e570 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -296,7 +296,7 @@ const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc( * format setup. */ struct soc_camera_format_xlate { - enum v4l2_mbus_pixelcode code; + u32 code; const struct soc_mbus_pixelfmt *host_fmt; }; diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h index d33f6d059692..2ff773785fb6 100644 --- a/include/media/soc_mediabus.h +++ b/include/media/soc_mediabus.h @@ -91,16 +91,16 @@ struct soc_mbus_pixelfmt { * @fmt: pixel format description */ struct soc_mbus_lookup { - enum v4l2_mbus_pixelcode code; + u32 code; struct soc_mbus_pixelfmt fmt; }; const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc( - enum v4l2_mbus_pixelcode code, + u32 code, const struct soc_mbus_lookup *lookup, int n); const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( - enum v4l2_mbus_pixelcode code); + u32 code); s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf, u32 bytes_per_line, u32 height); -- cgit v1.2.3-59-g8ed1b From 5325d844fdae416993c41271a6460fd1c81c6172 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Mon, 10 Nov 2014 17:34:42 -0300 Subject: [media] si4713: add DT binding documentation This patch adds the DT bindings documentation for Silicon Labs Si4713 FM radio transmitter. Signed-off-by: Sebastian Reichel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/devicetree/bindings/media/si4713.txt | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/si4713.txt (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/media/si4713.txt b/Documentation/devicetree/bindings/media/si4713.txt new file mode 100644 index 000000000000..5ee5552d3465 --- /dev/null +++ b/Documentation/devicetree/bindings/media/si4713.txt @@ -0,0 +1,30 @@ +* Silicon Labs FM Radio transmitter + +The Silicon Labs Si4713 is an FM radio transmitter with receive power scan +supporting 76-108 MHz. It includes an RDS encoder and has both, a stereo-analog +and a digital interface, which supports I2S, left-justified and a custom +DSP-mode format. It is programmable through an I2C interface. + +Required Properties: +- compatible: Should contain "silabs,si4713" +- reg: the I2C address of the device + +Optional Properties: +- interrupts-extended: Interrupt specifier for the chips interrupt +- reset-gpios: GPIO specifier for the chips reset line +- vdd-supply: phandle for Vdd regulator +- vio-supply: phandle for Vio regulator + +Example: + +&i2c2 { + fmtx: si4713@63 { + compatible = "silabs,si4713"; + reg = <0x63>; + + interrupts-extended = <&gpio2 21 IRQ_TYPE_EDGE_FALLING>; /* 53 */ + reset-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>; /* 163 */ + vio-supply = <&vio>; + vdd-supply = <&vaux1>; + }; +}; -- cgit v1.2.3-59-g8ed1b From 36cdfa76635b502c8c7bb7df695d7d5117eca7de Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 18 Nov 2014 17:22:33 -0300 Subject: [media] media: rc: meson: document device tree bindings This adds binding documentation for the infrared remote control receiver available in Amlogic Meson SoCs. Signed-off-by: Beniamino Galvani Signed-off-by: Mauro Carvalho Chehab --- Documentation/devicetree/bindings/media/meson-ir.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/meson-ir.txt (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/media/meson-ir.txt b/Documentation/devicetree/bindings/media/meson-ir.txt new file mode 100644 index 000000000000..407848e85f31 --- /dev/null +++ b/Documentation/devicetree/bindings/media/meson-ir.txt @@ -0,0 +1,14 @@ +* Amlogic Meson IR remote control receiver + +Required properties: + - compatible : should be "amlogic,meson6-ir" + - reg : physical base address and length of the device registers + - interrupts : a single specifier for the interrupt from the device + +Example: + + ir-receiver@c8100480 { + compatible= "amlogic,meson6-ir"; + reg = <0xc8100480 0x20>; + interrupts = <0 15 1>; + }; -- cgit v1.2.3-59-g8ed1b From 1afed88381bb332040f2cb80ab1fa1d70506d593 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 27 Nov 2014 10:16:08 -0300 Subject: [media] DocBook media: rewrite the Colorspace chapter The colorspace chapter in the V4L2 Specification was always poorly written. This patch rewrites it, documenting the new Y'CbCr encoding and quantization defines and going into much more detail with respect to how colorspaces are used and what it all means. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/v4l/biblio.xml | 85 ++ Documentation/DocBook/media/v4l/pixfmt.xml | 1274 +++++++++++++++++++++------- 2 files changed, 1052 insertions(+), 307 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/media/v4l/biblio.xml b/Documentation/DocBook/media/v4l/biblio.xml index d2eb79e41a01..7ff01a23c2fe 100644 --- a/Documentation/DocBook/media/v4l/biblio.xml +++ b/Documentation/DocBook/media/v4l/biblio.xml @@ -178,6 +178,75 @@ Signal - NTSC for Studio Applications" 1125-Line High-Definition Production" + + sRGB + + International Electrotechnical Commission +(http://www.iec.ch) + + IEC 61966-2-1 ed1.0 "Multimedia systems and equipment - Colour measurement +and management - Part 2-1: Colour management - Default RGB colour space - sRGB" + + + + sYCC + + International Electrotechnical Commission +(http://www.iec.ch) + + IEC 61966-2-1-am1 ed1.0 "Amendment 1 - Multimedia systems and equipment - Colour measurement +and management - Part 2-1: Colour management - Default RGB colour space - sRGB" + + + + xvYCC + + International Electrotechnical Commission +(http://www.iec.ch) + + IEC 61966-2-4 ed1.0 "Multimedia systems and equipment - Colour measurement +and management - Part 2-4: Colour management - Extended-gamut YCC colour space for video +applications - xvYCC" + + + + AdobeRGB + + Adobe Systems Incorporated (http://www.adobe.com) + + Adobe© RGB (1998) Color Image Encoding Version 2005-05 + + + + opRGB + + International Electrotechnical Commission +(http://www.iec.ch) + + IEC 61966-2-5 "Multimedia systems and equipment - Colour measurement +and management - Part 2-5: Colour management - Optional RGB colour space - opRGB" + + + + ITU BT.2020 + + International Telecommunication Union (http://www.itu.ch) + + ITU-R Recommendation BT.2020 (08/2012) "Parameter values for ultra-high +definition television systems for production and international programme exchange" + + + + + EBU Tech 3213 + + European Broadcast Union (http://www.ebu.ch) + + E.B.U. Standard for Chromaticity Tolerances for Studio Monitors" + + IEC 62106 @@ -266,4 +335,20 @@ in the frequency range from 87,5 to 108,0 MHz Version 1, Revision 2 + + poynton + + Charles Poynton + + Digital Video and HDTV, Algorithms and Interfaces + + + + colimg + + Erik Reinhard et al. + + Color Imaging: Fundamentals and Applications + + diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index df5b23d46552..ccf6053c1ae4 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml @@ -296,343 +296,1003 @@ in the 2-planar version or with each component in its own buffer in the
Colorspaces - [intro] + 'Color' is a very complex concept and depends on physics, chemistry and +biology. Just because you have three numbers that describe the 'red', 'green' +and 'blue' components of the color of a pixel does not mean that you can accurately +display that color. A colorspace defines what it actually means +to have an RGB value of e.g. (255, 0, 0). That is, which color should be +reproduced on the screen in a perfectly calibrated environment. - + In order to do that we first need to have a good definition of +color, i.e. some way to uniquely and unambiguously define a color so that someone +else can reproduce it. Human color vision is trichromatic since the human eye has +color receptors that are sensitive to three different wavelengths of light. Hence +the need to use three numbers to describe color. Be glad you are not a mantis shrimp +as those are sensitive to 12 different wavelengths, so instead of RGB we would be +using the ABCDEFGHIJKL colorspace... - - - - Gamma Correction - - [to do] - E'R = f(R) - E'G = f(G) - E'B = f(B) - - - - Construction of luminance and color-difference -signals - - [to do] - E'Y = -CoeffR E'R -+ CoeffG E'G -+ CoeffB E'B - (E'R - E'Y) = E'R -- CoeffR E'R -- CoeffG E'G -- CoeffB E'B - (E'B - E'Y) = E'B -- CoeffR E'R -- CoeffG E'G -- CoeffB E'B - - - - Re-normalized color-difference signals - - The color-difference signals are scaled back to unity -range [-0.5;+0.5]: - KB = 0.5 / (1 - CoeffB) - KR = 0.5 / (1 - CoeffR) - PB = -KB (E'B - E'Y) = - 0.5 (CoeffR / CoeffB) E'R -+ 0.5 (CoeffG / CoeffB) E'G -+ 0.5 E'B - PR = -KR (E'R - E'Y) = - 0.5 E'R -+ 0.5 (CoeffG / CoeffR) E'G -+ 0.5 (CoeffB / CoeffR) E'B - - - - Quantization - - [to do] - Y' = (Lum. Levels - 1) · E'Y + Lum. Offset - CB = (Chrom. Levels - 1) -· PB + Chrom. Offset - CR = (Chrom. Levels - 1) -· PR + Chrom. Offset - Rounding to the nearest integer and clamping to the range -[0;255] finally yields the digital color components Y'CbCr -stored in YUV images. - - - - - - - ITU-R Rec. BT.601 color conversion - - Forward Transformation - - -int ER, EG, EB; /* gamma corrected RGB input [0;255] */ -int Y1, Cb, Cr; /* output [0;255] */ - -double r, g, b; /* temporaries */ -double y1, pb, pr; - -int -clamp (double x) -{ - int r = x; /* round to nearest */ - - if (r < 0) return 0; - else if (r > 255) return 255; - else return r; -} - -r = ER / 255.0; -g = EG / 255.0; -b = EB / 255.0; - -y1 = 0.299 * r + 0.587 * g + 0.114 * b; -pb = -0.169 * r - 0.331 * g + 0.5 * b; -pr = 0.5 * r - 0.419 * g - 0.081 * b; - -Y1 = clamp (219 * y1 + 16); -Cb = clamp (224 * pb + 128); -Cr = clamp (224 * pr + 128); - -/* or shorter */ - -y1 = 0.299 * ER + 0.587 * EG + 0.114 * EB; - -Y1 = clamp ( (219 / 255.0) * y1 + 16); -Cb = clamp (((224 / 255.0) / (2 - 2 * 0.114)) * (EB - y1) + 128); -Cr = clamp (((224 / 255.0) / (2 - 2 * 0.299)) * (ER - y1) + 128); - - - Inverse Transformation - - -int Y1, Cb, Cr; /* gamma pre-corrected input [0;255] */ -int ER, EG, EB; /* output [0;255] */ - -double r, g, b; /* temporaries */ -double y1, pb, pr; - -int -clamp (double x) -{ - int r = x; /* round to nearest */ - - if (r < 0) return 0; - else if (r > 255) return 255; - else return r; -} - -y1 = (Y1 - 16) / 219.0; -pb = (Cb - 128) / 224.0; -pr = (Cr - 128) / 224.0; - -r = 1.0 * y1 + 0 * pb + 1.402 * pr; -g = 1.0 * y1 - 0.344 * pb - 0.714 * pr; -b = 1.0 * y1 + 1.772 * pb + 0 * pr; - -ER = clamp (r * 255); /* [ok? one should prob. limit y1,pb,pr] */ -EG = clamp (g * 255); -EB = clamp (b * 255); - - - - - enum v4l2_colorspace - - - - - - - - - - - - - - - + Color exists only in the eye and brain and is the result of how strongly +color receptors are stimulated. This is based on the Spectral +Power Distribution (SPD) which is a graph showing the intensity (radiant power) +of the light at wavelengths covering the visible spectrum as it enters the eye. +The science of colorimetry is about the relationship between the SPD and color as +perceived by the human brain. + + Since the human eye has only three color receptors it is perfectly +possible that different SPDs will result in the same stimulation of those receptors +and are perceived as the same color, even though the SPD of the light is +different. + + In the 1920s experiments were devised to determine the relationship +between SPDs and the perceived color and that resulted in the CIE 1931 standard +that defines spectral weighting functions that model the perception of color. +Specifically that standard defines functions that can take an SPD and calculate +the stimulus for each color receptor. After some further mathematical transforms +these stimuli are known as the CIE XYZ tristimulus values +and these X, Y and Z values describe a color as perceived by a human unambiguously. +These X, Y and Z values are all in the range [0…1]. + + The Y value in the CIE XYZ colorspace corresponds to luminance. Often +the CIE XYZ colorspace is transformed to the normalized CIE xyY colorspace: + + x = X / (X + Y + Z) + y = Y / (X + Y + Z) + + The x and y values are the chromaticity coordinates and can be used to +define a color without the luminance component Y. It is very confusing to +have such similar names for these colorspaces. Just be aware that if colors +are specified with lower case 'x' and 'y', then the CIE xyY colorspace is +used. Upper case 'X' and 'Y' refer to the CIE XYZ colorspace. Also, y has nothing +to do with luminance. Together x and y specify a color, and Y the luminance. +That is really all you need to remember from a practical point of view. At +the end of this section you will find reading resources that go into much more +detail if you are interested. + + + A monitor or TV will reproduce colors by emitting light at three +different wavelengths, the combination of which will stimulate the color receptors +in the eye and thus cause the perception of color. Historically these wavelengths +were defined by the red, green and blue phosphors used in the displays. These +color primaries are part of what defines a colorspace. + + Different display devices will have different primaries and some +primaries are more suitable for some display technologies than others. This has +resulted in a variety of colorspaces that are used for different display +technologies or uses. To define a colorspace you need to define the three +color primaries (these are typically defined as x, y chromaticity coordinates +from the CIE xyY colorspace) but also the white reference: that is the color obtained +when all three primaries are at maximum power. This determines the relative power +or energy of the primaries. This is usually chosen to be close to daylight which has +been defined as the CIE D65 Illuminant. + + To recapitulate: the CIE XYZ colorspace uniquely identifies colors. +Other colorspaces are defined by three chromaticity coordinates defined in the +CIE xyY colorspace. Based on those a 3x3 matrix can be constructed that +transforms CIE XYZ colors to colors in the new colorspace. + + + Both the CIE XYZ and the RGB colorspace that are derived from the +specific chromaticity primaries are linear colorspaces. But neither the eye, +nor display technology is linear. Doubling the values of all components in +the linear colorspace will not be perceived as twice the intensity of the color. +So each colorspace also defines a transfer function that takes a linear color +component value and transforms it to the non-linear component value, which is a +closer match to the non-linear performance of both the eye and displays. Linear +component values are denoted RGB, non-linear are denoted as R'G'B'. In general +colors used in graphics are all R'G'B', except in openGL which uses linear RGB. +Special care should be taken when dealing with openGL to provide linear RGB colors +or to use the built-in openGL support to apply the inverse transfer function. + + The final piece that defines a colorspace is a function that +transforms non-linear R'G'B' to non-linear Y'CbCr. This function is determined +by the so-called luma coefficients. There may be multiple possible Y'CbCr +encodings allowed for the same colorspace. Many encodings of color +prefer to use luma (Y') and chroma (CbCr) instead of R'G'B'. Since the human +eye is more sensitive to differences in luminance than in color this encoding +allows one to reduce the amount of color information compared to the luma +data. Note that the luma (Y') is unrelated to the Y in the CIE XYZ colorspace. +Also note that Y'CbCr is often called YCbCr or YUV even though these are +strictly speaking wrong. + + Sometimes people confuse Y'CbCr as being a colorspace. This is not +correct, it is just an encoding of an R'G'B' color into luma and chroma +values. The underlying colorspace that is associated with the R'G'B' color +is also associated with the Y'CbCr color. + + The final step is how the RGB, R'G'B' or Y'CbCr values are +quantized. The CIE XYZ colorspace where X, Y and Z are in the range +[0…1] describes all colors that humans can perceive, but the transform to +another colorspace will produce colors that are outside the [0…1] range. +Once clamped to the [0…1] range those colors can no longer be reproduced +in that colorspace. This clamping is what reduces the extent or gamut of the +colorspace. How the range of [0…1] is translated to integer values in the +range of [0…255] (or higher, depending on the color depth) is called the +quantization. This is not part of the colorspace +definition. In practice RGB or R'G'B' values are full range, i.e. they +use the full [0…255] range. Y'CbCr values on the other hand are limited +range with Y' using [16…235] and Cb and Cr using [16…240]. + + Unfortunately, in some cases limited range RGB is also used +where the components use the range [16…235]. And full range Y'CbCr also exists +using the [0…255] range. + + In order to correctly interpret a color you need to know the +quantization range, whether it is R'G'B' or Y'CbCr, the used Y'CbCr encoding +and the colorspace. +From that information you can calculate the corresponding CIE XYZ color +and map that again to whatever colorspace your display device uses. + + The colorspace definition itself consists of the three +chromaticity primaries, the white reference chromaticity, a transfer +function and the luma coefficients needed to transform R'G'B' to Y'CbCr. While +some colorspace standards correctly define all four, quite often the colorspace +standard only defines some, and you have to rely on other standards for +the missing pieces. The fact that colorspaces are often a mix of different +standards also led to very confusing naming conventions where the name of +a standard was used to name a colorspace when in fact that standard was +part of various other colorspaces as well. + + If you want to read more about colors and colorspaces, then the +following resources are useful: is a good practical +book for video engineers, has a much broader scope and +describes many more aspects of color (physics, chemistry, biology, etc.). +The http://www.brucelindbloom.com +website is an excellent resource, especially with respect to the mathematics behind +colorspace conversions. The wikipedia CIE 1931 colorspace article +is also very useful. + + +
+ Defining Colorspaces in V4L2 + In V4L2 colorspaces are defined by three values. The first is the colorspace +identifier (&v4l2-colorspace;) which defines the chromaticities, the transfer +function, the default Y'CbCr encoding and the default quantization method. The second +is the Y'CbCr encoding identifier (&v4l2-ycbcr-encoding;) to specify non-standard +Y'CbCr encodings and the third is the quantization identifier (&v4l2-quantization;) +to specify non-standard quantization methods. Most of the time only the colorspace +field of &v4l2-pix-format; or &v4l2-pix-format-mplane; needs to be filled in. Note +that the default R'G'B' quantization is always full range for all colorspaces, +so this won't be mentioned explicitly for each colorspace description. + +
+ V4L2 Colorspaces + + &cs-def; - Identifier - Value - Description - Chromaticities - The coordinates of the color primaries are -given in the CIE system (1931) - - White Point - Gamma Correction - Luminance E'Y - Quantization - - - Red - Green - Blue - Y' - Cb, Cr + Identifier + Details V4L2_COLORSPACE_SMPTE170M - 1 - NTSC/PAL according to , - - x = 0.630, y = 0.340 - x = 0.310, y = 0.595 - x = 0.155, y = 0.070 - x = 0.3127, y = 0.3290, - Illuminant D65 - E' = 4.5 I for I ≤0.018, -1.099 I0.45 - 0.099 for 0.018 < I - 0.299 E'R -+ 0.587 E'G -+ 0.114 E'B - 219 E'Y + 16 - 224 PB,R + 128 + See . - V4L2_COLORSPACE_SMPTE240M - 2 - 1125-Line (US) HDTV, see - x = 0.630, y = 0.340 - x = 0.310, y = 0.595 - x = 0.155, y = 0.070 - x = 0.3127, y = 0.3290, - Illuminant D65 - E' = 4 I for I ≤0.0228, -1.1115 I0.45 - 0.1115 for 0.0228 < I - 0.212 E'R -+ 0.701 E'G -+ 0.087 E'B - 219 E'Y + 16 - 224 PB,R + 128 + V4L2_COLORSPACE_REC709 + See . - V4L2_COLORSPACE_REC709 - 3 - HDTV and modern devices, see - x = 0.640, y = 0.330 - x = 0.300, y = 0.600 - x = 0.150, y = 0.060 - x = 0.3127, y = 0.3290, - Illuminant D65 - E' = 4.5 I for I ≤0.018, -1.099 I0.45 - 0.099 for 0.018 < I - 0.2125 E'R -+ 0.7154 E'G -+ 0.0721 E'B - 219 E'Y + 16 - 224 PB,R + 128 + V4L2_COLORSPACE_SRGB + See . - V4L2_COLORSPACE_BT878 - 4 - Broken Bt878 extents - The ubiquitous Bt878 video capture chip -quantizes E'Y to 238 levels, yielding a range -of Y' = 16 … 253, unlike Rec. 601 Y' = 16 … -235. This is not a typo in the Bt878 documentation, it has been -implemented in silicon. The chroma extents are unclear. - , - ? - ? - ? - ? - ? - 0.299 E'R -+ 0.587 E'G -+ 0.114 E'B - 237 E'Y + 16 - 224 PB,R + 128 (probably) + V4L2_COLORSPACE_ADOBERGB + See . + + + V4L2_COLORSPACE_BT2020 + See . + + + V4L2_COLORSPACE_SMPTE240M + See . V4L2_COLORSPACE_470_SYSTEM_M - 5 - M/NTSC - No identifier exists for M/PAL which uses -the chromaticities of M/NTSC, the remaining parameters are equal to B and -G/PAL. - according to , - x = 0.67, y = 0.33 - x = 0.21, y = 0.71 - x = 0.14, y = 0.08 - x = 0.310, y = 0.316, Illuminant C - ? - 0.299 E'R -+ 0.587 E'G -+ 0.114 E'B - 219 E'Y + 16 - 224 PB,R + 128 + See . V4L2_COLORSPACE_470_SYSTEM_BG - 6 - 625-line PAL and SECAM systems according to , - x = 0.64, y = 0.33 - x = 0.29, y = 0.60 - x = 0.15, y = 0.06 - x = 0.313, y = 0.329, -Illuminant D65 - ? - 0.299 E'R -+ 0.587 E'G -+ 0.114 E'B - 219 E'Y + 16 - 224 PB,R + 128 + See . V4L2_COLORSPACE_JPEG - 7 - JPEG Y'CbCr, see , - ? - ? - ? - ? - ? - 0.299 E'R -+ 0.587 E'G -+ 0.114 E'B - 256 E'Y + 16 - Note JFIF quantizes -Y'PBPR in range [0;+1] and -[-0.5;+0.5] to 257 levels, however Y'CbCr signals -are still clamped to [0;255]. - - 256 PB,R + 128 + See . + + + +
+ + + V4L2 Y'CbCr Encodings + + &cs-def; + + + Identifier + Details + + - V4L2_COLORSPACE_SRGB - 8 - [?] - x = 0.640, y = 0.330 - x = 0.300, y = 0.600 - x = 0.150, y = 0.060 - x = 0.3127, y = 0.3290, - Illuminant D65 - E' = 4.5 I for I ≤0.018, -1.099 I0.45 - 0.099 for 0.018 < I - n/a + V4L2_YCBCR_ENC_DEFAULT + Use the default Y'CbCr encoding as defined by the colorspace. + + + V4L2_YCBCR_ENC_601 + Use the BT.601 Y'CbCr encoding. + + + V4L2_YCBCR_ENC_709 + Use the Rec. 709 Y'CbCr encoding. + + + V4L2_YCBCR_ENC_XV601 + Use the extended gamut xvYCC BT.601 encoding. + + + V4L2_YCBCR_ENC_XV709 + Use the extended gamut xvYCC Rec. 709 encoding. + + + V4L2_YCBCR_ENC_SYCC + Use the extended gamut sYCC encoding. + + + V4L2_YCBCR_ENC_BT2020 + Use the default non-constant luminance BT.2020 Y'CbCr encoding. + + + V4L2_YCBCR_ENC_BT2020_CONST_LUM + Use the constant luminance BT.2020 Yc'CbcCrc encoding.
+ + + V4L2 Quantization Methods + + &cs-def; + + + Identifier + Details + + + + + V4L2_QUANTIZATION_DEFAULT + Use the default quantization encoding as defined by the colorspace. +This is always full range for R'G'B' and usually limited range for Y'CbCr. + + + V4L2_QUANTIZATION_FULL_RANGE + Use the full range quantization encoding. I.e. the range [0…1] +is mapped to [0…255] (with possible clipping to [1…254] to avoid the +0x00 and 0xff values). Cb and Cr are mapped from [-0.5…0.5] to [0…255] +(with possible clipping to [1…254] to avoid the 0x00 and 0xff values). + + + V4L2_QUANTIZATION_LIM_RANGE + Use the limited range quantization encoding. I.e. the range [0…1] +is mapped to [16…235]. Cb and Cr are mapped from [-0.5…0.5] to [16…240]. + + + + +
+
+ +
+ Detailed Colorspace Descriptions +
+ Colorspace SMPTE 170M (<constant>V4L2_COLORSPACE_SMPTE170M</constant>) + The standard defines the colorspace used by NTSC and PAL and by SDTV +in general. The default Y'CbCr encoding is V4L2_YCBCR_ENC_601. +The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and +the white reference are: + + SMPTE 170M Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.630 + 0.340 + + + Green + 0.310 + 0.595 + + + Blue + 0.155 + 0.070 + + + White Reference (D65) + 0.3127 + 0.3290 + + + +
+ The red, green and blue chromaticities are also often referred to +as the SMPTE C set, so this colorspace is sometimes called SMPTE C as well. + + + The transfer function defined for SMPTE 170M is the same as the +one defined in Rec. 709. Normally L is in the range [0…1], but for the extended +gamut xvYCC encoding values outside that range are allowed. + + L' = -1.099(-L)0.45 + 0.099 for L ≤ -0.018 + L' = 4.5L for -0.018 < L < 0.018 + L' = 1.099L0.45 - 0.099 for L ≥ 0.018 + + + + + + Inverse Transfer function: + + L = -((L' - 0.099) / -1.099)1/0.45 for L' ≤ -0.081 + L = L' / 4.5 for -0.081 < L' < 0.081 + L = ((L' + 0.099) / 1.099)1/0.45 for L' ≥ 0.081 + + + + + + The luminance (Y') and color difference (Cb and Cr) are obtained with +the following V4L2_YCBCR_ENC_601 encoding: + + Y' = 0.299R' + 0.587G' + 0.114B' + Cb = -0.169R' - 0.331G' + 0.5B' + Cr = 0.5R' - 0.419G' - 0.081B' + + + + Y' is clamped to the range [0…1] and Cb and Cr are +clamped to the range [-0.5…0.5]. This conversion to Y'CbCr is identical to the one +defined in the standard and this colorspace is sometimes called BT.601 as well, even +though BT.601 does not mention any color primaries. + The default quantization is limited range, but full range is possible although +rarely seen. + The V4L2_YCBCR_ENC_601 encoding as described above is the +default for this colorspace, but it can be overridden with V4L2_YCBCR_ENC_709, +in which case the Rec. 709 Y'CbCr encoding is used. + + + The xvYCC 601 encoding (V4L2_YCBCR_ENC_XV601, ) is similar +to the BT.601 encoding, but it allows for R', G' and B' values that are outside the range +[0…1]. The resulting Y', Cb and Cr values are scaled and offset: + + Y' = (219 / 255) * (0.299R' + 0.587G' + 0.114B') + (16 / 255) + Cb = (224 / 255) * (-0.169R' - 0.331G' + 0.5B') + Cr = (224 / 255) * (0.5R' - 0.419G' - 0.081B') + + + + Y' is clamped to the range [0…1] and Cb and Cr are clamped +to the range [-0.5…0.5]. The non-standard xvYCC 709 encoding can also be used by selecting +V4L2_YCBCR_ENC_XV709. The xvYCC encodings always use full range +quantization. +
+ +
+ Colorspace Rec. 709 (<constant>V4L2_COLORSPACE_REC709</constant>) + The standard defines the colorspace used by HDTV in general. The default +Y'CbCr encoding is V4L2_YCBCR_ENC_709. The default Y'CbCr quantization is +limited range. The chromaticities of the primary colors and the white reference are: + + Rec. 709 Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.640 + 0.330 + + + Green + 0.300 + 0.600 + + + Blue + 0.150 + 0.060 + + + White Reference (D65) + 0.3127 + 0.3290 + + + +
+ The full name of this standard is Rec. ITU-R BT.709-5. + + + Transfer function. Normally L is in the range [0…1], but for the extended +gamut xvYCC encoding values outside that range are allowed. + + L' = -1.099(-L)0.45 + 0.099 for L ≤ -0.018 + L' = 4.5L for -0.018 < L < 0.018 + L' = 1.099L0.45 - 0.099 for L ≥ 0.018 + + + + + + Inverse Transfer function: + + L = -((L' - 0.099) / -1.099)1/0.45 for L' ≤ -0.081 + L = L' / 4.5 for -0.081 < L' < 0.081 + L = ((L' + 0.099) / 1.099)1/0.45 for L' ≥ 0.081 + + + + + + The luminance (Y') and color difference (Cb and Cr) are obtained with the following +V4L2_YCBCR_ENC_709 encoding: + + Y' = 0.2126R' + 0.7152G' + 0.0722B' + Cb = -0.1146R' - 0.3854G' + 0.5B' + Cr = 0.5R' - 0.4542G' - 0.0458B' + + + + Y' is clamped to the range [0…1] and Cb and Cr are +clamped to the range [-0.5…0.5]. + The default quantization is limited range, but full range is possible although +rarely seen. + The V4L2_YCBCR_ENC_709 encoding described above is the default +for this colorspace, but it can be overridden with V4L2_YCBCR_ENC_601, in which +case the BT.601 Y'CbCr encoding is used. + + + The xvYCC 709 encoding (V4L2_YCBCR_ENC_XV709, ) +is similar to the Rec. 709 encoding, but it allows for R', G' and B' values that are outside the range +[0…1]. The resulting Y', Cb and Cr values are scaled and offset: + + Y' = (219 / 255) * (0.2126R' + 0.7152G' + 0.0722B') + (16 / 255) + Cb = (224 / 255) * (-0.1146R' - 0.3854G' + 0.5B') + Cr = (224 / 255) * (0.5R' - 0.4542G' - 0.0458B') + + + + Y' is clamped to the range [0…1] and Cb and Cr are clamped +to the range [-0.5…0.5]. The non-standard xvYCC 601 encoding can also be used by +selecting V4L2_YCBCR_ENC_XV601. The xvYCC encodings always use full +range quantization. +
+ +
+ Colorspace sRGB (<constant>V4L2_COLORSPACE_SRGB</constant>) + The standard defines the colorspace used by most webcams and computer graphics. The +default Y'CbCr encoding is V4L2_YCBCR_ENC_SYCC. The default Y'CbCr quantization +is full range. The chromaticities of the primary colors and the white reference are: + + sRGB Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.640 + 0.330 + + + Green + 0.300 + 0.600 + + + Blue + 0.150 + 0.060 + + + White Reference (D65) + 0.3127 + 0.3290 + + + +
+ These chromaticities are identical to the Rec. 709 colorspace. + + + Transfer function. Note that negative values for L are only used by the Y'CbCr conversion. + + L' = -1.055(-L)1/2.4 + 0.055 for L < -0.0031308 + L' = 12.92L for -0.0031308 ≤ L ≤ 0.0031308 + L' = 1.055L1/2.4 - 0.055 for 0.0031308 < L ≤ 1 + + + + Inverse Transfer function: + + L = -((-L' + 0.055) / 1.055)2.4 for L' < -0.04045 + L = L' / 12.92 for -0.04045 ≤ L' ≤ 0.04045 + L = ((L' + 0.055) / 1.055)2.4 for L' > 0.04045 + + + + + + The luminance (Y') and color difference (Cb and Cr) are obtained with the following +V4L2_YCBCR_ENC_SYCC encoding as defined by : + + Y' = 0.2990R' + 0.5870G' + 0.1140B' + Cb = -0.1687R' - 0.3313G' + 0.5B' + Cr = 0.5R' - 0.4187G' - 0.0813B' + + + + Y' is clamped to the range [0…1] and Cb and Cr are clamped +to the range [-0.5…0.5]. The V4L2_YCBCR_ENC_SYCC quantization is always +full range. Although this Y'CbCr encoding looks very similar to the V4L2_YCBCR_ENC_XV601 +encoding, it is not. The V4L2_YCBCR_ENC_XV601 scales and offsets the Y'CbCr +values before quantization, but this encoding does not do that. +
+ +
+ Colorspace Adobe RGB (<constant>V4L2_COLORSPACE_ADOBERGB</constant>) + The standard defines the colorspace used by computer graphics +that use the AdobeRGB colorspace. This is also known as the standard. +The default Y'CbCr encoding is V4L2_YCBCR_ENC_601. The default Y'CbCr +quantization is limited range. The chromaticities of the primary colors and the white reference +are: + + Adobe RGB Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.6400 + 0.3300 + + + Green + 0.2100 + 0.7100 + + + Blue + 0.1500 + 0.0600 + + + White Reference (D65) + 0.3127 + 0.3290 + + + +
+ + + Transfer function: + + L' = L1/2.19921875 + + + + Inverse Transfer function: + + L = L'2.19921875 + + + + + + The luminance (Y') and color difference (Cb and Cr) are obtained with the +following V4L2_YCBCR_ENC_601 encoding: + + Y' = 0.299R' + 0.587G' + 0.114B' + Cb = -0.169R' - 0.331G' + 0.5B' + Cr = 0.5R' - 0.419G' - 0.081B' + + + + Y' is clamped to the range [0…1] and Cb and Cr are +clamped to the range [-0.5…0.5]. This transform is identical to one defined in +SMPTE 170M/BT.601. The Y'CbCr quantization is limited range. +
+ +
+ Colorspace BT.2020 (<constant>V4L2_COLORSPACE_BT2020</constant>) + The standard defines the colorspace used by Ultra-high definition +television (UHDTV). The default Y'CbCr encoding is V4L2_YCBCR_ENC_BT2020. +The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and +the white reference are: + + BT.2020 Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.708 + 0.292 + + + Green + 0.170 + 0.797 + + + Blue + 0.131 + 0.046 + + + White Reference (D65) + 0.3127 + 0.3290 + + + +
+ + + Transfer function (same as Rec. 709): + + L' = 4.5L for 0 ≤ L < 0.018 + L' = 1.099L0.45 - 0.099 for 0.018 ≤ L ≤ 1 + + + + Inverse Transfer function: + + L = L' / 4.5 for L' < 0.081 + L = ((L' + 0.099) / 1.099)1/0.45 for L' ≥ 0.081 + + + + + + The luminance (Y') and color difference (Cb and Cr) are obtained with the +following V4L2_YCBCR_ENC_BT2020 encoding: + + Y' = 0.2627R' + 0.6789G' + 0.0593B' + Cb = -0.1396R' - 0.3604G' + 0.5B' + Cr = 0.5R' - 0.4598G' - 0.0402B' + + + + Y' is clamped to the range [0…1] and Cb and Cr are +clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range. + There is also an alternate constant luminance R'G'B' to Yc'CbcCrc +(V4L2_YCBCR_ENC_BT2020_CONST_LUM) encoding: + + + Luma: + + Yc' = (0.2627R + 0.6789G + 0.0593B)' + + + + + + B' - Yc' ≤ 0: + + Cbc = (B' - Y') / 1.9404 + + + + + + B' - Yc' > 0: + + Cbc = (B' - Y') / 1.5816 + + + + + + R' - Yc' ≤ 0: + + Crc = (R' - Y') / 1.7184 + + + + + + R' - Yc' > 0: + + Crc = (R' - Y') / 0.9936 + + + + Yc' is clamped to the range [0…1] and Cbc and Crc are +clamped to the range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range. +
+ +
+ Colorspace SMPTE 240M (<constant>V4L2_COLORSPACE_SMPTE240M</constant>) + The standard was an interim standard used during the early days of HDTV (1988-1998). +It has been superseded by Rec. 709. The default Y'CbCr encoding is V4L2_YCBCR_ENC_SMPTE240M. +The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the +white reference are: + + SMPTE 240M Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.630 + 0.340 + + + Green + 0.310 + 0.595 + + + Blue + 0.155 + 0.070 + + + White Reference (D65) + 0.3127 + 0.3290 + + + +
+ These chromaticities are identical to the SMPTE 170M colorspace. + + + Transfer function: + + L' = 4L for 0 ≤ L < 0.0228 + L' = 1.1115L0.45 - 0.1115 for 0.0228 ≤ L ≤ 1 + + + + Inverse Transfer function: + + L = L' / 4 for 0 ≤ L' < 0.0913 + L = ((L' + 0.1115) / 1.1115)1/0.45 for L' ≥ 0.0913 + + + + + + The luminance (Y') and color difference (Cb and Cr) are obtained with the +following V4L2_YCBCR_ENC_SMPTE240M encoding: + + Y' = 0.2122R' + 0.7013G' + 0.0865B' + Cb = -0.1161R' - 0.3839G' + 0.5B' + Cr = 0.5R' - 0.4451G' - 0.0549B' + + + + Yc' is clamped to the range [0…1] and Cbc and Crc are +clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range. +
+ +
+ Colorspace NTSC 1953 (<constant>V4L2_COLORSPACE_470_SYSTEM_M</constant>) + This standard defines the colorspace used by NTSC in 1953. In practice this +colorspace is obsolete and SMPTE 170M should be used instead. The default Y'CbCr encoding +is V4L2_YCBCR_ENC_601. The default Y'CbCr quantization is limited range. +The chromaticities of the primary colors and the white reference are: + + NTSC 1953 Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.67 + 0.33 + + + Green + 0.21 + 0.71 + + + Blue + 0.14 + 0.08 + + + White Reference (C) + 0.310 + 0.316 + + + +
+ Note that this colorspace uses Illuminant C instead of D65 as the +white reference. To correctly convert an image in this colorspace to another +that uses D65 you need to apply a chromatic adaptation algorithm such as the +Bradford method. + + + The transfer function was never properly defined for NTSC 1953. The +Rec. 709 transfer function is recommended in the literature: + + L' = 4.5L for 0 ≤ L < 0.018 + L' = 1.099L0.45 - 0.099 for 0.018 ≤ L ≤ 1 + + + + Inverse Transfer function: + + L = L' / 4.5 for L' < 0.081 + L = ((L' + 0.099) / 1.099)1/0.45 for L' ≥ 0.081 + + + + + + The luminance (Y') and color difference (Cb and Cr) are obtained with the +following V4L2_YCBCR_ENC_601 encoding: + + Y' = 0.299R' + 0.587G' + 0.114B' + Cb = -0.169R' - 0.331G' + 0.5B' + Cr = 0.5R' - 0.419G' - 0.081B' + + + + Y' is clamped to the range [0…1] and Cb and Cr are +clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range. +This transform is identical to one defined in SMPTE 170M/BT.601. +
+ +
+ Colorspace EBU Tech. 3213 (<constant>V4L2_COLORSPACE_470_SYSTEM_BG</constant>) + The standard defines the colorspace used by PAL/SECAM in 1975. In practice this +colorspace is obsolete and SMPTE 170M should be used instead. The default Y'CbCr encoding +is V4L2_YCBCR_ENC_601. The default Y'CbCr quantization is limited range. +The chromaticities of the primary colors and the white reference are: + + EBU Tech. 3213 Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.64 + 0.33 + + + Green + 0.29 + 0.60 + + + Blue + 0.15 + 0.06 + + + White Reference (D65) + 0.3127 + 0.3290 + + + +
+ + + The transfer function was never properly defined for this colorspace. +The Rec. 709 transfer function is recommended in the literature: + + L' = 4.5L for 0 ≤ L < 0.018 + L' = 1.099L0.45 - 0.099 for 0.018 ≤ L ≤ 1 + + + + Inverse Transfer function: + + L = L' / 4.5 for L' < 0.081 + L = ((L' + 0.099) / 1.099)1/0.45 for L' ≥ 0.081 + + + + + + The luminance (Y') and color difference (Cb and Cr) are obtained with the +following V4L2_YCBCR_ENC_601 encoding: + + Y' = 0.299R' + 0.587G' + 0.114B' + Cb = -0.169R' - 0.331G' + 0.5B' + Cr = 0.5R' - 0.419G' - 0.081B' + + + + Y' is clamped to the range [0…1] and Cb and Cr are +clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range. +This transform is identical to one defined in SMPTE 170M/BT.601. +
+ +
+ Colorspace JPEG (<constant>V4L2_COLORSPACE_JPEG</constant>) + This colorspace defines the colorspace used by most (Motion-)JPEG formats. The chromaticities +of the primary colors and the white reference are identical to sRGB. The Y'CbCr encoding is +V4L2_YCBCR_ENC_601 with full range quantization where +Y' is scaled to [0…255] and Cb/Cr are scaled to [-128…128] and +then clipped to [-128…127]. + Note that the JPEG standard does not actually store colorspace information. +So if something other than sRGB is used, then the driver will have to set that information +explicitly. Effectively V4L2_COLORSPACE_JPEG can be considered to be +an abbreviation for V4L2_COLORSPACE_SRGB, V4L2_YCBCR_ENC_601 +and V4L2_QUANTIZATION_FULL_RANGE. +
+
-- cgit v1.2.3-59-g8ed1b From 6936d74fb511b2d75720d6c15e8296d65988aaa2 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Wed, 15 Oct 2014 10:08:19 -0300 Subject: [media] v4l: Clean up sub-device format documentation The sub-device format documentation documented scaling configuration through formats. Instead the compose selection rectangle is elsewhere documented to be used for the purpose. Remove scaling related part of the documentation. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/v4l/dev-subdev.xml | 109 ++++++++++++++----------- 1 file changed, 63 insertions(+), 46 deletions(-) (limited to 'Documentation') diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml index d15aaf83f56f..4f0ba58c9bd9 100644 --- a/Documentation/DocBook/media/v4l/dev-subdev.xml +++ b/Documentation/DocBook/media/v4l/dev-subdev.xml @@ -195,53 +195,59 @@ Sample Pipeline Configuration - - - - - + + + + + + - Sensor/0 - Frontend/0 - Frontend/1 - Scaler/0 - Scaler/1 + Sensor/0 format + Frontend/0 format + Frontend/1 format + Scaler/0 format + Scaler/0 compose selection rectangle + Scaler/1 format Initial state - 2048x1536 - - - - - - - - + 2048x1536/SGRBG8_1X8 + (default) + (default) + (default) + (default) + (default) - Configure frontend input - 2048x1536 - 2048x1536 - 2046x1534 - - - - + Configure frontend sink format + 2048x1536/SGRBG8_1X8 + 2048x1536/SGRBG8_1X8 + 2046x1534/SGRBG8_1X8 + (default) + (default) + (default) - Configure scaler input - 2048x1536 - 2048x1536 - 2046x1534 - 2046x1534 - 2046x1534 + Configure scaler sink format + 2048x1536/SGRBG8_1X8 + 2048x1536/SGRBG8_1X8 + 2046x1534/SGRBG8_1X8 + 2046x1534/SGRBG8_1X8 + 0,0/2046x1534 + 2046x1534/SGRBG8_1X8 - Configure scaler output - 2048x1536 - 2048x1536 - 2046x1534 - 2046x1534 - 1280x960 + Configure scaler sink compose selection + 2048x1536/SGRBG8_1X8 + 2048x1536/SGRBG8_1X8 + 2046x1534/SGRBG8_1X8 + 2046x1534/SGRBG8_1X8 + 0,0/1280x960 + 1280x960/SGRBG8_1X8 @@ -249,19 +255,30 @@ - Initial state. The sensor output is set to its native 3MP - resolution. Resolutions on the host frontend and scaler input and output - pads are undefined. - The application configures the frontend input pad resolution to - 2048x1536. The driver propagates the format to the frontend output pad. - Note that the propagated output format can be different, as in this case, - than the input format, as the hardware might need to crop pixels (for - instance when converting a Bayer filter pattern to RGB or YUV). - The application configures the scaler input pad resolution to - 2046x1534 to match the frontend output resolution. The driver propagates - the format to the scaler output pad. - The application configures the scaler output pad resolution to - 1280x960. + Initial state. The sensor source pad format is + set to its native 3MP size and V4L2_MBUS_FMT_SGRBG8_1X8 + media bus code. Formats on the host frontend and scaler sink + and source pads have the default values, as well as the + compose rectangle on the scaler's sink pad. + + The application configures the frontend sink + pad format's size to 2048x1536 and its media bus code to + V4L2_MBUS_FMT_SGRBG_1X8. The driver propagates the format to + the frontend source pad. + + The application configures the scaler sink pad + format's size to 2046x1534 and the media bus code to + V4L2_MBUS_FMT_SGRBG_1X8 to match the frontend source size and + media bus code. The media bus code on the sink pad is set to + V4L2_MBUS_FMT_SGRBG_1X8. The driver propagates the size to the + compose selection rectangle on the scaler's sink pad, and the + format to the scaler source pad. + + The application configures the size of the compose + selection rectangle of the scaler's sink pad 1280x960. The driver + propagates the size to the scaler's source pad + format. + -- cgit v1.2.3-59-g8ed1b From 0b4bc768dc289731983ba5223555ffabe08eefdd Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Wed, 15 Oct 2014 13:38:15 -0300 Subject: [media] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target The V4L2_SEL_TGT_NATIVE_SIZE target is used to denote e.g. the size of a sensor's pixel array. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/v4l/selections-common.xml | 16 ++++++++++++++++ include/uapi/linux/v4l2-common.h | 2 ++ 2 files changed, 18 insertions(+) (limited to 'Documentation') diff --git a/Documentation/DocBook/media/v4l/selections-common.xml b/Documentation/DocBook/media/v4l/selections-common.xml index 7502f784b8cc..d6d56fb6f9c0 100644 --- a/Documentation/DocBook/media/v4l/selections-common.xml +++ b/Documentation/DocBook/media/v4l/selections-common.xml @@ -62,6 +62,22 @@ Yes Yes + + V4L2_SEL_TGT_NATIVE_SIZE + 0x0003 + The native size of the device, e.g. a sensor's + pixel array. left and + top fields are zero for this + target. Setting the native size will generally only make + sense for memory to memory devices where the software can + create a canvas of a given size in which for example a + video frame can be composed. In that case + V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size + of that canvas. + + Yes + Yes + V4L2_SEL_TGT_COMPOSE 0x0100 diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h index 2f6f8cafe773..15273987093e 100644 --- a/include/uapi/linux/v4l2-common.h +++ b/include/uapi/linux/v4l2-common.h @@ -43,6 +43,8 @@ #define V4L2_SEL_TGT_CROP_DEFAULT 0x0001 /* Cropping bounds */ #define V4L2_SEL_TGT_CROP_BOUNDS 0x0002 +/* Native frame size */ +#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003 /* Current composing area */ #define V4L2_SEL_TGT_COMPOSE 0x0100 /* Default composing area */ -- cgit v1.2.3-59-g8ed1b From 8af0345926c8cdbbf80102aa3eab8a6519c23272 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Tue, 18 Nov 2014 02:27:00 -0300 Subject: [media] v4l: Add input and output capability flags for native size setting Add input and output capability flags for setting native size of the device, and document them. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/v4l/vidioc-enuminput.xml | 8 ++++++++ Documentation/DocBook/media/v4l/vidioc-enumoutput.xml | 8 ++++++++ include/uapi/linux/videodev2.h | 2 ++ 3 files changed, 18 insertions(+) (limited to 'Documentation') diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml index 493a39a8ef21..603fecef9083 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml @@ -287,6 +287,14 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009. 0x00000004 This input supports setting the TV standard by using VIDIOC_S_STD. + + V4L2_IN_CAP_NATIVE_SIZE + 0x00000008 + This input supports setting the native size using + the V4L2_SEL_TGT_NATIVE_SIZE + selection target, see . + diff --git a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml index 2654e097df39..773fb1258c24 100644 --- a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml +++ b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml @@ -172,6 +172,14 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009. 0x00000004 This output supports setting the TV standard by using VIDIOC_S_STD. + + V4L2_OUT_CAP_NATIVE_SIZE + 0x00000008 + This output supports setting the native size using + the V4L2_SEL_TGT_NATIVE_SIZE + selection target, see . + diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index ced659e1b9f6..d279c1b75cf7 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1324,6 +1324,7 @@ struct v4l2_input { #define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ #define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */ #define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ +#define V4L2_IN_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */ /* * V I D E O O U T P U T S @@ -1347,6 +1348,7 @@ struct v4l2_output { #define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ #define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */ #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ +#define V4L2_OUT_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */ /* * C O N T R O L S -- cgit v1.2.3-59-g8ed1b