Skip to content

Commit 0fdd951

Browse files
committed
Merge tag 'media/v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: "This series is larger than I would like to submit for -rc4. My original intent were to sent it to either -rc2 or -rc3. Unfortunately, due to my vacations, I got a lot of pending stuff after my return, and had to do some biz trips, with prevented me to send this earlier. Several fixes: - some fixes at atomisp staging driver - several gcc 7 warning fixes - cleanup media SVG files, in order to fix PDF build on some distros - fix random Kconfig build of venus driver - some fixes for the venus driver - some changes from semaphone to mutex in ngene's driver - some locking fixes at dib0700 driver - several fixes on ngene's driver and frontends to make it properly support some new boards added on Kernel 4.13 - some fixes to CEC drivers - omap_vout: vrfb: convert to dmaengine - docs-rst: document EBUSY for VIDIOC_S_FMT Please notice that the big diffstat changes here are at the SVG files. Visually, the images look the same, but the file size is now a lot smaller than before, and they don't use some XML tags that would cause them to be badly parsed by some ImageMagick versions, or to require a lot of memory by TeTex, with would break PDF output on some distributions" * tag 'media/v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (68 commits) media: atomisp2: array underflow in imx_enum_frame_size() media: atomisp2: array underflow in ap1302_enum_frame_size() media: atomisp2: Array underflow in atomisp_enum_input() media: platform: davinci: drop VPFE_CMD_S_CCDC_RAW_PARAMS media: platform: davinci: return -EINVAL for VPFE_CMD_S_CCDC_RAW_PARAMS ioctl media: venus: don't abuse dma_alloc for non-DMA allocations media: venus: hfi: fix error handling in hfi_sys_init_done() media: venus: fix compile-test build on non-qcom ARM platform media: venus: mark PM functions as __maybe_unused media: cec-notifier: small improvements media: pulse8-cec: persistent_config should be off by default media: cec: cec_transmit_attempt_done: ignore CEC_TX_STATUS_MAX_RETRIES media: staging: atomisp: array underflow in ioctl media: lirc: LIRC_GET_REC_RESOLUTION should return microseconds media: svg: avoid too long lines media: svg files: simplify files media: selection.svg: simplify the SVG file media: vimc: set id_table for platform drivers media: staging: atomisp: disable warnings with cc-disable-warning media: davinci: variable 'common' set but not used ...
2 parents aab7761 + 8033120 commit 0fdd951

File tree

91 files changed

+5162
-14173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+5162
-14173
lines changed

Documentation/media/kapi/dtv-core.rst

Lines changed: 441 additions & 2 deletions
Large diffs are not rendered by default.

Documentation/media/typical_media_device.svg

Lines changed: 106 additions & 2948 deletions
Loading

Documentation/media/uapi/dvb/dvbstb.svg

Lines changed: 17 additions & 651 deletions
Loading

Documentation/media/uapi/v4l/bayer.svg

Lines changed: 29 additions & 984 deletions
Loading

Documentation/media/uapi/v4l/constraints.svg

Lines changed: 10 additions & 346 deletions
Loading

Documentation/media/uapi/v4l/crop.svg

Lines changed: 127 additions & 126 deletions
Loading

Documentation/media/uapi/v4l/fieldseq_bt.svg

Lines changed: 85 additions & 85 deletions
Loading

Documentation/media/uapi/v4l/fieldseq_tb.svg

Lines changed: 89 additions & 86 deletions
Loading

Documentation/media/uapi/v4l/nv12mt.svg

Lines changed: 382 additions & 382 deletions
Loading

Documentation/media/uapi/v4l/nv12mt_example.svg

Lines changed: 1237 additions & 1237 deletions
Loading

Documentation/media/uapi/v4l/selection.svg

Lines changed: 1148 additions & 5809 deletions
Loading

Documentation/media/uapi/v4l/subdev-image-processing-crop.svg

Lines changed: 5 additions & 5 deletions
Loading

Documentation/media/uapi/v4l/subdev-image-processing-full.svg

Lines changed: 5 additions & 5 deletions
Loading

Documentation/media/uapi/v4l/subdev-image-processing-scaling-multi-source.svg

Lines changed: 5 additions & 5 deletions
Loading

Documentation/media/uapi/v4l/vbi_525.svg

Lines changed: 308 additions & 306 deletions
Loading

Documentation/media/uapi/v4l/vbi_625.svg

Lines changed: 196 additions & 192 deletions
Loading

Documentation/media/uapi/v4l/vbi_hsync.svg

Lines changed: 119 additions & 119 deletions
Loading

