static int omap_hdmihw_probe(struct platform_device *pdev)
{
	int r;

	r = hdmi_init(pdev);
	if (r) {
		DSSERR("Failed to initialize hdmi\n");
		goto err_hdmi;
	}
	return 0;
err_hdmi:
	return r;
}
static int __init mtk_ext_disp_mgr_init(void)
{
    printk("[EXTD]%s\n", __func__);

    if (platform_driver_register(&external_display_driver))
    {
        printk("[EXTD]failed to register mtkfb driver\n");
        return -1;
    }

    hdmi_init();

#ifdef CONFIG_HAS_EARLYSUSPEND
    register_early_suspend(&hdmi_early_suspend_handler);
#endif
    return 0;
}
status_t HDMIDaemon::readyToRun() {
    if ((mFrameworkSock = android_get_control_socket(HDMI_SOCKET_NAME)) < 0) {
        ALOGE("Obtaining file descriptor socket '%s' failed: %s",
             HDMI_SOCKET_NAME, strerror(errno));
        return -1;
    }

    if (listen(mFrameworkSock, 4) < 0) {
        ALOGE("Unable to listen on fd '%d' for socket '%s': %s",
             mFrameworkSock, HDMI_SOCKET_NAME, strerror(errno));
        return -1;
    }

    mUeventSock = hdmi_init(0);
    hdmi_enable();

    ALOGD("readyToRun: success");

    return NO_ERROR;
}
示例#4
0
/* PLATFORM DEVICE */
static int omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
	int skip_init = 0;
	int r;
	int i;

	core.pdev = pdev;

	dss_init_overlay_managers(pdev);
	dss_init_overlays(pdev);

	/*
	 * FIX-ME: Replace with correct clk node when clk
	 * framework is available
	 */
	if (!cpu_is_omap44xx()) {
		r = dss_get_clocks();
		if (r)
			goto fail0;
	}

	dss_clk_enable_all_no_ctx();

	core.ctx_id = dss_get_ctx_id();
	DSSDBG("initial ctx id %u\n", core.ctx_id);

#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
	/* DISPC_CONTROL */
	if (omap_readl(0x48050440) & 1)	/* LCD enabled? */
		skip_init = 1;
#endif

	r = dss_init(skip_init);
	if (r) {
		DSSERR("Failed to initialize DSS\n");
		goto fail0;
	}

#ifdef CONFIG_OMAP2_DSS_RFBI
	r = rfbi_init();
	if (r) {
		DSSERR("Failed to initialize rfbi\n");
		goto fail0;
	}
#endif

	r = dpi_init();
	if (r) {
		DSSERR("Failed to initialize dpi\n");
		goto fail0;
	}

	r = dispc_init();
	if (r) {
		DSSERR("Failed to initialize dispc\n");
		goto fail0;
	}
#ifdef CONFIG_OMAP2_DSS_VENC
	r = venc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize venc\n");
		goto fail0;
	}
#endif
	if (cpu_is_omap34xx()) {
#ifdef CONFIG_OMAP2_DSS_SDI
		r = sdi_init(skip_init);
		if (r) {
			DSSERR("Failed to initialize SDI\n");
			goto fail0;
		}
#endif
	}
#ifdef CONFIG_OMAP2_DSS_DSI
		printk(KERN_INFO "dsi_init calling");
		r = dsi_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI\n");
			goto fail0;
		}
	if (cpu_is_omap44xx()) {
			printk(KERN_INFO "dsi2_init calling");
		r = dsi2_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI2\n");
			goto fail0;
			}
		}
#endif

#ifdef CONFIG_OMAP2_DSS_HDMI
	r = hdmi_init(pdev, hdmi_code);
	if (r) {
		DSSERR("Failed to initialize hdmi\n");
		goto fail0;
	}
#endif
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
	r = dss_initialize_debugfs();
	if (r)
		goto fail0;
#endif

	for (i = 0; i < pdata->num_devices; ++i) {
		struct omap_dss_device *dssdev = pdata->devices[i];

		r = omap_dss_register_device(dssdev);
		if (r)
			DSSERR("device reg failed %d\n", i);

		if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
			pdata->default_device = dssdev;
	}

	dss_clk_disable_all();

	return 0;

	/* XXX fail correctly */
