提交 02533540 编写于 作者: L Laurent Pinchart 提交者: Kieran Bingham

v4l: rcar-fcp: Add an API to retrieve the FCP device

The new rcar_fcp_get_device() function retrieves the struct device
related to the FCP device. This is useful to handle DMA mapping through
the right device.
Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: NKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: NKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: NMauro Cavalho Chehab <mchehab@s-opensource.com>
上级 8c71a1a3
......@@ -78,6 +78,12 @@ void rcar_fcp_put(struct rcar_fcp_device *fcp)
}
EXPORT_SYMBOL_GPL(rcar_fcp_put);
struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp)
{
return fcp->dev;
}
EXPORT_SYMBOL_GPL(rcar_fcp_get_device);
/**
* rcar_fcp_enable - Enable an FCP
* @fcp: The FCP instance
......
......@@ -19,6 +19,7 @@ struct rcar_fcp_device;
#if IS_ENABLED(CONFIG_VIDEO_RENESAS_FCP)
struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np);
void rcar_fcp_put(struct rcar_fcp_device *fcp);
struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp);
int rcar_fcp_enable(struct rcar_fcp_device *fcp);
void rcar_fcp_disable(struct rcar_fcp_device *fcp);
#else
......@@ -27,6 +28,10 @@ static inline struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np)
return ERR_PTR(-ENOENT);
}
static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { }
static inline struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp)
{
return NULL;
}
static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp)
{
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册