Skip to content

Commit b6255ee

Browse files
committed
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: "For a some fix patches for v3.4, including a regression fix at DVB core" Fix up trivial conflicts in Documentation/feature-removal-schedule.txt * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: [media] gspca - sonixj: Fix a zero divide in isoc interrupt [media] media: videobuf2-dma-contig: include header for exported symbols [media] media: videobuf2-dma-contig: quiet sparse noise about plain integer as NULL pointer [media] media: vb2-memops: Export vb2_get_vma symbol [media] s5p-fimc: Correct memory allocation for VIDIOC_CREATE_BUFS [media] s5p-fimc: Fix locking in subdev set_crop op [media] dvb_frontend: fix a regression with DVB-S zig-zag [media] fintek-cir: change || to && [media] V4L: Schedule V4L2_CID_HCENTER, V4L2_CID_VCENTER controls for removal [media] rc: Postpone ISR registration [media] marvell-cam: fix an ARM build error [media] V4L: soc-camera: protect hosts during probing from overzealous user-space
2 parents d69c5c2 + 788ab1b commit b6255ee

File tree

16 files changed

+147
-118
lines changed

16 files changed

+147
-118
lines changed

Documentation/feature-removal-schedule.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,3 +539,13 @@ When: 3.6
539539
Why: setitimer is not returning -EFAULT if user pointer is NULL. This
540540
violates the spec.
541541
Who: Sasikantha Babu <[email protected]>
542+
543+
----------------------------
544+
545+
What: V4L2_CID_HCENTER, V4L2_CID_VCENTER V4L2 controls
546+
When: 3.7
547+
Why: The V4L2_CID_VCENTER, V4L2_CID_HCENTER controls have been deprecated
548+
for about 4 years and they are not used by any mainline driver.
549+
There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide
550+
similar functionality.
551+
Who: Sylwester Nawrocki <[email protected]>

drivers/media/dvb/dvb-core/dvb_frontend.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,10 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
19211921
} else {
19221922
/* default values */
19231923
switch (c->delivery_system) {
1924+
case SYS_DVBS:
1925+
case SYS_DVBS2:
1926+
case SYS_ISDBS:
1927+
case SYS_TURBO:
19241928
case SYS_DVBC_ANNEX_A:
19251929
case SYS_DVBC_ANNEX_C:
19261930
fepriv->min_delay = HZ / 20;

drivers/media/rc/ene_ir.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,22 +1018,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
10181018

10191019
spin_lock_init(&dev->hw_lock);
10201020

1021-
/* claim the resources */
1022-
error = -EBUSY;
1023-
dev->hw_io = pnp_port_start(pnp_dev, 0);
1024-
if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
1025-
dev->hw_io = -1;
1026-
dev->irq = -1;
1027-
goto error;
1028-
}
1029-
1030-
dev->irq = pnp_irq(pnp_dev, 0);
1031-
if (request_irq(dev->irq, ene_isr,
1032-
IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) {
1033-
dev->irq = -1;
1034-
goto error;
1035-
}
1036-
10371021
pnp_set_drvdata(pnp_dev, dev);
10381022
dev->pnp_dev = pnp_dev;
10391023

@@ -1086,6 +1070,22 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
10861070
device_set_wakeup_capable(&pnp_dev->dev, true);
10871071
device_set_wakeup_enable(&pnp_dev->dev, true);
10881072

1073+
/* claim the resources */
1074+
error = -EBUSY;
1075+
dev->hw_io = pnp_port_start(pnp_dev, 0);
1076+
if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
1077+
dev->hw_io = -1;
1078+
dev->irq = -1;
1079+
goto error;
1080+
}
1081+
1082+
dev->irq = pnp_irq(pnp_dev, 0);
1083+
if (request_irq(dev->irq, ene_isr,
1084+
IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) {
1085+
dev->irq = -1;
1086+
goto error;
1087+
}
1088+
10891089
error = rc_register_device(rdev);
10901090
if (error < 0)
10911091
goto error;

drivers/media/rc/fintek-cir.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek)
197197
/*
198198
* Newer reviews of this chipset uses port 8 instead of 5
199199
*/
200-
if ((chip != 0x0408) || (chip != 0x0804))
200+
if ((chip != 0x0408) && (chip != 0x0804))
201201
fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2;
202202
else
203203
fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1;
@@ -514,16 +514,6 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
514514

515515
spin_lock_init(&fintek->fintek_lock);
516516

517-
ret = -EBUSY;
518-
/* now claim resources */
519-
if (!request_region(fintek->cir_addr,
520-
fintek->cir_port_len, FINTEK_DRIVER_NAME))
521-
goto failure;
522-
523-
if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
524-
FINTEK_DRIVER_NAME, (void *)fintek))
525-
goto failure;
526-
527517
pnp_set_drvdata(pdev, fintek);
528518
fintek->pdev = pdev;
529519

