Commit d5ad8ec3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'media/v5.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:

 - regression fix for the rtl28xxu I2C logic

 - build fix for the atmel driver

 - videobuf2-core: dequeue if start_streaming fails

* tag 'media/v5.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  media: atmel: fix build when ISC=m and XISC=y
  media: videobuf2-core: dequeue if start_streaming fails
  media: rtl28xxu: fix zero-length control request
  media: Revert "media: rtl28xxu: fix zero-length control request"
parents 785ee983 f1de1c78
...@@ -1573,6 +1573,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb, ...@@ -1573,6 +1573,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb,
struct media_request *req) struct media_request *req)
{ {
struct vb2_buffer *vb; struct vb2_buffer *vb;
enum vb2_buffer_state orig_state;
int ret; int ret;
if (q->error) { if (q->error) {
...@@ -1673,6 +1674,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb, ...@@ -1673,6 +1674,7 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb,
* Add to the queued buffers list, a buffer will stay on it until * Add to the queued buffers list, a buffer will stay on it until
* dequeued in dqbuf. * dequeued in dqbuf.
*/ */
orig_state = vb->state;
list_add_tail(&vb->queued_entry, &q->queued_list); list_add_tail(&vb->queued_entry, &q->queued_list);
q->queued_count++; q->queued_count++;
q->waiting_for_buffers = false; q->waiting_for_buffers = false;
...@@ -1703,9 +1705,18 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb, ...@@ -1703,9 +1705,18 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb,
if (q->streaming && !q->start_streaming_called && if (q->streaming && !q->start_streaming_called &&
q->queued_count >= q->min_buffers_needed) { q->queued_count >= q->min_buffers_needed) {
ret = vb2_start_streaming(q); ret = vb2_start_streaming(q);
if (ret) if (ret) {
/*
* Since vb2_core_qbuf will return with an error,
* we should return it to state DEQUEUED since
* the error indicates that the buffer wasn't queued.
*/
list_del(&vb->queued_entry);
q->queued_count--;
vb->state = orig_state;
return ret; return ret;
} }
}
dprintk(q, 2, "qbuf of buffer %d succeeded\n", vb->index); dprintk(q, 2, "qbuf of buffer %d succeeded\n", vb->index);
return 0; return 0;
......
...@@ -8,6 +8,7 @@ config VIDEO_ATMEL_ISC ...@@ -8,6 +8,7 @@ config VIDEO_ATMEL_ISC
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select REGMAP_MMIO select REGMAP_MMIO
select V4L2_FWNODE select V4L2_FWNODE
select VIDEO_ATMEL_ISC_BASE
help help
This module makes the ATMEL Image Sensor Controller available This module makes the ATMEL Image Sensor Controller available
as a v4l2 device. as a v4l2 device.
...@@ -19,10 +20,17 @@ config VIDEO_ATMEL_XISC ...@@ -19,10 +20,17 @@ config VIDEO_ATMEL_XISC
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select REGMAP_MMIO select REGMAP_MMIO
select V4L2_FWNODE select V4L2_FWNODE
select VIDEO_ATMEL_ISC_BASE
help help
This module makes the ATMEL eXtended Image Sensor Controller This module makes the ATMEL eXtended Image Sensor Controller
available as a v4l2 device. available as a v4l2 device.
config VIDEO_ATMEL_ISC_BASE
tristate
default n
help
ATMEL ISC and XISC common code base.
config VIDEO_ATMEL_ISI config VIDEO_ATMEL_ISI
tristate "ATMEL Image Sensor Interface (ISI) support" tristate "ATMEL Image Sensor Interface (ISI) support"
depends on VIDEO_V4L2 && OF depends on VIDEO_V4L2 && OF
......
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
atmel-isc-objs = atmel-sama5d2-isc.o atmel-isc-base.o atmel-isc-objs = atmel-sama5d2-isc.o
atmel-xisc-objs = atmel-sama7g5-isc.o atmel-isc-base.o atmel-xisc-objs = atmel-sama7g5-isc.o
obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel-isi.o obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel-isi.o
obj-$(CONFIG_VIDEO_ATMEL_ISC_BASE) += atmel-isc-base.o
obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel-isc.o obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel-isc.o
obj-$(CONFIG_VIDEO_ATMEL_XISC) += atmel-xisc.o obj-$(CONFIG_VIDEO_ATMEL_XISC) += atmel-xisc.o
...@@ -378,6 +378,7 @@ int isc_clk_init(struct isc_device *isc) ...@@ -378,6 +378,7 @@ int isc_clk_init(struct isc_device *isc)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(isc_clk_init);
void isc_clk_cleanup(struct isc_device *isc) void isc_clk_cleanup(struct isc_device *isc)
{ {
...@@ -392,6 +393,7 @@ void isc_clk_cleanup(struct isc_device *isc) ...@@ -392,6 +393,7 @@ void isc_clk_cleanup(struct isc_device *isc)
clk_unregister(isc_clk->clk); clk_unregister(isc_clk->clk);
} }
} }
EXPORT_SYMBOL_GPL(isc_clk_cleanup);
static int isc_queue_setup(struct vb2_queue *vq, static int isc_queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers, unsigned int *nplanes, unsigned int *nbuffers, unsigned int *nplanes,
...@@ -1578,6 +1580,7 @@ irqreturn_t isc_interrupt(int irq, void *dev_id) ...@@ -1578,6 +1580,7 @@ irqreturn_t isc_interrupt(int irq, void *dev_id)
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(isc_interrupt);
static void isc_hist_count(struct isc_device *isc, u32 *min, u32 *max) static void isc_hist_count(struct isc_device *isc, u32 *min, u32 *max)
{ {
...@@ -2212,6 +2215,7 @@ const struct v4l2_async_notifier_operations isc_async_ops = { ...@@ -2212,6 +2215,7 @@ const struct v4l2_async_notifier_operations isc_async_ops = {
.unbind = isc_async_unbind, .unbind = isc_async_unbind,
.complete = isc_async_complete, .complete = isc_async_complete,
}; };
EXPORT_SYMBOL_GPL(isc_async_ops);
void isc_subdev_cleanup(struct isc_device *isc) void isc_subdev_cleanup(struct isc_device *isc)
{ {
...@@ -2224,6 +2228,7 @@ void isc_subdev_cleanup(struct isc_device *isc) ...@@ -2224,6 +2228,7 @@ void isc_subdev_cleanup(struct isc_device *isc)
INIT_LIST_HEAD(&isc->subdev_entities); INIT_LIST_HEAD(&isc->subdev_entities);
} }
EXPORT_SYMBOL_GPL(isc_subdev_cleanup);
int isc_pipeline_init(struct isc_device *isc) int isc_pipeline_init(struct isc_device *isc)
{ {
...@@ -2264,6 +2269,7 @@ int isc_pipeline_init(struct isc_device *isc) ...@@ -2264,6 +2269,7 @@ int isc_pipeline_init(struct isc_device *isc)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(isc_pipeline_init);
/* regmap configuration */ /* regmap configuration */
#define ATMEL_ISC_REG_MAX 0xd5c #define ATMEL_ISC_REG_MAX 0xd5c
...@@ -2273,4 +2279,9 @@ const struct regmap_config isc_regmap_config = { ...@@ -2273,4 +2279,9 @@ const struct regmap_config isc_regmap_config = {
.val_bits = 32, .val_bits = 32,
.max_register = ATMEL_ISC_REG_MAX, .max_register = ATMEL_ISC_REG_MAX,
}; };
EXPORT_SYMBOL_GPL(isc_regmap_config);
MODULE_AUTHOR("Songjun Wu");
MODULE_AUTHOR("Eugen Hristev");
MODULE_DESCRIPTION("Atmel ISC common code base");
MODULE_LICENSE("GPL v2");
...@@ -37,7 +37,16 @@ static int rtl28xxu_ctrl_msg(struct dvb_usb_device *d, struct rtl28xxu_req *req) ...@@ -37,7 +37,16 @@ static int rtl28xxu_ctrl_msg(struct dvb_usb_device *d, struct rtl28xxu_req *req)
} else { } else {
/* read */ /* read */
requesttype = (USB_TYPE_VENDOR | USB_DIR_IN); requesttype = (USB_TYPE_VENDOR | USB_DIR_IN);
/*
* Zero-length transfers must use usb_sndctrlpipe() and
* rtl28xxu_identify_state() uses a zero-length i2c read
* command to determine the chip type.
*/
if (req->size)
pipe = usb_rcvctrlpipe(d->udev, 0); pipe = usb_rcvctrlpipe(d->udev, 0);
else
pipe = usb_sndctrlpipe(d->udev, 0);
} }
ret = usb_control_msg(d->udev, pipe, 0, requesttype, req->value, ret = usb_control_msg(d->udev, pipe, 0, requesttype, req->value,
...@@ -612,9 +621,8 @@ static int rtl28xxu_read_config(struct dvb_usb_device *d) ...@@ -612,9 +621,8 @@ static int rtl28xxu_read_config(struct dvb_usb_device *d)
static int rtl28xxu_identify_state(struct dvb_usb_device *d, const char **name) static int rtl28xxu_identify_state(struct dvb_usb_device *d, const char **name)
{ {
struct rtl28xxu_dev *dev = d_to_priv(d); struct rtl28xxu_dev *dev = d_to_priv(d);
u8 buf[1];
int ret; int ret;
struct rtl28xxu_req req_demod_i2c = {0x0020, CMD_I2C_DA_RD, 1, buf}; struct rtl28xxu_req req_demod_i2c = {0x0020, CMD_I2C_DA_RD, 0, NULL};
dev_dbg(&d->intf->dev, "\n"); dev_dbg(&d->intf->dev, "\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment