diff options
22 files changed, 286 insertions, 138 deletions
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 676bc46f9c52..cda0dfb6769a 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml | |||
| @@ -3988,7 +3988,7 @@ interface and may change in the future.</para> | |||
| 3988 | from RGB to Y'CbCr color space. | 3988 | from RGB to Y'CbCr color space. |
| 3989 | </entry> | 3989 | </entry> |
| 3990 | </row> | 3990 | </row> |
| 3991 | <row id = "v4l2-jpeg-chroma-subsampling"> | 3991 | <row> |
| 3992 | <entrytbl spanname="descr" cols="2"> | 3992 | <entrytbl spanname="descr" cols="2"> |
| 3993 | <tbody valign="top"> | 3993 | <tbody valign="top"> |
| 3994 | <row> | 3994 | <row> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml index e3d5afcdafbb..0a4b90fcf2da 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml | |||
| @@ -284,13 +284,6 @@ These controls are described in <xref | |||
| 284 | processing controls. These controls are described in <xref | 284 | processing controls. These controls are described in <xref |
| 285 | linkend="image-process-controls" />.</entry> | 285 | linkend="image-process-controls" />.</entry> |
| 286 | </row> | 286 | </row> |
| 287 | <row> | ||
| 288 | <entry><constant>V4L2_CTRL_CLASS_JPEG</constant></entry> | ||
| 289 | <entry>0x9d0000</entry> | ||
| 290 | <entry>The class containing JPEG compression controls. | ||
| 291 | These controls are described in <xref | ||
| 292 | linkend="jpeg-controls" />.</entry> | ||
| 293 | </row> | ||
| 294 | </tbody> | 287 | </tbody> |
| 295 | </tgroup> | 288 | </tgroup> |
| 296 | </table> | 289 | </table> |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 00a67326c193..39eab73b01ae 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
| @@ -243,6 +243,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
| 243 | if (minor == MAX_DVB_MINORS) { | 243 | if (minor == MAX_DVB_MINORS) { |
| 244 | kfree(dvbdevfops); | 244 | kfree(dvbdevfops); |
| 245 | kfree(dvbdev); | 245 | kfree(dvbdev); |
| 246 | up_write(&minor_rwsem); | ||
| 246 | mutex_unlock(&dvbdev_register_lock); | 247 | mutex_unlock(&dvbdev_register_lock); |
| 247 | return -EINVAL; | 248 | return -EINVAL; |
| 248 | } | 249 | } |
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index 342c2c8c1ddf..54ee34872d14 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
| @@ -232,7 +232,7 @@ MODULE_PARM_DESC(invert, "Invert the signal from the IR receiver"); | |||
| 232 | 232 | ||
| 233 | static bool txandrx; /* default = 0 */ | 233 | static bool txandrx; /* default = 0 */ |
| 234 | module_param(txandrx, bool, 0444); | 234 | module_param(txandrx, bool, 0444); |
| 235 | MODULE_PARM_DESC(invert, "Allow simultaneous TX and RX"); | 235 | MODULE_PARM_DESC(txandrx, "Allow simultaneous TX and RX"); |
| 236 | 236 | ||
| 237 | static unsigned int wake_sc = 0x800F040C; | 237 | static unsigned int wake_sc = 0x800F040C; |
| 238 | module_param(wake_sc, uint, 0644); | 238 | module_param(wake_sc, uint, 0644); |
| @@ -1032,6 +1032,8 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
| 1032 | data->dev->tx_ir = wbcir_tx; | 1032 | data->dev->tx_ir = wbcir_tx; |
| 1033 | data->dev->priv = data; | 1033 | data->dev->priv = data; |
| 1034 | data->dev->dev.parent = &device->dev; | 1034 | data->dev->dev.parent = &device->dev; |
| 1035 | data->dev->timeout = MS_TO_NS(100); | ||
| 1036 | data->dev->allowed_protos = RC_TYPE_ALL; | ||
| 1035 | 1037 | ||
| 1036 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | 1038 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { |
| 1037 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | 1039 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", |
diff --git a/drivers/media/video/cx231xx/cx231xx-audio.c b/drivers/media/video/cx231xx/cx231xx-audio.c index 068f78dc5d13..b4c99c7270cf 100644 --- a/drivers/media/video/cx231xx/cx231xx-audio.c +++ b/drivers/media/video/cx231xx/cx231xx-audio.c | |||
| @@ -307,7 +307,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev) | |||
| 307 | urb->context = dev; | 307 | urb->context = dev; |
| 308 | urb->pipe = usb_rcvisocpipe(dev->udev, | 308 | urb->pipe = usb_rcvisocpipe(dev->udev, |
| 309 | dev->adev.end_point_addr); | 309 | dev->adev.end_point_addr); |
| 310 | urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; | 310 | urb->transfer_flags = URB_ISO_ASAP; |
| 311 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; | 311 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; |
| 312 | urb->interval = 1; | 312 | urb->interval = 1; |
| 313 | urb->complete = cx231xx_audio_isocirq; | 313 | urb->complete = cx231xx_audio_isocirq; |
| @@ -368,7 +368,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev) | |||
| 368 | urb->context = dev; | 368 | urb->context = dev; |
| 369 | urb->pipe = usb_rcvbulkpipe(dev->udev, | 369 | urb->pipe = usb_rcvbulkpipe(dev->udev, |
| 370 | dev->adev.end_point_addr); | 370 | dev->adev.end_point_addr); |
| 371 | urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; | 371 | urb->transfer_flags = 0; |
| 372 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; | 372 | urb->transfer_buffer = dev->adev.transfer_buffer[i]; |
| 373 | urb->complete = cx231xx_audio_bulkirq; | 373 | urb->complete = cx231xx_audio_bulkirq; |
| 374 | urb->transfer_buffer_length = sb_size; | 374 | urb->transfer_buffer_length = sb_size; |
diff --git a/drivers/media/video/cx231xx/cx231xx-vbi.c b/drivers/media/video/cx231xx/cx231xx-vbi.c index 3d15314e1f88..ac7db52f404f 100644 --- a/drivers/media/video/cx231xx/cx231xx-vbi.c +++ b/drivers/media/video/cx231xx/cx231xx-vbi.c | |||
| @@ -448,7 +448,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets, | |||
| 448 | return -ENOMEM; | 448 | return -ENOMEM; |
| 449 | } | 449 | } |
| 450 | dev->vbi_mode.bulk_ctl.urb[i] = urb; | 450 | dev->vbi_mode.bulk_ctl.urb[i] = urb; |
| 451 | urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; | 451 | urb->transfer_flags = 0; |
| 452 | 452 | ||
| 453 | dev->vbi_mode.bulk_ctl.transfer_buffer[i] = | 453 | dev->vbi_mode.bulk_ctl.transfer_buffer[i] = |
| 454 | kzalloc(sb_size, GFP_KERNEL); | 454 | kzalloc(sb_size, GFP_KERNEL); |
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index 13739e002a63..080e11157e5f 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
| @@ -127,22 +127,37 @@ struct cx23885_board cx23885_boards[] = { | |||
| 127 | }, | 127 | }, |
| 128 | [CX23885_BOARD_HAUPPAUGE_HVR1250] = { | 128 | [CX23885_BOARD_HAUPPAUGE_HVR1250] = { |
| 129 | .name = "Hauppauge WinTV-HVR1250", | 129 | .name = "Hauppauge WinTV-HVR1250", |
| 130 | .porta = CX23885_ANALOG_VIDEO, | ||
| 130 | .portc = CX23885_MPEG_DVB, | 131 | .portc = CX23885_MPEG_DVB, |
| 132 | #ifdef MT2131_NO_ANALOG_SUPPORT_YET | ||
| 133 | .tuner_type = TUNER_PHILIPS_TDA8290, | ||
| 134 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
| 135 | .tuner_bus = 1, | ||
| 136 | #endif | ||
| 137 | .force_bff = 1, | ||
| 131 | .input = {{ | 138 | .input = {{ |
| 139 | #ifdef MT2131_NO_ANALOG_SUPPORT_YET | ||
| 132 | .type = CX23885_VMUX_TELEVISION, | 140 | .type = CX23885_VMUX_TELEVISION, |
| 133 | .vmux = 0, | 141 | .vmux = CX25840_VIN7_CH3 | |
| 142 | CX25840_VIN5_CH2 | | ||
| 143 | CX25840_VIN2_CH1, | ||
| 144 | .amux = CX25840_AUDIO8, | ||
| 134 | .gpio0 = 0xff00, | 145 | .gpio0 = 0xff00, |
| 135 | }, { | 146 | }, { |
| 136 | .type = CX23885_VMUX_DEBUG, | 147 | #endif |
| 137 | .vmux = 0, | ||
| 138 | .gpio0 = 0xff01, | ||
| 139 | }, { | ||
| 140 | .type = CX23885_VMUX_COMPOSITE1, | 148 | .type = CX23885_VMUX_COMPOSITE1, |
| 141 | .vmux = 1, | 149 | .vmux = CX25840_VIN7_CH3 | |
| 150 | CX25840_VIN4_CH2 | | ||
| 151 | CX25840_VIN6_CH1, | ||
| 152 | .amux = CX25840_AUDIO7, | ||
| 142 | .gpio0 = 0xff02, | 153 | .gpio0 = 0xff02, |
| 143 | }, { | 154 | }, { |
| 144 | .type = CX23885_VMUX_SVIDEO, | 155 | .type = CX23885_VMUX_SVIDEO, |
| 145 | .vmux = 2, | 156 | .vmux = CX25840_VIN7_CH3 | |
| 157 | CX25840_VIN4_CH2 | | ||
| 158 | CX25840_VIN8_CH1 | | ||
| 159 | CX25840_SVIDEO_ON, | ||
| 160 | .amux = CX25840_AUDIO7, | ||
| 146 | .gpio0 = 0xff02, | 161 | .gpio0 = 0xff02, |
| 147 | } }, | 162 | } }, |
| 148 | }, | 163 | }, |
| @@ -267,7 +282,55 @@ struct cx23885_board cx23885_boards[] = { | |||
| 267 | }, | 282 | }, |
| 268 | [CX23885_BOARD_HAUPPAUGE_HVR1255] = { | 283 | [CX23885_BOARD_HAUPPAUGE_HVR1255] = { |
| 269 | .name = "Hauppauge WinTV-HVR1255", | 284 | .name = "Hauppauge WinTV-HVR1255", |
| 285 | .porta = CX23885_ANALOG_VIDEO, | ||
| 286 | .portc = CX23885_MPEG_DVB, | ||
| 287 | .tuner_type = TUNER_ABSENT, | ||
| 288 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
| 289 | .force_bff = 1, | ||
| 290 | .input = {{ | ||
| 291 | .type = CX23885_VMUX_TELEVISION, | ||
| 292 | .vmux = CX25840_VIN7_CH3 | | ||
| 293 | CX25840_VIN5_CH2 | | ||
| 294 | CX25840_VIN2_CH1 | | ||
| 295 | CX25840_DIF_ON, | ||
| 296 | .amux = CX25840_AUDIO8, | ||
| 297 | }, { | ||
| 298 | .type = CX23885_VMUX_COMPOSITE1, | ||
| 299 | .vmux = CX25840_VIN7_CH3 | | ||
| 300 | CX25840_VIN4_CH2 | | ||
| 301 | CX25840_VIN6_CH1, | ||
| 302 | .amux = CX25840_AUDIO7, | ||
| 303 | }, { | ||
| 304 | .type = CX23885_VMUX_SVIDEO, | ||
| 305 | .vmux = CX25840_VIN7_CH3 | | ||
| 306 | CX25840_VIN4_CH2 | | ||
| 307 | CX25840_VIN8_CH1 | | ||
| 308 | CX25840_SVIDEO_ON, | ||
| 309 | .amux = CX25840_AUDIO7, | ||
| 310 | } }, | ||
| 311 | }, | ||
| 312 | [CX23885_BOARD_HAUPPAUGE_HVR1255_22111] = { | ||
| 313 | .name = "Hauppauge WinTV-HVR1255", | ||
| 314 | .porta = CX23885_ANALOG_VIDEO, | ||
| 270 | .portc = CX23885_MPEG_DVB, | 315 | .portc = CX23885_MPEG_DVB, |
| 316 | .tuner_type = TUNER_ABSENT, | ||
| 317 | .tuner_addr = 0x42, /* 0x84 >> 1 */ | ||
| 318 | .force_bff = 1, | ||
| 319 | .input = {{ | ||
| 320 | .type = CX23885_VMUX_TELEVISION, | ||
| 321 | .vmux = CX25840_VIN7_CH3 | | ||
| 322 | CX25840_VIN5_CH2 | | ||
| 323 | CX25840_VIN2_CH1 | | ||
| 324 | CX25840_DIF_ON, | ||
| 325 | .amux = CX25840_AUDIO8, | ||
| 326 | }, { | ||
| 327 | .type = CX23885_VMUX_SVIDEO, | ||
| 328 | .vmux = CX25840_VIN7_CH3 | | ||
| 329 | CX25840_VIN4_CH2 | | ||
| 330 | CX25840_VIN8_CH1 | | ||
| 331 | CX25840_SVIDEO_ON, | ||
| 332 | .amux = CX25840_AUDIO7, | ||
| 333 | } }, | ||
| 271 | }, | 334 | }, |
| 272 | [CX23885_BOARD_HAUPPAUGE_HVR1210] = { | 335 | [CX23885_BOARD_HAUPPAUGE_HVR1210] = { |
| 273 | .name = "Hauppauge WinTV-HVR1210", | 336 | .name = "Hauppauge WinTV-HVR1210", |
| @@ -624,7 +687,7 @@ struct cx23885_subid cx23885_subids[] = { | |||
| 624 | }, { | 687 | }, { |
| 625 | .subvendor = 0x0070, | 688 | .subvendor = 0x0070, |
| 626 | .subdevice = 0x2259, | 689 | .subdevice = 0x2259, |
| 627 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255, | 690 | .card = CX23885_BOARD_HAUPPAUGE_HVR1255_22111, |
| 628 | }, { | 691 | }, { |
| 629 | .subvendor = 0x0070, | 692 | .subvendor = 0x0070, |
| 630 | .subdevice = 0x2291, | 693 | .subdevice = 0x2291, |
| @@ -900,7 +963,7 @@ int cx23885_tuner_callback(void *priv, int component, int command, int arg) | |||
| 900 | struct cx23885_dev *dev = port->dev; | 963 | struct cx23885_dev *dev = port->dev; |
| 901 | u32 bitmask = 0; | 964 | u32 bitmask = 0; |
| 902 | 965 | ||
| 903 | if (command == XC2028_RESET_CLK) | 966 | if ((command == XC2028_RESET_CLK) || (command == XC2028_I2C_FLUSH)) |
| 904 | return 0; | 967 | return 0; |
| 905 | 968 | ||
| 906 | if (command != 0) { | 969 | if (command != 0) { |
| @@ -1130,6 +1193,7 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) | |||
| 1130 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1193 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
| 1131 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1194 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
| 1132 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1195 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
| 1196 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
| 1133 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1197 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
| 1134 | /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */ | 1198 | /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */ |
| 1135 | /* GPIO-6 I2C Gate which can isolate the demod from the bus */ | 1199 | /* GPIO-6 I2C Gate which can isolate the demod from the bus */ |
| @@ -1267,6 +1331,7 @@ int cx23885_ir_init(struct cx23885_dev *dev) | |||
| 1267 | case CX23885_BOARD_HAUPPAUGE_HVR1400: | 1331 | case CX23885_BOARD_HAUPPAUGE_HVR1400: |
| 1268 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1332 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
| 1269 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1333 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
| 1334 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
| 1270 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1335 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
| 1271 | /* FIXME: Implement me */ | 1336 | /* FIXME: Implement me */ |
| 1272 | break; | 1337 | break; |
| @@ -1424,6 +1489,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
| 1424 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1489 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
| 1425 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1490 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
| 1426 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1491 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
| 1492 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
| 1427 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1493 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
| 1428 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1494 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
| 1429 | case CX23885_BOARD_HAUPPAUGE_HVR1290: | 1495 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
| @@ -1511,6 +1577,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
| 1511 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1577 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
| 1512 | case CX23885_BOARD_HAUPPAUGE_HVR1275: | 1578 | case CX23885_BOARD_HAUPPAUGE_HVR1275: |
| 1513 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 1579 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
| 1580 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
| 1514 | case CX23885_BOARD_HAUPPAUGE_HVR1210: | 1581 | case CX23885_BOARD_HAUPPAUGE_HVR1210: |
| 1515 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: | 1582 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
| 1516 | case CX23885_BOARD_HAUPPAUGE_HVR1290: | 1583 | case CX23885_BOARD_HAUPPAUGE_HVR1290: |
| @@ -1526,10 +1593,10 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
| 1526 | */ | 1593 | */ |
| 1527 | switch (dev->board) { | 1594 | switch (dev->board) { |
| 1528 | case CX23885_BOARD_TEVII_S470: | 1595 | case CX23885_BOARD_TEVII_S470: |
| 1529 | case CX23885_BOARD_HAUPPAUGE_HVR1250: | ||
| 1530 | /* Currently only enabled for the integrated IR controller */ | 1596 | /* Currently only enabled for the integrated IR controller */ |
| 1531 | if (!enable_885_ir) | 1597 | if (!enable_885_ir) |
| 1532 | break; | 1598 | break; |
| 1599 | case CX23885_BOARD_HAUPPAUGE_HVR1250: | ||
| 1533 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 1600 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 1534 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: | 1601 | case CX23885_BOARD_HAUPPAUGE_HVR1800lp: |
| 1535 | case CX23885_BOARD_HAUPPAUGE_HVR1700: | 1602 | case CX23885_BOARD_HAUPPAUGE_HVR1700: |
| @@ -1539,6 +1606,8 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
| 1539 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: | 1606 | case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: |
| 1540 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: | 1607 | case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: |
| 1541 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: | 1608 | case CX23885_BOARD_COMPRO_VIDEOMATE_E800: |
| 1609 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | ||
| 1610 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
| 1542 | case CX23885_BOARD_HAUPPAUGE_HVR1270: | 1611 | case CX23885_BOARD_HAUPPAUGE_HVR1270: |
| 1543 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1612 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
| 1544 | case CX23885_BOARD_MYGICA_X8506: | 1613 | case CX23885_BOARD_MYGICA_X8506: |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index a80a92c47455..cd542684ba02 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
| @@ -712,6 +712,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
| 712 | } | 712 | } |
| 713 | break; | 713 | break; |
| 714 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | 714 | case CX23885_BOARD_HAUPPAUGE_HVR1255: |
| 715 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
| 715 | i2c_bus = &dev->i2c_bus[0]; | 716 | i2c_bus = &dev->i2c_bus[0]; |
| 716 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, | 717 | fe0->dvb.frontend = dvb_attach(s5h1411_attach, |
| 717 | &hcw_s5h1411_config, | 718 | &hcw_s5h1411_config, |
| @@ -721,6 +722,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
| 721 | 0x60, &dev->i2c_bus[1].i2c_adap, | 722 | 0x60, &dev->i2c_bus[1].i2c_adap, |
| 722 | &hauppauge_tda18271_config); | 723 | &hauppauge_tda18271_config); |
| 723 | } | 724 | } |
| 725 | |||
| 726 | tda18271_attach(&dev->ts1.analog_fe, | ||
| 727 | 0x60, &dev->i2c_bus[1].i2c_adap, | ||
| 728 | &hauppauge_tda18271_config); | ||
| 729 | |||
| 724 | break; | 730 | break; |
| 725 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 731 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
| 726 | i2c_bus = &dev->i2c_bus[0]; | 732 | i2c_bus = &dev->i2c_bus[0]; |
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index c654bdc7ccb2..22f8e7fbd665 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
| @@ -505,6 +505,9 @@ static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input) | |||
| 505 | 505 | ||
| 506 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1800) || | 506 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1800) || |
| 507 | (dev->board == CX23885_BOARD_MPX885) || | 507 | (dev->board == CX23885_BOARD_MPX885) || |
| 508 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1250) || | ||
| 509 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255) || | ||
| 510 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111) || | ||
| 508 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850)) { | 511 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850)) { |
| 509 | /* Configure audio routing */ | 512 | /* Configure audio routing */ |
| 510 | v4l2_subdev_call(dev->sd_cx25840, audio, s_routing, | 513 | v4l2_subdev_call(dev->sd_cx25840, audio, s_routing, |
| @@ -1578,7 +1581,9 @@ static int cx23885_set_freq_via_ops(struct cx23885_dev *dev, | |||
| 1578 | 1581 | ||
| 1579 | fe = vfe->dvb.frontend; | 1582 | fe = vfe->dvb.frontend; |
| 1580 | 1583 | ||
| 1581 | if (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) | 1584 | if ((dev->board == CX23885_BOARD_HAUPPAUGE_HVR1850) || |
| 1585 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255) || | ||
| 1586 | (dev->board == CX23885_BOARD_HAUPPAUGE_HVR1255_22111)) | ||
| 1582 | fe = &dev->ts1.analog_fe; | 1587 | fe = &dev->ts1.analog_fe; |
| 1583 | 1588 | ||
| 1584 | if (fe && fe->ops.tuner_ops.set_analog_params) { | 1589 | if (fe && fe->ops.tuner_ops.set_analog_params) { |
| @@ -1608,6 +1613,8 @@ int cx23885_set_frequency(struct file *file, void *priv, | |||
| 1608 | int ret; | 1613 | int ret; |
| 1609 | 1614 | ||
| 1610 | switch (dev->board) { | 1615 | switch (dev->board) { |
| 1616 | case CX23885_BOARD_HAUPPAUGE_HVR1255: | ||
| 1617 | case CX23885_BOARD_HAUPPAUGE_HVR1255_22111: | ||
| 1611 | case CX23885_BOARD_HAUPPAUGE_HVR1850: | 1618 | case CX23885_BOARD_HAUPPAUGE_HVR1850: |
| 1612 | ret = cx23885_set_freq_via_ops(dev, f); | 1619 | ret = cx23885_set_freq_via_ops(dev, f); |
| 1613 | break; | 1620 | break; |
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h index d884784a1c85..13c37ec07ae7 100644 --- a/drivers/media/video/cx23885/cx23885.h +++ b/drivers/media/video/cx23885/cx23885.h | |||
| @@ -90,6 +90,7 @@ | |||
| 90 | #define CX23885_BOARD_MYGICA_X8507 33 | 90 | #define CX23885_BOARD_MYGICA_X8507 33 |
| 91 | #define CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL 34 | 91 | #define CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL 34 |
| 92 | #define CX23885_BOARD_TEVII_S471 35 | 92 | #define CX23885_BOARD_TEVII_S471 35 |
| 93 | #define CX23885_BOARD_HAUPPAUGE_HVR1255_22111 36 | ||
| 93 | 94 | ||
| 94 | #define GPIO_0 0x00000001 | 95 | #define GPIO_0 0x00000001 |
| 95 | #define GPIO_1 0x00000002 | 96 | #define GPIO_1 0x00000002 |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index fc1ff69cffd0..d8eac3e30a7e 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
| @@ -84,7 +84,7 @@ MODULE_PARM_DESC(debug, "Debugging messages [0=Off (default) 1=On]"); | |||
| 84 | 84 | ||
| 85 | 85 | ||
| 86 | /* ----------------------------------------------------------------------- */ | 86 | /* ----------------------------------------------------------------------- */ |
| 87 | static void cx23885_std_setup(struct i2c_client *client); | 87 | static void cx23888_std_setup(struct i2c_client *client); |
| 88 | 88 | ||
| 89 | int cx25840_write(struct i2c_client *client, u16 addr, u8 value) | 89 | int cx25840_write(struct i2c_client *client, u16 addr, u8 value) |
| 90 | { | 90 | { |
| @@ -638,10 +638,13 @@ static void cx23885_initialize(struct i2c_client *client) | |||
| 638 | finish_wait(&state->fw_wait, &wait); | 638 | finish_wait(&state->fw_wait, &wait); |
| 639 | destroy_workqueue(q); | 639 | destroy_workqueue(q); |
| 640 | 640 | ||
| 641 | /* Call the cx23885 specific std setup func, we no longer rely on | 641 | /* Call the cx23888 specific std setup func, we no longer rely on |
| 642 | * the generic cx24840 func. | 642 | * the generic cx24840 func. |
| 643 | */ | 643 | */ |
| 644 | cx23885_std_setup(client); | 644 | if (is_cx23888(state)) |
| 645 | cx23888_std_setup(client); | ||
| 646 | else | ||
| 647 | cx25840_std_setup(client); | ||
| 645 | 648 | ||
| 646 | /* (re)set input */ | 649 | /* (re)set input */ |
| 647 | set_input(client, state->vid_input, state->aud_input); | 650 | set_input(client, state->vid_input, state->aud_input); |
| @@ -1103,9 +1106,23 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp | |||
| 1103 | 1106 | ||
| 1104 | cx25840_write4(client, 0x410, 0xffff0dbf); | 1107 | cx25840_write4(client, 0x410, 0xffff0dbf); |
| 1105 | cx25840_write4(client, 0x414, 0x00137d03); | 1108 | cx25840_write4(client, 0x414, 0x00137d03); |
| 1106 | cx25840_write4(client, 0x418, 0x01008080); | 1109 | |
| 1110 | /* on the 887, 0x418 is HSCALE_CTRL, on the 888 it is | ||
| 1111 | CHROMA_CTRL */ | ||
| 1112 | if (is_cx23888(state)) | ||
| 1113 | cx25840_write4(client, 0x418, 0x01008080); | ||
| 1114 | else | ||
| 1115 | cx25840_write4(client, 0x418, 0x01000000); | ||
| 1116 | |||
| 1107 | cx25840_write4(client, 0x41c, 0x00000000); | 1117 | cx25840_write4(client, 0x41c, 0x00000000); |
| 1108 | cx25840_write4(client, 0x420, 0x001c3e0f); | 1118 | |
| 1119 | /* on the 887, 0x420 is CHROMA_CTRL, on the 888 it is | ||
| 1120 | CRUSH_CTRL */ | ||
| 1121 | if (is_cx23888(state)) | ||
| 1122 | cx25840_write4(client, 0x420, 0x001c3e0f); | ||
| 1123 | else | ||
| 1124 | cx25840_write4(client, 0x420, 0x001c8282); | ||
| 1125 | |||
| 1109 | cx25840_write4(client, 0x42c, 0x42600000); | 1126 | cx25840_write4(client, 0x42c, 0x42600000); |
| 1110 | cx25840_write4(client, 0x430, 0x0000039b); | 1127 | cx25840_write4(client, 0x430, 0x0000039b); |
| 1111 | cx25840_write4(client, 0x438, 0x00000000); | 1128 | cx25840_write4(client, 0x438, 0x00000000); |
| @@ -1233,7 +1250,7 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp | |||
| 1233 | cx25840_write4(client, 0x8d0, 0x1f063870); | 1250 | cx25840_write4(client, 0x8d0, 0x1f063870); |
| 1234 | } | 1251 | } |
| 1235 | 1252 | ||
| 1236 | if (is_cx2388x(state)) { | 1253 | if (is_cx23888(state)) { |
| 1237 | /* HVR1850 */ | 1254 | /* HVR1850 */ |
| 1238 | /* AUD_IO_CTRL - I2S Input, Parallel1*/ | 1255 | /* AUD_IO_CTRL - I2S Input, Parallel1*/ |
| 1239 | /* - Channel 1 src - Parallel1 (Merlin out) */ | 1256 | /* - Channel 1 src - Parallel1 (Merlin out) */ |
| @@ -1298,8 +1315,8 @@ static int set_v4lstd(struct i2c_client *client) | |||
| 1298 | } | 1315 | } |
| 1299 | cx25840_and_or(client, 0x400, ~0xf, fmt); | 1316 | cx25840_and_or(client, 0x400, ~0xf, fmt); |
| 1300 | cx25840_and_or(client, 0x403, ~0x3, pal_m); | 1317 | cx25840_and_or(client, 0x403, ~0x3, pal_m); |
| 1301 | if (is_cx2388x(state)) | 1318 | if (is_cx23888(state)) |
| 1302 | cx23885_std_setup(client); | 1319 | cx23888_std_setup(client); |
| 1303 | else | 1320 | else |
| 1304 | cx25840_std_setup(client); | 1321 | cx25840_std_setup(client); |
| 1305 | if (!is_cx2583x(state)) | 1322 | if (!is_cx2583x(state)) |
| @@ -1312,6 +1329,7 @@ static int set_v4lstd(struct i2c_client *client) | |||
| 1312 | static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | 1329 | static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) |
| 1313 | { | 1330 | { |
| 1314 | struct v4l2_subdev *sd = to_sd(ctrl); | 1331 | struct v4l2_subdev *sd = to_sd(ctrl); |
| 1332 | struct cx25840_state *state = to_state(sd); | ||
| 1315 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1333 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
| 1316 | 1334 | ||
| 1317 | switch (ctrl->id) { | 1335 | switch (ctrl->id) { |
| @@ -1324,12 +1342,20 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl) | |||
| 1324 | break; | 1342 | break; |
| 1325 | 1343 | ||
| 1326 | case V4L2_CID_SATURATION: | 1344 | case V4L2_CID_SATURATION: |
| 1327 | cx25840_write(client, 0x420, ctrl->val << 1); | 1345 | if (is_cx23888(state)) { |
| 1328 | cx25840_write(client, 0x421, ctrl->val << 1); | 1346 | cx25840_write(client, 0x418, ctrl->val << 1); |
| 1347 | cx25840_write(client, 0x419, ctrl->val << 1); | ||
| 1348 | } else { | ||
| 1349 | cx25840_write(client, 0x420, ctrl->val << 1); | ||
| 1350 | cx25840_write(client, 0x421, ctrl->val << 1); | ||
| 1351 | } | ||
| 1329 | break; | 1352 | break; |
| 1330 | 1353 | ||
| 1331 | case V4L2_CID_HUE: | 1354 | case V4L2_CID_HUE: |
| 1332 | cx25840_write(client, 0x422, ctrl->val); | 1355 | if (is_cx23888(state)) |
| 1356 | cx25840_write(client, 0x41a, ctrl->val); | ||
| 1357 | else | ||
| 1358 | cx25840_write(client, 0x422, ctrl->val); | ||
| 1333 | break; | 1359 | break; |
| 1334 | 1360 | ||
| 1335 | default: | 1361 | default: |
| @@ -1354,11 +1380,21 @@ static int cx25840_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt | |||
| 1354 | fmt->field = V4L2_FIELD_INTERLACED; | 1380 | fmt->field = V4L2_FIELD_INTERLACED; |
| 1355 | fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; | 1381 | fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; |
| 1356 | 1382 | ||
| 1357 | Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; | 1383 | if (is_cx23888(state)) { |
| 1358 | Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; | 1384 | Vsrc = (cx25840_read(client, 0x42a) & 0x3f) << 4; |
| 1385 | Vsrc |= (cx25840_read(client, 0x429) & 0xf0) >> 4; | ||
| 1386 | } else { | ||
| 1387 | Vsrc = (cx25840_read(client, 0x476) & 0x3f) << 4; | ||
| 1388 | Vsrc |= (cx25840_read(client, 0x475) & 0xf0) >> 4; | ||
| 1389 | } | ||
| 1359 | 1390 | ||
| 1360 | Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; | 1391 | if (is_cx23888(state)) { |
| 1361 | Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; | 1392 | Hsrc = (cx25840_read(client, 0x426) & 0x3f) << 4; |
| 1393 | Hsrc |= (cx25840_read(client, 0x425) & 0xf0) >> 4; | ||
| 1394 | } else { | ||
| 1395 | Hsrc = (cx25840_read(client, 0x472) & 0x3f) << 4; | ||
| 1396 | Hsrc |= (cx25840_read(client, 0x471) & 0xf0) >> 4; | ||
| 1397 | } | ||
| 1362 | 1398 | ||
| 1363 | Vlines = fmt->height + (is_50Hz ? 4 : 7); | 1399 | Vlines = fmt->height + (is_50Hz ? 4 : 7); |
| 1364 | 1400 | ||
| @@ -1782,8 +1818,8 @@ static int cx25840_s_video_routing(struct v4l2_subdev *sd, | |||
| 1782 | struct cx25840_state *state = to_state(sd); | 1818 | struct cx25840_state *state = to_state(sd); |
| 1783 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1819 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
| 1784 | 1820 | ||
| 1785 | if (is_cx2388x(state)) | 1821 | if (is_cx23888(state)) |
| 1786 | cx23885_std_setup(client); | 1822 | cx23888_std_setup(client); |
| 1787 | 1823 | ||
| 1788 | return set_input(client, input, state->aud_input); | 1824 | return set_input(client, input, state->aud_input); |
| 1789 | } | 1825 | } |
| @@ -1794,8 +1830,8 @@ static int cx25840_s_audio_routing(struct v4l2_subdev *sd, | |||
| 1794 | struct cx25840_state *state = to_state(sd); | 1830 | struct cx25840_state *state = to_state(sd); |
| 1795 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1831 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
| 1796 | 1832 | ||
| 1797 | if (is_cx2388x(state)) | 1833 | if (is_cx23888(state)) |
| 1798 | cx23885_std_setup(client); | 1834 | cx23888_std_setup(client); |
| 1799 | return set_input(client, state->vid_input, input); | 1835 | return set_input(client, state->vid_input, input); |
| 1800 | } | 1836 | } |
| 1801 | 1837 | ||
| @@ -4939,7 +4975,7 @@ void cx23885_dif_setup(struct i2c_client *client, u32 ifHz) | |||
| 4939 | } | 4975 | } |
| 4940 | } | 4976 | } |
| 4941 | 4977 | ||
| 4942 | static void cx23885_std_setup(struct i2c_client *client) | 4978 | static void cx23888_std_setup(struct i2c_client *client) |
| 4943 | { | 4979 | { |
| 4944 | struct cx25840_state *state = to_state(i2c_get_clientdata(client)); | 4980 | struct cx25840_state *state = to_state(i2c_get_clientdata(client)); |
| 4945 | v4l2_std_id std = state->std; | 4981 | v4l2_std_id std = state->std; |
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 92da7c28b6f0..862c6575c557 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
| @@ -2893,7 +2893,7 @@ static void request_module_async(struct work_struct *work) | |||
| 2893 | 2893 | ||
| 2894 | if (dev->board.has_dvb) | 2894 | if (dev->board.has_dvb) |
| 2895 | request_module("em28xx-dvb"); | 2895 | request_module("em28xx-dvb"); |
| 2896 | if (dev->board.has_ir_i2c && !disable_ir) | 2896 | if (dev->board.ir_codes && !disable_ir) |
| 2897 | request_module("em28xx-rc"); | 2897 | request_module("em28xx-rc"); |
| 2898 | } | 2898 | } |
| 2899 | 2899 | ||
diff --git a/drivers/media/video/omap3isp/isppreview.c b/drivers/media/video/omap3isp/isppreview.c index 8a4935ecc655..dd91da26f1b0 100644 --- a/drivers/media/video/omap3isp/isppreview.c +++ b/drivers/media/video/omap3isp/isppreview.c | |||
| @@ -888,12 +888,12 @@ static const struct preview_update update_attrs[] = { | |||
| 888 | preview_config_contrast, | 888 | preview_config_contrast, |
| 889 | NULL, | 889 | NULL, |
| 890 | offsetof(struct prev_params, contrast), | 890 | offsetof(struct prev_params, contrast), |
| 891 | 0, true, | 891 | 0, 0, true, |
| 892 | }, /* OMAP3ISP_PREV_BRIGHTNESS */ { | 892 | }, /* OMAP3ISP_PREV_BRIGHTNESS */ { |
| 893 | preview_config_brightness, | 893 | preview_config_brightness, |
| 894 | NULL, | 894 | NULL, |
| 895 | offsetof(struct prev_params, brightness), | 895 | offsetof(struct prev_params, brightness), |
| 896 | 0, true, | 896 | 0, 0, true, |
| 897 | }, | 897 | }, |
| 898 | }; | 898 | }; |
| 899 | 899 | ||
| @@ -1102,7 +1102,7 @@ static void preview_config_input_size(struct isp_prev_device *prev, u32 active) | |||
| 1102 | unsigned int elv = prev->crop.top + prev->crop.height - 1; | 1102 | unsigned int elv = prev->crop.top + prev->crop.height - 1; |
| 1103 | u32 features; | 1103 | u32 features; |
| 1104 | 1104 | ||
| 1105 | if (format->code == V4L2_MBUS_FMT_Y10_1X10) { | 1105 | if (format->code != V4L2_MBUS_FMT_Y10_1X10) { |
| 1106 | sph -= 2; | 1106 | sph -= 2; |
| 1107 | eph += 2; | 1107 | eph += 2; |
| 1108 | slv -= 2; | 1108 | slv -= 2; |
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c index c370c2d87c17..b4c679b3fb0f 100644 --- a/drivers/media/video/pms.c +++ b/drivers/media/video/pms.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
| 27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
| 28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
| 30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
| 31 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index 354574591908..725812aa0c30 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c | |||
| @@ -350,7 +350,8 @@ static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, | |||
| 350 | if (pixm) | 350 | if (pixm) |
| 351 | sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); | 351 | sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); |
| 352 | else | 352 | else |
| 353 | sizes[i] = size; | 353 | sizes[i] = max_t(u32, size, frame->payload[i]); |
| 354 | |||
| 354 | allocators[i] = ctx->fimc_dev->alloc_ctx; | 355 | allocators[i] = ctx->fimc_dev->alloc_ctx; |
| 355 | } | 356 | } |
| 356 | 357 | ||
| @@ -479,37 +480,39 @@ static int fimc_capture_set_default_format(struct fimc_dev *fimc); | |||
| 479 | static int fimc_capture_open(struct file *file) | 480 | static int fimc_capture_open(struct file *file) |
| 480 | { | 481 | { |
| 481 | struct fimc_dev *fimc = video_drvdata(file); | 482 | struct fimc_dev *fimc = video_drvdata(file); |
| 482 | int ret = v4l2_fh_open(file); | 483 | int ret; |
| 483 | |||
| 484 | if (ret) | ||
| 485 | return ret; | ||
| 486 | 484 | ||
| 487 | dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state); | 485 | dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state); |
| 488 | 486 | ||
| 489 | /* Return if the corresponding video mem2mem node is already opened. */ | ||
| 490 | if (fimc_m2m_active(fimc)) | 487 | if (fimc_m2m_active(fimc)) |
| 491 | return -EBUSY; | 488 | return -EBUSY; |
| 492 | 489 | ||
| 493 | set_bit(ST_CAPT_BUSY, &fimc->state); | 490 | set_bit(ST_CAPT_BUSY, &fimc->state); |
| 494 | pm_runtime_get_sync(&fimc->pdev->dev); | 491 | ret = pm_runtime_get_sync(&fimc->pdev->dev); |
| 492 | if (ret < 0) | ||
| 493 | return ret; | ||
| 495 | 494 | ||
| 496 | if (++fimc->vid_cap.refcnt == 1) { | 495 | ret = v4l2_fh_open(file); |
| 497 | ret = fimc_pipeline_initialize(&fimc->pipeline, | 496 | if (ret) |
| 498 | &fimc->vid_cap.vfd->entity, true); | 497 | return ret; |
| 499 | if (ret < 0) { | ||
| 500 | dev_err(&fimc->pdev->dev, | ||
| 501 | "Video pipeline initialization failed\n"); | ||
| 502 | pm_runtime_put_sync(&fimc->pdev->dev); | ||
| 503 | fimc->vid_cap.refcnt--; | ||
| 504 | v4l2_fh_release(file); | ||
| 505 | clear_bit(ST_CAPT_BUSY, &fimc->state); | ||
| 506 | return ret; | ||
| 507 | } | ||
| 508 | ret = fimc_capture_ctrls_create(fimc); | ||
| 509 | 498 | ||
| 510 | if (!ret && !fimc->vid_cap.user_subdev_api) | 499 | if (++fimc->vid_cap.refcnt != 1) |
| 511 | ret = fimc_capture_set_default_format(fimc); | 500 | return 0; |
| 501 | |||
| 502 | ret = fimc_pipeline_initialize(&fimc->pipeline, | ||
| 503 | &fimc->vid_cap.vfd->entity, true); | ||
| 504 | if (ret < 0) { | ||
| 505 | clear_bit(ST_CAPT_BUSY, &fimc->state); | ||
| 506 | pm_runtime_put_sync(&fimc->pdev->dev); | ||
| 507 | fimc->vid_cap.refcnt--; | ||
| 508 | v4l2_fh_release(file); | ||
| 509 | return ret; | ||
| 512 | } | 510 | } |
| 511 | ret = fimc_capture_ctrls_create(fimc); | ||
| 512 | |||
| 513 | if (!ret && !fimc->vid_cap.user_subdev_api) | ||
| 514 | ret = fimc_capture_set_default_format(fimc); | ||
| 515 | |||
| 513 | return ret; | 516 | return ret; |
| 514 | } | 517 | } |
| 515 | 518 | ||
| @@ -818,9 +821,6 @@ static int fimc_cap_g_fmt_mplane(struct file *file, void *fh, | |||
| 818 | struct fimc_dev *fimc = video_drvdata(file); | 821 | struct fimc_dev *fimc = video_drvdata(file); |
| 819 | struct fimc_ctx *ctx = fimc->vid_cap.ctx; | 822 | struct fimc_ctx *ctx = fimc->vid_cap.ctx; |
| 820 | 823 | ||
| 821 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
| 822 | return -EINVAL; | ||
| 823 | |||
| 824 | return fimc_fill_format(&ctx->d_frame, f); | 824 | return fimc_fill_format(&ctx->d_frame, f); |
| 825 | } | 825 | } |
| 826 | 826 | ||
| @@ -833,9 +833,6 @@ static int fimc_cap_try_fmt_mplane(struct file *file, void *fh, | |||
| 833 | struct v4l2_mbus_framefmt mf; | 833 | struct v4l2_mbus_framefmt mf; |
| 834 | struct fimc_fmt *ffmt = NULL; | 834 | struct fimc_fmt *ffmt = NULL; |
| 835 | 835 | ||
| 836 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
| 837 | return -EINVAL; | ||
| 838 | |||
| 839 | if (pix->pixelformat == V4L2_PIX_FMT_JPEG) { | 836 | if (pix->pixelformat == V4L2_PIX_FMT_JPEG) { |
| 840 | fimc_capture_try_format(ctx, &pix->width, &pix->height, | 837 | fimc_capture_try_format(ctx, &pix->width, &pix->height, |
| 841 | NULL, &pix->pixelformat, | 838 | NULL, &pix->pixelformat, |
| @@ -887,8 +884,6 @@ static int fimc_capture_set_format(struct fimc_dev *fimc, struct v4l2_format *f) | |||
| 887 | struct fimc_fmt *s_fmt = NULL; | 884 | struct fimc_fmt *s_fmt = NULL; |
| 888 | int ret, i; | 885 | int ret, i; |
| 889 | 886 | ||
| 890 | if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) | ||
| 891 | return -EINVAL; | ||
| 892 | if (vb2_is_busy(&fimc->vid_cap.vbq)) | 887 | if (vb2_is_busy(&fimc->vid_cap.vbq)) |
| 893 | return -EBUSY; | 888 | return -EBUSY; |
| 894 | 889 | ||
| @@ -924,10 +919,10 @@ static int fimc_capture_set_format(struct fimc_dev *fimc, struct v4l2_format *f) | |||
| 924 | pix->width = mf->width; | 919 | pix->width = mf->width; |
| 925 | pix->height = mf->height; | 920 | pix->height = mf->height; |
| 926 | } | 921 | } |
| 922 | |||
| 927 | fimc_adjust_mplane_format(ff->fmt, pix->width, pix->height, pix); | 923 | fimc_adjust_mplane_format(ff->fmt, pix->width, pix->height, pix); |
| 928 | for (i = 0; i < ff->fmt->colplanes; i++) | 924 | for (i = 0; i < ff->fmt->colplanes; i++) |
| 929 | ff->payload[i] = | 925 | ff->payload[i] = pix->plane_fmt[i].sizeimage; |
| 930 | (pix->width * pix->height * ff->fmt->depth[i]) / 8; | ||
| 931 | 926 | ||
| 932 | set_frame_bounds(ff, pix->width, pix->height); | 927 | set_frame_bounds(ff, pix->width, pix->height); |
| 933 | /* Reset the composition rectangle if not yet configured */ | 928 | /* Reset the composition rectangle if not yet configured */ |
| @@ -1045,18 +1040,22 @@ static int fimc_cap_streamon(struct file *file, void *priv, | |||
| 1045 | { | 1040 | { |
| 1046 | struct fimc_dev *fimc = video_drvdata(file); | 1041 | struct fimc_dev *fimc = video_drvdata(file); |
| 1047 | struct fimc_pipeline *p = &fimc->pipeline; | 1042 | struct fimc_pipeline *p = &fimc->pipeline; |
| 1043 | struct v4l2_subdev *sd = p->subdevs[IDX_SENSOR]; | ||
| 1048 | int ret; | 1044 | int ret; |
| 1049 | 1045 | ||
| 1050 | if (fimc_capture_active(fimc)) | 1046 | if (fimc_capture_active(fimc)) |
| 1051 | return -EBUSY; | 1047 | return -EBUSY; |
| 1052 | 1048 | ||
| 1053 | media_entity_pipeline_start(&p->subdevs[IDX_SENSOR]->entity, | 1049 | ret = media_entity_pipeline_start(&sd->entity, p->m_pipeline); |
| 1054 | p->m_pipeline); | 1050 | if (ret < 0) |
| 1051 | return ret; | ||
| 1055 | 1052 | ||
| 1056 | if (fimc->vid_cap.user_subdev_api) { | 1053 | if (fimc->vid_cap.user_subdev_api) { |
| 1057 | ret = fimc_pipeline_validate(fimc); | 1054 | ret = fimc_pipeline_validate(fimc); |
| 1058 | if (ret) | 1055 | if (ret < 0) { |
| 1056 | media_entity_pipeline_stop(&sd->entity); | ||
| 1059 | return ret; | 1057 | return ret; |
| 1058 | } | ||
| 1060 | } | 1059 | } |
| 1061 | return vb2_streamon(&fimc->vid_cap.vbq, type); | 1060 | return vb2_streamon(&fimc->vid_cap.vbq, type); |
| 1062 | } | 1061 | } |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index 92fc5a20fb76..a4646ca1d56f 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c | |||
| @@ -153,7 +153,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
| 153 | .colplanes = 2, | 153 | .colplanes = 2, |
| 154 | .flags = FMT_FLAGS_M2M, | 154 | .flags = FMT_FLAGS_M2M, |
| 155 | }, { | 155 | }, { |
| 156 | .name = "YUV 4:2:0 non-contiguous 2-planar, Y/CbCr", | 156 | .name = "YUV 4:2:0 non-contig. 2p, Y/CbCr", |
| 157 | .fourcc = V4L2_PIX_FMT_NV12M, | 157 | .fourcc = V4L2_PIX_FMT_NV12M, |
| 158 | .color = FIMC_FMT_YCBCR420, | 158 | .color = FIMC_FMT_YCBCR420, |
| 159 | .depth = { 8, 4 }, | 159 | .depth = { 8, 4 }, |
| @@ -161,7 +161,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
| 161 | .colplanes = 2, | 161 | .colplanes = 2, |
| 162 | .flags = FMT_FLAGS_M2M, | 162 | .flags = FMT_FLAGS_M2M, |
| 163 | }, { | 163 | }, { |
| 164 | .name = "YUV 4:2:0 non-contiguous 3-planar, Y/Cb/Cr", | 164 | .name = "YUV 4:2:0 non-contig. 3p, Y/Cb/Cr", |
| 165 | .fourcc = V4L2_PIX_FMT_YUV420M, | 165 | .fourcc = V4L2_PIX_FMT_YUV420M, |
| 166 | .color = FIMC_FMT_YCBCR420, | 166 | .color = FIMC_FMT_YCBCR420, |
| 167 | .depth = { 8, 2, 2 }, | 167 | .depth = { 8, 2, 2 }, |
| @@ -169,7 +169,7 @@ static struct fimc_fmt fimc_formats[] = { | |||
| 169 | .colplanes = 3, | 169 | .colplanes = 3, |
| 170 | .flags = FMT_FLAGS_M2M, | 170 | .flags = FMT_FLAGS_M2M, |
| 171 | }, { | 171 | }, { |
| 172 | .name = "YUV 4:2:0 non-contiguous 2-planar, Y/CbCr, tiled", | 172 | .name = "YUV 4:2:0 non-contig. 2p, tiled", |
| 173 | .fourcc = V4L2_PIX_FMT_NV12MT, | 173 | .fourcc = V4L2_PIX_FMT_NV12MT, |
| 174 | .color = FIMC_FMT_YCBCR420, | 174 | .color = FIMC_FMT_YCBCR420, |
| 175 | .depth = { 8, 4 }, | 175 | .depth = { 8, 4 }, |
| @@ -641,7 +641,7 @@ void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active) | |||
| 641 | if (!ctrls->ready) | 641 | if (!ctrls->ready) |
| 642 | return; | 642 | return; |
| 643 | 643 | ||
| 644 | mutex_lock(&ctrls->handler.lock); | 644 | mutex_lock(ctrls->handler.lock); |
| 645 | v4l2_ctrl_activate(ctrls->rotate, active); | 645 | v4l2_ctrl_activate(ctrls->rotate, active); |
| 646 | v4l2_ctrl_activate(ctrls->hflip, active); | 646 | v4l2_ctrl_activate(ctrls->hflip, active); |
| 647 | v4l2_ctrl_activate(ctrls->vflip, active); | 647 | v4l2_ctrl_activate(ctrls->vflip, active); |
| @@ -660,7 +660,7 @@ void fimc_ctrls_activate(struct fimc_ctx *ctx, bool active) | |||
| 660 | ctx->hflip = 0; | 660 | ctx->hflip = 0; |
| 661 | ctx->vflip = 0; | 661 | ctx->vflip = 0; |
| 662 | } | 662 | } |
| 663 | mutex_unlock(&ctrls->handler.lock); | 663 | mutex_unlock(ctrls->handler.lock); |
| 664 | } | 664 | } |
| 665 | 665 | ||
| 666 | /* Update maximum value of the alpha color control */ | 666 | /* Update maximum value of the alpha color control */ |
| @@ -741,8 +741,8 @@ void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, | |||
| 741 | pix->width = width; | 741 | pix->width = width; |
| 742 | 742 | ||
| 743 | for (i = 0; i < pix->num_planes; ++i) { | 743 | for (i = 0; i < pix->num_planes; ++i) { |
| 744 | u32 bpl = pix->plane_fmt[i].bytesperline; | 744 | struct v4l2_plane_pix_format *plane_fmt = &pix->plane_fmt[i]; |
| 745 | u32 *sizeimage = &pix->plane_fmt[i].sizeimage; | 745 | u32 bpl = plane_fmt->bytesperline; |
| 746 | 746 | ||
| 747 | if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width)) | 747 | if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width)) |
| 748 | bpl = pix->width; /* Planar */ | 748 | bpl = pix->width; /* Planar */ |
| @@ -754,8 +754,9 @@ void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, | |||
| 754 | if (i == 0) /* Same bytesperline for each plane. */ | 754 | if (i == 0) /* Same bytesperline for each plane. */ |
| 755 | bytesperline = bpl; | 755 | bytesperline = bpl; |
| 756 | 756 | ||
| 757 | pix->plane_fmt[i].bytesperline = bytesperline; | 757 | plane_fmt->bytesperline = bytesperline; |
| 758 | *sizeimage = (pix->width * pix->height * fmt->depth[i]) / 8; | 758 | plane_fmt->sizeimage = max((pix->width * pix->height * |
| 759 | fmt->depth[i]) / 8, plane_fmt->sizeimage); | ||
| 759 | } | 760 | } |
| 760 | } | 761 | } |
| 761 | 762 | ||
diff --git a/drivers/media/video/s5p-fimc/fimc-lite.c b/drivers/media/video/s5p-fimc/fimc-lite.c index 400d701aef04..74ff310db30c 100644 --- a/drivers/media/video/s5p-fimc/fimc-lite.c +++ b/drivers/media/video/s5p-fimc/fimc-lite.c | |||
| @@ -451,34 +451,44 @@ static void fimc_lite_clear_event_counters(struct fimc_lite *fimc) | |||
| 451 | static int fimc_lite_open(struct file *file) | 451 | static int fimc_lite_open(struct file *file) |
| 452 | { | 452 | { |
| 453 | struct fimc_lite *fimc = video_drvdata(file); | 453 | struct fimc_lite *fimc = video_drvdata(file); |
| 454 | int ret = v4l2_fh_open(file); | 454 | int ret; |
| 455 | 455 | ||
| 456 | if (ret) | 456 | if (mutex_lock_interruptible(&fimc->lock)) |
| 457 | return ret; | 457 | return -ERESTARTSYS; |
| 458 | 458 | ||
| 459 | set_bit(ST_FLITE_IN_USE, &fimc->state); | 459 | set_bit(ST_FLITE_IN_USE, &fimc->state); |
| 460 | pm_runtime_get_sync(&fimc->pdev->dev); | 460 | ret = pm_runtime_get_sync(&fimc->pdev->dev); |
| 461 | if (ret < 0) | ||
| 462 | goto done; | ||
| 461 | 463 | ||
| 462 | if (++fimc->ref_count != 1 || fimc->out_path != FIMC_IO_DMA) | 464 | ret = v4l2_fh_open(file); |
| 463 | return ret; | 465 | if (ret < 0) |
| 466 | goto done; | ||
| 464 | 467 | ||
| 465 | ret = fimc_pipeline_initialize(&fimc->pipeline, &fimc->vfd->entity, | 468 | if (++fimc->ref_count == 1 && fimc->out_path == FIMC_IO_DMA) { |
| 466 | true); | 469 | ret = fimc_pipeline_initialize(&fimc->pipeline, |
| 467 | if (ret < 0) { | 470 | &fimc->vfd->entity, true); |
| 468 | v4l2_err(fimc->vfd, "Video pipeline initialization failed\n"); | 471 | if (ret < 0) { |
| 469 | pm_runtime_put_sync(&fimc->pdev->dev); | 472 | pm_runtime_put_sync(&fimc->pdev->dev); |
| 470 | fimc->ref_count--; | 473 | fimc->ref_count--; |
| 471 | v4l2_fh_release(file); | 474 | v4l2_fh_release(file); |
| 472 | clear_bit(ST_FLITE_IN_USE, &fimc->state); | 475 | clear_bit(ST_FLITE_IN_USE, &fimc->state); |
| 473 | } | 476 | } |
| 474 | 477 | ||
| 475 | fimc_lite_clear_event_counters(fimc); | 478 | fimc_lite_clear_event_counters(fimc); |
| 479 | } | ||
| 480 | done: | ||
| 481 | mutex_unlock(&fimc->lock); | ||
| 476 | return ret; | 482 | return ret; |
| 477 | } | 483 | } |
| 478 | 484 | ||
| 479 | static int fimc_lite_close(struct file *file) | 485 | static int fimc_lite_close(struct file *file) |
| 480 | { | 486 | { |
| 481 | struct fimc_lite *fimc = video_drvdata(file); | 487 | struct fimc_lite *fimc = video_drvdata(file); |
| 488 | int ret; | ||
| 489 | |||
| 490 | if (mutex_lock_interruptible(&fimc->lock)) | ||
| 491 | return -ERESTARTSYS; | ||
| 482 | 492 | ||
| 483 | if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) { | 493 | if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) { |
| 484 | clear_bit(ST_FLITE_IN_USE, &fimc->state); | 494 | clear_bit(ST_FLITE_IN_USE, &fimc->state); |
| @@ -492,20 +502,39 @@ static int fimc_lite_close(struct file *file) | |||
| 492 | if (fimc->ref_count == 0) | 502 | if (fimc->ref_count == 0) |
| 493 | vb2_queue_release(&fimc->vb_queue); | 503 | vb2_queue_release(&fimc->vb_queue); |
| 494 | 504 | ||
| 495 | return v4l2_fh_release(file); | 505 | ret = v4l2_fh_release(file); |
| 506 | |||
| 507 | mutex_unlock(&fimc->lock); | ||
| 508 | return ret; | ||
| 496 | } | 509 | } |
| 497 | 510 | ||
| 498 | static unsigned int fimc_lite_poll(struct file *file, | 511 | static unsigned int fimc_lite_poll(struct file *file, |
| 499 | struct poll_table_struct *wait) | 512 | struct poll_table_struct *wait) |
| 500 | { | 513 | { |
| 501 | struct fimc_lite *fimc = video_drvdata(file); | 514 | struct fimc_lite *fimc = video_drvdata(file); |
| 502 | return vb2_poll(&fimc->vb_queue, file, wait); | 515 | int ret; |
| 516 | |||
| 517 | if (mutex_lock_interruptible(&fimc->lock)) | ||
| 518 | return POLL_ERR; | ||
| 519 | |||
| 520 | ret = vb2_poll(&fimc->vb_queue, file, wait); | ||
| 521 | mutex_unlock(&fimc->lock); | ||
| 522 | |||
| 523 | return ret; | ||
| 503 | } | 524 | } |
| 504 | 525 | ||
| 505 | static int fimc_lite_mmap(struct file *file, struct vm_area_struct *vma) | 526 | static int fimc_lite_mmap(struct file *file, struct vm_area_struct *vma) |
| 506 | { | 527 | { |
| 507 | struct fimc_lite *fimc = video_drvdata(file); | 528 | struct fimc_lite *fimc = video_drvdata(file); |
| 508 | return vb2_mmap(&fimc->vb_queue, vma); | 529 | int ret; |
| 530 | |||
| 531 | if (mutex_lock_interruptible(&fimc->lock)) | ||
| 532 | return -ERESTARTSYS; | ||
| 533 | |||
| 534 | ret = vb2_mmap(&fimc->vb_queue, vma); | ||
| 535 | mutex_unlock(&fimc->lock); | ||
| 536 | |||
| 537 | return ret; | ||
| 509 | } | 538 | } |
| 510 | 539 | ||
| 511 | static const struct v4l2_file_operations fimc_lite_fops = { | 540 | static const struct v4l2_file_operations fimc_lite_fops = { |
| @@ -762,7 +791,9 @@ static int fimc_lite_streamon(struct file *file, void *priv, | |||
| 762 | if (fimc_lite_active(fimc)) | 791 | if (fimc_lite_active(fimc)) |
| 763 | return -EBUSY; | 792 | return -EBUSY; |
| 764 | 793 | ||
| 765 | media_entity_pipeline_start(&sensor->entity, p->m_pipeline); | 794 | ret = media_entity_pipeline_start(&sensor->entity, p->m_pipeline); |
| 795 | if (ret < 0) | ||
| 796 | return ret; | ||
| 766 | 797 | ||
| 767 | ret = fimc_pipeline_validate(fimc); | 798 | ret = fimc_pipeline_validate(fimc); |
| 768 | if (ret) { | 799 | if (ret) { |
| @@ -1508,7 +1539,7 @@ static int fimc_lite_suspend(struct device *dev) | |||
| 1508 | return 0; | 1539 | return 0; |
| 1509 | 1540 | ||
| 1510 | ret = fimc_lite_stop_capture(fimc, suspend); | 1541 | ret = fimc_lite_stop_capture(fimc, suspend); |
| 1511 | if (ret) | 1542 | if (ret < 0 || !fimc_lite_active(fimc)) |
| 1512 | return ret; | 1543 | return ret; |
| 1513 | 1544 | ||
| 1514 | return fimc_pipeline_shutdown(&fimc->pipeline); | 1545 | return fimc_pipeline_shutdown(&fimc->pipeline); |
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.c b/drivers/media/video/s5p-fimc/fimc-mdevice.c index 6753c45631b8..52cef4865423 100644 --- a/drivers/media/video/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/video/s5p-fimc/fimc-mdevice.c | |||
| @@ -193,9 +193,13 @@ int __fimc_pipeline_shutdown(struct fimc_pipeline *p) | |||
| 193 | 193 | ||
| 194 | int fimc_pipeline_shutdown(struct fimc_pipeline *p) | 194 | int fimc_pipeline_shutdown(struct fimc_pipeline *p) |
| 195 | { | 195 | { |
| 196 | struct media_entity *me = &p->subdevs[IDX_SENSOR]->entity; | 196 | struct media_entity *me; |
| 197 | int ret; | 197 | int ret; |
| 198 | 198 | ||
| 199 | if (!p || !p->subdevs[IDX_SENSOR]) | ||
| 200 | return -EINVAL; | ||
| 201 | |||
| 202 | me = &p->subdevs[IDX_SENSOR]->entity; | ||
| 199 | mutex_lock(&me->parent->graph_mutex); | 203 | mutex_lock(&me->parent->graph_mutex); |
| 200 | ret = __fimc_pipeline_shutdown(p); | 204 | ret = __fimc_pipeline_shutdown(p); |
| 201 | mutex_unlock(&me->parent->graph_mutex); | 205 | mutex_unlock(&me->parent->graph_mutex); |
| @@ -498,12 +502,12 @@ static void fimc_md_unregister_entities(struct fimc_md *fmd) | |||
| 498 | * @source: the source entity to create links to all fimc entities from | 502 | * @source: the source entity to create links to all fimc entities from |
| 499 | * @sensor: sensor subdev linked to FIMC[fimc_id] entity, may be null | 503 | * @sensor: sensor subdev linked to FIMC[fimc_id] entity, may be null |
| 500 | * @pad: the source entity pad index | 504 | * @pad: the source entity pad index |
| 501 | * @fimc_id: index of the fimc device for which link should be enabled | 505 | * @link_mask: bitmask of the fimc devices for which link should be enabled |
| 502 | */ | 506 | */ |
| 503 | static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | 507 | static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, |
| 504 | struct media_entity *source, | 508 | struct media_entity *source, |
| 505 | struct v4l2_subdev *sensor, | 509 | struct v4l2_subdev *sensor, |
| 506 | int pad, int fimc_id) | 510 | int pad, int link_mask) |
| 507 | { | 511 | { |
| 508 | struct fimc_sensor_info *s_info; | 512 | struct fimc_sensor_info *s_info; |
| 509 | struct media_entity *sink; | 513 | struct media_entity *sink; |
| @@ -520,7 +524,7 @@ static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | |||
| 520 | if (!fmd->fimc[i]->variant->has_cam_if) | 524 | if (!fmd->fimc[i]->variant->has_cam_if) |
| 521 | continue; | 525 | continue; |
| 522 | 526 | ||
| 523 | flags = (i == fimc_id) ? MEDIA_LNK_FL_ENABLED : 0; | 527 | flags = ((1 << i) & link_mask) ? MEDIA_LNK_FL_ENABLED : 0; |
| 524 | 528 | ||
| 525 | sink = &fmd->fimc[i]->vid_cap.subdev.entity; | 529 | sink = &fmd->fimc[i]->vid_cap.subdev.entity; |
| 526 | ret = media_entity_create_link(source, pad, sink, | 530 | ret = media_entity_create_link(source, pad, sink, |
| @@ -552,7 +556,10 @@ static int __fimc_md_create_fimc_sink_links(struct fimc_md *fmd, | |||
| 552 | if (!fmd->fimc_lite[i]) | 556 | if (!fmd->fimc_lite[i]) |
| 553 | continue; | 557 | continue; |
| 554 | 558 | ||
| 555 | flags = (i == fimc_id) ? MEDIA_LNK_FL_ENABLED : 0; | 559 | if (link_mask & (1 << (i + FIMC_MAX_DEVS))) |
| 560 | flags = MEDIA_LNK_FL_ENABLED; | ||
| 561 | else | ||
| 562 | flags = 0; | ||
| 556 | 563 | ||
| 557 | sink = &fmd->fimc_lite[i]->subdev.entity; | 564 | sink = &fmd->fimc_lite[i]->subdev.entity; |
| 558 | ret = media_entity_create_link(source, pad, sink, | 565 | ret = media_entity_create_link(source, pad, sink, |
| @@ -614,9 +621,8 @@ static int fimc_md_create_links(struct fimc_md *fmd) | |||
| 614 | struct s5p_fimc_isp_info *pdata; | 621 | struct s5p_fimc_isp_info *pdata; |
| 615 | struct fimc_sensor_info *s_info; | 622 | struct fimc_sensor_info *s_info; |
| 616 | struct media_entity *source, *sink; | 623 | struct media_entity *source, *sink; |
| 617 | int i, pad, fimc_id = 0; | 624 | int i, pad, fimc_id = 0, ret = 0; |
| 618 | int ret = 0; | 625 | u32 flags, link_mask = 0; |
| 619 | u32 flags; | ||
| 620 | 626 | ||
| 621 | for (i = 0; i < fmd->num_sensors; i++) { | 627 | for (i = 0; i < fmd->num_sensors; i++) { |
| 622 | if (fmd->sensor[i].subdev == NULL) | 628 | if (fmd->sensor[i].subdev == NULL) |
| @@ -668,19 +674,20 @@ static int fimc_md_create_links(struct fimc_md *fmd) | |||
| 668 | if (source == NULL) | 674 | if (source == NULL) |
| 669 | continue; | 675 | continue; |
| 670 | 676 | ||
| 677 | link_mask = 1 << fimc_id++; | ||
| 671 | ret = __fimc_md_create_fimc_sink_links(fmd, source, sensor, | 678 | ret = __fimc_md_create_fimc_sink_links(fmd, source, sensor, |
| 672 | pad, fimc_id++); | 679 | pad, link_mask); |
| 673 | } | 680 | } |
| 674 | 681 | ||
| 675 | fimc_id = 0; | ||
| 676 | for (i = 0; i < ARRAY_SIZE(fmd->csis); i++) { | 682 | for (i = 0; i < ARRAY_SIZE(fmd->csis); i++) { |
| 677 | if (fmd->csis[i].sd == NULL) | 683 | if (fmd->csis[i].sd == NULL) |
| 678 | continue; | 684 | continue; |
| 679 | source = &fmd->csis[i].sd->entity; | 685 | source = &fmd->csis[i].sd->entity; |
| 680 | pad = CSIS_PAD_SOURCE; | 686 | pad = CSIS_PAD_SOURCE; |
| 681 | 687 | ||
| 688 | link_mask = 1 << fimc_id++; | ||
| 682 | ret = __fimc_md_create_fimc_sink_links(fmd, source, NULL, | 689 | ret = __fimc_md_create_fimc_sink_links(fmd, source, NULL, |
| 683 | pad, fimc_id++); | 690 | pad, link_mask); |
| 684 | } | 691 | } |
| 685 | 692 | ||
| 686 | /* Create immutable links between each FIMC's subdev and video node */ | 693 | /* Create immutable links between each FIMC's subdev and video node */ |
| @@ -734,8 +741,8 @@ static void fimc_md_put_clocks(struct fimc_md *fmd) | |||
| 734 | } | 741 | } |
| 735 | 742 | ||
| 736 | static int __fimc_md_set_camclk(struct fimc_md *fmd, | 743 | static int __fimc_md_set_camclk(struct fimc_md *fmd, |
| 737 | struct fimc_sensor_info *s_info, | 744 | struct fimc_sensor_info *s_info, |
| 738 | bool on) | 745 | bool on) |
| 739 | { | 746 | { |
| 740 | struct s5p_fimc_isp_info *pdata = s_info->pdata; | 747 | struct s5p_fimc_isp_info *pdata = s_info->pdata; |
| 741 | struct fimc_camclk_info *camclk; | 748 | struct fimc_camclk_info *camclk; |
| @@ -744,12 +751,10 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
| 744 | if (WARN_ON(pdata->clk_id >= FIMC_MAX_CAMCLKS) || fmd == NULL) | 751 | if (WARN_ON(pdata->clk_id >= FIMC_MAX_CAMCLKS) || fmd == NULL) |
| 745 | return -EINVAL; | 752 | return -EINVAL; |
| 746 | 753 | ||
| 747 | if (s_info->clk_on == on) | ||
| 748 | return 0; | ||
| 749 | camclk = &fmd->camclk[pdata->clk_id]; | 754 | camclk = &fmd->camclk[pdata->clk_id]; |
| 750 | 755 | ||
| 751 | dbg("camclk %d, f: %lu, clk: %p, on: %d", | 756 | dbg("camclk %d, f: %lu, use_count: %d, on: %d", |
| 752 | pdata->clk_id, pdata->clk_frequency, camclk, on); | 757 | pdata->clk_id, pdata->clk_frequency, camclk->use_count, on); |
| 753 | 758 | ||
| 754 | if (on) { | 759 | if (on) { |
| 755 | if (camclk->use_count > 0 && | 760 | if (camclk->use_count > 0 && |
| @@ -760,11 +765,9 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
| 760 | clk_set_rate(camclk->clock, pdata->clk_frequency); | 765 | clk_set_rate(camclk->clock, pdata->clk_frequency); |
| 761 | camclk->frequency = pdata->clk_frequency; | 766 | camclk->frequency = pdata->clk_frequency; |
| 762 | ret = clk_enable(camclk->clock); | 767 | ret = clk_enable(camclk->clock); |
| 768 | dbg("Enabled camclk %d: f: %lu", pdata->clk_id, | ||
| 769 | clk_get_rate(camclk->clock)); | ||
| 763 | } | 770 | } |
| 764 | s_info->clk_on = 1; | ||
| 765 | dbg("Enabled camclk %d: f: %lu", pdata->clk_id, | ||
| 766 | clk_get_rate(camclk->clock)); | ||
| 767 | |||
| 768 | return ret; | 771 | return ret; |
| 769 | } | 772 | } |
| 770 | 773 | ||
| @@ -773,7 +776,6 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
| 773 | 776 | ||
| 774 | if (--camclk->use_count == 0) { | 777 | if (--camclk->use_count == 0) { |
| 775 | clk_disable(camclk->clock); | 778 | clk_disable(camclk->clock); |
| 776 | s_info->clk_on = 0; | ||
| 777 | dbg("Disabled camclk %d", pdata->clk_id); | 779 | dbg("Disabled camclk %d", pdata->clk_id); |
| 778 | } | 780 | } |
| 779 | return ret; | 781 | return ret; |
| @@ -789,8 +791,6 @@ static int __fimc_md_set_camclk(struct fimc_md *fmd, | |||
| 789 | * devices to which sensors can be attached, either directly or through | 791 | * devices to which sensors can be attached, either directly or through |
| 790 | * the MIPI CSI receiver. The clock is allowed here to be used by | 792 | * the MIPI CSI receiver. The clock is allowed here to be used by |
| 791 | * multiple sensors concurrently if they use same frequency. | 793 | * multiple sensors concurrently if they use same frequency. |
| 792 | * The per sensor subdev clk_on attribute helps to synchronize accesses | ||
| 793 | * to the sclk_cam clocks from the video and media device nodes. | ||
| 794 | * This function should only be called when the graph mutex is held. | 794 | * This function should only be called when the graph mutex is held. |
| 795 | */ | 795 | */ |
| 796 | int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on) | 796 | int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on) |
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.h b/drivers/media/video/s5p-fimc/fimc-mdevice.h index 3b8a3492a176..1f5dbaff5442 100644 --- a/drivers/media/video/s5p-fimc/fimc-mdevice.h +++ b/drivers/media/video/s5p-fimc/fimc-mdevice.h | |||
| @@ -47,7 +47,6 @@ struct fimc_camclk_info { | |||
| 47 | * @pdata: sensor's atrributes passed as media device's platform data | 47 | * @pdata: sensor's atrributes passed as media device's platform data |
| 48 | * @subdev: image sensor v4l2 subdev | 48 | * @subdev: image sensor v4l2 subdev |
| 49 | * @host: fimc device the sensor is currently linked to | 49 | * @host: fimc device the sensor is currently linked to |
| 50 | * @clk_on: sclk_cam clock's state associated with this subdev | ||
| 51 | * | 50 | * |
| 52 | * This data structure applies to image sensor and the writeback subdevs. | 51 | * This data structure applies to image sensor and the writeback subdevs. |
| 53 | */ | 52 | */ |
| @@ -55,7 +54,6 @@ struct fimc_sensor_info { | |||
| 55 | struct s5p_fimc_isp_info *pdata; | 54 | struct s5p_fimc_isp_info *pdata; |
| 56 | struct v4l2_subdev *subdev; | 55 | struct v4l2_subdev *subdev; |
| 57 | struct fimc_dev *host; | 56 | struct fimc_dev *host; |
| 58 | bool clk_on; | ||
| 59 | }; | 57 | }; |
| 60 | 58 | ||
| 61 | /** | 59 | /** |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c index 4dd32fc8fd82..feea867f318c 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c | |||
| @@ -996,6 +996,7 @@ int s5p_mfc_dec_ctrls_setup(struct s5p_mfc_ctx *ctx) | |||
| 996 | 996 | ||
| 997 | for (i = 0; i < NUM_CTRLS; i++) { | 997 | for (i = 0; i < NUM_CTRLS; i++) { |
| 998 | if (IS_MFC51_PRIV(controls[i].id)) { | 998 | if (IS_MFC51_PRIV(controls[i].id)) { |
| 999 | memset(&cfg, 0, sizeof(struct v4l2_ctrl_config)); | ||
| 999 | cfg.ops = &s5p_mfc_dec_ctrl_ops; | 1000 | cfg.ops = &s5p_mfc_dec_ctrl_ops; |
| 1000 | cfg.id = controls[i].id; | 1001 | cfg.id = controls[i].id; |
| 1001 | cfg.min = controls[i].minimum; | 1002 | cfg.min = controls[i].minimum; |
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c index 03d83340e7fb..158b78989b89 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c | |||
| @@ -1773,6 +1773,7 @@ int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx) | |||
| 1773 | } | 1773 | } |
| 1774 | for (i = 0; i < NUM_CTRLS; i++) { | 1774 | for (i = 0; i < NUM_CTRLS; i++) { |
| 1775 | if (IS_MFC51_PRIV(controls[i].id)) { | 1775 | if (IS_MFC51_PRIV(controls[i].id)) { |
| 1776 | memset(&cfg, 0, sizeof(struct v4l2_ctrl_config)); | ||
| 1776 | cfg.ops = &s5p_mfc_enc_ctrl_ops; | 1777 | cfg.ops = &s5p_mfc_enc_ctrl_ops; |
| 1777 | cfg.id = controls[i].id; | 1778 | cfg.id = controls[i].id; |
| 1778 | cfg.min = controls[i].minimum; | 1779 | cfg.min = controls[i].minimum; |
diff --git a/drivers/media/video/smiapp/smiapp-core.c b/drivers/media/video/smiapp/smiapp-core.c index e8c93c89265a..9cf5bda35fbe 100644 --- a/drivers/media/video/smiapp/smiapp-core.c +++ b/drivers/media/video/smiapp/smiapp-core.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/device.h> | 31 | #include <linux/device.h> |
| 32 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
| 33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <linux/regulator/consumer.h> | 35 | #include <linux/regulator/consumer.h> |
| 35 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
| 36 | #include <linux/v4l2-mediabus.h> | 37 | #include <linux/v4l2-mediabus.h> |
