Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] msi2500: rename namespace msi3101 => msi2500

Rename driver namespace according to current driver name. Old
msi3101 was name of reference design, msi2500 is name of chip
itself.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

authored by

Antti Palosaari and committed by
Mauro Carvalho Chehab
06ce32cb 8591f708

+128 -128
+128 -128
drivers/media/usb/msi2500/msi2500.c
··· 34 34 #include <media/videobuf2-vmalloc.h> 35 35 #include <linux/spi/spi.h> 36 36 37 - static bool msi3101_emulated_fmt; 38 - module_param_named(emulated_formats, msi3101_emulated_fmt, bool, 0644); 37 + static bool msi2500_emulated_fmt; 38 + module_param_named(emulated_formats, msi2500_emulated_fmt, bool, 0644); 39 39 MODULE_PARM_DESC(emulated_formats, "enable emulated formats (disappears in future)"); 40 40 41 41 /* ··· 76 76 }; 77 77 78 78 /* stream formats */ 79 - struct msi3101_format { 79 + struct msi2500_format { 80 80 char *name; 81 81 u32 pixelformat; 82 82 u32 buffersize; 83 83 }; 84 84 85 85 /* format descriptions for capture and preview */ 86 - static struct msi3101_format formats[] = { 86 + static struct msi2500_format formats[] = { 87 87 { 88 88 .name = "Complex S8", 89 89 .pixelformat = V4L2_SDR_FMT_CS8, ··· 114 114 static const unsigned int NUM_FORMATS = ARRAY_SIZE(formats); 115 115 116 116 /* intermediate buffers with raw data from the USB device */ 117 - struct msi3101_frame_buf { 117 + struct msi2500_frame_buf { 118 118 struct vb2_buffer vb; /* common v4l buffer stuff -- must be first */ 119 119 struct list_head list; 120 120 }; 121 121 122 - struct msi3101_state { 122 + struct msi2500_state { 123 123 struct video_device vdev; 124 124 struct v4l2_device v4l2_dev; 125 125 struct v4l2_subdev *v4l2_subdev; ··· 157 157 }; 158 158 159 159 /* Private functions */ 160 - static struct msi3101_frame_buf *msi3101_get_next_fill_buf( 161 - struct msi3101_state *s) 160 + static struct msi2500_frame_buf *msi2500_get_next_fill_buf( 161 + struct msi2500_state *s) 162 162 { 163 163 unsigned long flags = 0; 164 - struct msi3101_frame_buf *buf = NULL; 164 + struct msi2500_frame_buf *buf = NULL; 165 165 166 166 spin_lock_irqsave(&s->queued_bufs_lock, flags); 167 167 if (list_empty(&s->queued_bufs)) 168 168 goto leave; 169 169 170 - buf = list_entry(s->queued_bufs.next, struct msi3101_frame_buf, list); 170 + buf = list_entry(s->queued_bufs.next, struct msi2500_frame_buf, list); 171 171 list_del(&buf->list); 172 172 leave: 173 173 spin_unlock_irqrestore(&s->queued_bufs_lock, flags); ··· 256 256 * signed 14-bit sample 257 257 */ 258 258 259 - static int msi3101_convert_stream(struct msi3101_state *s, u8 *dst, u8 *src, 259 + static int msi2500_convert_stream(struct msi2500_state *s, u8 *dst, u8 *src, 260 260 unsigned int src_len) 261 261 { 262 262 unsigned int i, j, transactions, dst_len = 0; ··· 378 378 * This gets called for the Isochronous pipe (stream). This is done in interrupt 379 379 * time, so it has to be fast, not crash, and not stall. Neat. 380 380 */ 381 - static void msi3101_isoc_handler(struct urb *urb) 381 + static void msi2500_isoc_handler(struct urb *urb) 382 382 { 383 - struct msi3101_state *s = (struct msi3101_state *)urb->context; 383 + struct msi2500_state *s = (struct msi2500_state *)urb->context; 384 384 int i, flen, fstatus; 385 385 unsigned char *iso_buf = NULL; 386 - struct msi3101_frame_buf *fbuf; 386 + struct msi2500_frame_buf *fbuf; 387 387 388 388 if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET || 389 389 urb->status == -ESHUTDOWN)) { ··· 394 394 395 395 if (unlikely(urb->status != 0)) { 396 396 dev_dbg(&s->udev->dev, 397 - "msi3101_isoc_handler() called with status %d\n", 397 + "msi2500_isoc_handler() called with status %d\n", 398 398 urb->status); 399 399 /* Give up after a number of contiguous errors */ 400 400 if (++s->isoc_errors > MAX_ISOC_ERRORS) ··· 427 427 iso_buf = urb->transfer_buffer + urb->iso_frame_desc[i].offset; 428 428 429 429 /* Get free framebuffer */ 430 - fbuf = msi3101_get_next_fill_buf(s); 430 + fbuf = msi2500_get_next_fill_buf(s); 431 431 if (unlikely(fbuf == NULL)) { 432 432 s->vb_full++; 433 433 dev_dbg_ratelimited(&s->udev->dev, ··· 438 438 439 439 /* fill framebuffer */ 440 440 ptr = vb2_plane_vaddr(&fbuf->vb, 0); 441 - flen = msi3101_convert_stream(s, ptr, iso_buf, flen); 441 + flen = msi2500_convert_stream(s, ptr, iso_buf, flen); 442 442 vb2_set_plane_payload(&fbuf->vb, 0, flen); 443 443 vb2_buffer_done(&fbuf->vb, VB2_BUF_STATE_DONE); 444 444 } ··· 447 447 i = usb_submit_urb(urb, GFP_ATOMIC); 448 448 if (unlikely(i != 0)) 449 449 dev_dbg(&s->udev->dev, 450 - "Error (%d) re-submitting urb in msi3101_isoc_handler\n", 450 + "Error (%d) re-submitting urb in msi2500_isoc_handler\n", 451 451 i); 452 452 } 453 453 454 - static void msi3101_iso_stop(struct msi3101_state *s) 454 + static void msi2500_iso_stop(struct msi2500_state *s) 455 455 { 456 456 int i; 457 457 ··· 467 467 } 468 468 } 469 469 470 - static void msi3101_iso_free(struct msi3101_state *s) 470 + static void msi2500_iso_free(struct msi2500_state *s) 471 471 { 472 472 int i; 473 473 ··· 490 490 } 491 491 492 492 /* Both v4l2_lock and vb_queue_lock should be locked when calling this */ 493 - static void msi3101_isoc_cleanup(struct msi3101_state *s) 493 + static void msi2500_isoc_cleanup(struct msi2500_state *s) 494 494 { 495 495 dev_dbg(&s->udev->dev, "%s:\n", __func__); 496 496 497 - msi3101_iso_stop(s); 498 - msi3101_iso_free(s); 497 + msi2500_iso_stop(s); 498 + msi2500_iso_free(s); 499 499 } 500 500 501 501 /* Both v4l2_lock and vb_queue_lock should be locked when calling this */ 502 - static int msi3101_isoc_init(struct msi3101_state *s) 502 + static int msi2500_isoc_init(struct msi2500_state *s) 503 503 { 504 504 struct usb_device *udev; 505 505 struct urb *urb; ··· 520 520 if (urb == NULL) { 521 521 dev_err(&s->udev->dev, 522 522 "Failed to allocate urb %d\n", i); 523 - msi3101_isoc_cleanup(s); 523 + msi2500_isoc_cleanup(s); 524 524 return -ENOMEM; 525 525 } 526 526 s->urbs[i] = urb; ··· 536 536 dev_err(&s->udev->dev, 537 537 "Failed to allocate urb buffer %d\n", 538 538 i); 539 - msi3101_isoc_cleanup(s); 539 + msi2500_isoc_cleanup(s); 540 540 return -ENOMEM; 541 541 } 542 542 urb->transfer_buffer_length = ISO_BUFFER_SIZE; 543 - urb->complete = msi3101_isoc_handler; 543 + urb->complete = msi2500_isoc_handler; 544 544 urb->context = s; 545 545 urb->start_frame = 0; 546 546 urb->number_of_packets = ISO_FRAMES_PER_DESC; ··· 557 557 dev_err(&s->udev->dev, 558 558 "isoc_init() submit_urb %d failed with error %d\n", 559 559 i, ret); 560 - msi3101_isoc_cleanup(s); 560 + msi2500_isoc_cleanup(s); 561 561 return ret; 562 562 } 563 563 dev_dbg(&s->udev->dev, "URB 0x%p submitted.\n", s->urbs[i]); ··· 568 568 } 569 569 570 570 /* Must be called with vb_queue_lock hold */ 571 - static void msi3101_cleanup_queued_bufs(struct msi3101_state *s) 571 + static void msi2500_cleanup_queued_bufs(struct msi2500_state *s) 572 572 { 573 573 unsigned long flags = 0; 574 574 ··· 576 576 577 577 spin_lock_irqsave(&s->queued_bufs_lock, flags); 578 578 while (!list_empty(&s->queued_bufs)) { 579 - struct msi3101_frame_buf *buf; 579 + struct msi2500_frame_buf *buf; 580 580 581 - buf = list_entry(s->queued_bufs.next, struct msi3101_frame_buf, 581 + buf = list_entry(s->queued_bufs.next, struct msi2500_frame_buf, 582 582 list); 583 583 list_del(&buf->list); 584 584 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); ··· 587 587 } 588 588 589 589 /* The user yanked out the cable... */ 590 - static void msi3101_disconnect(struct usb_interface *intf) 590 + static void msi2500_disconnect(struct usb_interface *intf) 591 591 { 592 592 struct v4l2_device *v = usb_get_intfdata(intf); 593 - struct msi3101_state *s = 594 - container_of(v, struct msi3101_state, v4l2_dev); 593 + struct msi2500_state *s = 594 + container_of(v, struct msi2500_state, v4l2_dev); 595 595 596 596 dev_dbg(&s->udev->dev, "%s:\n", __func__); 597 597 ··· 608 608 v4l2_device_put(&s->v4l2_dev); 609 609 } 610 610 611 - static int msi3101_querycap(struct file *file, void *fh, 611 + static int msi2500_querycap(struct file *file, void *fh, 612 612 struct v4l2_capability *cap) 613 613 { 614 - struct msi3101_state *s = video_drvdata(file); 614 + struct msi2500_state *s = video_drvdata(file); 615 615 616 616 dev_dbg(&s->udev->dev, "%s:\n", __func__); 617 617 ··· 625 625 } 626 626 627 627 /* Videobuf2 operations */ 628 - static int msi3101_queue_setup(struct vb2_queue *vq, 628 + static int msi2500_queue_setup(struct vb2_queue *vq, 629 629 const struct v4l2_format *fmt, unsigned int *nbuffers, 630 630 unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) 631 631 { 632 - struct msi3101_state *s = vb2_get_drv_priv(vq); 632 + struct msi2500_state *s = vb2_get_drv_priv(vq); 633 633 634 634 dev_dbg(&s->udev->dev, "%s: *nbuffers=%d\n", __func__, *nbuffers); 635 635 ··· 642 642 return 0; 643 643 } 644 644 645 - static void msi3101_buf_queue(struct vb2_buffer *vb) 645 + static void msi2500_buf_queue(struct vb2_buffer *vb) 646 646 { 647 - struct msi3101_state *s = vb2_get_drv_priv(vb->vb2_queue); 648 - struct msi3101_frame_buf *buf = 649 - container_of(vb, struct msi3101_frame_buf, vb); 647 + struct msi2500_state *s = vb2_get_drv_priv(vb->vb2_queue); 648 + struct msi2500_frame_buf *buf = 649 + container_of(vb, struct msi2500_frame_buf, vb); 650 650 unsigned long flags = 0; 651 651 652 652 /* Check the device has not disconnected between prep and queuing */ ··· 665 665 #define CMD_STOP_STREAMING 0x45 666 666 #define CMD_READ_UNKNOW 0x48 667 667 668 - #define msi3101_dbg_usb_control_msg(_udev, _r, _t, _v, _i, _b, _l) { \ 668 + #define msi2500_dbg_usb_control_msg(_udev, _r, _t, _v, _i, _b, _l) { \ 669 669 char *_direction; \ 670 670 if (_t & USB_DIR_IN) \ 671 671 _direction = "<<<"; \ ··· 677 677 _l, _b); \ 678 678 } 679 679 680 - static int msi3101_ctrl_msg(struct msi3101_state *s, u8 cmd, u32 data) 680 + static int msi2500_ctrl_msg(struct msi2500_state *s, u8 cmd, u32 data) 681 681 { 682 682 int ret; 683 683 u8 request = cmd; ··· 685 685 u16 value = (data >> 0) & 0xffff; 686 686 u16 index = (data >> 16) & 0xffff; 687 687 688 - msi3101_dbg_usb_control_msg(s->udev, 688 + msi2500_dbg_usb_control_msg(s->udev, 689 689 request, requesttype, value, index, NULL, 0); 690 690 691 691 ret = usb_control_msg(s->udev, usb_sndctrlpipe(s->udev, 0), ··· 700 700 701 701 #define F_REF 24000000 702 702 #define DIV_R_IN 2 703 - static int msi3101_set_usb_adc(struct msi3101_state *s) 703 + static int msi2500_set_usb_adc(struct msi2500_state *s) 704 704 { 705 705 int ret, div_n, div_m, div_r_out, f_sr, f_vco, fract; 706 706 u32 reg3, reg4, reg7; ··· 805 805 __func__, f_sr, f_vco, div_n, div_m, div_r_out, reg3, 806 806 reg4); 807 807 808 - ret = msi3101_ctrl_msg(s, CMD_WREG, 0x00608008); 808 + ret = msi2500_ctrl_msg(s, CMD_WREG, 0x00608008); 809 809 if (ret) 810 810 goto err; 811 811 812 - ret = msi3101_ctrl_msg(s, CMD_WREG, 0x00000c05); 812 + ret = msi2500_ctrl_msg(s, CMD_WREG, 0x00000c05); 813 813 if (ret) 814 814 goto err; 815 815 816 - ret = msi3101_ctrl_msg(s, CMD_WREG, 0x00020000); 816 + ret = msi2500_ctrl_msg(s, CMD_WREG, 0x00020000); 817 817 if (ret) 818 818 goto err; 819 819 820 - ret = msi3101_ctrl_msg(s, CMD_WREG, 0x00480102); 820 + ret = msi2500_ctrl_msg(s, CMD_WREG, 0x00480102); 821 821 if (ret) 822 822 goto err; 823 823 824 - ret = msi3101_ctrl_msg(s, CMD_WREG, 0x00f38008); 824 + ret = msi2500_ctrl_msg(s, CMD_WREG, 0x00f38008); 825 825 if (ret) 826 826 goto err; 827 827 828 - ret = msi3101_ctrl_msg(s, CMD_WREG, reg7); 828 + ret = msi2500_ctrl_msg(s, CMD_WREG, reg7); 829 829 if (ret) 830 830 goto err; 831 831 832 - ret = msi3101_ctrl_msg(s, CMD_WREG, reg4); 832 + ret = msi2500_ctrl_msg(s, CMD_WREG, reg4); 833 833 if (ret) 834 834 goto err; 835 835 836 - ret = msi3101_ctrl_msg(s, CMD_WREG, reg3); 836 + ret = msi2500_ctrl_msg(s, CMD_WREG, reg3); 837 837 if (ret) 838 838 goto err; 839 839 err: 840 840 return ret; 841 841 }; 842 842 843 - static int msi3101_start_streaming(struct vb2_queue *vq, unsigned int count) 843 + static int msi2500_start_streaming(struct vb2_queue *vq, unsigned int count) 844 844 { 845 - struct msi3101_state *s = vb2_get_drv_priv(vq); 845 + struct msi2500_state *s = vb2_get_drv_priv(vq); 846 846 int ret; 847 847 848 848 dev_dbg(&s->udev->dev, "%s:\n", __func__); ··· 856 856 /* wake-up tuner */ 857 857 v4l2_subdev_call(s->v4l2_subdev, core, s_power, 1); 858 858 859 - ret = msi3101_set_usb_adc(s); 859 + ret = msi2500_set_usb_adc(s); 860 860 861 - ret = msi3101_isoc_init(s); 861 + ret = msi2500_isoc_init(s); 862 862 if (ret) 863 - msi3101_cleanup_queued_bufs(s); 863 + msi2500_cleanup_queued_bufs(s); 864 864 865 - ret = msi3101_ctrl_msg(s, CMD_START_STREAMING, 0); 865 + ret = msi2500_ctrl_msg(s, CMD_START_STREAMING, 0); 866 866 867 867 mutex_unlock(&s->v4l2_lock); 868 868 869 869 return ret; 870 870 } 871 871 872 - static void msi3101_stop_streaming(struct vb2_queue *vq) 872 + static void msi2500_stop_streaming(struct vb2_queue *vq) 873 873 { 874 - struct msi3101_state *s = vb2_get_drv_priv(vq); 874 + struct msi2500_state *s = vb2_get_drv_priv(vq); 875 875 876 876 dev_dbg(&s->udev->dev, "%s:\n", __func__); 877 877 878 878 mutex_lock(&s->v4l2_lock); 879 879 880 880 if (s->udev) 881 - msi3101_isoc_cleanup(s); 881 + msi2500_isoc_cleanup(s); 882 882 883 - msi3101_cleanup_queued_bufs(s); 883 + msi2500_cleanup_queued_bufs(s); 884 884 885 885 /* according to tests, at least 700us delay is required */ 886 886 msleep(20); 887 - if (!msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0)) { 887 + if (!msi2500_ctrl_msg(s, CMD_STOP_STREAMING, 0)) { 888 888 /* sleep USB IF / ADC */ 889 - msi3101_ctrl_msg(s, CMD_WREG, 0x01000003); 889 + msi2500_ctrl_msg(s, CMD_WREG, 0x01000003); 890 890 } 891 891 892 892 /* sleep tuner */ ··· 895 895 mutex_unlock(&s->v4l2_lock); 896 896 } 897 897 898 - static struct vb2_ops msi3101_vb2_ops = { 899 - .queue_setup = msi3101_queue_setup, 900 - .buf_queue = msi3101_buf_queue, 901 - .start_streaming = msi3101_start_streaming, 902 - .stop_streaming = msi3101_stop_streaming, 898 + static struct vb2_ops msi2500_vb2_ops = { 899 + .queue_setup = msi2500_queue_setup, 900 + .buf_queue = msi2500_buf_queue, 901 + .start_streaming = msi2500_start_streaming, 902 + .stop_streaming = msi2500_stop_streaming, 903 903 .wait_prepare = vb2_ops_wait_prepare, 904 904 .wait_finish = vb2_ops_wait_finish, 905 905 }; 906 906 907 - static int msi3101_enum_fmt_sdr_cap(struct file *file, void *priv, 907 + static int msi2500_enum_fmt_sdr_cap(struct file *file, void *priv, 908 908 struct v4l2_fmtdesc *f) 909 909 { 910 - struct msi3101_state *s = video_drvdata(file); 910 + struct msi2500_state *s = video_drvdata(file); 911 911 912 912 dev_dbg(&s->udev->dev, "%s: index=%d\n", __func__, f->index); 913 913 ··· 920 920 return 0; 921 921 } 922 922 923 - static int msi3101_g_fmt_sdr_cap(struct file *file, void *priv, 923 + static int msi2500_g_fmt_sdr_cap(struct file *file, void *priv, 924 924 struct v4l2_format *f) 925 925 { 926 - struct msi3101_state *s = video_drvdata(file); 926 + struct msi2500_state *s = video_drvdata(file); 927 927 928 928 dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__, 929 929 (char *)&s->pixelformat); ··· 935 935 return 0; 936 936 } 937 937 938 - static int msi3101_s_fmt_sdr_cap(struct file *file, void *priv, 938 + static int msi2500_s_fmt_sdr_cap(struct file *file, void *priv, 939 939 struct v4l2_format *f) 940 940 { 941 - struct msi3101_state *s = video_drvdata(file); 941 + struct msi2500_state *s = video_drvdata(file); 942 942 struct vb2_queue *q = &s->vb_queue; 943 943 int i; 944 944 ··· 966 966 return 0; 967 967 } 968 968 969 - static int msi3101_try_fmt_sdr_cap(struct file *file, void *priv, 969 + static int msi2500_try_fmt_sdr_cap(struct file *file, void *priv, 970 970 struct v4l2_format *f) 971 971 { 972 - struct msi3101_state *s = video_drvdata(file); 972 + struct msi2500_state *s = video_drvdata(file); 973 973 int i; 974 974 975 975 dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__, ··· 989 989 return 0; 990 990 } 991 991 992 - static int msi3101_s_tuner(struct file *file, void *priv, 992 + static int msi2500_s_tuner(struct file *file, void *priv, 993 993 const struct v4l2_tuner *v) 994 994 { 995 - struct msi3101_state *s = video_drvdata(file); 995 + struct msi2500_state *s = video_drvdata(file); 996 996 int ret; 997 997 998 998 dev_dbg(&s->udev->dev, "%s: index=%d\n", __func__, v->index); ··· 1007 1007 return ret; 1008 1008 } 1009 1009 1010 - static int msi3101_g_tuner(struct file *file, void *priv, struct v4l2_tuner *v) 1010 + static int msi2500_g_tuner(struct file *file, void *priv, struct v4l2_tuner *v) 1011 1011 { 1012 - struct msi3101_state *s = video_drvdata(file); 1012 + struct msi2500_state *s = video_drvdata(file); 1013 1013 int ret; 1014 1014 1015 1015 dev_dbg(&s->udev->dev, "%s: index=%d\n", __func__, v->index); ··· 1030 1030 return ret; 1031 1031 } 1032 1032 1033 - static int msi3101_g_frequency(struct file *file, void *priv, 1033 + static int msi2500_g_frequency(struct file *file, void *priv, 1034 1034 struct v4l2_frequency *f) 1035 1035 { 1036 - struct msi3101_state *s = video_drvdata(file); 1036 + struct msi2500_state *s = video_drvdata(file); 1037 1037 int ret = 0; 1038 1038 1039 1039 dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d\n", ··· 1052 1052 return ret; 1053 1053 } 1054 1054 1055 - static int msi3101_s_frequency(struct file *file, void *priv, 1055 + static int msi2500_s_frequency(struct file *file, void *priv, 1056 1056 const struct v4l2_frequency *f) 1057 1057 { 1058 - struct msi3101_state *s = video_drvdata(file); 1058 + struct msi2500_state *s = video_drvdata(file); 1059 1059 int ret; 1060 1060 1061 1061 dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d frequency=%u\n", ··· 1067 1067 bands[0].rangehigh); 1068 1068 dev_dbg(&s->udev->dev, "%s: ADC frequency=%u Hz\n", 1069 1069 __func__, s->f_adc); 1070 - ret = msi3101_set_usb_adc(s); 1070 + ret = msi2500_set_usb_adc(s); 1071 1071 } else if (f->tuner == 1) { 1072 1072 ret = v4l2_subdev_call(s->v4l2_subdev, tuner, s_frequency, f); 1073 1073 } else { ··· 1077 1077 return ret; 1078 1078 } 1079 1079 1080 - static int msi3101_enum_freq_bands(struct file *file, void *priv, 1080 + static int msi2500_enum_freq_bands(struct file *file, void *priv, 1081 1081 struct v4l2_frequency_band *band) 1082 1082 { 1083 - struct msi3101_state *s = video_drvdata(file); 1083 + struct msi2500_state *s = video_drvdata(file); 1084 1084 int ret; 1085 1085 1086 1086 dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d index=%d\n", ··· 1103 1103 return ret; 1104 1104 } 1105 1105 1106 - static const struct v4l2_ioctl_ops msi3101_ioctl_ops = { 1107 - .vidioc_querycap = msi3101_querycap, 1106 + static const struct v4l2_ioctl_ops msi2500_ioctl_ops = { 1107 + .vidioc_querycap = msi2500_querycap, 1108 1108 1109 - .vidioc_enum_fmt_sdr_cap = msi3101_enum_fmt_sdr_cap, 1110 - .vidioc_g_fmt_sdr_cap = msi3101_g_fmt_sdr_cap, 1111 - .vidioc_s_fmt_sdr_cap = msi3101_s_fmt_sdr_cap, 1112 - .vidioc_try_fmt_sdr_cap = msi3101_try_fmt_sdr_cap, 1109 + .vidioc_enum_fmt_sdr_cap = msi2500_enum_fmt_sdr_cap, 1110 + .vidioc_g_fmt_sdr_cap = msi2500_g_fmt_sdr_cap, 1111 + .vidioc_s_fmt_sdr_cap = msi2500_s_fmt_sdr_cap, 1112 + .vidioc_try_fmt_sdr_cap = msi2500_try_fmt_sdr_cap, 1113 1113 1114 1114 .vidioc_reqbufs = vb2_ioctl_reqbufs, 1115 1115 .vidioc_create_bufs = vb2_ioctl_create_bufs, ··· 1121 1121 .vidioc_streamon = vb2_ioctl_streamon, 1122 1122 .vidioc_streamoff = vb2_ioctl_streamoff, 1123 1123 1124 - .vidioc_g_tuner = msi3101_g_tuner, 1125 - .vidioc_s_tuner = msi3101_s_tuner, 1124 + .vidioc_g_tuner = msi2500_g_tuner, 1125 + .vidioc_s_tuner = msi2500_s_tuner, 1126 1126 1127 - .vidioc_g_frequency = msi3101_g_frequency, 1128 - .vidioc_s_frequency = msi3101_s_frequency, 1129 - .vidioc_enum_freq_bands = msi3101_enum_freq_bands, 1127 + .vidioc_g_frequency = msi2500_g_frequency, 1128 + .vidioc_s_frequency = msi2500_s_frequency, 1129 + .vidioc_enum_freq_bands = msi2500_enum_freq_bands, 1130 1130 1131 1131 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1132 1132 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1133 1133 .vidioc_log_status = v4l2_ctrl_log_status, 1134 1134 }; 1135 1135 1136 - static const struct v4l2_file_operations msi3101_fops = { 1136 + static const struct v4l2_file_operations msi2500_fops = { 1137 1137 .owner = THIS_MODULE, 1138 1138 .open = v4l2_fh_open, 1139 1139 .release = vb2_fop_release, ··· 1143 1143 .unlocked_ioctl = video_ioctl2, 1144 1144 }; 1145 1145 1146 - static struct video_device msi3101_template = { 1146 + static struct video_device msi2500_template = { 1147 1147 .name = "Mirics MSi3101 SDR Dongle", 1148 1148 .release = video_device_release_empty, 1149 - .fops = &msi3101_fops, 1150 - .ioctl_ops = &msi3101_ioctl_ops, 1149 + .fops = &msi2500_fops, 1150 + .ioctl_ops = &msi2500_ioctl_ops, 1151 1151 }; 1152 1152 1153 - static void msi3101_video_release(struct v4l2_device *v) 1153 + static void msi2500_video_release(struct v4l2_device *v) 1154 1154 { 1155 - struct msi3101_state *s = 1156 - container_of(v, struct msi3101_state, v4l2_dev); 1155 + struct msi2500_state *s = 1156 + container_of(v, struct msi2500_state, v4l2_dev); 1157 1157 1158 1158 v4l2_ctrl_handler_free(&s->hdl); 1159 1159 v4l2_device_unregister(&s->v4l2_dev); 1160 1160 kfree(s); 1161 1161 } 1162 1162 1163 - static int msi3101_transfer_one_message(struct spi_master *master, 1163 + static int msi2500_transfer_one_message(struct spi_master *master, 1164 1164 struct spi_message *m) 1165 1165 { 1166 - struct msi3101_state *s = spi_master_get_devdata(master); 1166 + struct msi2500_state *s = spi_master_get_devdata(master); 1167 1167 struct spi_transfer *t; 1168 1168 int ret = 0; 1169 1169 u32 data; ··· 1175 1175 data |= ((u8 *)t->tx_buf)[0] << 8; 1176 1176 data |= ((u8 *)t->tx_buf)[1] << 16; 1177 1177 data |= ((u8 *)t->tx_buf)[2] << 24; 1178 - ret = msi3101_ctrl_msg(s, CMD_WREG, data); 1178 + ret = msi2500_ctrl_msg(s, CMD_WREG, data); 1179 1179 } 1180 1180 1181 1181 m->status = ret; ··· 1183 1183 return ret; 1184 1184 } 1185 1185 1186 - static int msi3101_probe(struct usb_interface *intf, 1186 + static int msi2500_probe(struct usb_interface *intf, 1187 1187 const struct usb_device_id *id) 1188 1188 { 1189 1189 struct usb_device *udev = interface_to_usbdev(intf); 1190 - struct msi3101_state *s = NULL; 1190 + struct msi2500_state *s = NULL; 1191 1191 struct v4l2_subdev *sd; 1192 1192 struct spi_master *master; 1193 1193 int ret; ··· 1198 1198 .max_speed_hz = 12000000, 1199 1199 }; 1200 1200 1201 - s = kzalloc(sizeof(struct msi3101_state), GFP_KERNEL); 1201 + s = kzalloc(sizeof(struct msi2500_state), GFP_KERNEL); 1202 1202 if (s == NULL) { 1203 - pr_err("Could not allocate memory for msi3101_state\n"); 1203 + pr_err("Could not allocate memory for msi2500_state\n"); 1204 1204 return -ENOMEM; 1205 1205 } 1206 1206 ··· 1213 1213 s->pixelformat = formats[0].pixelformat; 1214 1214 s->buffersize = formats[0].buffersize; 1215 1215 s->num_formats = NUM_FORMATS; 1216 - if (msi3101_emulated_fmt == false) 1216 + if (msi2500_emulated_fmt == false) 1217 1217 s->num_formats -= 2; 1218 1218 1219 1219 /* Init videobuf2 queue structure */ 1220 1220 s->vb_queue.type = V4L2_BUF_TYPE_SDR_CAPTURE; 1221 1221 s->vb_queue.io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ; 1222 1222 s->vb_queue.drv_priv = s; 1223 - s->vb_queue.buf_struct_size = sizeof(struct msi3101_frame_buf); 1224 - s->vb_queue.ops = &msi3101_vb2_ops; 1223 + s->vb_queue.buf_struct_size = sizeof(struct msi2500_frame_buf); 1224 + s->vb_queue.ops = &msi2500_vb2_ops; 1225 1225 s->vb_queue.mem_ops = &vb2_vmalloc_memops; 1226 1226 s->vb_queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; 1227 1227 ret = vb2_queue_init(&s->vb_queue); ··· 1231 1231 } 1232 1232 1233 1233 /* Init video_device structure */ 1234 - s->vdev = msi3101_template; 1234 + s->vdev = msi2500_template; 1235 1235 s->vdev.queue = &s->vb_queue; 1236 1236 s->vdev.queue->lock = &s->vb_queue_lock; 1237 1237 video_set_drvdata(&s->vdev, s); 1238 1238 1239 1239 /* Register the v4l2_device structure */ 1240 - s->v4l2_dev.release = msi3101_video_release; 1240 + s->v4l2_dev.release = msi2500_video_release; 1241 1241 ret = v4l2_device_register(&intf->dev, &s->v4l2_dev); 1242 1242 if (ret) { 1243 1243 dev_err(&s->udev->dev, ··· 1255 1255 s->master = master; 1256 1256 master->bus_num = 0; 1257 1257 master->num_chipselect = 1; 1258 - master->transfer_one_message = msi3101_transfer_one_message; 1258 + master->transfer_one_message = msi2500_transfer_one_message; 1259 1259 spi_master_set_devdata(master, s); 1260 1260 ret = spi_register_master(master); 1261 1261 if (ret) { ··· 1314 1314 } 1315 1315 1316 1316 /* USB device ID list */ 1317 - static struct usb_device_id msi3101_id_table[] = { 1317 + static struct usb_device_id msi2500_id_table[] = { 1318 1318 { USB_DEVICE(0x1df7, 0x2500) }, /* Mirics MSi3101 SDR Dongle */ 1319 1319 { USB_DEVICE(0x2040, 0xd300) }, /* Hauppauge WinTV 133559 LF */ 1320 1320 { } 1321 1321 }; 1322 - MODULE_DEVICE_TABLE(usb, msi3101_id_table); 1322 + MODULE_DEVICE_TABLE(usb, msi2500_id_table); 1323 1323 1324 1324 /* USB subsystem interface */ 1325 - static struct usb_driver msi3101_driver = { 1325 + static struct usb_driver msi2500_driver = { 1326 1326 .name = KBUILD_MODNAME, 1327 - .probe = msi3101_probe, 1328 - .disconnect = msi3101_disconnect, 1329 - .id_table = msi3101_id_table, 1327 + .probe = msi2500_probe, 1328 + .disconnect = msi2500_disconnect, 1329 + .id_table = msi2500_id_table, 1330 1330 }; 1331 1331 1332 - module_usb_driver(msi3101_driver); 1332 + module_usb_driver(msi2500_driver); 1333 1333 1334 1334 MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); 1335 1335 MODULE_DESCRIPTION("Mirics MSi3101 SDR Dongle");