Skip to content

Commit c02d7da

Browse files
committed
Merge tag 'media/v4.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: "Three driver fixes: - fix for omap4, fixing a regression due to a subsystem API that got removed for 4.1 (commit efde234); - fix for one of the formats supported by Marvel ccic driver; - fix rcar_vin driver that, when stopping abnormally, the driver can't return from wait_for_completion" * tag 'media/v4.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: [media] v4l: omap4iss: Replace outdated OMAP4 control pad API with syscon [media] media: soc_camera: rcar_vin: Fix wait_for_completion [media] marvell-ccic: fix Y'CbCr ordering
2 parents 5ebe6af + fefad2d commit c02d7da

File tree

7 files changed

+40
-17
lines changed

7 files changed

+40
-17
lines changed

drivers/media/platform/marvell-ccic/mcam-core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ static struct mcam_format_struct {
116116
.planar = false,
117117
},
118118
{
119-
.desc = "UYVY 4:2:2",
120-
.pixelformat = V4L2_PIX_FMT_UYVY,
119+
.desc = "YVYU 4:2:2",
120+
.pixelformat = V4L2_PIX_FMT_YVYU,
121121
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
122122
.bpp = 2,
123123
.planar = false,
@@ -748,7 +748,7 @@ static void mcam_ctlr_image(struct mcam_camera *cam)
748748

749749
switch (fmt->pixelformat) {
750750
case V4L2_PIX_FMT_YUYV:
751-
case V4L2_PIX_FMT_UYVY:
751+
case V4L2_PIX_FMT_YVYU:
752752
widthy = fmt->width * 2;
753753
widthuv = 0;
754754
break;
@@ -784,15 +784,15 @@ static void mcam_ctlr_image(struct mcam_camera *cam)
784784
case V4L2_PIX_FMT_YUV420:
785785
case V4L2_PIX_FMT_YVU420:
786786
mcam_reg_write_mask(cam, REG_CTRL0,
787-
C0_DF_YUV | C0_YUV_420PL | C0_YUVE_YVYU, C0_DF_MASK);
787+
C0_DF_YUV | C0_YUV_420PL | C0_YUVE_VYUY, C0_DF_MASK);
788788
break;
789789
case V4L2_PIX_FMT_YUYV:
790790
mcam_reg_write_mask(cam, REG_CTRL0,
791-
C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_UYVY, C0_DF_MASK);
791+
C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_NOSWAP, C0_DF_MASK);
792792
break;
793-
case V4L2_PIX_FMT_UYVY:
793+
case V4L2_PIX_FMT_YVYU:
794794
mcam_reg_write_mask(cam, REG_CTRL0,
795-
C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_YUYV, C0_DF_MASK);
795+
C0_DF_YUV | C0_YUV_PACKED | C0_YUVE_SWAP24, C0_DF_MASK);
796796
break;
797797
case V4L2_PIX_FMT_JPEG:
798798
mcam_reg_write_mask(cam, REG_CTRL0,

drivers/media/platform/marvell-ccic/mcam-core.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,10 @@ int mccic_resume(struct mcam_camera *cam);
330330
#define C0_YUVE_YVYU 0x00010000 /* Y1CrY0Cb */
331331
#define C0_YUVE_VYUY 0x00020000 /* CrY1CbY0 */
332332
#define C0_YUVE_UYVY 0x00030000 /* CbY1CrY0 */
333-
#define C0_YUVE_XYUV 0x00000000 /* 420: .YUV */
334-
#define C0_YUVE_XYVU 0x00010000 /* 420: .YVU */
335-
#define C0_YUVE_XUVY 0x00020000 /* 420: .UVY */
336-
#define C0_YUVE_XVUY 0x00030000 /* 420: .VUY */
333+
#define C0_YUVE_NOSWAP 0x00000000 /* no bytes swapping */
334+
#define C0_YUVE_SWAP13 0x00010000 /* swap byte 1 and 3 */
335+
#define C0_YUVE_SWAP24 0x00020000 /* swap byte 2 and 4 */
336+
#define C0_YUVE_SWAP1324 0x00030000 /* swap bytes 1&3 and 2&4 */
337337
/* Bayer bits 18,19 if needed */
338338
#define C0_EOF_VSYNC 0x00400000 /* Generate EOF by VSYNC */
339339
#define C0_VEDGE_CTRL 0x00800000 /* Detect falling edge of VSYNC */

drivers/media/platform/soc_camera/rcar_vin.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@
135135
#define VIN_MAX_WIDTH 2048
136136
#define VIN_MAX_HEIGHT 2048
137137

138+
#define TIMEOUT_MS 100
139+
138140
enum chip_id {
139141
RCAR_GEN2,
140142
RCAR_H1,
@@ -820,7 +822,10 @@ static void rcar_vin_wait_stop_streaming(struct rcar_vin_priv *priv)
820822
if (priv->state == STOPPING) {
821823
priv->request_to_stop = true;
822824
spin_unlock_irq(&priv->lock);
823-
wait_for_completion(&priv->capture_stop);
825+
if (!wait_for_completion_timeout(
826+
&priv->capture_stop,
827+
msecs_to_jiffies(TIMEOUT_MS)))
828+
priv->state = STOPPED;
824829
spin_lock_irq(&priv->lock);
825830
}
826831
}

drivers/staging/media/omap4iss/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ config VIDEO_OMAP4
22
bool "OMAP 4 Camera support"
33
depends on VIDEO_V4L2=y && VIDEO_V4L2_SUBDEV_API && I2C=y && ARCH_OMAP4
44
depends on HAS_DMA
5+
select MFD_SYSCON
56
select VIDEOBUF2_DMA_CONTIG
67
---help---
78
Driver for an OMAP 4 ISS controller.

drivers/staging/media/omap4iss/iss.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/dma-mapping.h>
1818
#include <linux/i2c.h>
1919
#include <linux/interrupt.h>
20+
#include <linux/mfd/syscon.h>
2021
#include <linux/module.h>
2122
#include <linux/platform_device.h>
2223
#include <linux/slab.h>
@@ -1386,6 +1387,16 @@ static int iss_probe(struct platform_device *pdev)
13861387

13871388
platform_set_drvdata(pdev, iss);
13881389

1390+
/*
1391+
* TODO: When implementing DT support switch to syscon regmap lookup by
1392+
* phandle.
1393+
*/
1394+
iss->syscon = syscon_regmap_lookup_by_compatible("syscon");
1395+
if (IS_ERR(iss->syscon)) {
1396+
ret = PTR_ERR(iss->syscon);
1397+
goto error;
1398+
}
1399+
13891400
/* Clocks */
13901401
ret = iss_map_mem_resource(pdev, iss, OMAP4_ISS_MEM_TOP);
13911402
if (ret < 0)

drivers/staging/media/omap4iss/iss.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include "iss_ipipe.h"
3030
#include "iss_resizer.h"
3131

32+
struct regmap;
33+
3234
#define to_iss_device(ptr_module) \
3335
container_of(ptr_module, struct iss_device, ptr_module)
3436
#define to_device(ptr_module) \
@@ -79,6 +81,7 @@ struct iss_reg {
7981

8082
/*
8183
* struct iss_device - ISS device structure.
84+
* @syscon: Regmap for the syscon register space
8285
* @crashed: Bitmask of crashed entities (indexed by entity ID)
8386
*/
8487
struct iss_device {
@@ -93,6 +96,7 @@ struct iss_device {
9396

9497
struct resource *res[OMAP4_ISS_MEM_LAST];
9598
void __iomem *regs[OMAP4_ISS_MEM_LAST];
99+
struct regmap *syscon;
96100

97101
u64 raw_dmamask;
98102

drivers/staging/media/omap4iss/iss_csiphy.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <linux/delay.h>
1515
#include <linux/device.h>
16+
#include <linux/regmap.h>
1617

1718
#include "../../../../arch/arm/mach-omap2/control.h"
1819

@@ -140,9 +141,11 @@ int omap4iss_csiphy_config(struct iss_device *iss,
140141
* - bit [18] : CSIPHY1 CTRLCLK enable
141142
* - bit [17:16] : CSIPHY1 config: 00 d-phy, 01/10 ccp2
142143
*/
143-
cam_rx_ctrl = omap4_ctrl_pad_readl(
144-
OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX);
145-
144+
/*
145+
* TODO: When implementing DT support specify the CONTROL_CAMERA_RX
146+
* register offset in the syscon property instead of hardcoding it.
147+
*/
148+
regmap_read(iss->syscon, 0x68, &cam_rx_ctrl);
146149

147150
if (subdevs->interface == ISS_INTERFACE_CSI2A_PHY1) {
148151
cam_rx_ctrl &= ~(OMAP4_CAMERARX_CSI21_LANEENABLE_MASK |
@@ -166,8 +169,7 @@ int omap4iss_csiphy_config(struct iss_device *iss,
166169
cam_rx_ctrl |= OMAP4_CAMERARX_CSI22_CTRLCLKEN_MASK;
167170
}
168171

169-
omap4_ctrl_pad_writel(cam_rx_ctrl,
170-
OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX);
172+
regmap_write(iss->syscon, 0x68, cam_rx_ctrl);
171173

172174
/* Reset used lane count */
173175
csi2->phy->used_data_lanes = 0;

0 commit comments

Comments
 (0)