fail0:
	return r;
}
/* PLATFORM DEVICE */
static int omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
	int r = 0;
	int i;

	core.pdev = pdev;

	dss_init_overlay_managers(pdev);
	dss_init_overlays(pdev);

#ifdef CONFIG_HAS_EARLYSUSPEND
	omap_pm_set_min_bus_tput(&pdev->dev, OCP_INITIATOR_AGENT, 166 * 1000 * 4);
#endif

	if (cpu_is_omap44xx())
		dss_init_writeback(pdev); /*Write back init*/
#ifdef HWMOD
	if (!cpu_is_omap44xx()) {
		r = dss_get_clocks();
		if (r)
			goto err_clocks;
	}

	core.ctx_id = dss_get_ctx_id();
	DSSDBG("initial ctx id %u\n", core.ctx_id);

	r = dss_init(pdev);
	if (r) {
		DSSERR("Failed to initialize DSS\n");
		goto err_dss;
	}

	r = rfbi_init();
	if (r) {
		DSSERR("Failed to initialize rfbi\n");
		goto err_rfbi;
	}

	r = dpi_init(pdev);
	if (r) {
		DSSERR("Failed to initialize dpi\n");
		goto err_dpi;
	}

	r = dispc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize dispc\n");
		goto err_dispc;
	}

	r = venc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize venc\n");
		goto err_venc;
	}

	if (cpu_is_omap34xx()) {
		r = sdi_init(skip_init);
		if (r) {
			DSSERR("Failed to initialize SDI\n");
			goto err_sdi;
		}
	}

	if (!cpu_is_omap24xx()) {
		r = dsi_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI\n");
			goto err_dsi1;
		}

		if (cpu_is_omap44xx()) {
			r = dsi2_init(pdev);
			if (r) {
				DSSERR("Failed to initialize DSI2\n");
				goto err_dsi2;
			}
		}
	}
#ifdef CONFIG_OMAP2_DSS_HDMI
	r = hdmi_init(pdev);
	if (r) {
		DSSERR("Failed to initialize hdmi\n");
		goto err_hdmi;
	}
#endif
#endif
	r = dss_initialize_debugfs();
	if (r)
		goto err_debugfs;

	for (i = 0; i < pdata->num_devices; ++i) {
		struct omap_dss_device *dssdev = pdata->devices[i];

		r = omap_dss_register_device(dssdev);
		if (r) {
			DSSERR("device %d %s register failed %d\n", i,
				dssdev->name ?: "unnamed", r);

			while (--i >= 0)
				omap_dss_unregister_device(pdata->devices[i]);

			goto err_register;
		}

		if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
			pdata->default_device = dssdev;
	}
#ifdef HWMOD
	dss_clk_disable_all();
#endif
	return 0;

err_register:
	dss_uninitialize_debugfs();
err_debugfs:
#ifdef HWMOD
#ifdef CONFIG_OMAP2_DSS_HDMI
	hdmi_exit();
err_hdmi:
#endif
	if (cpu_is_omap44xx())
		dsi2_exit();
err_dsi2:
	if (!cpu_is_omap24xx())
		dsi_exit();
err_dsi1:
	if (cpu_is_omap34xx())
		sdi_exit();
err_sdi:
	venc_exit();
err_venc:
	dispc_exit();
err_dispc:
	dpi_exit();
err_dpi:
	rfbi_exit();
err_rfbi:
	dss_exit();
err_dss:
	dss_clk_disable_all_no_ctx();
	dss_put_clocks();