@@ -558,6 +548,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
558548
/* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
559549
rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
560550

551+
ret = -EBUSY;
552+
/* now claim resources */
553+
if (!request_region(fintek->cir_addr,
554+
fintek->cir_port_len, FINTEK_DRIVER_NAME))
555+
goto failure;
556+
557+
if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
558+
FINTEK_DRIVER_NAME, (void *)fintek))
559+
goto failure;
560+
561561
ret = rc_register_device(rdev);
562562
if (ret)
563563
goto failure;

drivers/media/rc/ite-cir.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,16 +1515,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
15151515
/* initialize raw event */
15161516
init_ir_raw_event(&itdev->rawir);
15171517

1518-
ret = -EBUSY;
1519-
/* now claim resources */
1520-
if (!request_region(itdev->cir_addr,
1521-
dev_desc->io_region_size, ITE_DRIVER_NAME))
1522-
goto failure;
1523-
1524-
if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
1525-
ITE_DRIVER_NAME, (void *)itdev))
1526-
goto failure;
1527-
15281518
/* set driver data into the pnp device */
15291519
pnp_set_drvdata(pdev, itdev);
15301520
itdev->pdev = pdev;
@@ -1600,6 +1590,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
16001590
rdev->driver_name = ITE_DRIVER_NAME;
16011591
rdev->map_name = RC_MAP_RC6_MCE;
16021592

1593+
ret = -EBUSY;
1594+
/* now claim resources */
1595+
if (!request_region(itdev->cir_addr,
1596+
dev_desc->io_region_size, ITE_DRIVER_NAME))
1597+
goto failure;
1598+
1599+
if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
1600+
ITE_DRIVER_NAME, (void *)itdev))
1601+
goto failure;
1602+
16031603
ret = rc_register_device(rdev);
16041604
if (ret)
16051605
goto failure;

drivers/media/rc/nuvoton-cir.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,24 +1021,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
10211021
spin_lock_init(&nvt->nvt_lock);
10221022
spin_lock_init(&nvt->tx.lock);
10231023

1024-
ret = -EBUSY;
1025-
/* now claim resources */
1026-
if (!request_region(nvt->cir_addr,
1027-
CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1028-
goto failure;
1029-
1030-
if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
1031-
NVT_DRIVER_NAME, (void *)nvt))
1032-
goto failure;
1033-
1034-
if (!request_region(nvt->cir_wake_addr,
1035-
CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1036-
goto failure;
1037-
1038-
if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
1039-
NVT_DRIVER_NAME, (void *)nvt))
1040-
goto failure;
1041-
10421024
pnp_set_drvdata(pdev, nvt);
10431025
nvt->pdev = pdev;
10441026

@@ -1085,6 +1067,24 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
10851067
rdev->tx_resolution = XYZ;
10861068
#endif
10871069

