Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9253d2d8 authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

Merge branch '3.8/dss-version'

Merge omapdss code to remove cpu_is_* checks from the driver.
parents da6c5687 97fbd0fc
Loading
Loading
Loading
Loading
+38 −0
Original line number Original line Diff line number Diff line
@@ -284,6 +284,35 @@ static struct platform_device *create_simple_dss_pdev(const char *pdev_name,
	return ERR_PTR(r);
	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 __init omap_display_init(struct omap_dss_board_info *board_data)
{
{
	int r = 0;
	int r = 0;
@@ -291,9 +320,18 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
	int i, oh_count;
	int i, oh_count;
	const struct omap_dss_hwmod_data *curr_dss_hwmod;
	const struct omap_dss_hwmod_data *curr_dss_hwmod;
	struct platform_device *dss_pdev;
	struct platform_device *dss_pdev;
	enum omapdss_version ver;


	/* create omapdss device */
	/* 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_enable_pads = omap_dsi_enable_pads;
	board_data->dsi_disable_pads = omap_dsi_disable_pads;
	board_data->dsi_disable_pads = omap_dsi_disable_pads;
	board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
	board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
+0 −5
Original line number Original line Diff line number Diff line
menuconfig OMAP2_DSS
menuconfig OMAP2_DSS
        tristate "OMAP2+ Display Subsystem support"
        tristate "OMAP2+ Display Subsystem support"
        depends on ARCH_OMAP2PLUS
        help
        help
	  OMAP2+ Display Subsystem support.
	  OMAP2+ Display Subsystem support.


@@ -72,7 +71,6 @@ config OMAP2_DSS_VENC


config OMAP4_DSS_HDMI
config OMAP4_DSS_HDMI
	bool "HDMI support"
	bool "HDMI support"
	depends on ARCH_OMAP4
        default y
        default y
	help
	help
	  HDMI Interface. This adds the High Definition Multimedia Interface.
	  HDMI Interface. This adds the High Definition Multimedia Interface.
@@ -80,11 +78,9 @@ config OMAP4_DSS_HDMI


config OMAP4_DSS_HDMI_AUDIO
config OMAP4_DSS_HDMI_AUDIO
	bool
	bool
	depends on OMAP4_DSS_HDMI


config OMAP2_DSS_SDI
config OMAP2_DSS_SDI
	bool "SDI support"
	bool "SDI support"
	depends on ARCH_OMAP3
        default n
        default n
	help
	help
	  SDI (Serial Display Interface) support.
	  SDI (Serial Display Interface) support.
@@ -94,7 +90,6 @@ config OMAP2_DSS_SDI


config OMAP2_DSS_DSI
config OMAP2_DSS_DSI
	bool "DSI support"
	bool "DSI support"
	depends on ARCH_OMAP3 || ARCH_OMAP4 || ARCH_OMAP5
        default n
        default n
	help
	help
	  MIPI DSI (Display Serial Interface) support.
	  MIPI DSI (Display Serial Interface) support.
+1 −1
Original line number Original line Diff line number Diff line
@@ -232,7 +232,7 @@ static int __init omap_dss_probe(struct platform_device *pdev)


	core.pdev = pdev;
	core.pdev = pdev;


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


	dss_apply_init();
	dss_apply_init();


+31 −17
Original line number Original line Diff line number Diff line
@@ -36,8 +36,7 @@
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/pm_runtime.h>

#include <linux/sizes.h>
#include <plat/cpu.h>


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


@@ -3353,7 +3352,7 @@ static void dispc_dump_regs(struct seq_file *s)


#define DISPC_REG(i, name) name(i)
#define DISPC_REG(i, name) name(i)
#define DUMPREG(i, r) seq_printf(s, "%s(%s)%*s %08x\n", #r, p_names[i], \
#define DUMPREG(i, r) seq_printf(s, "%s(%s)%*s %08x\n", #r, p_names[i], \
	48 - strlen(#r) - strlen(p_names[i]), " ", \
	(int)(48 - strlen(#r) - strlen(p_names[i])), " ", \
	dispc_read_reg(DISPC_REG(i, r)))
	dispc_read_reg(DISPC_REG(i, r)))


	p_names = mgr_names;
	p_names = mgr_names;
@@ -3430,7 +3429,7 @@ static void dispc_dump_regs(struct seq_file *s)
#define DISPC_REG(plane, name, i) name(plane, i)
#define DISPC_REG(plane, name, i) name(plane, i)
#define DUMPREG(plane, name, i) \
#define DUMPREG(plane, name, i) \
	seq_printf(s, "%s_%d(%s)%*s %08x\n", #name, i, p_names[plane], \
	seq_printf(s, "%s_%d(%s)%*s %08x\n", #name, i, p_names[plane], \
	46 - strlen(#name) - strlen(p_names[plane]), " ", \
	(int)(46 - strlen(#name) - strlen(p_names[plane])), " ", \
	dispc_read_reg(DISPC_REG(plane, name, i)))
	dispc_read_reg(DISPC_REG(plane, name, i)))


	/* Video pipeline coefficient registers */
	/* Video pipeline coefficient registers */
@@ -4032,29 +4031,44 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
	.gfx_fifo_workaround	=	true,
	.gfx_fifo_workaround	=	true,
};
};


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


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


	if (cpu_is_omap24xx()) {
	switch (pdata->version) {
	case OMAPDSS_VER_OMAP24xx:
		src = &omap24xx_dispc_feats;
		src = &omap24xx_dispc_feats;
	} else if (cpu_is_omap34xx()) {
		break;
		if (omap_rev() < OMAP3430_REV_ES3_0)

	case OMAPDSS_VER_OMAP34xx_ES1:
		src = &omap34xx_rev1_0_dispc_feats;
		src = &omap34xx_rev1_0_dispc_feats;
		else
		break;

	case OMAPDSS_VER_OMAP34xx_ES3:
	case OMAPDSS_VER_OMAP3630:
	case OMAPDSS_VER_AM35xx:
		src = &omap34xx_rev3_0_dispc_feats;
		src = &omap34xx_rev3_0_dispc_feats;
	} else if (cpu_is_omap44xx()) {
		break;

	case OMAPDSS_VER_OMAP4430_ES1:
	case OMAPDSS_VER_OMAP4430_ES2:
	case OMAPDSS_VER_OMAP4:
		src = &omap44xx_dispc_feats;
		src = &omap44xx_dispc_feats;
	} else if (soc_is_omap54xx()) {
		break;

	case OMAPDSS_VER_OMAP5:
		src = &omap44xx_dispc_feats;
		src = &omap44xx_dispc_feats;
	} else {
		break;

	default:
		return -ENODEV;
		return -ENODEV;
	}
	}


@@ -4074,7 +4088,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)


	dispc.pdev = pdev;
	dispc.pdev = pdev;


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


+28 −12
Original line number Original line Diff line number Diff line
@@ -32,11 +32,10 @@
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/pm_runtime.h>
#include <linux/gfp.h>
#include <linux/gfp.h>
#include <linux/sizes.h>


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


#include <plat/cpu.h>

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


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


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


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


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

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

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

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

	case OMAPDSS_VER_OMAP5:
		src = &omap54xx_dss_feats;
		src = &omap54xx_dss_feats;
	else
		break;

	default:
		return -ENODEV;
		return -ENODEV;
	}


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


	dss.pdev = pdev;
	dss.pdev = pdev;


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


Loading