err_clocks:
#endif
	return r;
}
示例#6
0
文件: hdmi.c 项目: 383530895/linux
static int hdmi_bind(struct device *dev, struct device *master, void *data)
{
	struct drm_device *drm = dev_get_drvdata(master);
	struct msm_drm_private *priv = drm->dev_private;
	static struct hdmi_platform_config config = {};
	struct hdmi *hdmi;
#ifdef CONFIG_OF
	struct device_node *of_node = dev->of_node;

	if (of_device_is_compatible(of_node, "qcom,hdmi-tx-8074")) {
		static const char *hpd_reg_names[] = {"hpd-gdsc", "hpd-5v"};
		static const char *pwr_reg_names[] = {"core-vdda", "core-vcc"};
		static const char *hpd_clk_names[] = {"iface_clk", "core_clk", "mdp_core_clk"};
		static unsigned long hpd_clk_freq[] = {0, 19200000, 0};
		static const char *pwr_clk_names[] = {"extp_clk", "alt_iface_clk"};
		config.phy_init      = hdmi_phy_8x74_init;
		config.hpd_reg_names = hpd_reg_names;
		config.hpd_reg_cnt   = ARRAY_SIZE(hpd_reg_names);
		config.pwr_reg_names = pwr_reg_names;
		config.pwr_reg_cnt   = ARRAY_SIZE(pwr_reg_names);
		config.hpd_clk_names = hpd_clk_names;
		config.hpd_freq      = hpd_clk_freq;
		config.hpd_clk_cnt   = ARRAY_SIZE(hpd_clk_names);
		config.pwr_clk_names = pwr_clk_names;
		config.pwr_clk_cnt   = ARRAY_SIZE(pwr_clk_names);
	} else if (of_device_is_compatible(of_node, "qcom,hdmi-tx-8960")) {
		static const char *hpd_clk_names[] = {"core_clk", "master_iface_clk", "slave_iface_clk"};
		static const char *hpd_reg_names[] = {"core-vdda", "hdmi-mux"};
		config.phy_init      = hdmi_phy_8960_init;
		config.hpd_reg_names = hpd_reg_names;
		config.hpd_reg_cnt   = ARRAY_SIZE(hpd_reg_names);
		config.hpd_clk_names = hpd_clk_names;
		config.hpd_clk_cnt   = ARRAY_SIZE(hpd_clk_names);
	} else if (of_device_is_compatible(of_node, "qcom,hdmi-tx-8660")) {
		config.phy_init      = hdmi_phy_8x60_init;
	} else {
		dev_err(dev, "unknown phy: %s\n", of_node->name);
	}

	config.mmio_name     = "core_physical";
	config.ddc_clk_gpio  = get_gpio(dev, of_node, "qcom,hdmi-tx-ddc-clk");
	config.ddc_data_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-ddc-data");
	config.hpd_gpio      = get_gpio(dev, of_node, "qcom,hdmi-tx-hpd");
	config.mux_en_gpio   = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-en");
	config.mux_sel_gpio  = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-sel");
	config.mux_lpm_gpio  = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-lpm");

#else
	static const char *hpd_clk_names[] = {
			"core_clk", "master_iface_clk", "slave_iface_clk",
	};
	if (cpu_is_apq8064()) {
		static const char *hpd_reg_names[] = {"8921_hdmi_mvs"};
		config.phy_init      = hdmi_phy_8960_init;
		config.mmio_name     = "hdmi_msm_hdmi_addr";
		config.hpd_reg_names = hpd_reg_names;
		config.hpd_reg_cnt   = ARRAY_SIZE(hpd_reg_names);
		config.hpd_clk_names = hpd_clk_names;
		config.hpd_clk_cnt   = ARRAY_SIZE(hpd_clk_names);
		config.ddc_clk_gpio  = 70;
		config.ddc_data_gpio = 71;
		config.hpd_gpio      = 72;
		config.mux_en_gpio   = -1;
		config.mux_sel_gpio  = -1;
	} else if (cpu_is_msm8960() || cpu_is_msm8960ab()) {
		static const char *hpd_reg_names[] = {"8921_hdmi_mvs"};
		config.phy_init      = hdmi_phy_8960_init;
		config.mmio_name     = "hdmi_msm_hdmi_addr";
		config.hpd_reg_names = hpd_reg_names;
		config.hpd_reg_cnt   = ARRAY_SIZE(hpd_reg_names);
		config.hpd_clk_names = hpd_clk_names;
		config.hpd_clk_cnt   = ARRAY_SIZE(hpd_clk_names);
		config.ddc_clk_gpio  = 100;
		config.ddc_data_gpio = 101;
		config.hpd_gpio      = 102;
		config.mux_en_gpio   = -1;
		config.mux_sel_gpio  = -1;
	} else if (cpu_is_msm8x60()) {
		static const char *hpd_reg_names[] = {
				"8901_hdmi_mvs", "8901_mpp0"
		};
		config.phy_init      = hdmi_phy_8x60_init;
		config.mmio_name     = "hdmi_msm_hdmi_addr";
		config.hpd_reg_names = hpd_reg_names;
		config.hpd_reg_cnt   = ARRAY_SIZE(hpd_reg_names);
		config.hpd_clk_names = hpd_clk_names;
		config.hpd_clk_cnt   = ARRAY_SIZE(hpd_clk_names);
		config.ddc_clk_gpio  = 170;
		config.ddc_data_gpio = 171;
		config.hpd_gpio      = 172;
		config.mux_en_gpio   = -1;
		config.mux_sel_gpio  = -1;
	}
#endif
	dev->platform_data = &config;
	hdmi = hdmi_init(to_platform_device(dev));
	if (IS_ERR(hdmi))
		return PTR_ERR(hdmi);
	priv->hdmi = hdmi;
	return 0;
}
示例#7
0
文件: tda19988.c 项目: Hooman3/minix
static ssize_t
tda19988_blk_transfer(devminor_t minor, int do_write, u64_t pos64,
    endpoint_t endpt, iovec_t * iov, unsigned int nr_req, int flags)
{
	unsigned count;
	struct device *dv;
	u64_t dv_size;
	int r;
	cp_grant_id_t grant;

	log_trace(&log, "tda19988_blk_transfer()\n");

	/* Get minor device information. */
	dv = tda19988_blk_part(minor);
	if (dv == NULL) {
		return ENXIO;
	}

	if (nr_req > NR_IOREQS) {
		return EINVAL;
	}

	dv_size = dv->dv_size;
	if (pos64 >= dv_size) {
		return OK;	/* Beyond EOF */
	}

	if (nr_req > 0) {

		/* How much to transfer and where to / from. */
		count = iov->iov_size;
		grant = (cp_grant_id_t) iov->iov_addr;

		/* check for EOF */
		if (pos64 >= dv_size) {
			return 0;
		}

		/* don't go past the end of the device */
		if (pos64 + count > dv_size) {
			count = dv_size - pos64;
		}

		/* don't overflow copybuf */
		if (count > COPYBUF_SIZE) {
			count = COPYBUF_SIZE;
		}

		log_debug(&log, "transfering 0x%x bytes\n", count);

		if (do_write) {

			log_warn(&log, "Error: writing to read-only device\n");
			return EACCES;

		} else {

			if (is_display_connected() == 1) {

				r = hdmi_init();
				if (r != OK) {
					log_warn(&log,
					    "Failed to enable HDMI module\n");
					return EIO;
				}

				memset(copybuf, '\0', COPYBUF_SIZE);
				r = read_edid(copybuf, count);
				if (r != OK) {
					log_warn(&log,
					    "read_edid() failed (r=%d)\n", r);
					return r;
				}

				r = sys_safecopyto(endpt, grant, (vir_bytes)
				    0, (vir_bytes) copybuf, count);
				if (r != OK) {
					log_warn(&log, "safecopyto failed\n");
					return EINVAL;
				}

				return iov->iov_size;
			} else {
				log_warn(&log, "Display not connected.\n");
				return ENODEV;
			}
		}
	} else {

		/* empty request */
		return 0;
	}
}
示例#8
0
static int modeset_init(struct mdp5_kms *mdp5_kms)
{
	static const enum mdp5_pipe crtcs[] = {
			SSPP_RGB0, SSPP_RGB1, SSPP_RGB2,
	};
	struct drm_device *dev = mdp5_kms->dev;
	struct msm_drm_private *priv = dev->dev_private;
	struct drm_encoder *encoder;
	int i, ret;

	/* construct CRTCs: */
	for (i = 0; i < ARRAY_SIZE(crtcs); i++) {
		struct drm_plane *plane;
		struct drm_crtc *crtc;

		plane = mdp5_plane_init(dev, crtcs[i], true);
		if (IS_ERR(plane)) {
			ret = PTR_ERR(plane);
			dev_err(dev->dev, "failed to construct plane for %s (%d)\n",
					pipe2name(crtcs[i]), ret);
			goto fail;
		}

		crtc  = mdp5_crtc_init(dev, plane, i);
		if (IS_ERR(crtc)) {
			ret = PTR_ERR(crtc);
			dev_err(dev->dev, "failed to construct crtc for %s (%d)\n",
					pipe2name(crtcs[i]), ret);
			goto fail;
		}
		priv->crtcs[priv->num_crtcs++] = crtc;
	}

	/* Construct encoder for HDMI: */
	encoder = mdp5_encoder_init(dev, 3, INTF_HDMI);
	if (IS_ERR(encoder)) {
		dev_err(dev->dev, "failed to construct encoder\n");
		ret = PTR_ERR(encoder);
		goto fail;
	}

	/* NOTE: the vsync and error irq's are actually associated with
	 * the INTF/encoder.. the easiest way to deal with this (ie. what
	 * we do now) is assume a fixed relationship between crtc's and
	 * encoders.  I'm not sure if there is ever a need to more freely
	 * assign crtcs to encoders, but if there is then we need to take
	 * care of error and vblank irq's that the crtc has registered,
	 * and also update user-requested vblank_mask.
	 */
	encoder->possible_crtcs = BIT(0);
	mdp5_crtc_set_intf(priv->crtcs[0], 3, INTF_HDMI);

	priv->encoders[priv->num_encoders++] = encoder;

	/* Construct bridge/connector for HDMI: */
	mdp5_kms->hdmi = hdmi_init(dev, encoder);
	if (IS_ERR(mdp5_kms->hdmi)) {
		ret = PTR_ERR(mdp5_kms->hdmi);
		dev_err(dev->dev, "failed to initialize HDMI: %d\n", ret);
		goto fail;
	}

	return 0;

fail:
	return ret;
}
示例#9
0
static int modeset_init(struct mdp4_kms *mdp4_kms)
{
	struct drm_device *dev = mdp4_kms->dev;
	struct msm_drm_private *priv = dev->dev_private;
	struct drm_plane *plane;
	struct drm_crtc *crtc;
	struct drm_encoder *encoder;
	struct hdmi *hdmi;
	int ret;

	/*
	 *  NOTE: this is a bit simplistic until we add support
	 * for more than just RGB1->DMA_E->DTV->HDMI
	 */

	/* construct non-private planes: */
	plane = mdp4_plane_init(dev, VG1, false);
	if (IS_ERR(plane)) {
		dev_err(dev->dev, "failed to construct plane for VG1\n");
		ret = PTR_ERR(plane);
		goto fail;
	}
	priv->planes[priv->num_planes++] = plane;

	plane = mdp4_plane_init(dev, VG2, false);
	if (IS_ERR(plane)) {
		dev_err(dev->dev, "failed to construct plane for VG2\n");
		ret = PTR_ERR(plane);
		goto fail;
	}
	priv->planes[priv->num_planes++] = plane;

	/* the CRTCs get constructed with a private plane: */
	plane = mdp4_plane_init(dev, RGB1, true);
	if (IS_ERR(plane)) {
		dev_err(dev->dev, "failed to construct plane for RGB1\n");
		ret = PTR_ERR(plane);
		goto fail;
	}

	crtc  = mdp4_crtc_init(dev, plane, priv->num_crtcs, 1, DMA_E);
	if (IS_ERR(crtc)) {
		dev_err(dev->dev, "failed to construct crtc for DMA_E\n");
		ret = PTR_ERR(crtc);
		goto fail;
	}
	priv->crtcs[priv->num_crtcs++] = crtc;

	encoder = mdp4_dtv_encoder_init(dev);
	if (IS_ERR(encoder)) {
		dev_err(dev->dev, "failed to construct DTV encoder\n");
		ret = PTR_ERR(encoder);
		goto fail;
	}
	encoder->possible_crtcs = 0x1;     /* DTV can be hooked to DMA_E */
	priv->encoders[priv->num_encoders++] = encoder;

	hdmi = hdmi_init(dev, encoder);
	if (IS_ERR(hdmi)) {
		ret = PTR_ERR(hdmi);
		dev_err(dev->dev, "failed to initialize HDMI: %d\n", ret);
		goto fail;
	}

	return 0;

fail:
	return ret;
}
示例#10
0
文件: hdmi.c 项目: guanhe0/kernel
static int hdmi_bind(struct device *dev, struct device *master, void *data)
{
	struct drm_device *drm = dev_get_drvdata(master);
	struct msm_drm_private *priv = drm->dev_private;
	static struct hdmi_platform_config *hdmi_cfg;
	struct hdmi *hdmi;
#ifdef CONFIG_OF
	struct device_node *of_node = dev->of_node;
	const struct of_device_id *match;

	match = of_match_node(dt_match, of_node);
	if (match && match->data) {
		hdmi_cfg = (struct hdmi_platform_config *)match->data;
		DBG("hdmi phy: %s", match->compatible);
	} else {
		dev_err(dev, "unknown phy: %s\n", of_node->name);
		return -ENXIO;
	}

	hdmi_cfg->mmio_name     = "core_physical";
	hdmi_cfg->qfprom_mmio_name = "qfprom_physical";
	hdmi_cfg->ddc_clk_gpio  = get_gpio(dev, of_node, "qcom,hdmi-tx-ddc-clk");
	hdmi_cfg->ddc_data_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-ddc-data");
	hdmi_cfg->hpd_gpio      = get_gpio(dev, of_node, "qcom,hdmi-tx-hpd");
	hdmi_cfg->mux_en_gpio   = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-en");
	hdmi_cfg->mux_sel_gpio  = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-sel");
	hdmi_cfg->mux_lpm_gpio  = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-lpm");

#else
	static struct hdmi_platform_config config = {};
	static const char *hpd_clk_names[] = {
			"core_clk", "master_iface_clk", "slave_iface_clk",
	};
	if (cpu_is_apq8064()) {
		static const char *hpd_reg_names[] = {"8921_hdmi_mvs"};
		config.phy_init      = hdmi_phy_8960_init;
		config.hpd_reg_names = hpd_reg_names;
		config.hpd_reg_cnt   = ARRAY_SIZE(hpd_reg_names);
		config.hpd_clk_names = hpd_clk_names;
		config.hpd_clk_cnt   = ARRAY_SIZE(hpd_clk_names);
		config.ddc_clk_gpio  = 70;
		config.ddc_data_gpio = 71;
		config.hpd_gpio      = 72;
		config.mux_en_gpio   = -1;
		config.mux_sel_gpio  = -1;
	} else if (cpu_is_msm8960() || cpu_is_msm8960ab()) {
		static const char *hpd_reg_names[] = {"8921_hdmi_mvs"};
		config.phy_init      = hdmi_phy_8960_init;
		config.hpd_reg_names = hpd_reg_names;
		config.hpd_reg_cnt   = ARRAY_SIZE(hpd_reg_names);
		config.hpd_clk_names = hpd_clk_names;
		config.hpd_clk_cnt   = ARRAY_SIZE(hpd_clk_names);
		config.ddc_clk_gpio  = 100;
		config.ddc_data_gpio = 101;
		config.hpd_gpio      = 102;
		config.mux_en_gpio   = -1;
		config.mux_sel_gpio  = -1;
	} else if (cpu_is_msm8x60()) {
		static const char *hpd_reg_names[] = {
				"8901_hdmi_mvs", "8901_mpp0"
		};
		config.phy_init      = hdmi_phy_8x60_init;
		config.hpd_reg_names = hpd_reg_names;
		config.hpd_reg_cnt   = ARRAY_SIZE(hpd_reg_names);
		config.hpd_clk_names = hpd_clk_names;
		config.hpd_clk_cnt   = ARRAY_SIZE(hpd_clk_names);
		config.ddc_clk_gpio  = 170;
		config.ddc_data_gpio = 171;
		config.hpd_gpio      = 172;
		config.mux_en_gpio   = -1;
		config.mux_sel_gpio  = -1;
	}
	config.mmio_name     = "hdmi_msm_hdmi_addr";
	config.qfprom_mmio_name = "hdmi_msm_qfprom_addr";

	hdmi_cfg = &config;
#endif
	dev->platform_data = hdmi_cfg;

	hdmi = hdmi_init(to_platform_device(dev));
	if (IS_ERR(hdmi))
		return PTR_ERR(hdmi);
	priv->hdmi = hdmi;
	msm_hdmi_register_audio_driver(hdmi, dev);

	return 0;
}
示例#11
0
/* PLATFORM DEVICE */
static int omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
	int r = 0;
	int i;

	core.pdev = pdev;
	core.pdata = pdev->dev.platform_data;

	dss_init_overlay_managers(pdev);
	dss_init_overlays(pdev);

	if (cpu_is_omap44xx())
		dss_init_writeback(pdev); /*Write back init*/
