diff options
Diffstat (limited to 'drivers/video/mxc_hdmi.c')
| -rw-r--r-- | drivers/video/mxc_hdmi.c | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c index 34fb1b282173..9c9620c67f1d 100644 --- a/drivers/video/mxc_hdmi.c +++ b/drivers/video/mxc_hdmi.c @@ -52,6 +52,7 @@  #include <linux/console.h>  #include <linux/types.h> +#include <linux/switch.h>  #include <mach/mxc_edid.h>  #include "mxc/mxc_dispdrv.h" @@ -187,6 +188,8 @@ struct mxc_hdmi {  	bool requesting_vga_for_initialization;  	struct hdmi_phy_reg_config phy_config; +	struct switch_dev sdev_audio; +	struct switch_dev sdev_display;  };  struct i2c_client *hdmi_i2c; @@ -1733,6 +1736,10 @@ static void mxc_hdmi_cable_connected(struct mxc_hdmi *hdmi)  	/* HDMI Initialization Steps D, E, F */  	switch (edid_status) {  	case HDMI_EDID_SUCCESS: +		/* centimeter to millimeter */ +		hdmi->fbi->var.width = hdmi->fbi->monspecs.max_x * 10; +		hdmi->fbi->var.height = hdmi->fbi->monspecs.max_y * 10; +  		mxc_hdmi_edid_rebuild_modelist(hdmi);  		break; @@ -1816,9 +1823,15 @@ static void hotplug_worker(struct work_struct *work)  #endif  			hdmi_set_cable_state(1); +			switch_set_state(&hdmi->sdev_audio, 1); +			switch_set_state(&hdmi->sdev_display, 1); +  		} else if (!(phy_int_pol & HDMI_PHY_HPD)) {  			/* Plugout event */  			dev_dbg(&hdmi->pdev->dev, "EVENT=plugout\n"); +			switch_set_state(&hdmi->sdev_audio, 0); +			switch_set_state(&hdmi->sdev_display, 0); +  			hdmi_set_cable_state(0);  			mxc_hdmi_abort_stream();  			mxc_hdmi_cable_disconnected(hdmi); @@ -2430,10 +2443,18 @@ static int __devinit mxc_hdmi_probe(struct platform_device *pdev)  		ret = (int)hdmi->disp_mxc_hdmi;  		goto edispdrv;  	} + +	hdmi->sdev_audio.name = "hdmi_audio"; +	hdmi->sdev_display.name = "hdmi"; +	switch_dev_register(&hdmi->sdev_audio); +	switch_dev_register(&hdmi->sdev_display); +  	mxc_dispdrv_setdata(hdmi->disp_mxc_hdmi, hdmi);  	platform_set_drvdata(pdev, hdmi); +	mxc_dispdrv_setdev(hdmi->disp_mxc_hdmi, &pdev->dev); +  	return 0;  edispdrv:  	platform_device_put(hdmi->core_pdev); @@ -2450,6 +2471,9 @@ static int mxc_hdmi_remove(struct platform_device *pdev)  	fb_unregister_client(&hdmi->nb); +	switch_dev_unregister(&hdmi->sdev_audio); +	switch_dev_unregister(&hdmi->sdev_display); +  	mxc_dispdrv_puthandle(hdmi->disp_mxc_hdmi);  	mxc_dispdrv_unregister(hdmi->disp_mxc_hdmi);  	/* No new work will be scheduled, wait for running ISR */ | 
