diff options
author | Steve Longerbeam <slongerbeam@gmail.com> | 2014-06-25 21:05:35 -0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2014-09-02 08:55:45 -0400 |
commit | a2be35e3320b27c84488729e9fb56a62e74d65fa (patch) | |
tree | a2d770f3fe7f5e5165c753820262df5a95940192 | |
parent | 7fafa8f06f9bdf32b806b4612bfe387de8e34125 (diff) |
gpu: ipu-v3: smfc: Add ipu_smfc_set_watermark()
Adds ipu_smfc_set_watermark() which programs a channel's SMFC FIFO
levels at which the watermark signal is set and cleared.
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-smfc.c | 20 | ||||
-rw-r--r-- | include/video/imx-ipu-v3.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-smfc.c b/drivers/gpu/ipu-v3/ipu-smfc.c index a6429ca913c1..6ca9b43ce25a 100644 --- a/drivers/gpu/ipu-v3/ipu-smfc.c +++ b/drivers/gpu/ipu-v3/ipu-smfc.c | |||
@@ -80,6 +80,26 @@ int ipu_smfc_map_channel(struct ipu_smfc *smfc, int csi_id, int mipi_id) | |||
80 | } | 80 | } |
81 | EXPORT_SYMBOL_GPL(ipu_smfc_map_channel); | 81 | EXPORT_SYMBOL_GPL(ipu_smfc_map_channel); |
82 | 82 | ||
83 | int ipu_smfc_set_watermark(struct ipu_smfc *smfc, u32 set_level, u32 clr_level) | ||
84 | { | ||
85 | struct ipu_smfc_priv *priv = smfc->priv; | ||
86 | unsigned long flags; | ||
87 | u32 val, shift; | ||
88 | |||
89 | spin_lock_irqsave(&priv->lock, flags); | ||
90 | |||
91 | shift = smfc->chno * 6 + (smfc->chno > 1 ? 4 : 0); | ||
92 | val = readl(priv->base + SMFC_WMC); | ||
93 | val &= ~(0x3f << shift); | ||
94 | val |= ((clr_level << 3) | set_level) << shift; | ||
95 | writel(val, priv->base + SMFC_WMC); | ||
96 | |||
97 | spin_unlock_irqrestore(&priv->lock, flags); | ||
98 | |||
99 | return 0; | ||
100 | } | ||
101 | EXPORT_SYMBOL_GPL(ipu_smfc_set_watermark); | ||
102 | |||
83 | int ipu_smfc_enable(struct ipu_smfc *smfc) | 103 | int ipu_smfc_enable(struct ipu_smfc *smfc) |
84 | { | 104 | { |
85 | struct ipu_smfc_priv *priv = smfc->priv; | 105 | struct ipu_smfc_priv *priv = smfc->priv; |
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index a695ee83e4e1..49e5954ac033 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h | |||
@@ -296,6 +296,7 @@ int ipu_smfc_enable(struct ipu_smfc *smfc); | |||
296 | int ipu_smfc_disable(struct ipu_smfc *smfc); | 296 | int ipu_smfc_disable(struct ipu_smfc *smfc); |
297 | int ipu_smfc_map_channel(struct ipu_smfc *smfc, int csi_id, int mipi_id); | 297 | int ipu_smfc_map_channel(struct ipu_smfc *smfc, int csi_id, int mipi_id); |
298 | int ipu_smfc_set_burstsize(struct ipu_smfc *smfc, int burstsize); | 298 | int ipu_smfc_set_burstsize(struct ipu_smfc *smfc, int burstsize); |
299 | int ipu_smfc_set_watermark(struct ipu_smfc *smfc, u32 set_level, u32 clr_level); | ||
299 | 300 | ||
300 | enum ipu_color_space ipu_drm_fourcc_to_colorspace(u32 drm_fourcc); | 301 | enum ipu_color_space ipu_drm_fourcc_to_colorspace(u32 drm_fourcc); |
301 | enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat); | 302 | enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat); |