1070+
ret = -EBUSY;
1071+
/* now claim resources */
1072+
if (!request_region(nvt->cir_addr,
1073+
CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1074+
goto failure;
1075+
1076+
if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
1077+
NVT_DRIVER_NAME, (void *)nvt))
1078+
goto failure;
1079+
1080+
if (!request_region(nvt->cir_wake_addr,
1081+
CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1082+
goto failure;
1083+
1084+
if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
1085+
NVT_DRIVER_NAME, (void *)nvt))
1086+
goto failure;
1087+
10881088
ret = rc_register_device(rdev);
10891089
if (ret)
10901090
goto failure;

drivers/media/rc/winbond-cir.c

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -991,39 +991,10 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
991991
"(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n",
992992
data->wbase, data->ebase, data->sbase, data->irq);
993993

994-
if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
995-
dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
996-
data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
997-
err = -EBUSY;
998-
goto exit_free_data;
999-
}
1000-
1001-
if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
1002-
dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1003-
data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1);
1004-
err = -EBUSY;
1005-
goto exit_release_wbase;
1006-
}
1007-
1008-
if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) {
1009-
dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1010-
data->sbase, data->sbase + SP_IOMEM_LEN - 1);
1011-
err = -EBUSY;
1012-
goto exit_release_ebase;
1013-
}
1014-
1015-
err = request_irq(data->irq, wbcir_irq_handler,
1016-
IRQF_DISABLED, DRVNAME, device);
1017-
if (err) {
1018-
dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
1019-
err = -EBUSY;
1020-
goto exit_release_sbase;
1021-
}
1022-
1023994
led_trigger_register_simple("cir-tx", &data->txtrigger);
1024995
if (!data->txtrigger) {
1025996
err = -ENOMEM;
1026-
goto exit_free_irq;
997+
goto exit_free_data;
1027998
}
1028999

10291000
led_trigger_register_simple("cir-rx", &data->rxtrigger);
@@ -1062,24 +1033,45 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
10621033
data->dev->priv = data;
10631034
data->dev->dev.parent = &device->dev;
10641035

1036+
if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
1037+
dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1038+
data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
1039+
err = -EBUSY;
1040+
goto exit_free_rc;
1041+
}
1042+
1043+
if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
1044+
dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1045+
data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1);
1046+
err = -EBUSY;
1047+
goto exit_release_wbase;
1048+
}
1049+
1050+
if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) {
1051+
dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1052+
data->sbase, data->sbase + SP_IOMEM_LEN - 1);
1053+
err = -EBUSY;
1054+
goto exit_release_ebase;
1055+
}
1056+
1057+
err = request_irq(data->irq, wbcir_irq_handler,
1058+
IRQF_DISABLED, DRVNAME, device);
1059+
if (err) {
1060+
dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
1061+
err = -EBUSY;
1062+
goto exit_release_sbase;
1063+
}
1064+
10651065
err = rc_register_device(data->dev);
10661066
if (err)
1067-
goto exit_free_rc;
1067+
goto exit_free_irq;
10681068

10691069
device_init_wakeup(&device->dev, 1);
10701070

10711071
wbcir_init_hw(data);
10721072

10731073
return 0;
10741074

1075-
exit_free_rc:
1076-
rc_free_device(data->dev);
1077-
exit_unregister_led:
1078-
led_classdev_unregister(&data->led);
1079-
exit_unregister_rxtrigger:
1080-
led_trigger_unregister_simple(data->rxtrigger);
1081-
exit_unregister_txtrigger:
1082-
led_trigger_unregister_simple(data->txtrigger);
10831075
exit_free_irq:
10841076
free_irq(data->irq, device);
10851077
exit_release_sbase:
@@ -1088,6 +1080,14 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
10881080
release_region(data->ebase, EHFUNC_IOMEM_LEN);
10891081
exit_release_wbase:
10901082
release_region(data->wbase, WAKEUP_IOMEM_LEN);
1083+
exit_free_rc:
1084+
rc_free_device(data->dev);
1085+
exit_unregister_led:
1086+
led_classdev_unregister(&data->led);
1087+
exit_unregister_rxtrigger:
1088+
led_trigger_unregister_simple(data->rxtrigger);
1089+
exit_unregister_txtrigger:
1090+
led_trigger_unregister_simple(data->txtrigger);
10911091
exit_free_data:
10921092
kfree(data);
10931093
pnp_set_drvdata(device, NULL);

