diff options
author | Jean-François Moine <moinejf@free.fr> | 2012-03-24 08:20:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-03 14:29:54 -0400 |
commit | dae1de645e41a5d7f36686ebcb62987545f95e94 (patch) | |
tree | 38ff3efdeb7bbfba2e3d395150a528d2efe84e70 /drivers | |
parent | bed37388cf9f7d6248b6bd1033afa3dc69ca456b (diff) |
[media] gspca - sn9c20x: Define more tables as constant
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/gspca/sn9c20x.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index 5107fd6001c8..0958a93e0b82 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
@@ -747,7 +747,7 @@ static const s16 hsv_blue_y[] = { | |||
747 | 4, 2, 0, -1, -3, -5, -7, -9, -11 | 747 | 4, 2, 0, -1, -3, -5, -7, -9, -11 |
748 | }; | 748 | }; |
749 | 749 | ||
750 | static u16 i2c_ident[] = { | 750 | static const u16 i2c_ident[] = { |
751 | V4L2_IDENT_OV9650, | 751 | V4L2_IDENT_OV9650, |
752 | V4L2_IDENT_OV9655, | 752 | V4L2_IDENT_OV9655, |
753 | V4L2_IDENT_SOI968, | 753 | V4L2_IDENT_SOI968, |
@@ -763,7 +763,7 @@ static u16 i2c_ident[] = { | |||
763 | [SENSOR_MT9VPRB] = V4L2_IDENT_UNKNOWN, | 763 | [SENSOR_MT9VPRB] = V4L2_IDENT_UNKNOWN, |
764 | }; | 764 | }; |
765 | 765 | ||
766 | static u16 bridge_init[][2] = { | 766 | static const u16 bridge_init[][2] = { |
767 | {0x1000, 0x78}, {0x1001, 0x40}, {0x1002, 0x1c}, | 767 | {0x1000, 0x78}, {0x1001, 0x40}, {0x1002, 0x1c}, |
768 | {0x1020, 0x80}, {0x1061, 0x01}, {0x1067, 0x40}, | 768 | {0x1020, 0x80}, {0x1061, 0x01}, {0x1067, 0x40}, |
769 | {0x1068, 0x30}, {0x1069, 0x20}, {0x106a, 0x10}, | 769 | {0x1068, 0x30}, {0x1069, 0x20}, {0x106a, 0x10}, |
@@ -787,7 +787,7 @@ static u16 bridge_init[][2] = { | |||
787 | }; | 787 | }; |
788 | 788 | ||
789 | /* Gain = (bit[3:0] / 16 + 1) * (bit[4] + 1) * (bit[5] + 1) * (bit[6] + 1) */ | 789 | /* Gain = (bit[3:0] / 16 + 1) * (bit[4] + 1) * (bit[5] + 1) * (bit[6] + 1) */ |
790 | static u8 ov_gain[] = { | 790 | static const u8 ov_gain[] = { |
791 | 0x00 /* 1x */, 0x04 /* 1.25x */, 0x08 /* 1.5x */, 0x0c /* 1.75x */, | 791 | 0x00 /* 1x */, 0x04 /* 1.25x */, 0x08 /* 1.5x */, 0x0c /* 1.75x */, |
792 | 0x10 /* 2x */, 0x12 /* 2.25x */, 0x14 /* 2.5x */, 0x16 /* 2.75x */, | 792 | 0x10 /* 2x */, 0x12 /* 2.25x */, 0x14 /* 2.5x */, 0x16 /* 2.75x */, |
793 | 0x18 /* 3x */, 0x1a /* 3.25x */, 0x1c /* 3.5x */, 0x1e /* 3.75x */, | 793 | 0x18 /* 3x */, 0x1a /* 3.25x */, 0x1c /* 3.5x */, 0x1e /* 3.75x */, |
@@ -799,7 +799,7 @@ static u8 ov_gain[] = { | |||
799 | }; | 799 | }; |
800 | 800 | ||
801 | /* Gain = (bit[8] + 1) * (bit[7] + 1) * (bit[6:0] * 0.03125) */ | 801 | /* Gain = (bit[8] + 1) * (bit[7] + 1) * (bit[6:0] * 0.03125) */ |
802 | static u16 micron1_gain[] = { | 802 | static const u16 micron1_gain[] = { |
803 | /* 1x 1.25x 1.5x 1.75x */ | 803 | /* 1x 1.25x 1.5x 1.75x */ |
804 | 0x0020, 0x0028, 0x0030, 0x0038, | 804 | 0x0020, 0x0028, 0x0030, 0x0038, |
805 | /* 2x 2.25x 2.5x 2.75x */ | 805 | /* 2x 2.25x 2.5x 2.75x */ |
@@ -820,7 +820,7 @@ static u16 micron1_gain[] = { | |||
820 | 820 | ||
821 | /* mt9m001 sensor uses a different gain formula then other micron sensors */ | 821 | /* mt9m001 sensor uses a different gain formula then other micron sensors */ |
822 | /* Gain = (bit[6] + 1) * (bit[5-0] * 0.125) */ | 822 | /* Gain = (bit[6] + 1) * (bit[5-0] * 0.125) */ |
823 | static u16 micron2_gain[] = { | 823 | static const u16 micron2_gain[] = { |
824 | /* 1x 1.25x 1.5x 1.75x */ | 824 | /* 1x 1.25x 1.5x 1.75x */ |
825 | 0x0008, 0x000a, 0x000c, 0x000e, | 825 | 0x0008, 0x000a, 0x000c, 0x000e, |
826 | /* 2x 2.25x 2.5x 2.75x */ | 826 | /* 2x 2.25x 2.5x 2.75x */ |
@@ -840,7 +840,7 @@ static u16 micron2_gain[] = { | |||
840 | }; | 840 | }; |
841 | 841 | ||
842 | /* Gain = .5 + bit[7:0] / 16 */ | 842 | /* Gain = .5 + bit[7:0] / 16 */ |
843 | static u8 hv7131r_gain[] = { | 843 | static const u8 hv7131r_gain[] = { |
844 | 0x08 /* 1x */, 0x0c /* 1.25x */, 0x10 /* 1.5x */, 0x14 /* 1.75x */, | 844 | 0x08 /* 1x */, 0x0c /* 1.25x */, 0x10 /* 1.5x */, 0x14 /* 1.75x */, |
845 | 0x18 /* 2x */, 0x1c /* 2.25x */, 0x20 /* 2.5x */, 0x24 /* 2.75x */, | 845 | 0x18 /* 2x */, 0x1c /* 2.25x */, 0x20 /* 2.5x */, 0x24 /* 2.75x */, |
846 | 0x28 /* 3x */, 0x2c /* 3.25x */, 0x30 /* 3.5x */, 0x34 /* 3.75x */, | 846 | 0x28 /* 3x */, 0x2c /* 3.25x */, 0x30 /* 3.5x */, 0x34 /* 3.75x */, |
@@ -851,7 +851,7 @@ static u8 hv7131r_gain[] = { | |||
851 | 0x78 /* 8x */ | 851 | 0x78 /* 8x */ |
852 | }; | 852 | }; |
853 | 853 | ||
854 | static struct i2c_reg_u8 soi968_init[] = { | 854 | static const struct i2c_reg_u8 soi968_init[] = { |
855 | {0x0c, 0x00}, {0x0f, 0x1f}, | 855 | {0x0c, 0x00}, {0x0f, 0x1f}, |
856 | {0x11, 0x80}, {0x38, 0x52}, {0x1e, 0x00}, | 856 | {0x11, 0x80}, {0x38, 0x52}, {0x1e, 0x00}, |
857 | {0x33, 0x08}, {0x35, 0x8c}, {0x36, 0x0c}, | 857 | {0x33, 0x08}, {0x35, 0x8c}, {0x36, 0x0c}, |
@@ -865,7 +865,7 @@ static struct i2c_reg_u8 soi968_init[] = { | |||
865 | {0x00, 0x00}, {0x01, 0x80}, {0x02, 0x80}, | 865 | {0x00, 0x00}, {0x01, 0x80}, {0x02, 0x80}, |
866 | }; | 866 | }; |
867 | 867 | ||
868 | static struct i2c_reg_u8 ov7660_init[] = { | 868 | static const struct i2c_reg_u8 ov7660_init[] = { |
869 | {0x0e, 0x80}, {0x0d, 0x08}, {0x0f, 0xc3}, | 869 | {0x0e, 0x80}, {0x0d, 0x08}, {0x0f, 0xc3}, |
870 | {0x04, 0xc3}, {0x10, 0x40}, {0x11, 0x40}, | 870 | {0x04, 0xc3}, {0x10, 0x40}, {0x11, 0x40}, |
871 | {0x12, 0x05}, {0x13, 0xba}, {0x14, 0x2a}, | 871 | {0x12, 0x05}, {0x13, 0xba}, {0x14, 0x2a}, |
@@ -877,7 +877,7 @@ static struct i2c_reg_u8 ov7660_init[] = { | |||
877 | {0x2e, 0x0b}, {0x01, 0x78}, {0x02, 0x50}, | 877 | {0x2e, 0x0b}, {0x01, 0x78}, {0x02, 0x50}, |
878 | }; | 878 | }; |
879 | 879 | ||
880 | static struct i2c_reg_u8 ov7670_init[] = { | 880 | static const struct i2c_reg_u8 ov7670_init[] = { |
881 | {0x11, 0x80}, {0x3a, 0x04}, {0x12, 0x01}, | 881 | {0x11, 0x80}, {0x3a, 0x04}, {0x12, 0x01}, |
882 | {0x32, 0xb6}, {0x03, 0x0a}, {0x0c, 0x00}, {0x3e, 0x00}, | 882 | {0x32, 0xb6}, {0x03, 0x0a}, {0x0c, 0x00}, {0x3e, 0x00}, |
883 | {0x70, 0x3a}, {0x71, 0x35}, {0x72, 0x11}, {0x73, 0xf0}, | 883 | {0x70, 0x3a}, {0x71, 0x35}, {0x72, 0x11}, {0x73, 0xf0}, |
@@ -934,7 +934,7 @@ static struct i2c_reg_u8 ov7670_init[] = { | |||
934 | {0x93, 0x00}, | 934 | {0x93, 0x00}, |
935 | }; | 935 | }; |
936 | 936 | ||
937 | static struct i2c_reg_u8 ov9650_init[] = { | 937 | static const struct i2c_reg_u8 ov9650_init[] = { |
938 | {0x00, 0x00}, {0x01, 0x78}, | 938 | {0x00, 0x00}, {0x01, 0x78}, |
939 | {0x02, 0x78}, {0x03, 0x36}, {0x04, 0x03}, | 939 | {0x02, 0x78}, {0x03, 0x36}, {0x04, 0x03}, |
940 | {0x05, 0x00}, {0x06, 0x00}, {0x08, 0x00}, | 940 | {0x05, 0x00}, {0x06, 0x00}, {0x08, 0x00}, |
@@ -964,7 +964,7 @@ static struct i2c_reg_u8 ov9650_init[] = { | |||
964 | {0xaa, 0x92}, {0xab, 0x0a}, | 964 | {0xaa, 0x92}, {0xab, 0x0a}, |
965 | }; | 965 | }; |
966 | 966 | ||
967 | static struct i2c_reg_u8 ov9655_init[] = { | 967 | static const struct i2c_reg_u8 ov9655_init[] = { |
968 | {0x0e, 0x61}, {0x11, 0x80}, {0x13, 0xba}, | 968 | {0x0e, 0x61}, {0x11, 0x80}, {0x13, 0xba}, |
969 | {0x14, 0x2e}, {0x16, 0x24}, {0x1e, 0x04}, {0x27, 0x08}, | 969 | {0x14, 0x2e}, {0x16, 0x24}, {0x1e, 0x04}, {0x27, 0x08}, |
970 | {0x28, 0x08}, {0x29, 0x15}, {0x2c, 0x08}, {0x34, 0x3d}, | 970 | {0x28, 0x08}, {0x29, 0x15}, {0x2c, 0x08}, {0x34, 0x3d}, |
@@ -991,7 +991,7 @@ static struct i2c_reg_u8 ov9655_init[] = { | |||
991 | {0x04, 0x03}, {0x00, 0x13}, | 991 | {0x04, 0x03}, {0x00, 0x13}, |
992 | }; | 992 | }; |
993 | 993 | ||
994 | static struct i2c_reg_u16 mt9v112_init[] = { | 994 | static const struct i2c_reg_u16 mt9v112_init[] = { |
995 | {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0020}, | 995 | {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0020}, |
996 | {0x34, 0xc019}, {0x0a, 0x0011}, {0x0b, 0x000b}, | 996 | {0x34, 0xc019}, {0x0a, 0x0011}, {0x0b, 0x000b}, |
997 | {0x20, 0x0703}, {0x35, 0x2022}, {0xf0, 0x0001}, | 997 | {0x20, 0x0703}, {0x35, 0x2022}, {0xf0, 0x0001}, |
@@ -1010,7 +1010,7 @@ static struct i2c_reg_u16 mt9v112_init[] = { | |||
1010 | {0x2c, 0x00ae}, {0x2d, 0x00ae}, {0x2e, 0x00ae}, | 1010 | {0x2c, 0x00ae}, {0x2d, 0x00ae}, {0x2e, 0x00ae}, |
1011 | }; | 1011 | }; |
1012 | 1012 | ||
1013 | static struct i2c_reg_u16 mt9v111_init[] = { | 1013 | static const struct i2c_reg_u16 mt9v111_init[] = { |
1014 | {0x01, 0x0004}, {0x0d, 0x0001}, {0x0d, 0x0000}, | 1014 | {0x01, 0x0004}, {0x0d, 0x0001}, {0x0d, 0x0000}, |
1015 | {0x01, 0x0001}, {0x05, 0x0004}, {0x2d, 0xe0a0}, | 1015 | {0x01, 0x0001}, {0x05, 0x0004}, {0x2d, 0xe0a0}, |
1016 | {0x2e, 0x0c64}, {0x2f, 0x0064}, {0x06, 0x600e}, | 1016 | {0x2e, 0x0c64}, {0x2f, 0x0064}, {0x06, 0x600e}, |
@@ -1020,7 +1020,7 @@ static struct i2c_reg_u16 mt9v111_init[] = { | |||
1020 | {0x0e, 0x0008}, {0x20, 0x0000} | 1020 | {0x0e, 0x0008}, {0x20, 0x0000} |
1021 | }; | 1021 | }; |
1022 | 1022 | ||
1023 | static struct i2c_reg_u16 mt9v011_init[] = { | 1023 | static const struct i2c_reg_u16 mt9v011_init[] = { |
1024 | {0x07, 0x0002}, {0x0d, 0x0001}, {0x0d, 0x0000}, | 1024 | {0x07, 0x0002}, {0x0d, 0x0001}, {0x0d, 0x0000}, |
1025 | {0x01, 0x0008}, {0x02, 0x0016}, {0x03, 0x01e1}, | 1025 | {0x01, 0x0008}, {0x02, 0x0016}, {0x03, 0x01e1}, |
1026 | {0x04, 0x0281}, {0x05, 0x0083}, {0x06, 0x0006}, | 1026 | {0x04, 0x0281}, {0x05, 0x0083}, {0x06, 0x0006}, |
@@ -1047,7 +1047,7 @@ static struct i2c_reg_u16 mt9v011_init[] = { | |||
1047 | {0x06, 0x0029}, {0x05, 0x0009}, | 1047 | {0x06, 0x0029}, {0x05, 0x0009}, |
1048 | }; | 1048 | }; |
1049 | 1049 | ||
1050 | static struct i2c_reg_u16 mt9m001_init[] = { | 1050 | static const struct i2c_reg_u16 mt9m001_init[] = { |
1051 | {0x0d, 0x0001}, | 1051 | {0x0d, 0x0001}, |
1052 | {0x0d, 0x0000}, | 1052 | {0x0d, 0x0000}, |
1053 | {0x04, 0x0500}, /* hres = 1280 */ | 1053 | {0x04, 0x0500}, /* hres = 1280 */ |
@@ -1063,21 +1063,21 @@ static struct i2c_reg_u16 mt9m001_init[] = { | |||
1063 | {0x35, 0x0057}, | 1063 | {0x35, 0x0057}, |
1064 | }; | 1064 | }; |
1065 | 1065 | ||
1066 | static struct i2c_reg_u16 mt9m111_init[] = { | 1066 | static const struct i2c_reg_u16 mt9m111_init[] = { |
1067 | {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0008}, | 1067 | {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0008}, |
1068 | {0xf0, 0x0001}, {0x3a, 0x4300}, {0x9b, 0x4300}, | 1068 | {0xf0, 0x0001}, {0x3a, 0x4300}, {0x9b, 0x4300}, |
1069 | {0x06, 0x708e}, {0xf0, 0x0002}, {0x2e, 0x0a1e}, | 1069 | {0x06, 0x708e}, {0xf0, 0x0002}, {0x2e, 0x0a1e}, |
1070 | {0xf0, 0x0000}, | 1070 | {0xf0, 0x0000}, |
1071 | }; | 1071 | }; |
1072 | 1072 | ||
1073 | static struct i2c_reg_u16 mt9m112_init[] = { | 1073 | static const struct i2c_reg_u16 mt9m112_init[] = { |
1074 | {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0008}, | 1074 | {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0008}, |
1075 | {0xf0, 0x0001}, {0x3a, 0x4300}, {0x9b, 0x4300}, | 1075 | {0xf0, 0x0001}, {0x3a, 0x4300}, {0x9b, 0x4300}, |
1076 | {0x06, 0x708e}, {0xf0, 0x0002}, {0x2e, 0x0a1e}, | 1076 | {0x06, 0x708e}, {0xf0, 0x0002}, {0x2e, 0x0a1e}, |
1077 | {0xf0, 0x0000}, | 1077 | {0xf0, 0x0000}, |
1078 | }; | 1078 | }; |
1079 | 1079 | ||
1080 | static struct i2c_reg_u8 hv7131r_init[] = { | 1080 | static const struct i2c_reg_u8 hv7131r_init[] = { |
1081 | {0x02, 0x08}, {0x02, 0x00}, {0x01, 0x08}, | 1081 | {0x02, 0x08}, {0x02, 0x00}, {0x01, 0x08}, |
1082 | {0x02, 0x00}, {0x20, 0x00}, {0x21, 0xd0}, | 1082 | {0x02, 0x00}, {0x20, 0x00}, {0x21, 0xd0}, |
1083 | {0x22, 0x00}, {0x23, 0x09}, {0x01, 0x08}, | 1083 | {0x22, 0x00}, {0x23, 0x09}, {0x01, 0x08}, |
@@ -1181,7 +1181,7 @@ static void i2c_w1(struct gspca_dev *gspca_dev, u8 reg, u8 val) | |||
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | static void i2c_w1_buf(struct gspca_dev *gspca_dev, | 1183 | static void i2c_w1_buf(struct gspca_dev *gspca_dev, |
1184 | struct i2c_reg_u8 *buf, int sz) | 1184 | const struct i2c_reg_u8 *buf, int sz) |
1185 | { | 1185 | { |
1186 | while (--sz >= 0) { | 1186 | while (--sz >= 0) { |
1187 | i2c_w1(gspca_dev, buf->reg, buf->val); | 1187 | i2c_w1(gspca_dev, buf->reg, buf->val); |
@@ -1211,7 +1211,7 @@ static void i2c_w2(struct gspca_dev *gspca_dev, u8 reg, u16 val) | |||
1211 | } | 1211 | } |
1212 | 1212 | ||
1213 | static void i2c_w2_buf(struct gspca_dev *gspca_dev, | 1213 | static void i2c_w2_buf(struct gspca_dev *gspca_dev, |
1214 | struct i2c_reg_u16 *buf, int sz) | 1214 | const struct i2c_reg_u16 *buf, int sz) |
1215 | { | 1215 | { |
1216 | while (--sz >= 0) { | 1216 | while (--sz >= 0) { |
1217 | i2c_w2(gspca_dev, buf->reg, buf->val); | 1217 | i2c_w2(gspca_dev, buf->reg, buf->val); |
@@ -2310,7 +2310,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
2310 | { | 2310 | { |
2311 | struct sd *sd = (struct sd *) gspca_dev; | 2311 | struct sd *sd = (struct sd *) gspca_dev; |
2312 | int avg_lum, is_jpeg; | 2312 | int avg_lum, is_jpeg; |
2313 | static u8 frame_header[] = | 2313 | static const u8 frame_header[] = |
2314 | {0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96}; | 2314 | {0xff, 0xff, 0x00, 0xc4, 0xc4, 0x96}; |
2315 | 2315 | ||
2316 | is_jpeg = (sd->fmt & 0x03) == 0; | 2316 | is_jpeg = (sd->fmt & 0x03) == 0; |