Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339635
b: refs/heads/master
c: 406c856
h: refs/heads/master
i:
  339633: b4a30d6
  339631: c0f6d2f
v: v3
  • Loading branch information
Tomi Valkeinen committed Oct 17, 2012
1 parent 5dae513 commit 6211526
Show file tree
Hide file tree
Showing 11 changed files with 217 additions and 178 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35f70935c64ae229ebd1fc65398ec68d4d803712
refs/heads/master: 406c8563a7b07ce91b1310536948477c7a8755de
38 changes: 0 additions & 38 deletions trunk/arch/arm/mach-omap2/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,54 +284,16 @@ static struct platform_device *create_simple_dss_pdev(const char *pdev_name,
return ERR_PTR(r);
}

static enum omapdss_version __init omap_display_get_version(void)
{
if (cpu_is_omap24xx())
return OMAPDSS_VER_OMAP24xx;
else if (cpu_is_omap3630())
return OMAPDSS_VER_OMAP3630;
else if (cpu_is_omap34xx()) {
if (soc_is_am35xx()) {
return OMAPDSS_VER_AM35xx;
} else {
if (omap_rev() < OMAP3430_REV_ES3_0)
return OMAPDSS_VER_OMAP34xx_ES1;
else
return OMAPDSS_VER_OMAP34xx_ES3;
}
} else if (omap_rev() == OMAP4430_REV_ES1_0)
return OMAPDSS_VER_OMAP4430_ES1;
else if (omap_rev() == OMAP4430_REV_ES2_0 ||
omap_rev() == OMAP4430_REV_ES2_1 ||
omap_rev() == OMAP4430_REV_ES2_2)
return OMAPDSS_VER_OMAP4430_ES2;
else if (cpu_is_omap44xx())
return OMAPDSS_VER_OMAP4;
else if (soc_is_omap54xx())
return OMAPDSS_VER_OMAP5;
else
return OMAPDSS_VER_UNKNOWN;
}

int __init omap_display_init(struct omap_dss_board_info *board_data)
{
int r = 0;
struct platform_device *pdev;
int i, oh_count;
const struct omap_dss_hwmod_data *curr_dss_hwmod;
struct platform_device *dss_pdev;
enum omapdss_version ver;

/* create omapdss device */

ver = omap_display_get_version();

if (ver == OMAPDSS_VER_UNKNOWN) {
pr_err("DSS not supported on this SoC\n");
return -ENODEV;
}

board_data->version = ver;
board_data->dsi_enable_pads = omap_dsi_enable_pads;
board_data->dsi_disable_pads = omap_dsi_disable_pads;
board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
Expand Down
61 changes: 61 additions & 0 deletions trunk/arch/arm/plat-omap/fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,67 @@
#include <mach/hardware.h>
#include <asm/mach/map.h>

#include <plat/cpu.h>

#ifdef CONFIG_OMAP2_VRFB

/*
* The first memory resource is the register region for VRFB,
* the rest are VRFB virtual memory areas for each VRFB context.
*/

static const struct resource omap2_vrfb_resources[] = {
DEFINE_RES_MEM_NAMED(0x68008000u, 0x40, "vrfb-regs"),
DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
};

static const struct resource omap3_vrfb_resources[] = {
DEFINE_RES_MEM_NAMED(0x6C000180u, 0xc0, "vrfb-regs"),
DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
DEFINE_RES_MEM_NAMED(0xe0000000u, 0x4000000, "vrfb-area-4"),
DEFINE_RES_MEM_NAMED(0xe4000000u, 0x4000000, "vrfb-area-5"),
DEFINE_RES_MEM_NAMED(0xe8000000u, 0x4000000, "vrfb-area-6"),
DEFINE_RES_MEM_NAMED(0xec000000u, 0x4000000, "vrfb-area-7"),
DEFINE_RES_MEM_NAMED(0xf0000000u, 0x4000000, "vrfb-area-8"),
DEFINE_RES_MEM_NAMED(0xf4000000u, 0x4000000, "vrfb-area-9"),
DEFINE_RES_MEM_NAMED(0xf8000000u, 0x4000000, "vrfb-area-10"),
DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"),
};

static int __init omap_init_vrfb(void)
{
struct platform_device *pdev;
const struct resource *res;
unsigned int num_res;

if (cpu_is_omap24xx()) {
res = omap2_vrfb_resources;
num_res = ARRAY_SIZE(omap2_vrfb_resources);
} else if (cpu_is_omap34xx()) {
res = omap3_vrfb_resources;
num_res = ARRAY_SIZE(omap3_vrfb_resources);
} else {
return 0;
}

pdev = platform_device_register_resndata(NULL, "omapvrfb", -1,
res, num_res, NULL, 0);

if (IS_ERR(pdev))
return PTR_ERR(pdev);
else
return 0;
}

arch_initcall(omap_init_vrfb);
#endif

#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)

static bool omapfb_lcd_configured;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/video/omap2/dss/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static int __init omap_dss_probe(struct platform_device *pdev)

core.pdev = pdev;

dss_features_init(pdata->version);
dss_features_init();

dss_apply_init();

Expand Down
43 changes: 15 additions & 28 deletions trunk/drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>

#include <plat/cpu.h>

#include <video/omapdss.h>

#include "dss.h"
Expand Down Expand Up @@ -4040,44 +4042,29 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
.gfx_fifo_workaround = true,
};

