aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2017-05-16 19:20:04 -0400
committerKieran Bingham <kieran.bingham+renesas@ideasonboard.com>2017-06-09 07:25:36 -0400
commit02533540ef8a54840a41843b8852755a543318e6 (patch)
treed68b079f0cdb70ead2ed51fe9491f490cae42d7c
parent8c71a1a318385ba2354fa7e8adf3d42678edd766 (diff)
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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Acked-by: Mauro Cavalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/platform/rcar-fcp.c6
-rw-r--r--include/media/rcar-fcp.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c
index e9f609edf513..2988031d285d 100644
--- a/drivers/media/platform/rcar-fcp.c
+++ b/drivers/media/platform/rcar-fcp.c
@@ -78,6 +78,12 @@ void rcar_fcp_put(struct rcar_fcp_device *fcp)
78} 78}
79EXPORT_SYMBOL_GPL(rcar_fcp_put); 79EXPORT_SYMBOL_GPL(rcar_fcp_put);
80 80
81struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp)
82{
83 return fcp->dev;
84}
85EXPORT_SYMBOL_GPL(rcar_fcp_get_device);
86
81/** 87/**
82 * rcar_fcp_enable - Enable an FCP 88 * rcar_fcp_enable - Enable an FCP
83 * @fcp: The FCP instance 89 * @fcp: The FCP instance
diff --git a/include/media/rcar-fcp.h b/include/media/rcar-fcp.h
index 8723f05c6321..b60a7b176c37 100644
--- a/include/media/rcar-fcp.h
+++ b/include/media/rcar-fcp.h
@@ -19,6 +19,7 @@ struct rcar_fcp_device;
19#if IS_ENABLED(CONFIG_VIDEO_RENESAS_FCP) 19#if IS_ENABLED(CONFIG_VIDEO_RENESAS_FCP)
20struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np); 20struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np);
21void rcar_fcp_put(struct rcar_fcp_device *fcp); 21void rcar_fcp_put(struct rcar_fcp_device *fcp);
22struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp);
22int rcar_fcp_enable(struct rcar_fcp_device *fcp); 23int rcar_fcp_enable(struct rcar_fcp_device *fcp);
23void rcar_fcp_disable(struct rcar_fcp_device *fcp); 24void rcar_fcp_disable(struct rcar_fcp_device *fcp);
24#else 25#else
@@ -27,6 +28,10 @@ static inline struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np)
27 return ERR_PTR(-ENOENT); 28 return ERR_PTR(-ENOENT);
28} 29}
29static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { } 30static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { }
31static inline struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp)
32{
33 return NULL;
34}
30static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp) 35static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp)
31{ 36{
32 return 0; 37 return 0;