drivers/media/video/gspca/sonixj.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,6 +2923,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
29232923
* not the JPEG end of frame ('ff d9').
29242924
*/
29252925

2926+
/* count the packets and their size */
2927+
sd->npkt++;
2928+
sd->pktsz += len;
2929+
29262930
/*fixme: assumption about the following code:
29272931
* - there can be only one marker in a packet
29282932
*/
@@ -2945,10 +2949,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
29452949
data += i;
29462950
}
29472951

2948-
/* count the packets and their size */
2949-
sd->npkt++;
2950-
sd->pktsz += len;
2951-
29522952
/* search backwards if there is a marker in the packet */
29532953
for (i = len - 1; --i >= 0; ) {
29542954
if (data[i] != 0xff) {

drivers/media/video/marvell-ccic/mmp-driver.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ static int mmpcam_probe(struct platform_device *pdev)
181181
INIT_LIST_HEAD(&cam->devlist);
182182

183183
mcam = &cam->mcam;
184-
mcam->platform = MHP_Armada610;
185184
mcam->plat_power_up = mmpcam_power_up;
186185
mcam->plat_power_down = mmpcam_power_down;
187186
mcam->dev = &pdev->dev;

drivers/media/video/s5p-fimc/fimc-capture.c

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,28 +246,37 @@ int fimc_capture_resume(struct fimc_dev *fimc)
246246

247247
}
248248

249-
static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane)
250-
{
251-
if (!fr || plane >= fr->fmt->memplanes)
252-
return 0;
253-
return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8;
254-
}
255-
256-
static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
249+
static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
257250
unsigned int *num_buffers, unsigned int *num_planes,
258251
unsigned int sizes[], void *allocators[])
259252
{
253+
const struct v4l2_pix_format_mplane *pixm = NULL;
260254
struct fimc_ctx *ctx = vq->drv_priv;
261-
struct fimc_fmt *fmt = ctx->d_frame.fmt;
255+
struct fimc_frame *frame = &ctx->d_frame;
256+
struct fimc_fmt *fmt = frame->fmt;
257+
unsigned long wh;
262258
int i;
263259

264-
if (!fmt)
260+
if (pfmt) {
261+
pixm = &pfmt->fmt.pix_mp;
262+
fmt = fimc_find_format(&pixm->pixelformat, NULL,
263+
FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1);
264+
wh = pixm->width * pixm->height;
265+
} else {
266+
wh = frame->f_width * frame->f_height;
267+
}
268+
269+
if (fmt == NULL)
265270
return -EINVAL;
266271

267272
*num_planes = fmt->memplanes;
268273

269274
for (i = 0; i < fmt->memplanes; i++) {
270-
sizes[i] = get_plane_size(&ctx->d_frame, i);
275+
unsigned int size = (wh * fmt->depth[i]) / 8;
276+
if (pixm)
277+
sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
278+
else
279+
sizes[i] = size;
271280
allocators[i] = ctx->fimc_dev->alloc_ctx;
272281
}
273282

@@ -1383,7 +1392,7 @@ static int fimc_subdev_set_crop(struct v4l2_subdev *sd,
13831392
fimc_capture_try_crop(ctx, r, crop->pad);
13841393

13851394
if (crop->which == V4L2_SUBDEV_FORMAT_TRY) {
1386-
mutex_lock(&fimc->lock);
1395+
mutex_unlock(&fimc->lock);
13871396
*v4l2_subdev_get_try_crop(fh, crop->pad) = *r;
13881397
return 0;
13891398
}

0 commit comments

Comments
 (0)