aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-05-14 09:47:30 -0400
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-05-14 09:47:30 -0400
commit9076aa994a9e3b63ed9c79f5f46ffa2b5a001249 (patch)
tree0442b83b33466be3a0a37ef4d8b7e96dd4ce08be
parent745f8c14e35d32ff43a52a9415e4dcc2955c4321 (diff)
video: fbdev: sh_mobile_lcdcfb: remove unused MERAM support
Since commit a521422ea4ae ("ARM: shmobile: mackerel: Remove Legacy C board code") MERAM functionality is unused. Remove it. Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-rw-r--r--drivers/video/fbdev/Kconfig1
-rw-r--r--drivers/video/fbdev/sh_mobile_lcdcfb.c63
-rw-r--r--drivers/video/fbdev/sh_mobile_lcdcfb.h1
-rw-r--r--include/video/sh_mobile_lcdc.h3
4 files changed, 1 insertions, 67 deletions
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 381a9c588792..79634a134074 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -1888,7 +1888,6 @@ config FB_W100
1888config FB_SH_MOBILE_LCDC 1888config FB_SH_MOBILE_LCDC
1889 tristate "SuperH Mobile LCDC framebuffer support" 1889 tristate "SuperH Mobile LCDC framebuffer support"
1890 depends on FB && (SUPERH || ARCH_RENESAS) && HAVE_CLK 1890 depends on FB && (SUPERH || ARCH_RENESAS) && HAVE_CLK
1891 depends on FB_SH_MOBILE_MERAM || !FB_SH_MOBILE_MERAM
1892 select FB_SYS_FILLRECT 1891 select FB_SYS_FILLRECT
1893 select FB_SYS_COPYAREA 1892 select FB_SYS_COPYAREA
1894 select FB_SYS_IMAGEBLIT 1893 select FB_SYS_IMAGEBLIT
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index 929b1c51aab6..dc46be38c970 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -29,7 +29,6 @@
29#include <linux/vmalloc.h> 29#include <linux/vmalloc.h>
30 30
31#include <video/sh_mobile_lcdc.h> 31#include <video/sh_mobile_lcdc.h>
32#include <video/sh_mobile_meram.h>
33 32
34#include "sh_mobile_lcdcfb.h" 33#include "sh_mobile_lcdcfb.h"
35 34
@@ -217,7 +216,6 @@ struct sh_mobile_lcdc_priv {
217 struct notifier_block notifier; 216 struct notifier_block notifier;
218 int started; 217 int started;
219 int forced_fourcc; /* 2 channel LCDC must share fourcc setting */ 218 int forced_fourcc; /* 2 channel LCDC must share fourcc setting */
220 struct sh_mobile_meram_info *meram_dev;
221}; 219};
222 220
223/* ----------------------------------------------------------------------------- 221/* -----------------------------------------------------------------------------
@@ -346,16 +344,12 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
346 if (priv->dot_clk) 344 if (priv->dot_clk)
347 clk_prepare_enable(priv->dot_clk); 345 clk_prepare_enable(priv->dot_clk);
348 pm_runtime_get_sync(priv->dev); 346 pm_runtime_get_sync(priv->dev);
349 if (priv->meram_dev && priv->meram_dev->pdev)
350 pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
351 } 347 }
352} 348}
353 349
354static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv) 350static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
355{ 351{
356 if (atomic_sub_return(1, &priv->hw_usecnt) == -1) { 352 if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
357 if (priv->meram_dev && priv->meram_dev->pdev)
358 pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
359 pm_runtime_put(priv->dev); 353 pm_runtime_put(priv->dev);
360 if (priv->dot_clk) 354 if (priv->dot_clk)
361 clk_disable_unprepare(priv->dot_clk); 355 clk_disable_unprepare(priv->dot_clk);
@@ -1073,7 +1067,6 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
1073 1067
1074static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv) 1068static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
1075{ 1069{
1076 struct sh_mobile_meram_info *mdev = priv->meram_dev;
1077 struct sh_mobile_lcdc_chan *ch; 1070 struct sh_mobile_lcdc_chan *ch;
1078 unsigned long tmp; 1071 unsigned long tmp;
1079 int ret; 1072 int ret;
@@ -1106,9 +1099,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
1106 1099
1107 /* Compute frame buffer base address and pitch for each channel. */ 1100 /* Compute frame buffer base address and pitch for each channel. */
1108 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) { 1101 for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
1109 int pixelformat;
1110 void *cache;
1111
1112 ch = &priv->ch[k]; 1102 ch = &priv->ch[k];
1113 if (!ch->enabled) 1103 if (!ch->enabled)
1114 continue; 1104 continue;
@@ -1117,45 +1107,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
1117 ch->base_addr_c = ch->dma_handle 1107 ch->base_addr_c = ch->dma_handle
1118 + ch->xres_virtual * ch->yres_virtual; 1108 + ch->xres_virtual * ch->yres_virtual;
1119 ch->line_size = ch->pitch; 1109 ch->line_size = ch->pitch;
1120
1121 /* Enable MERAM if possible. */
1122 if (mdev == NULL || ch->cfg->meram_cfg == NULL)
1123 continue;
1124
1125 /* Free the allocated MERAM cache. */
1126 if (ch->cache) {
1127 sh_mobile_meram_cache_free(mdev, ch->cache);
1128 ch->cache = NULL;
1129 }
1130
1131 switch (ch->format->fourcc) {
1132 case V4L2_PIX_FMT_NV12:
1133 case V4L2_PIX_FMT_NV21:
1134 case V4L2_PIX_FMT_NV16:
1135 case V4L2_PIX_FMT_NV61:
1136 pixelformat = SH_MOBILE_MERAM_PF_NV;
1137 break;
1138 case V4L2_PIX_FMT_NV24:
1139 case V4L2_PIX_FMT_NV42:
1140 pixelformat = SH_MOBILE_MERAM_PF_NV24;
1141 break;
1142 case V4L2_PIX_FMT_RGB565:
1143 case V4L2_PIX_FMT_BGR24:
1144 case V4L2_PIX_FMT_BGR32:
1145 default:
1146 pixelformat = SH_MOBILE_MERAM_PF_RGB;
1147 break;
1148 }
1149
1150 cache = sh_mobile_meram_cache_alloc(mdev, ch->cfg->meram_cfg,
1151 ch->pitch, ch->yres, pixelformat,
1152 &ch->line_size);
1153 if (!IS_ERR(cache)) {
1154 sh_mobile_meram_cache_update(mdev, cache,
1155 ch->base_addr_y, ch->base_addr_c,
1156 &ch->base_addr_y, &ch->base_addr_c);
1157 ch->cache = cache;
1158 }
1159 } 1110 }
1160 1111
1161 for (k = 0; k < ARRAY_SIZE(priv->overlays); ++k) { 1112 for (k = 0; k < ARRAY_SIZE(priv->overlays); ++k) {
@@ -1223,13 +1174,6 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
1223 } 1174 }
1224 1175
1225 sh_mobile_lcdc_display_off(ch); 1176 sh_mobile_lcdc_display_off(ch);
1226
1227 /* Free the MERAM cache. */
1228 if (ch->cache) {
1229 sh_mobile_meram_cache_free(priv->meram_dev, ch->cache);
1230 ch->cache = NULL;
1231 }
1232
1233 } 1177 }
1234 1178
1235 /* stop the lcdc */ 1179 /* stop the lcdc */
@@ -1851,11 +1795,6 @@ static int sh_mobile_lcdc_pan(struct fb_var_screeninfo *var,
1851 base_addr_c = ch->dma_handle + ch->xres_virtual * ch->yres_virtual 1795 base_addr_c = ch->dma_handle + ch->xres_virtual * ch->yres_virtual
1852 + c_offset; 1796 + c_offset;
1853 1797
1854 if (ch->cache)
1855 sh_mobile_meram_cache_update(priv->meram_dev, ch->cache,
1856 base_addr_y, base_addr_c,
1857 &base_addr_y, &base_addr_c);
1858
1859 ch->base_addr_y = base_addr_y; 1798 ch->base_addr_y = base_addr_y;
1860 ch->base_addr_c = base_addr_c; 1799 ch->base_addr_c = base_addr_c;
1861 ch->pan_y_offset = y_offset; 1800 ch->pan_y_offset = y_offset;
@@ -2718,7 +2657,7 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev)
2718 return -ENOMEM; 2657 return -ENOMEM;
2719 2658
2720 priv->dev = &pdev->dev; 2659 priv->dev = &pdev->dev;
2721 priv->meram_dev = pdata->meram_dev; 2660
2722 for (i = 0; i < ARRAY_SIZE(priv->ch); i++) 2661 for (i = 0; i < ARRAY_SIZE(priv->ch); i++)
2723 mutex_init(&priv->ch[i].open_lock); 2662 mutex_init(&priv->ch[i].open_lock);
2724 platform_set_drvdata(pdev, priv); 2663 platform_set_drvdata(pdev, priv);
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.h b/drivers/video/fbdev/sh_mobile_lcdcfb.h
index cc52c74721fe..b8e47a8bd8ab 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.h
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.h
@@ -61,7 +61,6 @@ struct sh_mobile_lcdc_chan {
61 unsigned long *reg_offs; 61 unsigned long *reg_offs;
62 unsigned long ldmt1r_value; 62 unsigned long ldmt1r_value;
63 unsigned long enabled; /* ME and SE in LDCNT2R */ 63 unsigned long enabled; /* ME and SE in LDCNT2R */
64 void *cache;
65 64
66 struct mutex open_lock; /* protects the use counter */ 65 struct mutex open_lock; /* protects the use counter */
67 int use_count; 66 int use_count;
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
index f706b0fed399..84aa976ca4ea 100644
--- a/include/video/sh_mobile_lcdc.h
+++ b/include/video/sh_mobile_lcdc.h
@@ -3,7 +3,6 @@
3#define __ASM_SH_MOBILE_LCDC_H__ 3#define __ASM_SH_MOBILE_LCDC_H__
4 4
5#include <linux/fb.h> 5#include <linux/fb.h>
6#include <video/sh_mobile_meram.h>
7 6
8/* Register definitions */ 7/* Register definitions */
9#define _LDDCKR 0x410 8#define _LDDCKR 0x410
@@ -184,7 +183,6 @@ struct sh_mobile_lcdc_chan_cfg {
184 struct sh_mobile_lcdc_panel_cfg panel_cfg; 183 struct sh_mobile_lcdc_panel_cfg panel_cfg;
185 struct sh_mobile_lcdc_bl_info bl_info; 184 struct sh_mobile_lcdc_bl_info bl_info;
186 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ 185 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
187 const struct sh_mobile_meram_cfg *meram_cfg;
188 186
189 struct platform_device *tx_dev; /* HDMI/DSI transmitter device */ 187 struct platform_device *tx_dev; /* HDMI/DSI transmitter device */
190}; 188};
@@ -193,7 +191,6 @@ struct sh_mobile_lcdc_info {
193 int clock_source; 191 int clock_source;
194 struct sh_mobile_lcdc_chan_cfg ch[2]; 192 struct sh_mobile_lcdc_chan_cfg ch[2];
195 struct sh_mobile_lcdc_overlay_cfg overlays[4]; 193 struct sh_mobile_lcdc_overlay_cfg overlays[4];
196 struct sh_mobile_meram_info *meram_dev;
197}; 194};
198 195
199#endif /* __ASM_SH_MOBILE_LCDC_H__ */ 196#endif /* __ASM_SH_MOBILE_LCDC_H__ */