diff options
Diffstat (limited to 'drivers/media/video/ov511.c')
-rw-r--r-- | drivers/media/video/ov511.c | 105 |
1 files changed, 57 insertions, 48 deletions
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c index c6852402c5e9..935d73de57bd 100644 --- a/drivers/media/video/ov511.c +++ b/drivers/media/video/ov511.c | |||
@@ -974,14 +974,14 @@ dump_i2c_range(struct usb_ov511 *ov, int reg1, int regn) | |||
974 | 974 | ||
975 | for (i = reg1; i <= regn; i++) { | 975 | for (i = reg1; i <= regn; i++) { |
976 | rc = i2c_r(ov, i); | 976 | rc = i2c_r(ov, i); |
977 | info("Sensor[0x%02X] = 0x%02X", i, rc); | 977 | dev_info(&ov->dev->dev, "Sensor[0x%02X] = 0x%02X\n", i, rc); |
978 | } | 978 | } |
979 | } | 979 | } |
980 | 980 | ||
981 | static void | 981 | static void |
982 | dump_i2c_regs(struct usb_ov511 *ov) | 982 | dump_i2c_regs(struct usb_ov511 *ov) |
983 | { | 983 | { |
984 | info("I2C REGS"); | 984 | dev_info(&ov->dev->dev, "I2C REGS\n"); |
985 | dump_i2c_range(ov, 0x00, 0x7C); | 985 | dump_i2c_range(ov, 0x00, 0x7C); |
986 | } | 986 | } |
987 | 987 | ||
@@ -992,28 +992,28 @@ dump_reg_range(struct usb_ov511 *ov, int reg1, int regn) | |||
992 | 992 | ||
993 | for (i = reg1; i <= regn; i++) { | 993 | for (i = reg1; i <= regn; i++) { |
994 | rc = reg_r(ov, i); | 994 | rc = reg_r(ov, i); |
995 | info("OV511[0x%02X] = 0x%02X", i, rc); | 995 | dev_info(&ov->dev->dev, "OV511[0x%02X] = 0x%02X\n", i, rc); |
996 | } | 996 | } |
997 | } | 997 | } |
998 | 998 | ||
999 | static void | 999 | static void |
1000 | ov511_dump_regs(struct usb_ov511 *ov) | 1000 | ov511_dump_regs(struct usb_ov511 *ov) |
1001 | { | 1001 | { |
1002 | info("CAMERA INTERFACE REGS"); | 1002 | dev_info(&ov->dev->dev, "CAMERA INTERFACE REGS\n"); |
1003 | dump_reg_range(ov, 0x10, 0x1f); | 1003 | dump_reg_range(ov, 0x10, 0x1f); |
1004 | info("DRAM INTERFACE REGS"); | 1004 | dev_info(&ov->dev->dev, "DRAM INTERFACE REGS\n"); |
1005 | dump_reg_range(ov, 0x20, 0x23); | 1005 | dump_reg_range(ov, 0x20, 0x23); |
1006 | info("ISO FIFO REGS"); | 1006 | dev_info(&ov->dev->dev, "ISO FIFO REGS\n"); |
1007 | dump_reg_range(ov, 0x30, 0x31); | 1007 | dump_reg_range(ov, 0x30, 0x31); |
1008 | info("PIO REGS"); | 1008 | dev_info(&ov->dev->dev, "PIO REGS\n"); |
1009 | dump_reg_range(ov, 0x38, 0x39); | 1009 | dump_reg_range(ov, 0x38, 0x39); |
1010 | dump_reg_range(ov, 0x3e, 0x3e); | 1010 | dump_reg_range(ov, 0x3e, 0x3e); |
1011 | info("I2C REGS"); | 1011 | dev_info(&ov->dev->dev, "I2C REGS\n"); |
1012 | dump_reg_range(ov, 0x40, 0x49); | 1012 | dump_reg_range(ov, 0x40, 0x49); |
1013 | info("SYSTEM CONTROL REGS"); | 1013 | dev_info(&ov->dev->dev, "SYSTEM CONTROL REGS\n"); |
1014 | dump_reg_range(ov, 0x50, 0x55); | 1014 | dump_reg_range(ov, 0x50, 0x55); |
1015 | dump_reg_range(ov, 0x5e, 0x5f); | 1015 | dump_reg_range(ov, 0x5e, 0x5f); |
1016 | info("OmniCE REGS"); | 1016 | dev_info(&ov->dev->dev, "OmniCE REGS\n"); |
1017 | dump_reg_range(ov, 0x70, 0x79); | 1017 | dump_reg_range(ov, 0x70, 0x79); |
1018 | /* NOTE: Quantization tables are not readable. You will get the value | 1018 | /* NOTE: Quantization tables are not readable. You will get the value |
1019 | * in reg. 0x79 for every table register */ | 1019 | * in reg. 0x79 for every table register */ |
@@ -1025,25 +1025,25 @@ ov511_dump_regs(struct usb_ov511 *ov) | |||
1025 | static void | 1025 | static void |
1026 | ov518_dump_regs(struct usb_ov511 *ov) | 1026 | ov518_dump_regs(struct usb_ov511 *ov) |
1027 | { | 1027 | { |
1028 | info("VIDEO MODE REGS"); | 1028 | dev_info(&ov->dev->dev, "VIDEO MODE REGS\n"); |
1029 | dump_reg_range(ov, 0x20, 0x2f); | 1029 | dump_reg_range(ov, 0x20, 0x2f); |
1030 | info("DATA PUMP AND SNAPSHOT REGS"); | 1030 | dev_info(&ov->dev->dev, "DATA PUMP AND SNAPSHOT REGS\n"); |
1031 | dump_reg_range(ov, 0x30, 0x3f); | 1031 | dump_reg_range(ov, 0x30, 0x3f); |
1032 | info("I2C REGS"); | 1032 | dev_info(&ov->dev->dev, "I2C REGS\n"); |
1033 | dump_reg_range(ov, 0x40, 0x4f); | 1033 | dump_reg_range(ov, 0x40, 0x4f); |
1034 | info("SYSTEM CONTROL AND VENDOR REGS"); | 1034 | dev_info(&ov->dev->dev, "SYSTEM CONTROL AND VENDOR REGS\n"); |
1035 | dump_reg_range(ov, 0x50, 0x5f); | 1035 | dump_reg_range(ov, 0x50, 0x5f); |
1036 | info("60 - 6F"); | 1036 | dev_info(&ov->dev->dev, "60 - 6F\n"); |
1037 | dump_reg_range(ov, 0x60, 0x6f); | 1037 | dump_reg_range(ov, 0x60, 0x6f); |
1038 | info("70 - 7F"); | 1038 | dev_info(&ov->dev->dev, "70 - 7F\n"); |
1039 | dump_reg_range(ov, 0x70, 0x7f); | 1039 | dump_reg_range(ov, 0x70, 0x7f); |
1040 | info("Y QUANTIZATION TABLE"); | 1040 | dev_info(&ov->dev->dev, "Y QUANTIZATION TABLE\n"); |
1041 | dump_reg_range(ov, 0x80, 0x8f); | 1041 | dump_reg_range(ov, 0x80, 0x8f); |
1042 | info("UV QUANTIZATION TABLE"); | 1042 | dev_info(&ov->dev->dev, "UV QUANTIZATION TABLE\n"); |
1043 | dump_reg_range(ov, 0x90, 0x9f); | 1043 | dump_reg_range(ov, 0x90, 0x9f); |
1044 | info("A0 - BF"); | 1044 | dev_info(&ov->dev->dev, "A0 - BF\n"); |
1045 | dump_reg_range(ov, 0xa0, 0xbf); | 1045 | dump_reg_range(ov, 0xa0, 0xbf); |
1046 | info("CBR"); | 1046 | dev_info(&ov->dev->dev, "CBR\n"); |
1047 | dump_reg_range(ov, 0xc0, 0xcf); | 1047 | dump_reg_range(ov, 0xc0, 0xcf); |
1048 | } | 1048 | } |
1049 | #endif | 1049 | #endif |
@@ -3205,9 +3205,10 @@ ov511_move_data(struct usb_ov511 *ov, unsigned char *in, int n) | |||
3205 | */ | 3205 | */ |
3206 | 3206 | ||
3207 | if (printph) { | 3207 | if (printph) { |
3208 | info("ph(%3d): %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x", | 3208 | dev_info(&ov->dev->dev, |
3209 | pnum, in[0], in[1], in[2], in[3], in[4], in[5], in[6], | 3209 | "ph(%3d): %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x\n", |
3210 | in[7], in[8], in[9], in[10], in[11]); | 3210 | pnum, in[0], in[1], in[2], in[3], in[4], in[5], in[6], |
3211 | in[7], in[8], in[9], in[10], in[11]); | ||
3211 | } | 3212 | } |
3212 | 3213 | ||
3213 | /* Check for SOF/EOF packet */ | 3214 | /* Check for SOF/EOF packet */ |
@@ -3366,8 +3367,10 @@ ov518_move_data(struct usb_ov511 *ov, unsigned char *in, int n) | |||
3366 | * the definitive SOF/EOF format */ | 3367 | * the definitive SOF/EOF format */ |
3367 | if ((!(in[0] | in[1] | in[2] | in[3] | in[5])) && in[6]) { | 3368 | if ((!(in[0] | in[1] | in[2] | in[3] | in[5])) && in[6]) { |
3368 | if (printph) { | 3369 | if (printph) { |
3369 | info("ph: %2x %2x %2x %2x %2x %2x %2x %2x", in[0], | 3370 | dev_info(&ov->dev->dev, |
3370 | in[1], in[2], in[3], in[4], in[5], in[6], in[7]); | 3371 | "ph: %2x %2x %2x %2x %2x %2x %2x %2x\n", |
3372 | in[0], in[1], in[2], in[3], in[4], in[5], | ||
3373 | in[6], in[7]); | ||
3371 | } | 3374 | } |
3372 | 3375 | ||
3373 | if (frame->scanstate == STATE_LINES) { | 3376 | if (frame->scanstate == STATE_LINES) { |
@@ -3646,14 +3649,16 @@ ov51x_init_isoc(struct usb_ov511 *ov) | |||
3646 | if (packetsize == -1) { | 3649 | if (packetsize == -1) { |
3647 | ov518_set_packet_size(ov, 640); | 3650 | ov518_set_packet_size(ov, 640); |
3648 | } else { | 3651 | } else { |
3649 | info("Forcing packet size to %d", packetsize); | 3652 | dev_info(&ov->dev->dev, "Forcing packet size to %d\n", |
3653 | packetsize); | ||
3650 | ov518_set_packet_size(ov, packetsize); | 3654 | ov518_set_packet_size(ov, packetsize); |
3651 | } | 3655 | } |
3652 | } else { | 3656 | } else { |
3653 | if (packetsize == -1) { | 3657 | if (packetsize == -1) { |
3654 | ov511_set_packet_size(ov, size); | 3658 | ov511_set_packet_size(ov, size); |
3655 | } else { | 3659 | } else { |
3656 | info("Forcing packet size to %d", packetsize); | 3660 | dev_info(&ov->dev->dev, "Forcing packet size to %d\n", |
3661 | packetsize); | ||
3657 | ov511_set_packet_size(ov, packetsize); | 3662 | ov511_set_packet_size(ov, packetsize); |
3658 | } | 3663 | } |
3659 | } | 3664 | } |
@@ -4121,7 +4126,7 @@ ov51x_v4l1_ioctl_internal(struct inode *inode, struct file *file, | |||
4121 | return -EIO; | 4126 | return -EIO; |
4122 | 4127 | ||
4123 | if (force_palette && p->palette != force_palette) { | 4128 | if (force_palette && p->palette != force_palette) { |
4124 | info("Palette rejected (%s)", | 4129 | dev_info(&ov->dev->dev, "Palette rejected (%s)\n", |
4125 | symbolic(v4l1_plist, p->palette)); | 4130 | symbolic(v4l1_plist, p->palette)); |
4126 | return -EINVAL; | 4131 | return -EINVAL; |
4127 | } | 4132 | } |
@@ -4849,26 +4854,27 @@ ov7xx0_configure(struct usb_ov511 *ov) | |||
4849 | err("Error detecting sensor type"); | 4854 | err("Error detecting sensor type"); |
4850 | return -1; | 4855 | return -1; |
4851 | } else if ((rc & 3) == 3) { | 4856 | } else if ((rc & 3) == 3) { |
4852 | info("Sensor is an OV7610"); | 4857 | dev_info(&ov->dev->dev, "Sensor is an OV7610\n"); |
4853 | ov->sensor = SEN_OV7610; | 4858 | ov->sensor = SEN_OV7610; |
4854 | } else if ((rc & 3) == 1) { | 4859 | } else if ((rc & 3) == 1) { |
4855 | /* I don't know what's different about the 76BE yet. */ | 4860 | /* I don't know what's different about the 76BE yet. */ |
4856 | if (i2c_r(ov, 0x15) & 1) | 4861 | if (i2c_r(ov, 0x15) & 1) |
4857 | info("Sensor is an OV7620AE"); | 4862 | dev_info(&ov->dev->dev, "Sensor is an OV7620AE\n"); |
4858 | else | 4863 | else |
4859 | info("Sensor is an OV76BE"); | 4864 | dev_info(&ov->dev->dev, "Sensor is an OV76BE\n"); |
4860 | 4865 | ||
4861 | /* OV511+ will return all zero isoc data unless we | 4866 | /* OV511+ will return all zero isoc data unless we |
4862 | * configure the sensor as a 7620. Someone needs to | 4867 | * configure the sensor as a 7620. Someone needs to |
4863 | * find the exact reg. setting that causes this. */ | 4868 | * find the exact reg. setting that causes this. */ |
4864 | if (ov->bridge == BRG_OV511PLUS) { | 4869 | if (ov->bridge == BRG_OV511PLUS) { |
4865 | info("Enabling 511+/7620AE workaround"); | 4870 | dev_info(&ov->dev->dev, |
4871 | "Enabling 511+/7620AE workaround\n"); | ||
4866 | ov->sensor = SEN_OV7620; | 4872 | ov->sensor = SEN_OV7620; |
4867 | } else { | 4873 | } else { |
4868 | ov->sensor = SEN_OV76BE; | 4874 | ov->sensor = SEN_OV76BE; |
4869 | } | 4875 | } |
4870 | } else if ((rc & 3) == 0) { | 4876 | } else if ((rc & 3) == 0) { |
4871 | info("Sensor is an OV7620"); | 4877 | dev_info(&ov->dev->dev, "Sensor is an OV7620\n"); |
4872 | ov->sensor = SEN_OV7620; | 4878 | ov->sensor = SEN_OV7620; |
4873 | } else { | 4879 | } else { |
4874 | err("Unknown image sensor version: %d", rc & 3); | 4880 | err("Unknown image sensor version: %d", rc & 3); |
@@ -5024,16 +5030,16 @@ ov6xx0_configure(struct usb_ov511 *ov) | |||
5024 | 5030 | ||
5025 | if ((rc & 3) == 0) { | 5031 | if ((rc & 3) == 0) { |
5026 | ov->sensor = SEN_OV6630; | 5032 | ov->sensor = SEN_OV6630; |
5027 | info("Sensor is an OV6630"); | 5033 | dev_info(&ov->dev->dev, "Sensor is an OV6630\n"); |
5028 | } else if ((rc & 3) == 1) { | 5034 | } else if ((rc & 3) == 1) { |
5029 | ov->sensor = SEN_OV6620; | 5035 | ov->sensor = SEN_OV6620; |
5030 | info("Sensor is an OV6620"); | 5036 | dev_info(&ov->dev->dev, "Sensor is an OV6620\n"); |
5031 | } else if ((rc & 3) == 2) { | 5037 | } else if ((rc & 3) == 2) { |
5032 | ov->sensor = SEN_OV6630; | 5038 | ov->sensor = SEN_OV6630; |
5033 | info("Sensor is an OV6630AE"); | 5039 | dev_info(&ov->dev->dev, "Sensor is an OV6630AE\n"); |
5034 | } else if ((rc & 3) == 3) { | 5040 | } else if ((rc & 3) == 3) { |
5035 | ov->sensor = SEN_OV6630; | 5041 | ov->sensor = SEN_OV6630; |
5036 | info("Sensor is an OV6630AF"); | 5042 | dev_info(&ov->dev->dev, "Sensor is an OV6630AF\n"); |
5037 | } | 5043 | } |
5038 | 5044 | ||
5039 | /* Set sensor-specific vars */ | 5045 | /* Set sensor-specific vars */ |
@@ -5088,10 +5094,10 @@ ks0127_configure(struct usb_ov511 *ov) | |||
5088 | err("Error detecting sensor type"); | 5094 | err("Error detecting sensor type"); |
5089 | return -1; | 5095 | return -1; |
5090 | } else if ((rc & 0x0f) == 0) { | 5096 | } else if ((rc & 0x0f) == 0) { |
5091 | info("Sensor is a KS0127"); | 5097 | dev_info(&ov->dev->dev, "Sensor is a KS0127\n"); |
5092 | ov->sensor = SEN_KS0127; | 5098 | ov->sensor = SEN_KS0127; |
5093 | } else if ((rc & 0x0f) == 9) { | 5099 | } else if ((rc & 0x0f) == 9) { |
5094 | info("Sensor is a KS0127B Rev. A"); | 5100 | dev_info(&ov->dev->dev, "Sensor is a KS0127B Rev. A\n"); |
5095 | ov->sensor = SEN_KS0127B; | 5101 | ov->sensor = SEN_KS0127B; |
5096 | } | 5102 | } |
5097 | } else { | 5103 | } else { |
@@ -5200,7 +5206,8 @@ saa7111a_configure(struct usb_ov511 *ov) | |||
5200 | err("Error detecting sensor version"); | 5206 | err("Error detecting sensor version"); |
5201 | return -1; | 5207 | return -1; |
5202 | } else { | 5208 | } else { |
5203 | info("Sensor is an SAA7111A (version 0x%x)", rc); | 5209 | dev_info(&ov->dev->dev, |
5210 | "Sensor is an SAA7111A (version 0x%x)\n", rc); | ||
5204 | ov->sensor = SEN_SAA7111A; | 5211 | ov->sensor = SEN_SAA7111A; |
5205 | } | 5212 | } |
5206 | 5213 | ||
@@ -5262,7 +5269,7 @@ ov511_configure(struct usb_ov511 *ov) | |||
5262 | 5269 | ||
5263 | PDEBUG (1, "CustomID = %d", ov->customid); | 5270 | PDEBUG (1, "CustomID = %d", ov->customid); |
5264 | ov->desc = symbolic(camlist, ov->customid); | 5271 | ov->desc = symbolic(camlist, ov->customid); |
5265 | info("model: %s", ov->desc); | 5272 | dev_info(&ov->dev->dev, "model: %s\n", ov->desc); |
5266 | 5273 | ||
5267 | if (0 == strcmp(ov->desc, NOT_DEFINED_STR)) { | 5274 | if (0 == strcmp(ov->desc, NOT_DEFINED_STR)) { |
5268 | err("Camera type (%d) not recognized", ov->customid); | 5275 | err("Camera type (%d) not recognized", ov->customid); |
@@ -5426,7 +5433,8 @@ ov518_configure(struct usb_ov511 *ov) | |||
5426 | PDEBUG(4, ""); | 5433 | PDEBUG(4, ""); |
5427 | 5434 | ||
5428 | /* First 5 bits of custom ID reg are a revision ID on OV518 */ | 5435 | /* First 5 bits of custom ID reg are a revision ID on OV518 */ |
5429 | info("Device revision %d", 0x1F & reg_r(ov, R511_SYS_CUST_ID)); | 5436 | dev_info(&ov->dev->dev, "Device revision %d\n", |
5437 | 0x1F & reg_r(ov, R511_SYS_CUST_ID)); | ||
5430 | 5438 | ||
5431 | /* Give it the default description */ | 5439 | /* Give it the default description */ |
5432 | ov->desc = symbolic(camlist, 0); | 5440 | ov->desc = symbolic(camlist, 0); |
@@ -5773,7 +5781,8 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
5773 | goto error; | 5781 | goto error; |
5774 | } | 5782 | } |
5775 | 5783 | ||
5776 | info("USB %s video device found", symbolic(brglist, ov->bridge)); | 5784 | dev_info(&intf->dev, "USB %s video device found\n", |
5785 | symbolic(brglist, ov->bridge)); | ||
5777 | 5786 | ||
5778 | init_waitqueue_head(&ov->wq); | 5787 | init_waitqueue_head(&ov->wq); |
5779 | 5788 | ||
@@ -5854,8 +5863,8 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
5854 | goto error; | 5863 | goto error; |
5855 | } | 5864 | } |
5856 | 5865 | ||
5857 | info("Device at %s registered to minor %d", ov->usb_path, | 5866 | dev_info(&intf->dev, "Device at %s registered to minor %d\n", |
5858 | ov->vdev->minor); | 5867 | ov->usb_path, ov->vdev->minor); |
5859 | 5868 | ||
5860 | usb_set_intfdata(intf, ov); | 5869 | usb_set_intfdata(intf, ov); |
5861 | if (ov_create_sysfs(ov->vdev)) { | 5870 | if (ov_create_sysfs(ov->vdev)) { |
@@ -5958,7 +5967,8 @@ usb_ov511_init(void) | |||
5958 | if (retval) | 5967 | if (retval) |
5959 | goto out; | 5968 | goto out; |
5960 | 5969 | ||
5961 | info(DRIVER_VERSION " : " DRIVER_DESC); | 5970 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
5971 | DRIVER_DESC "\n"); | ||
5962 | 5972 | ||
5963 | out: | 5973 | out: |
5964 | return retval; | 5974 | return retval; |
@@ -5968,8 +5978,7 @@ static void __exit | |||
5968 | usb_ov511_exit(void) | 5978 | usb_ov511_exit(void) |
5969 | { | 5979 | { |
5970 | usb_deregister(&ov511_driver); | 5980 | usb_deregister(&ov511_driver); |
5971 | info("driver deregistered"); | 5981 | printk(KERN_INFO KBUILD_MODNAME ": driver deregistered\n"); |
5972 | |||
5973 | } | 5982 | } |
5974 | 5983 | ||
5975 | module_init(usb_ov511_init); | 5984 | module_init(usb_ov511_init); |