Skip to content

Commit d095b18

Browse files
committed
Merge tag 'media/v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab. * tag 'media/v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: pci: mgb4: add COMMON_CLK dependency media: v4l2-subdev: Fix a 64bit bug media: mgb4: Added support for T200 card variant media: vsp1: Remove unbalanced .s_stream(0) calls
2 parents 2cc14f5 + 32138be commit d095b18

8 files changed

Lines changed: 31 additions & 45 deletions

File tree

drivers/media/pci/mgb4/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config VIDEO_MGB4
33
tristate "Digiteq Automotive MGB4 support"
44
depends on VIDEO_DEV && PCI && I2C && DMADEVICES && SPI && MTD && IIO
5+
depends on COMMON_CLK
56
select VIDEOBUF2_DMA_SG
67
select IIO_BUFFER
78
select IIO_TRIGGERED_BUFFER

drivers/media/pci/mgb4/mgb4_core.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242

4343
#define MGB4_USER_IRQS 16
4444

45+
#define DIGITEQ_VID 0x1ed8
46+
#define T100_DID 0x0101
47+
#define T200_DID 0x0201
48+
4549
ATTRIBUTE_GROUPS(mgb4_pci);
4650

4751
static int flashid;
@@ -151,7 +155,7 @@ static struct spi_master *get_spi_adap(struct platform_device *pdev)
151155
return dev ? container_of(dev, struct spi_master, dev) : NULL;
152156
}
153157

154-
static int init_spi(struct mgb4_dev *mgbdev)
158+
static int init_spi(struct mgb4_dev *mgbdev, u32 devid)
155159
{
156160
struct resource spi_resources[] = {
157161
{
@@ -213,8 +217,13 @@ static int init_spi(struct mgb4_dev *mgbdev)
213217
snprintf(mgbdev->fw_part_name, sizeof(mgbdev->fw_part_name),
214218
"mgb4-fw.%d", flashid);
215219
mgbdev->partitions[0].name = mgbdev->fw_part_name;
216-
mgbdev->partitions[0].size = 0x400000;
217-
mgbdev->partitions[0].offset = 0x400000;
220+
if (devid == T200_DID) {
221+
mgbdev->partitions[0].size = 0x950000;
222+
mgbdev->partitions[0].offset = 0x1000000;
223+
} else {
224+
mgbdev->partitions[0].size = 0x400000;
225+
mgbdev->partitions[0].offset = 0x400000;
226+
}
218227
mgbdev->partitions[0].mask_flags = 0;
219228

220229
snprintf(mgbdev->data_part_name, sizeof(mgbdev->data_part_name),
@@ -551,7 +560,7 @@ static int mgb4_probe(struct pci_dev *pdev, const struct pci_device_id *id)
551560
goto err_video_regs;
552561

553562
/* SPI FLASH */
554-
rv = init_spi(mgbdev);
563+
rv = init_spi(mgbdev, id->device);
555564
if (rv < 0)
556565
goto err_cmt_regs;
557566

@@ -666,7 +675,8 @@ static void mgb4_remove(struct pci_dev *pdev)
666675
}
667676

668677
static const struct pci_device_id mgb4_pci_ids[] = {
669-
{ PCI_DEVICE(0x1ed8, 0x0101), },
678+
{ PCI_DEVICE(DIGITEQ_VID, T100_DID), },
679+
{ PCI_DEVICE(DIGITEQ_VID, T200_DID), },
670680
{ 0, }
671681
};
672682
MODULE_DEVICE_TABLE(pci, mgb4_pci_ids);

drivers/media/platform/renesas/vsp1/vsp1_pipe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ int vsp1_pipeline_stop(struct vsp1_pipeline *pipe)
373373
(7 << VI6_DPR_SMPPT_TGW_SHIFT) |
374374
(VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
375375

376-
v4l2_subdev_call(&pipe->output->entity.subdev, video, s_stream, 0);
376+
vsp1_wpf_stop(pipe->output);
377377

378378
return ret;
379379
}

drivers/media/platform/renesas/vsp1/vsp1_rpf.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ static inline void vsp1_rpf_write(struct vsp1_rwpf *rpf,
4343
data);
4444
}
4545

46-
/* -----------------------------------------------------------------------------
47-
* V4L2 Subdevice Operations
48-
*/
49-
50-
static const struct v4l2_subdev_ops rpf_ops = {
51-
.pad = &vsp1_rwpf_pad_ops,
52-
};
53-
5446
/* -----------------------------------------------------------------------------
5547
* VSP1 Entity Operations
5648
*/
@@ -411,7 +403,7 @@ struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index)
411403
rpf->entity.index = index;
412404

413405
sprintf(name, "rpf.%u", index);
414-
ret = vsp1_entity_init(vsp1, &rpf->entity, name, 2, &rpf_ops,
406+
ret = vsp1_entity_init(vsp1, &rpf->entity, name, 2, &vsp1_rwpf_subdev_ops,
415407
MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
416408
if (ret < 0)
417409
return ERR_PTR(ret);

drivers/media/platform/renesas/vsp1/vsp1_rwpf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
2424
}
2525

2626
/* -----------------------------------------------------------------------------
27-
* V4L2 Subdevice Pad Operations
27+
* V4L2 Subdevice Operations
2828
*/
2929

3030
static int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
@@ -243,7 +243,7 @@ static int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
243243
return ret;
244244
}
245245

246-
const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = {
246+
static const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = {
247247
.init_cfg = vsp1_entity_init_cfg,
248248
.enum_mbus_code = vsp1_rwpf_enum_mbus_code,
249249
.enum_frame_size = vsp1_rwpf_enum_frame_size,
@@ -253,6 +253,10 @@ const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = {
253253
.set_selection = vsp1_rwpf_set_selection,
254254
};
255255

256+
const struct v4l2_subdev_ops vsp1_rwpf_subdev_ops = {
257+
.pad = &vsp1_rwpf_pad_ops,
258+
};
259+
256260
/* -----------------------------------------------------------------------------
257261
* Controls
258262
*/

drivers/media/platform/renesas/vsp1/vsp1_rwpf.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ static inline struct vsp1_rwpf *entity_to_rwpf(struct vsp1_entity *entity)
7979
struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index);
8080
struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index);
8181

82+
void vsp1_wpf_stop(struct vsp1_rwpf *wpf);
83+
8284
int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf, unsigned int ncontrols);
8385

