示例#1
0
文件: hdmi5.c 项目: 513855417/linux
static int hdmi_connect(struct omap_dss_device *dssdev,
		struct omap_dss_device *dst)
{
	struct omap_overlay_manager *mgr;
	int r;

	r = hdmi_init_regulator();
	if (r)
		return r;

	mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
	if (!mgr)
		return -ENODEV;

	r = dss_mgr_connect(mgr, dssdev);
	if (r)
		return r;

	r = omapdss_output_set_device(dssdev, dst);
	if (r) {
		DSSERR("failed to connect output to new device: %s\n",
				dst->name);
		dss_mgr_disconnect(mgr, dssdev);
		return r;
	}

	return 0;
}
示例#2
0
文件: display.c 项目: AllenDou/linux
/*
 * Connect dssdev to a manager if the manager is free or if force is specified.
 * Connect all overlays to that manager if they are free or if force is
 * specified.
 */
static int dss_init_connections(struct omap_dss_device *dssdev, bool force)
{
	struct omap_dss_output *out;
	struct omap_overlay_manager *mgr;
	int i, r;

	out = omapdss_get_output_from_dssdev(dssdev);

	WARN_ON(dssdev->output);
	WARN_ON(out->device);

	r = omapdss_output_set_device(out, dssdev);
	if (r) {
		DSSERR("failed to connect output to new device\n");
		return r;
	}

	mgr = omap_dss_get_overlay_manager(dssdev->channel);

	if (mgr->output && !force)
		return 0;

	if (mgr->output)
		mgr->unset_output(mgr);

	r = mgr->set_output(mgr, out);
	if (r) {
		DSSERR("failed to connect manager to output of new device\n");

		/* remove the output-device connection we just made */
		omapdss_output_unset_device(out);
		return r;
	}

	for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
		struct omap_overlay *ovl = omap_dss_get_overlay(i);

		if (!ovl->manager || force) {
			if (ovl->manager)
				ovl->unset_manager(ovl);

			r = ovl->set_manager(ovl, mgr);
			if (r) {
				DSSERR("failed to set initial overlay\n");
				return r;
			}
		}
	}

	return 0;
}
示例#3
0
static void __init hdmi_probe_pdata(struct platform_device *pdev)
{
	struct omap_dss_device *plat_dssdev;
	struct omap_dss_device *dssdev;
	struct omap_dss_hdmi_data *priv;
	int r;

	plat_dssdev = hdmi_find_dssdev(pdev);

	if (!plat_dssdev)
		return;

	dssdev = dss_alloc_and_init_device(&pdev->dev);
	if (!dssdev)
		return;

	dss_copy_device_pdata(dssdev, plat_dssdev);

	priv = dssdev->data;

	hdmi.ct_cp_hpd_gpio = priv->ct_cp_hpd_gpio;
	hdmi.ls_oe_gpio = priv->ls_oe_gpio;
	hdmi.hpd_gpio = priv->hpd_gpio;

	dssdev->channel = OMAP_DSS_CHANNEL_DIGIT;

	r = hdmi_init_display(dssdev);
	if (r) {
		DSSERR("device %s init failed: %d\n", dssdev->name, r);
		dss_put_device(dssdev);
		return;
	}

	r = omapdss_output_set_device(&hdmi.output, dssdev);
	if (r) {
		DSSERR("failed to connect output to new device: %s\n",
				dssdev->name);
		dss_put_device(dssdev);
		return;
	}

	r = dss_add_device(dssdev);
	if (r) {
		DSSERR("device %s register failed: %d\n", dssdev->name, r);
		omapdss_output_unset_device(&hdmi.output);
		hdmi_uninit_display(dssdev);
		dss_put_device(dssdev);
		return;
	}
}
示例#4
0
static int dpi_probe_pdata(struct platform_device *dpidev)
{
	struct omap_dss_device *plat_dssdev;
	struct omap_dss_device *dssdev;
	int r;

	plat_dssdev = dpi_find_dssdev(dpidev);

	if (!plat_dssdev)
		return 0;

	dssdev = dss_alloc_and_init_device(&dpidev->dev);
	if (!dssdev)
		return -ENOMEM;

	dss_copy_device_pdata(dssdev, plat_dssdev);

	r = dpi_init_display(dssdev);
	if (r) {
		DSSERR("device %s init failed: %d\n", dssdev->name, r);
		dss_put_device(dssdev);
		return r;
	}

	r = omapdss_output_set_device(&dpi.output, dssdev);
	if (r) {
		DSSERR("failed to connect output to new device: %s\n",
				dssdev->name);
		dss_put_device(dssdev);
		return r;
	}

	r = dss_add_device(dssdev);
	if (r) {
		DSSERR("device %s register failed: %d\n", dssdev->name, r);
		omapdss_output_unset_device(&dpi.output);
		dss_put_device(dssdev);
		return r;
	}

	return 0;
}
示例#5
0
文件: sdi.c 项目: krzk/linux
static int sdi_connect(struct omap_dss_device *dssdev,
		struct omap_dss_device *dst)
{
	struct sdi_device *sdi = dssdev_to_sdi(dssdev);
	int r;

	r = sdi_init_regulator(sdi);
	if (r)
		return r;

	r = dss_mgr_connect(&sdi->output, dssdev);
	if (r)
		return r;

	r = omapdss_output_set_device(dssdev, dst);
	if (r) {
		DSSERR("failed to connect output to new device: %s\n",
				dst->name);
		dss_mgr_disconnect(&sdi->output, dssdev);
		return r;
	}

	return 0;
}
示例#6
0
static int hdmi_connect(struct omap_dss_device *dssdev,
		struct omap_dss_device *dst)
{
	enum omap_channel channel = dssdev->dispc_channel;
	int r;

	r = hdmi_init_regulator();
	if (r)
		return r;

	r = dss_mgr_connect(channel, dssdev);
	if (r)
		return r;

	r = omapdss_output_set_device(dssdev, dst);
	if (r) {
		DSSERR("failed to connect output to new device: %s\n",
				dst->name);
		dss_mgr_disconnect(channel, dssdev);
		return r;
	}

	return 0;
}