Documentation/media/uapi/v4l/vidioc-g-fmt.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,9 @@ appropriately. The generic error codes are described at the
147147
EINVAL
148148
The struct :c:type:`v4l2_format` ``type`` field is
149149
invalid or the requested buffer type not supported.
150+
151+
EBUSY
152+
The device is busy and cannot change the format. This could be
153+
because or the device is streaming or buffers are allocated or
154+
queued to the driver. Relevant for :ref:`VIDIOC_S_FMT
155+
<VIDIOC_G_FMT>` only.

Documentation/media/v4l-drivers/imx.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,9 @@ References
607607
608608
Authors
609609
-------
610-
Steve Longerbeam <steve_longerbeam@mentor.com>
611-
Philipp Zabel <kernel@pengutronix.de>
612-
Russell King <linux@armlinux.org.uk>
610+
611+
- Steve Longerbeam <steve_longerbeam@mentor.com>
612+
- Philipp Zabel <kernel@pengutronix.de>
613+
- Russell King <linux@armlinux.org.uk>
613614

614615
Copyright (C) 2012-2017 Mentor Graphics Inc.

Documentation/media/v4l-drivers/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ For more details see the file COPYING in the source distribution of Linux.
4141
cx88
4242
davinci-vpbe
4343
fimc
44+
imx
4445
ivtv
4546
max2175
4647
meye

drivers/media/cec/cec-adap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ EXPORT_SYMBOL_GPL(cec_transmit_done);
559559

560560
void cec_transmit_attempt_done(struct cec_adapter *adap, u8 status)
561561
{
562-
switch (status) {
562+
switch (status & ~CEC_TX_STATUS_MAX_RETRIES) {
563563
case CEC_TX_STATUS_OK:
564564
cec_transmit_done(adap, status, 0, 0, 0, 0);
565565
return;

drivers/media/cec/cec-notifier.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ EXPORT_SYMBOL_GPL(cec_notifier_put);
8787

8888
void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa)
8989
{
90+
if (n == NULL)
91+
return;
92+
9093
mutex_lock(&n->lock);
9194
n->phys_addr = pa;
9295
if (n->callback)
@@ -100,6 +103,9 @@ void cec_notifier_set_phys_addr_from_edid(struct cec_notifier *n,
100103
{
101104
u16 pa = CEC_PHYS_ADDR_INVALID;
102105

106+
if (n == NULL)
107+
return;
108+
103109
if (edid && edid->extensions)
104110
pa = cec_get_edid_phys_addr((const u8 *)edid,
105111
EDID_LENGTH * (edid->extensions + 1), NULL);

drivers/media/dvb-core/dvb_ca_en50221.c

Lines changed: 89 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot)
349349
/* read the buffer size from the CAM */
350350
if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN | CMDREG_SR)) != 0)
351351
return ret;
352-
if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ / 10)) != 0)
352+
ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ);
353+
if (ret != 0)
353354
return ret;
354355
if ((ret = dvb_ca_en50221_read_data(ca, slot, buf, 2)) != 2)
355356
return -EIO;
@@ -644,72 +645,101 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot,
644645
}
645646
buf_free = dvb_ringbuffer_free(&ca->slot_info[slot].rx_buffer);
646647

647-
if (buf_free < (ca->slot_info[slot].link_buf_size + DVB_RINGBUFFER_PKTHDRSIZE)) {
648+
if (buf_free < (ca->slot_info[slot].link_buf_size +
649+
DVB_RINGBUFFER_PKTHDRSIZE)) {
648650
status = -EAGAIN;
649651
goto exit;
650652
}
651653
}
652654