84-
extern const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops;
86+
extern const struct v4l2_subdev_ops vsp1_rwpf_subdev_ops;
8587

8688
struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
8789
struct v4l2_subdev_state *sd_state);

drivers/media/platform/renesas/vsp1/vsp1_wpf.c

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -186,45 +186,22 @@ static int wpf_init_controls(struct vsp1_rwpf *wpf)
186186
}
187187

188188
/* -----------------------------------------------------------------------------
189-
* V4L2 Subdevice Core Operations
189+
* VSP1 Entity Operations
190190
*/
191191

192-
static int wpf_s_stream(struct v4l2_subdev *subdev, int enable)
192+
void vsp1_wpf_stop(struct vsp1_rwpf *wpf)
193193
{
194-
struct vsp1_rwpf *wpf = to_rwpf(subdev);
195194
struct vsp1_device *vsp1 = wpf->entity.vsp1;
196195

197-
if (enable)
198-
return 0;
199-
200196
/*
201197
* Write to registers directly when stopping the stream as there will be
202198
* no pipeline run to apply the display list.
203199
*/
204200
vsp1_write(vsp1, VI6_WPF_IRQ_ENB(wpf->entity.index), 0);
205201
vsp1_write(vsp1, wpf->entity.index * VI6_WPF_OFFSET +
206202
VI6_WPF_SRCRPF, 0);
207-
208-
return 0;
209203
}
210204

211-
/* -----------------------------------------------------------------------------
212-
* V4L2 Subdevice Operations
213-
*/
214-
215-
static const struct v4l2_subdev_video_ops wpf_video_ops = {
216-
.s_stream = wpf_s_stream,
217-
};
218-
219-
static const struct v4l2_subdev_ops wpf_ops = {
220-
.video = &wpf_video_ops,
221-
.pad = &vsp1_rwpf_pad_ops,
222-
};
223-
224-
/* -----------------------------------------------------------------------------
225-
* VSP1 Entity Operations
226-
*/
227-
228205
static void vsp1_wpf_destroy(struct vsp1_entity *entity)
229206
{
230207
struct vsp1_rwpf *wpf = entity_to_rwpf(entity);
@@ -583,7 +560,7 @@ struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index)
583560
wpf->entity.index = index;
584561

585562
sprintf(name, "wpf.%u", index);
586-
ret = vsp1_entity_init(vsp1, &wpf->entity, name, 2, &wpf_ops,
563+
ret = vsp1_entity_init(vsp1, &wpf->entity, name, 2, &vsp1_rwpf_subdev_ops,
587564
MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
588565
if (ret < 0)
589566
return ERR_PTR(ret);

include/uapi/linux/v4l2-subdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ struct v4l2_subdev_routing {
239239
* set (which is the default), the 'stream' fields will be forced to 0 by the
240240
* kernel.
241241
*/
242-
#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1U << 0)
242+
#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0)
243243

244244
/**
245245
* struct v4l2_subdev_client_capability - Capabilities of the client accessing

0 commit comments

Comments
 (0)