| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | From 95b6a6fea10497ca8f583768522d80317f8d700e Mon Sep 17 00:00:00 2001 |
| 2 | From: Dave Stevenson <dave.stevenson@raspberrypi.com> |
| 3 | Date: Wed, 29 Apr 2020 22:11:01 +0100 |
| 4 | Subject: [PATCH] media: i2c: ov5647: Use member names in mode tables |
| 5 | |
| 6 | To make adding new members to the mode structures easier, use |
| 7 | the member names in the initialisers. |
| 8 | |
| 9 | Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> |
| 10 | --- |
| 11 | drivers/media/i2c/ov5647.c | 30 +++++++++++++++--------------- |
| 12 | 1 file changed, 15 insertions(+), 15 deletions(-) |
| 13 | |
| 14 | --- a/drivers/media/i2c/ov5647.c |
| 15 | +++ b/drivers/media/i2c/ov5647.c |
| 16 | @@ -592,7 +592,7 @@ static struct ov5647_mode supported_mode |
| 17 | * Uncentred crop (top left quarter) from 2x2 binned 1296x972 image. |
| 18 | */ |
| 19 | { |
| 20 | - { |
| 21 | + .format = { |
| 22 | .code = MEDIA_BUS_FMT_SBGGR8_1X8, |
| 23 | .colorspace = V4L2_COLORSPACE_SRGB, |
| 24 | .field = V4L2_FIELD_NONE, |
| 25 | @@ -608,8 +608,8 @@ static struct ov5647_mode supported_mode |
| 26 | .pixel_rate = 77291670, |
| 27 | .hts = 1896, |
| 28 | .vts_def = 0x3d8, |
| 29 | - ov5647_640x480_8bit, |
| 30 | - ARRAY_SIZE(ov5647_640x480_8bit) |
| 31 | + .reg_list = ov5647_640x480_8bit, |
| 32 | + .num_regs = ARRAY_SIZE(ov5647_640x480_8bit) |
| 33 | }, |
| 34 | }; |
| 35 | |
| 36 | @@ -618,7 +618,7 @@ static struct ov5647_mode supported_mode |
| 37 | * MODE 0: 2592x1944 full resolution full FOV 10-bit mode. |
| 38 | */ |
| 39 | { |
| 40 | - { |
| 41 | + .format = { |
| 42 | .code = MEDIA_BUS_FMT_SBGGR10_1X10, |
| 43 | .colorspace = V4L2_COLORSPACE_SRGB, |
| 44 | .field = V4L2_FIELD_NONE, |
| 45 | @@ -634,15 +634,15 @@ static struct ov5647_mode supported_mode |
| 46 | .pixel_rate = 87500000, |
| 47 | .hts = 2844, |
| 48 | .vts_def = 0x7b0, |
| 49 | - ov5647_2592x1944_10bit, |
| 50 | - ARRAY_SIZE(ov5647_2592x1944_10bit) |
| 51 | + .reg_list = ov5647_2592x1944_10bit, |
| 52 | + .num_regs = ARRAY_SIZE(ov5647_2592x1944_10bit) |
| 53 | }, |
| 54 | /* |
| 55 | * MODE 1: 1080p30 10-bit mode. |
| 56 | * Full resolution centre-cropped down to 1080p. |
| 57 | */ |
| 58 | { |
| 59 | - { |
| 60 | + .format = { |
| 61 | .code = MEDIA_BUS_FMT_SBGGR10_1X10, |
| 62 | .colorspace = V4L2_COLORSPACE_SRGB, |
| 63 | .field = V4L2_FIELD_NONE, |
| 64 | @@ -658,14 +658,14 @@ static struct ov5647_mode supported_mode |
| 65 | .pixel_rate = 81666700, |
| 66 | .hts = 2416, |
| 67 | .vts_def = 0x450, |
| 68 | - ov5647_1080p30_10bit, |
| 69 | - ARRAY_SIZE(ov5647_1080p30_10bit) |
| 70 | + .reg_list = ov5647_1080p30_10bit, |
| 71 | + .num_regs = ARRAY_SIZE(ov5647_1080p30_10bit) |
| 72 | }, |
| 73 | /* |
| 74 | * MODE 2: 2x2 binned full FOV 10-bit mode. |
| 75 | */ |
| 76 | { |
| 77 | - { |
| 78 | + .format = { |
| 79 | .code = MEDIA_BUS_FMT_SBGGR10_1X10, |
| 80 | .colorspace = V4L2_COLORSPACE_SRGB, |
| 81 | .field = V4L2_FIELD_NONE, |
| 82 | @@ -681,15 +681,15 @@ static struct ov5647_mode supported_mode |
| 83 | .pixel_rate = 81666700, |
| 84 | .hts = 1896, |
| 85 | .vts_def = 0x59b, |
| 86 | - ov5647_2x2binned_10bit, |
| 87 | - ARRAY_SIZE(ov5647_2x2binned_10bit) |
| 88 | + .reg_list = ov5647_2x2binned_10bit, |
| 89 | + .num_regs = ARRAY_SIZE(ov5647_2x2binned_10bit) |
| 90 | }, |
| 91 | /* |
| 92 | * MODE 3: 10-bit VGA full FOV mode 60fps. |
| 93 | * 2x2 binned and subsampled down to VGA. |
| 94 | */ |
| 95 | { |
| 96 | - { |
| 97 | + .format = { |
| 98 | .code = MEDIA_BUS_FMT_SBGGR10_1X10, |
| 99 | .colorspace = V4L2_COLORSPACE_SRGB, |
| 100 | .field = V4L2_FIELD_NONE, |
| 101 | @@ -705,8 +705,8 @@ static struct ov5647_mode supported_mode |
| 102 | .pixel_rate = 55000000, |
| 103 | .hts = 1852, |
| 104 | .vts_def = 0x1f8, |
| 105 | - ov5647_640x480_10bit, |
| 106 | - ARRAY_SIZE(ov5647_640x480_10bit) |
| 107 | + .reg_list = ov5647_640x480_10bit, |
| 108 | + .num_regs = ARRAY_SIZE(ov5647_640x480_10bit) |
| 109 | }, |
| 110 | }; |
| 111 | |