static int __init dispc_init_features(struct platform_device *pdev)
static int __init dispc_init_features(struct device *dev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
const struct dispc_features *src;
struct dispc_features *dst;

dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL);
if (!dst) {
dev_err(&pdev->dev, "Failed to allocate DISPC Features\n");
dev_err(dev, "Failed to allocate DISPC Features\n");
return -ENOMEM;
}

switch (pdata->version) {
case OMAPDSS_VER_OMAP24xx:
if (cpu_is_omap24xx()) {
src = &omap24xx_dispc_feats;
break;

case OMAPDSS_VER_OMAP34xx_ES1:
src = &omap34xx_rev1_0_dispc_feats;
break;

case OMAPDSS_VER_OMAP34xx_ES3:
case OMAPDSS_VER_OMAP3630:
case OMAPDSS_VER_AM35xx:
src = &omap34xx_rev3_0_dispc_feats;
break;

case OMAPDSS_VER_OMAP4430_ES1:
case OMAPDSS_VER_OMAP4430_ES2:
case OMAPDSS_VER_OMAP4:
} else if (cpu_is_omap34xx()) {
if (omap_rev() < OMAP3430_REV_ES3_0)
src = &omap34xx_rev1_0_dispc_feats;
else
src = &omap34xx_rev3_0_dispc_feats;
} else if (cpu_is_omap44xx()) {
src = &omap44xx_dispc_feats;
break;

case OMAPDSS_VER_OMAP5:
} else if (soc_is_omap54xx()) {
src = &omap44xx_dispc_feats;
break;

default:
} else {
return -ENODEV;
}

Expand All @@ -4097,7 +4084,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)

dispc.pdev = pdev;

r = dispc_init_features(dispc.pdev);
r = dispc_init_features(&dispc.pdev->dev);
if (r)
return r;

Expand Down
39 changes: 12 additions & 27 deletions trunk/drivers/video/omap2/dss/dss.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

#include <video/omapdss.h>

#include <plat/cpu.h>

#include "dss.h"
#include "dss_features.h"

Expand Down Expand Up @@ -790,46 +792,29 @@ static const struct dss_features omap54xx_dss_feats __initconst = {
.dpi_select_source = &dss_dpi_select_source_omap5,
};

static int __init dss_init_features(struct platform_device *pdev)
static int __init dss_init_features(struct device *dev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
const struct dss_features *src;
struct dss_features *dst;

dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL);
if (!dst) {
dev_err(&pdev->dev, "Failed to allocate local DSS Features\n");
dev_err(dev, "Failed to allocate local DSS Features\n");
return -ENOMEM;
}

