Skip to content

Commit

Permalink
video: fbdev: sh_mobile_lcdcfb: remove unused MERAM support
Browse files Browse the repository at this point in the history
Since commit a521422  ("ARM: shmobile: mackerel: Remove Legacy C
board code") MERAM functionality is unused. Remove it.

Reviewed-by: Simon Horman <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
  • Loading branch information
bzolnier committed May 14, 2018
1 parent 745f8c1 commit 9076aa9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 67 deletions.
1 change: 0 additions & 1 deletion drivers/video/fbdev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,6 @@ config FB_W100
config FB_SH_MOBILE_LCDC
tristate "SuperH Mobile LCDC framebuffer support"
depends on FB && (SUPERH || ARCH_RENESAS) && HAVE_CLK
depends on FB_SH_MOBILE_MERAM || !FB_SH_MOBILE_MERAM
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
Expand Down
63 changes: 1 addition & 62 deletions drivers/video/fbdev/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/vmalloc.h>

#include <video/sh_mobile_lcdc.h>
#include <video/sh_mobile_meram.h>

#include "sh_mobile_lcdcfb.h"

Expand Down Expand Up @@ -217,7 +216,6 @@ struct sh_mobile_lcdc_priv {
struct notifier_block notifier;
int started;
int forced_fourcc; /* 2 channel LCDC must share fourcc setting */
struct sh_mobile_meram_info *meram_dev;
};

/* -----------------------------------------------------------------------------
Expand Down Expand Up @@ -346,16 +344,12 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
if (priv->dot_clk)
clk_prepare_enable(priv->dot_clk);
pm_runtime_get_sync(priv->dev);
if (priv->meram_dev && priv->meram_dev->pdev)
pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
}
}

static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
{
if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
if (priv->meram_dev && priv->meram_dev->pdev)
pm_runtime_put_sync(&priv->meram_dev->pdev->dev);
pm_runtime_put(priv->dev);
if (priv->dot_clk)
clk_disable_unprepare(priv->dot_clk);
Expand Down Expand Up @@ -1073,7 +1067,6 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)

static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
{
struct sh_mobile_meram_info *mdev = priv->meram_dev;
struct sh_mobile_lcdc_chan *ch;
unsigned long tmp;
int ret;
Expand Down Expand Up @@ -1106,9 +1099,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)

/* Compute frame buffer base address and pitch for each channel. */
for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
int pixelformat;
void *cache;

ch = &priv->ch[k];
if (!ch->enabled)
continue;
Expand All @@ -1117,45 +1107,6 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
ch->base_addr_c = ch->dma_handle
+ ch->xres_virtual * ch->yres_virtual;
ch->line_size = ch->pitch;

/* Enable MERAM if possible. */
if (mdev == NULL || ch->cfg->meram_cfg == NULL)
continue;

/* Free the allocated MERAM cache. */
if (ch->cache) {
sh_mobile_meram_cache_free(mdev, ch->cache);
ch->cache = NULL;
}

switch (ch->format->fourcc) {
case V4L2_PIX_FMT_NV12:
case V4L2_PIX_FMT_NV21:
case V4L2_PIX_FMT_NV16:
case V4L2_PIX_FMT_NV61:
pixelformat = SH_MOBILE_MERAM_PF_NV;
break;
case V4L2_PIX_FMT_NV24:
case V4L2_PIX_FMT_NV42:
pixelformat = SH_MOBILE_MERAM_PF_NV24;
break;
case V4L2_PIX_FMT_RGB565:
case V4L2_PIX_FMT_BGR24:
case V4L2_PIX_FMT_BGR32:
default:
pixelformat = SH_MOBILE_MERAM_PF_RGB;
break;
}

cache = sh_mobile_meram_cache_alloc(mdev, ch->cfg->meram_cfg,
ch->pitch, ch->yres, pixelformat,
&ch->line_size);
if (!IS_ERR(cache)) {
sh_mobile_meram_cache_update(mdev, cache,
ch->base_addr_y, ch->base_addr_c,
&ch->base_addr_y, &ch->base_addr_c);
ch->cache = cache;
}
}

for (k = 0; k < ARRAY_SIZE(priv->overlays); ++k) {
Expand Down Expand Up @@ -1223,13 +1174,6 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
}

sh_mobile_lcdc_display_off(ch);

/* Free the MERAM cache. */
if (ch->cache) {
sh_mobile_meram_cache_free(priv->meram_dev, ch->cache);
ch->cache = NULL;
}

}

/* stop the lcdc */
Expand Down Expand Up @@ -1851,11 +1795,6 @@ static int sh_mobile_lcdc_pan(struct fb_var_screeninfo *var,
base_addr_c = ch->dma_handle + ch->xres_virtual * ch->yres_virtual
+ c_offset;

if (ch->cache)
sh_mobile_meram_cache_update(priv->meram_dev, ch->cache,
base_addr_y, base_addr_c,
&base_addr_y, &base_addr_c);

ch->base_addr_y = base_addr_y;
ch->base_addr_c = base_addr_c;
ch->pan_y_offset = y_offset;
Expand Down Expand Up @@ -2718,7 +2657,7 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev)
return -ENOMEM;

priv->dev = &pdev->dev;
priv->meram_dev = pdata->meram_dev;

for (i = 0; i < ARRAY_SIZE(priv->ch); i++)
mutex_init(&priv->ch[i].open_lock);
platform_set_drvdata(pdev, priv);
Expand Down
1 change: 0 additions & 1 deletion drivers/video/fbdev/sh_mobile_lcdcfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ struct sh_mobile_lcdc_chan {
unsigned long *reg_offs;
unsigned long ldmt1r_value;
unsigned long enabled; /* ME and SE in LDCNT2R */
void *cache;

struct mutex open_lock; /* protects the use counter */
int use_count;
Expand Down
3 changes: 0 additions & 3 deletions include/video/sh_mobile_lcdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#define __ASM_SH_MOBILE_LCDC_H__

#include <linux/fb.h>
#include <video/sh_mobile_meram.h>

/* Register definitions */
#define _LDDCKR 0x410
Expand Down Expand Up @@ -184,7 +183,6 @@ struct sh_mobile_lcdc_chan_cfg {
struct sh_mobile_lcdc_panel_cfg panel_cfg;
struct sh_mobile_lcdc_bl_info bl_info;
struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
const struct sh_mobile_meram_cfg *meram_cfg;

struct platform_device *tx_dev; /* HDMI/DSI transmitter device */
};
Expand All @@ -193,7 +191,6 @@ struct sh_mobile_lcdc_info {
int clock_source;
struct sh_mobile_lcdc_chan_cfg ch[2];
struct sh_mobile_lcdc_overlay_cfg overlays[4];
struct sh_mobile_meram_info *meram_dev;
};

#endif /* __ASM_SH_MOBILE_LCDC_H__ */

0 comments on commit 9076aa9

Please sign in to comment.