diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2012-05-16 11:28:29 -0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2014-06-04 05:07:11 -0400 |
commit | e90460970fde8bdccf2147e899cb9953943e16d2 (patch) | |
tree | 29278f3b2d38d919979ccca628448eeb1e435492 | |
parent | 35de925ffaa67971e073d3ebf1e0600be0d0d3f1 (diff) |
gpu: ipu-v3: Add ipu_idmac_get_current_buffer function
This function returns the currently active buffer (0 or 1)
of a double buffered IDMAC channel. It is to be used by the
CSI driver.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-common.c | 9 | ||||
-rw-r--r-- | include/video/imx-ipu-v3.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index 2aecc474c478..9459f4091a27 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c | |||
@@ -661,6 +661,15 @@ int ipu_module_disable(struct ipu_soc *ipu, u32 mask) | |||
661 | } | 661 | } |
662 | EXPORT_SYMBOL_GPL(ipu_module_disable); | 662 | EXPORT_SYMBOL_GPL(ipu_module_disable); |
663 | 663 | ||
664 | int ipu_idmac_get_current_buffer(struct ipuv3_channel *channel) | ||
665 | { | ||
666 | struct ipu_soc *ipu = channel->ipu; | ||
667 | unsigned int chno = channel->num; | ||
668 | |||
669 | return (ipu_cm_read(ipu, IPU_CHA_CUR_BUF(chno)) & idma_mask(chno)) ? 1 : 0; | ||
670 | } | ||
671 | EXPORT_SYMBOL_GPL(ipu_idmac_get_current_buffer); | ||
672 | |||
664 | void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num) | 673 | void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num) |
665 | { | 674 | { |
666 | struct ipu_soc *ipu = channel->ipu; | 675 | struct ipu_soc *ipu = channel->ipu; |
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index e639387eee3f..f3714301d740 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h | |||
@@ -103,6 +103,7 @@ int ipu_idmac_wait_busy(struct ipuv3_channel *channel, int ms); | |||
103 | 103 | ||
104 | void ipu_idmac_set_double_buffer(struct ipuv3_channel *channel, | 104 | void ipu_idmac_set_double_buffer(struct ipuv3_channel *channel, |
105 | bool doublebuffer); | 105 | bool doublebuffer); |
106 | int ipu_idmac_get_current_buffer(struct ipuv3_channel *channel); | ||
106 | void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num); | 107 | void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num); |
107 | 108 | ||
108 | /* | 109 | /* |