653-
/* check if there is data available */
654-
if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
655-
goto exit;
656-
if (!(status & STATUSREG_DA)) {
657-
/* no data */
658-
status = 0;
659-
goto exit;
660-
}
661-
662-
/* read the amount of data */
663-
if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_HIGH)) < 0)
664-
goto exit;
665-
bytes_read = status << 8;
666-
if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_SIZE_LOW)) < 0)
667-
goto exit;
668-
bytes_read |= status;
655+
if (ca->pub->read_data &&
656+
(ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_LINKINIT)) {
657+
if (ebuf == NULL)
658+
status = ca->pub->read_data(ca->pub, slot, buf,
659+
sizeof(buf));
660+
else
661+
status = ca->pub->read_data(ca->pub, slot, buf, ecount);
662+
if (status < 0)
663+
return status;
664+
bytes_read = status;
665+
if (status == 0)
666+
goto exit;
667+
} else {
669668

670-
/* check it will fit */
671-
if (ebuf == NULL) {
672-
if (bytes_read > ca->slot_info[slot].link_buf_size) {
673-
pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the link buffer size (%i > %i)!\n",
674-
ca->dvbdev->adapter->num, bytes_read,
675-
ca->slot_info[slot].link_buf_size);
676-
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
677-
status = -EIO;
669+
/* check if there is data available */
670+
status = ca->pub->read_cam_control(ca->pub, slot,
671+
CTRLIF_STATUS);
672+
if (status < 0)
678673
goto exit;
679-
}
680-
if (bytes_read < 2) {
681-
pr_err("dvb_ca adapter %d: CAM sent a buffer that was less than 2 bytes!\n",
682-
ca->dvbdev->adapter->num);
683-
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
684-
status = -EIO;
674+
if (!(status & STATUSREG_DA)) {
675+
/* no data */
676+
status = 0;
685677
goto exit;
686678
}
687-
} else {
688-
if (bytes_read > ecount) {
689-
pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the ecount size!\n",
690-
ca->dvbdev->adapter->num);
691-
status = -EIO;
679+
680+
/* read the amount of data */
681+
status = ca->pub->read_cam_control(ca->pub, slot,
682+
CTRLIF_SIZE_HIGH);
683+
if (status < 0)
684+
goto exit;
685+
bytes_read = status << 8;
686+
status = ca->pub->read_cam_control(ca->pub, slot,
687+
CTRLIF_SIZE_LOW);
688+
if (status < 0)
692689
goto exit;
690+
bytes_read |= status;
691+
692+
/* check it will fit */
693+
if (ebuf == NULL) {
694+
if (bytes_read > ca->slot_info[slot].link_buf_size) {
695+
pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the link buffer size (%i > %i)!\n",
696+
ca->dvbdev->adapter->num, bytes_read,
697+
ca->slot_info[slot].link_buf_size);
698+
ca->slot_info[slot].slot_state =
699+
DVB_CA_SLOTSTATE_LINKINIT;
700+
status = -EIO;
701+
goto exit;
702+
}
703+
if (bytes_read < 2) {
704+
pr_err("dvb_ca adapter %d: CAM sent a buffer that was less than 2 bytes!\n",
705+
ca->dvbdev->adapter->num);
706+
ca->slot_info[slot].slot_state =
707+
DVB_CA_SLOTSTATE_LINKINIT;
708+
status = -EIO;
709+
goto exit;
710+
}
711+
} else {
712+
if (bytes_read > ecount) {
713+
pr_err("dvb_ca adapter %d: CAM tried to send a buffer larger than the ecount size!\n",
714+
ca->dvbdev->adapter->num);
715+
status = -EIO;
716+
goto exit;
717+
}
693718
}
694-
}
695719

696-
/* fill the buffer */
697-
for (i = 0; i < bytes_read; i++) {
698-
/* read byte and check */
699-
if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_DATA)) < 0)
700-
goto exit;
720+
/* fill the buffer */
721+
for (i = 0; i < bytes_read; i++) {
722+
/* read byte and check */
723+
status = ca->pub->read_cam_control(ca->pub, slot,
724+
CTRLIF_DATA);
725+
if (status < 0)
726+
goto exit;
701727

702-
/* OK, store it in the buffer */
703-
buf[i] = status;
704-
}
728+
/* OK, store it in the buffer */
729+
buf[i] = status;
730+
}
705731

706-
/* check for read error (RE should now be 0) */
707-
if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
708-
goto exit;
709-
if (status & STATUSREG_RE) {
710-
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_LINKINIT;
711-
status = -EIO;
712-
goto exit;
732+
/* check for read error (RE should now be 0) */
733+
status = ca->pub->read_cam_control(ca->pub, slot,
734+
CTRLIF_STATUS);
735+
if (status < 0)
736+
goto exit;
737+
if (status & STATUSREG_RE) {
738+
ca->slot_info[slot].slot_state =
739+
DVB_CA_SLOTSTATE_LINKINIT;
740+
status = -EIO;
741+
goto exit;
742+
}
713743
}
714744

715745
/* OK, add it to the receive buffer, or copy into external buffer if supplied */
@@ -762,6 +792,10 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,
762792
if (bytes_write > ca->slot_info[slot].link_buf_size)
763793
return -EINVAL;
764794

