ODROID-N2: display: Support hdmi phy control using osd blank ioctl

1. control with env 'monitor_onoff' in boot.ini
2. blank_mode
  - FB_BLANK_POWERDOWN - hdmi phy off
  - FB_BLANK_UNBLANK - hdmi phy on

Change-Id: I00411be529fe80f19d9a1e4b17eed3583934ff4a
This commit is contained in:
Joy Cho
2019-03-28 14:45:08 +09:00
parent 9a4a1f4b14
commit 74f7463b03
3 changed files with 44 additions and 0 deletions

View File

@@ -1915,12 +1915,43 @@ done:
return err;
}
static bool monitor_onoff_action;
int osd_blank(int blank_mode, struct fb_info *info)
{
osd_enable_hw(info->node, (blank_mode != 0) ? 0 : 1);
if (!monitor_onoff_action)
return 0;
switch (blank_mode) {
case FB_BLANK_UNBLANK:
control_hdmiphy(true);
break;
case FB_BLANK_POWERDOWN:
control_hdmiphy(false);
break;
case FB_BLANK_NORMAL:
case FB_BLANK_HSYNC_SUSPEND:
case FB_BLANK_VSYNC_SUSPEND:
default:
break;
}
return 0;
}
static int __init osd_setup_monitor_onoff(char *str)
{
if (!strcmp(str, "true") || !strcmp(str, "1"))
monitor_onoff_action = true;
else
monitor_onoff_action = false;
return 0;
}
__setup("monitor_onoff=", osd_setup_monitor_onoff);
static int osd_pan_display(struct fb_var_screeninfo *var,
struct fb_info *fbi)
{

View File

@@ -73,4 +73,5 @@ extern size_t get_fb_rmem_size(int index);
extern int osd_blank(int blank_mode, struct fb_info *info);
extern struct osd_fb_dev_s *gp_fbdev_list[];
extern const struct color_bit_define_s default_color_format_array[];
extern void control_hdmiphy(bool on);
#endif

View File

@@ -110,6 +110,18 @@ struct extcon_dev *hdmitx_extcon_hdr;
struct extcon_dev *hdmitx_extcon_rxsense;
struct extcon_dev *hdmitx_extcon_hdcp;
void control_hdmiphy(bool on)
{
if (on)
hdmitx_device.HWOp.CntlMisc(&hdmitx_device,
MISC_TMDS_PHY_OP,
TMDS_PHY_ENABLE);
else
hdmitx_device.HWOp.CntlMisc(&hdmitx_device,
MISC_TMDS_PHY_OP,
TMDS_PHY_DISABLE);
}
static struct hdmi_cea_timing custom_timing;
struct hdmi_cea_timing *get_custom_timing(void)
{