@@ -756,7 +756,6 @@ static void tc358743_set_ref_clk(struct v4l2_subdev *sd)
756756static void tc358743_set_csi_color_space (struct v4l2_subdev * sd )
757757{
758758 struct tc358743_state * state = to_state (sd );
759- struct device * dev = & state -> i2c_client -> dev ;
760759
761760 switch (state -> mbus_fmt_code ) {
762761 case MEDIA_BUS_FMT_UYVY8_1X16 :
@@ -772,17 +771,7 @@ static void tc358743_set_csi_color_space(struct v4l2_subdev *sd)
772771 mutex_unlock (& state -> confctl_mutex );
773772 break ;
774773 case MEDIA_BUS_FMT_RGB888_1X24 :
775- /*
776- * The driver was initially introduced with RGB888
777- * support, but CSI really means BGR.
778- *
779- * Since we might have applications that would have
780- * hard-coded the RGB888, let's support both.
781- */
782- dev_warn_once (dev , "RGB format isn't actually supported by the hardware. The application should be fixed to use BGR." );
783- fallthrough ;
784- case MEDIA_BUS_FMT_BGR888_1X24 :
785- v4l2_dbg (2 , debug , sd , "%s: BGR 888 24-bit\n" , __func__ );
774+ v4l2_dbg (2 , debug , sd , "%s: RGB 888 24-bit\n" , __func__ );
786775 i2c_wr8_and_or (sd , VOUT_SET2 ,
787776 ~(MASK_SEL422 | MASK_VOUT_422FIL_100 ) & 0xff ,
788777 0x00 );
@@ -1443,26 +1432,11 @@ static int tc358743_log_status(struct v4l2_subdev *sd)
14431432 v4l2_info (sd , "Stopped: %s\n" ,
14441433 (i2c_rd16 (sd , CSI_STATUS ) & MASK_S_HLT ) ?
14451434 "yes" : "no" );
1446-
1447- switch (state -> mbus_fmt_code ) {
1448- case MEDIA_BUS_FMT_BGR888_1X24 :
1449- /*
1450- * The driver was initially introduced with RGB888
1451- * support, but CSI really means BGR.
1452- *
1453- * Since we might have applications that would have
1454- * hard-coded the RGB888, let's support both.
1455- */
1456- case MEDIA_BUS_FMT_RGB888_1X24 :
1457- v4l2_info (sd , "Color space: BGR 888 24-bit\n" );
1458- break ;
1459- case MEDIA_BUS_FMT_UYVY8_1X16 :
1460- v4l2_info (sd , "Color space: YCbCr 422 16-bit\n" );
1461- break ;
1462- default :
1463- v4l2_info (sd , "Color space: Unsupported\n" );
1464- break ;
1465- }
1435+ v4l2_info (sd , "Color space: %s\n" ,
1436+ state -> mbus_fmt_code == MEDIA_BUS_FMT_UYVY8_1X16 ?
1437+ "YCbCr 422 16-bit" :
1438+ state -> mbus_fmt_code == MEDIA_BUS_FMT_RGB888_1X24 ?
1439+ "RGB 888 24-bit" : "Unsupported" );
14661440
14671441 v4l2_info (sd , "-----%s status-----\n" , is_hdmi (sd ) ? "HDMI" : "DVI-D" );
14681442 v4l2_info (sd , "HDCP encrypted content: %s\n" ,
@@ -1799,18 +1773,11 @@ static int tc358743_enum_mbus_code(struct v4l2_subdev *sd,
17991773{
18001774 switch (code -> index ) {
18011775 case 0 :
1802- code -> code = MEDIA_BUS_FMT_BGR888_1X24 ;
1776+ code -> code = MEDIA_BUS_FMT_RGB888_1X24 ;
18031777 break ;
18041778 case 1 :
18051779 code -> code = MEDIA_BUS_FMT_UYVY8_1X16 ;
18061780 break ;
1807- case 2 :
1808- /*
1809- * We need to keep RGB888 for backward compatibility,
1810- * but we should list it last for userspace to pick BGR.
1811- */
1812- code -> code = MEDIA_BUS_FMT_RGB888_1X24 ;
1813- break ;
18141781 default :
18151782 return - EINVAL ;
18161783 }
@@ -1820,7 +1787,6 @@ static int tc358743_enum_mbus_code(struct v4l2_subdev *sd,
18201787static u32 tc358743_g_colorspace (u32 code )
18211788{
18221789 switch (code ) {
1823- case MEDIA_BUS_FMT_BGR888_1X24 :
18241790 case MEDIA_BUS_FMT_RGB888_1X24 :
18251791 return V4L2_COLORSPACE_SRGB ;
18261792 case MEDIA_BUS_FMT_UYVY8_1X16 :
@@ -1858,8 +1824,7 @@ static int tc358743_set_fmt(struct v4l2_subdev *sd,
18581824 u32 code = format -> format .code ; /* is overwritten by get_fmt */
18591825 int ret = tc358743_get_fmt (sd , sd_state , format );
18601826
1861- if (code == MEDIA_BUS_FMT_BGR888_1X24 ||
1862- code == MEDIA_BUS_FMT_RGB888_1X24 ||
1827+ if (code == MEDIA_BUS_FMT_RGB888_1X24 ||
18631828 code == MEDIA_BUS_FMT_UYVY8_1X16 )
18641829 format -> format .code = code ;
18651830 format -> format .colorspace = tc358743_g_colorspace (format -> format .code );
@@ -2279,7 +2244,7 @@ static int tc358743_probe(struct i2c_client *client)
22792244 if (err < 0 )
22802245 goto err_hdl ;
22812246
2282- state -> mbus_fmt_code = MEDIA_BUS_FMT_BGR888_1X24 ;
2247+ state -> mbus_fmt_code = MEDIA_BUS_FMT_RGB888_1X24 ;
22832248
22842249 sd -> dev = & client -> dev ;
22852250
0 commit comments