Skip to content

Commit fefad2d

Browse files
pinchartlmchehab
authored andcommitted
[media] v4l: omap4iss: Replace outdated OMAP4 control pad API with syscon
The omap4_ctrl_pad_readl and omap4_ctrl_pad_writel functions have been removed by commit efde234 but are still used by the OMAP4 ISS driver, resulting in a compilation breakage: drivers/staging/media/omap4iss/iss_csiphy.c: In function 'omap4iss_csiphy_config': drivers/staging/media/omap4iss/iss_csiphy.c:167:2: error: implicit declaration of function 'omap4_ctrl_pad_writel' [-Werror=implicit-function-declaration] omap4_ctrl_pad_writel(cam_rx_ctrl, Fix the problem by using the syscon API to reaplace the control pad API. Lookup the syscon instance by compatible name for now as the OMAP4 ISS driver doesn't support DT yet. Fixes: efde234 ("ARM: OMAP4+: control: remove support for legacy pad read/write") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Alius <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
1 parent 5a9b06a commit fefad2d

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

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)