aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-06-08 12:54:58 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-06-19 12:36:10 -0400
commit1fe3a8fe494463cfe2556a25ae41a1499725c178 (patch)
treec4d3d83ad49caf04d24f159b6b56f879fae51eed /drivers/media
parent64ea37bbd8a5815522706f0099ad3f11c7537e15 (diff)
[media] au0828: don't hardcode height/width
While this device doesn't have a scaler (or have it disabled), the screen dimentions are a function of the standard. Ok, right now, only 480 lines standards are implemented, although it supports other ones. Yet, let's calculate the size, to make easier to add more standards latter. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/au0828/au0828-video.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 85d83ca5a4cd..385894a1ff68 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -791,7 +791,7 @@ static int au0828_i2s_init(struct au0828_dev *dev)
791static int au0828_analog_stream_enable(struct au0828_dev *d) 791static int au0828_analog_stream_enable(struct au0828_dev *d)
792{ 792{
793 struct usb_interface *iface; 793 struct usb_interface *iface;
794 int ret; 794 int ret, h, w;
795 795
796 dprintk(1, "au0828_analog_stream_enable called\n"); 796 dprintk(1, "au0828_analog_stream_enable called\n");
797 797
@@ -806,20 +806,21 @@ static int au0828_analog_stream_enable(struct au0828_dev *d)
806 } 806 }
807 } 807 }
808 808
809 /* FIXME: size should be calculated using d->width, d->height */ 809 h = d->height / 2 + 2;
810 w = d->width * 2;
810 811
811 au0828_writereg(d, AU0828_SENSORCTRL_VBI_103, 0x00); 812 au0828_writereg(d, AU0828_SENSORCTRL_VBI_103, 0x00);
812 au0828_writereg(d, 0x106, 0x00); 813 au0828_writereg(d, 0x106, 0x00);
813 /* set x position */ 814 /* set x position */
814 au0828_writereg(d, 0x110, 0x00); 815 au0828_writereg(d, 0x110, 0x00);
815 au0828_writereg(d, 0x111, 0x00); 816 au0828_writereg(d, 0x111, 0x00);
816 au0828_writereg(d, 0x114, 0xa0); 817 au0828_writereg(d, 0x114, w & 0xff);
817 au0828_writereg(d, 0x115, 0x05); 818 au0828_writereg(d, 0x115, w >> 8);
818 /* set y position */ 819 /* set y position */
819 au0828_writereg(d, 0x112, 0x00); 820 au0828_writereg(d, 0x112, 0x00);
820 au0828_writereg(d, 0x113, 0x00); 821 au0828_writereg(d, 0x113, 0x00);
821 au0828_writereg(d, 0x116, 0xf2); 822 au0828_writereg(d, 0x116, h & 0xff);
822 au0828_writereg(d, 0x117, 0x00); 823 au0828_writereg(d, 0x117, h >> 8);
823 au0828_writereg(d, AU0828_SENSORCTRL_100, 0xb3); 824 au0828_writereg(d, AU0828_SENSORCTRL_100, 0xb3);
824 825
825 return 0; 826 return 0;
@@ -1725,6 +1726,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
1725 dev->vid_timeout_running = 0; 1726 dev->vid_timeout_running = 0;
1726 del_timer_sync(&dev->vid_timeout); 1727 del_timer_sync(&dev->vid_timeout);
1727 1728
1729 au0828_analog_stream_disable(dev);
1728 v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0); 1730 v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0);
1729 rc = au0828_stream_interrupt(dev); 1731 rc = au0828_stream_interrupt(dev);
1730 if (rc != 0) 1732 if (rc != 0)
@@ -1930,7 +1932,8 @@ int au0828_analog_register(struct au0828_dev *dev,
1930 struct usb_endpoint_descriptor *endpoint; 1932 struct usb_endpoint_descriptor *endpoint;
1931 int i, ret; 1933 int i, ret;
1932 1934
1933 dprintk(1, "au0828_analog_register called!\n"); 1935 dprintk(1, "au0828_analog_register called for intf#%d!\n",
1936 interface->cur_altsetting->desc.bInterfaceNumber);
1934 1937
1935 /* set au0828 usb interface0 to as5 */ 1938 /* set au0828 usb interface0 to as5 */
1936 retval = usb_set_interface(dev->usbdev, 1939 retval = usb_set_interface(dev->usbdev,
@@ -1954,6 +1957,9 @@ int au0828_analog_register(struct au0828_dev *dev,
1954 dev->max_pkt_size = (tmp & 0x07ff) * 1957 dev->max_pkt_size = (tmp & 0x07ff) *
1955 (((tmp & 0x1800) >> 11) + 1); 1958 (((tmp & 0x1800) >> 11) + 1);
1956 dev->isoc_in_endpointaddr = endpoint->bEndpointAddress; 1959 dev->isoc_in_endpointaddr = endpoint->bEndpointAddress;
1960 dprintk(1,
1961 "Found isoc endpoint 0x%02x, max size = %d\n",
1962 dev->isoc_in_endpointaddr, dev->max_pkt_size);
1957 } 1963 }
1958 } 1964 }
1959 if (!(dev->isoc_in_endpointaddr)) { 1965 if (!(dev->isoc_in_endpointaddr)) {