#ifdef HWMOD
	if (!cpu_is_omap44xx()) {
		r = dss_get_clocks();
		if (r)
			goto err_clocks;
	}

	core.ctx_id = dss_get_ctx_id();
	DSSDBG("initial ctx id %u\n", core.ctx_id);

	r = dss_init(pdev);
	if (r) {
		DSSERR("Failed to initialize DSS\n");
		goto err_dss;
	}

	r = rfbi_init();
	if (r) {
		DSSERR("Failed to initialize rfbi\n");
		goto err_rfbi;
	}

	r = dpi_init(pdev);
	if (r) {
		DSSERR("Failed to initialize dpi\n");
		goto err_dpi;
	}

	r = dispc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize dispc\n");
		goto err_dispc;
	}

	r = venc_init(pdev);
	if (r) {
		DSSERR("Failed to initialize venc\n");
		goto err_venc;
	}

	if (cpu_is_omap34xx()) {
		r = sdi_init(skip_init);
		if (r) {
			DSSERR("Failed to initialize SDI\n");
			goto err_sdi;
		}
	}

	if (!cpu_is_omap24xx()) {
		r = dsi_init(pdev);
		if (r) {
			DSSERR("Failed to initialize DSI\n");
			goto err_dsi1;
		}

		if (cpu_is_omap44xx()) {
			r = dsi2_init(pdev);
			if (r) {
				DSSERR("Failed to initialize DSI2\n");
				goto err_dsi2;
			}
		}
	}