switch (pdata->version) {
case OMAPDSS_VER_OMAP24xx:
if (cpu_is_omap24xx())
src = &omap24xx_dss_feats;
break;

case OMAPDSS_VER_OMAP34xx_ES1:
case OMAPDSS_VER_OMAP34xx_ES3:
case OMAPDSS_VER_AM35xx:
else if (cpu_is_omap34xx())
src = &omap34xx_dss_feats;
break;

case OMAPDSS_VER_OMAP3630:
else if (cpu_is_omap3630())
src = &omap3630_dss_feats;
break;

case OMAPDSS_VER_OMAP4430_ES1:
case OMAPDSS_VER_OMAP4430_ES2:
case OMAPDSS_VER_OMAP4:
else if (cpu_is_omap44xx())
src = &omap44xx_dss_feats;
break;

case OMAPDSS_VER_OMAP5:
else if (soc_is_omap54xx())
src = &omap54xx_dss_feats;
break;

default:
else
return -ENODEV;
}

memcpy(dst, src, sizeof(*dst));
dss.feat = dst;
Expand All @@ -846,7 +831,7 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)

dss.pdev = pdev;

r = dss_init_features(dss.pdev);
r = dss_init_features(&dss.pdev->dev);
if (r)
return r;

Expand Down
64 changes: 20 additions & 44 deletions trunk/drivers/video/omap2/dss/dss_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/slab.h>

#include <video/omapdss.h>
#include <plat/cpu.h>

#include "dss.h"
#include "dss_features.h"
Expand Down Expand Up @@ -824,20 +825,10 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {

};

void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
enum omapdss_version version)
void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data)
{
switch (version) {
case OMAPDSS_VER_OMAP4430_ES1:
case OMAPDSS_VER_OMAP4430_ES2:
case OMAPDSS_VER_OMAP4:
if (cpu_is_omap44xx())
ip_data->ops = &omap4_hdmi_functions;
break;
default:
ip_data->ops = NULL;
}

WARN_ON(ip_data->ops == NULL);
}
#endif

Expand Down Expand Up @@ -938,44 +929,29 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type)
return omap_current_dss_features->supported_rotation_types & rot_type;
}

void dss_features_init(enum omapdss_version version)
void dss_features_init(void)
{
switch (version) {
case OMAPDSS_VER_OMAP24xx:
if (cpu_is_omap24xx())
omap_current_dss_features = &omap2_dss_features;
break;

case OMAPDSS_VER_OMAP34xx_ES1:
case OMAPDSS_VER_OMAP34xx_ES3:
omap_current_dss_features = &omap3430_dss_features;
break;

case OMAPDSS_VER_OMAP3630:
else if (cpu_is_omap3630())
omap_current_dss_features = &omap3630_dss_features;
break;

case OMAPDSS_VER_OMAP4430_ES1:
else if (cpu_is_omap34xx()) {
if (soc_is_am35xx()) {
omap_current_dss_features = &am35xx_dss_features;
} else {
omap_current_dss_features = &omap3430_dss_features;
}
}
else if (omap_rev() == OMAP4430_REV_ES1_0)
omap_current_dss_features = &omap4430_es1_0_dss_features;
break;

case OMAPDSS_VER_OMAP4430_ES2:
else if (omap_rev() == OMAP4430_REV_ES2_0 ||
omap_rev() == OMAP4430_REV_ES2_1 ||
omap_rev() == OMAP4430_REV_ES2_2)
omap_current_dss_features = &omap4430_es2_0_1_2_dss_features;
break;

case OMAPDSS_VER_OMAP4:
else if (cpu_is_omap44xx())
omap_current_dss_features = &omap4_dss_features;
break;

case OMAPDSS_VER_OMAP5:
else if (soc_is_omap54xx())
omap_current_dss_features = &omap5_dss_features;
break;

case OMAPDSS_VER_AM35xx:
omap_current_dss_features = &am35xx_dss_features;
break;

default:
else
DSSWARN("Unsupported OMAP version");
break;
}
}
5 changes: 2 additions & 3 deletions trunk/drivers/video/omap2/dss/dss_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type);

bool dss_has_feature(enum dss_feat_id id);
void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end);
void dss_features_init(enum omapdss_version version);
void dss_features_init(void);
#if defined(CONFIG_OMAP4_DSS_HDMI)
void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data,
enum omapdss_version version);
void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data);
#endif
#endif
Loading

0 comments on commit 6211526

Please sign in to comment.