795+
if (ca->pub->write_data &&
796+
(ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_LINKINIT))
797+
return ca->pub->write_data(ca->pub, slot, buf, bytes_write);
798+
765799
/* it is possible we are dealing with a single buffer implementation,
766800
thus if there is data available for read or if there is even a read
767801
already in progress, we do nothing but awake the kernel thread to
@@ -1176,7 +1210,8 @@ static int dvb_ca_en50221_thread(void *data)
11761210

11771211
pr_err("dvb_ca adapter %d: DVB CAM link initialisation failed :(\n",
11781212
ca->dvbdev->adapter->num);
1179-
ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID;
1213+
ca->slot_info[slot].slot_state =
1214+
DVB_CA_SLOTSTATE_UNINITIALISED;
11801215
dvb_ca_en50221_thread_update_delay(ca);
11811216
break;
11821217
}

drivers/media/dvb-core/dvb_ca_en50221.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
* @write_attribute_mem: function for writing attribute memory on the CAM
4242
* @read_cam_control: function for reading the control interface on the CAM
4343
* @write_cam_control: function for reading the control interface on the CAM
44+
* @read_data: function for reading data (block mode)
45+
* @write_data: function for writing data (block mode)
4446
* @slot_reset: function to reset the CAM slot
4547
* @slot_shutdown: function to shutdown a CAM slot
4648
* @slot_ts_enable: function to enable the Transport Stream on a CAM slot
@@ -66,6 +68,11 @@ struct dvb_ca_en50221 {
6668
int (*write_cam_control)(struct dvb_ca_en50221 *ca,
6769
int slot, u8 address, u8 value);
6870

71+
int (*read_data)(struct dvb_ca_en50221 *ca,
72+
int slot, u8 *ebuf, int ecount);
73+
int (*write_data)(struct dvb_ca_en50221 *ca,
74+
int slot, u8 *ebuf, int ecount);
75+
6976
int (*slot_reset)(struct dvb_ca_en50221 *ca, int slot);
7077
int (*slot_shutdown)(struct dvb_ca_en50221 *ca, int slot);
7178
int (*slot_ts_enable)(struct dvb_ca_en50221 *ca, int slot);

drivers/media/dvb-frontends/cxd2841er.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3279,7 +3279,10 @@ static int cxd2841er_get_frontend(struct dvb_frontend *fe,
32793279
else if (priv->state == STATE_ACTIVE_TC)
32803280
cxd2841er_read_status_tc(fe, &status);
32813281

3282-
cxd2841er_read_signal_strength(fe);
3282+
if (priv->state == STATE_ACTIVE_TC || priv->state == STATE_ACTIVE_S)
3283+
cxd2841er_read_signal_strength(fe);
3284+
else
3285+
p->strength.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
32833286

32843287
if (status & FE_HAS_LOCK) {
32853288
cxd2841er_read_snr(fe);

drivers/media/dvb-frontends/drx39xyj/drx_driver.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ int drxbsp_tuner_default_i2c_write_read(struct tuner_instance *tuner,
307307
* \def DRX_UNKNOWN
308308
* \brief Generic UNKNOWN value for DRX enumerated types.
309309
*
310-
* Used to indicate that the parameter value is unknown or not yet initalized.
310+
* Used to indicate that the parameter value is unknown or not yet initialized.
311311
*/
312312
#ifndef DRX_UNKNOWN
313313
#define DRX_UNKNOWN (254)
@@ -449,19 +449,6 @@ MACROS
449449
#define DRX_16TO8(x) ((u8) (((u16)x) & 0xFF)), \
450450
((u8)((((u16)x)>>8)&0xFF))
451451

452-
/**
453-
* \brief Macro to sign extend signed 9 bit value to signed 16 bit value
454-
*/
455-
#define DRX_S9TOS16(x) ((((u16)x)&0x100) ? ((s16)((u16)(x)|0xFF00)) : (x))
456-
457-
/**
458-
* \brief Macro to sign extend signed 9 bit value to signed 16 bit value
459-
*/
460-
#define DRX_S24TODRXFREQ(x) ((((u32) x) & 0x00800000UL) ? \
461-
((s32) \
462-
(((u32) x) | 0xFF000000)) : \
463-
((s32) x))
464-
465452
/**
466453
* \brief Macro to convert 16 bit register value to a s32
467454
*/

drivers/media/dvb-frontends/lnbh25.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ static int lnbh25_read_vmon(struct lnbh25_priv *priv)
7676
return ret;
7777
}
7878
}
79-
print_hex_dump_bytes("lnbh25_read_vmon: ",
80-
DUMP_PREFIX_OFFSET, status, sizeof(status));
79+
dev_dbg(&priv->i2c->dev, "%s(): %*ph\n",
80+
__func__, (int) sizeof(status), status);
8181
if ((status[0] & (LNBH25_STATUS_OFL | LNBH25_STATUS_VMON)) != 0) {
8282
dev_err(&priv->i2c->dev,
8383
"%s(): voltage in failure state, status reg 0x%x\n",
@@ -178,7 +178,7 @@ struct dvb_frontend *lnbh25_attach(struct dvb_frontend *fe,
178178
fe->ops.release_sec = lnbh25_release;
179179
fe->ops.set_voltage = lnbh25_set_voltage;
180180

181-
dev_err(&i2c->dev, "%s(): attached at I2C addr 0x%02x\n",
181+
dev_info(&i2c->dev, "%s(): attached at I2C addr 0x%02x\n",
182182
__func__, priv->i2c_address);
183183
return fe;
184184
}

0 commit comments

Comments
 (0)