// == 2011.05.31 === [email protected] START	
#ifdef CONFIG_OMAP2_DSS_HDMI
// TEDCHO_HDMI
#if defined(CONFIG_PRODUCT_LGE_HUB) || defined(CONFIG_PRODUCT_LGE_JUSTIN)
#else
	r = hdmi_init(pdev, hdmi_code, hdmi_mode);
	if (r) {
		DSSERR("Failed to initialize hdmi\n");
		goto err_hdmi;
	}
#endif
#endif
#endif
// == 2011.05.31 === [email protected] END
	r = dss_initialize_debugfs();
	if (r)
		goto err_debugfs;

	for (i = 0; i < pdata->num_devices; ++i) {
		struct omap_dss_device *dssdev = pdata->devices[i];

		r = omap_dss_register_device(dssdev);
		if (r) {
			DSSERR("device %d %s register failed %d\n", i,
				dssdev->name ?: "unnamed", r);

			while (--i >= 0)
				omap_dss_unregister_device(pdata->devices[i]);

			goto err_register;
		}

		if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
			pdata->default_device = dssdev;
	}
#ifdef HWMOD
	dss_clk_disable_all();
#endif
	return 0;

err_register:
	dss_uninitialize_debugfs();
err_debugfs:
#ifdef HWMOD
#ifdef CONFIG_OMAP2_DSS_HDMI
	hdmi_exit();
err_hdmi:
#endif
	if (cpu_is_omap44xx())
		dsi2_exit();
err_dsi2:
	if (!cpu_is_omap24xx())
		dsi_exit();
err_dsi1:
	if (cpu_is_omap34xx())
		sdi_exit();
err_sdi:
	venc_exit();
err_venc:
	dispc_exit();
err_dispc:
	dpi_exit();
err_dpi:
	rfbi_exit();
err_rfbi:
	dss_exit();
err_dss:
	dss_clk_disable_all_no_ctx();
	dss_put_clocks();
err_clocks:
#endif
	return r;
}