Skip to content

Odroidxu3-3.10.y-android updated on July 8,2015 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/configs/odroidxu3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,7 @@ CONFIG_VIDEO_EXYNOS_HDMI=y
CONFIG_VIDEO_EXYNOS_HDMI_AUDIO_I2S=y
# CONFIG_VIDEO_EXYNOS_HDMI_DEBUG is not set
CONFIG_VIDEO_EXYNOS_MIXER=y
# CONFIG_VIDEO_EXYNOS_HDMI_CEC is not set
CONFIG_VIDEO_EXYNOS_HDMI_CEC=y
# CONFIG_VIDEO_EXYNOS_MIXER_DEBUG is not set
CONFIG_MEDIA_EXYNOS=y
# CONFIG_VIDEO_TIMBERDALE is not set
Expand Down
11 changes: 6 additions & 5 deletions arch/arm/mach-exynos/pmu-exynos5422.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ static void odroid_power_off(void)
{
unsigned int value, off_retry = 0;

printk("%s : set PS_HOLD low\n", __func__);
printk(KERN_EMERG "%s : Set PS_HOLD_CONTROL (PS_HOLD_LOW)\n", __func__);

local_irq_disable();

Expand All @@ -696,18 +696,19 @@ static void odroid_power_off(void)
*/
value = __raw_readl(EXYNOS5422_PS_HOLD_CONTROL);
value |= EXYNOS_PS_HOLD_EN;
__raw_writel(value, EXYNOS_PS_HOLD_CONTROL);
__raw_writel(value, EXYNOS5422_PS_HOLD_CONTROL);

mdelay(1000);
mdelay(3000);

if(off_retry++ > 5) {
flush_cache_all();
outer_flush_all();
exynos5_restart(0, 0);

pr_emerg("%s: waiting for reboot\n", __func__);
printk(KERN_EMERG "%s: waiting for reboot\n", __func__);
while(1);
}
printk("%s : Power OFF error count = %d !!!\n", __func__, off_retry);
printk(KERN_EMERG "%s : Power OFF Error! PS_HOLD = 0x%08X, error retry = %d !!!\n", __func__, value, off_retry);
}
}
#endif
Expand Down
7 changes: 2 additions & 5 deletions drivers/hardkernel/ina231-misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int ina231_misc_probe(struct ina231_sensor *sensor)
struct miscdevice *pmisc;
struct global_sensor *gsensor;

if(!(pmisc = kzalloc(sizeof(struct miscdevice), GFP_KERNEL))) {
if(!(pmisc = devm_kzalloc(&sensor->client->dev, sizeof(struct miscdevice), GFP_KERNEL))) {
printk("INA231 Sensor misc struct malloc error!\n");
return -ENOMEM;
}
Expand All @@ -131,7 +131,7 @@ int ina231_misc_probe(struct ina231_sensor *sensor)
printk("%s : INA231 misc register fail!\n", __func__); return rc;
}

if(!(gsensor = (struct global_sensor *)kmalloc(sizeof(struct global_sensor), GFP_KERNEL))) {
if(!(gsensor = (struct global_sensor *)devm_kzalloc(&sensor->client->dev, sizeof(struct global_sensor), GFP_KERNEL))) {
printk("%s : INA231 global sensor malloc error!\n", __func__);
}
else {
Expand All @@ -154,10 +154,7 @@ void ina231_misc_remove(struct device *dev)
list_for_each(list_head, &SensorList)
{
gsensor = list_entry(list_head, struct global_sensor, list);

kfree(gsensor);
}
kfree(sensor->misc);
}

//[*]--------------------------------------------------------------------------------------------------[*]
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/exynos/tv/hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define INFOFRAME_CNT 2

/* default preset configured on probe */
#define HDMI_DEFAULT_TIMINGS_IDX (3)
#define HDMI_DEFAULT_TIMINGS_IDX (6)

#define HDMI_VSI_VERSION 0x01
#define HDMI_AVI_VERSION 0x02
Expand Down
30 changes: 23 additions & 7 deletions drivers/media/platform/exynos/tv/hdmi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ MODULE_LICENSE("GPL");

#ifdef CONFIG_MACH_ODROIDXU3
extern unsigned long HdmiEDIDBootArgs;
extern unsigned char HdmiVOUTBootArgs[10];
#endif

/* I2C module and id for HDMIPHY */
Expand Down Expand Up @@ -412,7 +413,8 @@ int hdmi_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
hdev->color_range = ctrl->value;
break;
case V4L2_CID_TV_HDCP_ENABLE:
hdev->hdcp_info.hdcp_enable = ctrl->value;
if (!hdev->dvi_mode)
hdev->hdcp_info.hdcp_enable = ctrl->value;
dev_dbg(hdev->dev, "HDCP %s\n",
ctrl->value ? "enable" : "disable");
break;
Expand Down Expand Up @@ -775,16 +777,30 @@ static void hdmi_hpd_changed(struct hdmi_device *hdev, int state)
return;
}

#ifdef CONFIG_MACH_ODROIDXU3
printk("###########################################\n");
printk("# HDMI EDID mode %d #\n", HdmiEDIDBootArgs);
printk("###########################################\n");

printk("###########################################\n");
printk("# HDMI VOUT mode %s #\n", HdmiVOUTBootArgs);
printk("###########################################\n");

if (HdmiEDIDBootArgs == 0) {
if(strcmp(HdmiVOUTBootArgs, "dvi") == 0) {
hdev->dvi_mode = true;
} else {
hdev->dvi_mode = false;
}
}
#endif
hdev->dvi_mode = !edid_supports_hdmi(hdev);
hdev->cur_timings = edid_preferred_preset(hdev);
hdev->cur_conf = hdmi_timing2conf(&hdev->cur_timings);

#ifdef CONFIG_MACH_ODROIDXU3
if (HdmiEDIDBootArgs == 0)
hdev->dvi_mode = false;
#endif


printk("###########################################\n");
printk("# hdev->dvi_mode %s #\n", hdev->dvi_mode ? "true" : "false");
printk("###########################################\n");
}

switch_set_state(&hdev->hpd_switch, state);
Expand Down
75 changes: 55 additions & 20 deletions drivers/media/platform/exynos/tv/hdmi_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ MODULE_DEVICE_TABLE(of, edid_device_table);
// HDMI PHY Bootargs parsing
//
//[*]--------------------------------------------------------------------------------------------------[*]
unsigned char HdmiPHYBootArgs[10] = { 0 };
unsigned char HdmiPHYBootArgs[12] = "720p60hz";

// Bootargs parsing
static int __init hdmi_resolution_setup(char *line)
Expand All @@ -64,12 +64,23 @@ static int __init hdmi_resolution_setup(char *line)
}
__setup("hdmi_phy_res=", hdmi_resolution_setup);

unsigned long HdmiEDIDBootArgs = 1;
unsigned char HdmiVOUTBootArgs[10] = "hdmi";

// Bootargs parsing
static int __init hdmi_vout_setup(char *line)
{
memset(HdmiVOUTBootArgs, 0x00, sizeof(HdmiVOUTBootArgs));
sprintf(HdmiVOUTBootArgs, "%s", line);
return 0;
}
__setup("vout=", hdmi_vout_setup);

unsigned long HdmiEDIDBootArgs = 0;

// Bootargs parsing
static int __init hdmi_edid_setup(char *line)
{
if(kstrtoul(line, 10, &HdmiEDIDBootArgs) != 0) HdmiEDIDBootArgs = 1;
if(kstrtoul(line, 10, &HdmiEDIDBootArgs) != 0) HdmiEDIDBootArgs = 0;
return 0;
}
__setup("edid=", hdmi_edid_setup);
Expand Down Expand Up @@ -104,18 +115,24 @@ static struct edid_preset {
char *name;
bool supported;
} edid_presets[] = {
{ V4L2_DV_BT_DMT_640X480P60, 640, 480, 60, FB_VMODE_NONINTERLACED, "480p@60" },
{ V4L2_DV_BT_CEA_720X480P59_94, 720, 480, 59, FB_VMODE_NONINTERLACED, "[email protected]" },
{ V4L2_DV_BT_CEA_720X576P50, 720, 576, 50, FB_VMODE_NONINTERLACED, "576p@50" },
{ V4L2_DV_BT_CEA_720X576P50, 720, 576, 50, FB_VMODE_NONINTERLACED, "576p@50" },
{ V4L2_DV_BT_DMT_800X600P60, 800, 600, 60, FB_VMODE_NONINTERLACED, "600@60" },
{ V4L2_DV_BT_DMT_1024X768P60, 1024, 768, 60, FB_VMODE_NONINTERLACED, "768@60" },
{ V4L2_DV_BT_CEA_1280X720P50, 1280, 720, 50, FB_VMODE_NONINTERLACED, "720p@50" },
{ V4L2_DV_BT_CEA_1280X720P60, 1280, 720, 60, FB_VMODE_NONINTERLACED, "720p@60" },
{ V4L2_DV_BT_DMT_1280X800P60_RB, 1280, 800, 59, FB_VMODE_NONINTERLACED, "800p@59" },
{ V4L2_DV_BT_DMT_1280X960P60, 1280, 960, 60, FB_VMODE_NONINTERLACED, "960@60" },
{ V4L2_DV_BT_DMT_1440X900P60, 1440, 900, 60, FB_VMODE_NONINTERLACED, "900@60" },
{ V4L2_DV_BT_DMT_1280X1024P60, 1280, 1024, 60, FB_VMODE_NONINTERLACED, "1024p@60" },
{ V4L2_DV_BT_CEA_1920X1080I50, 1920, 1080, 50, FB_VMODE_INTERLACED, "1080i@50" },
{ V4L2_DV_BT_CEA_1920X1080I60, 1920, 1080, 60, FB_VMODE_INTERLACED, "1080i@60" },
{ V4L2_DV_BT_CEA_1920X1080P24, 1920, 1080, 24, FB_VMODE_NONINTERLACED, "1080p@24" },
{ V4L2_DV_BT_CEA_1920X1080P25, 1920, 1080, 25, FB_VMODE_NONINTERLACED, "1080p@25" },
{ V4L2_DV_BT_CEA_1920X1080P30, 1920, 1080, 30, FB_VMODE_NONINTERLACED, "1080p@30" },
{ V4L2_DV_BT_CEA_1920X1080P50, 1920, 1080, 50, FB_VMODE_NONINTERLACED, "1080p@50" },
{ V4L2_DV_BT_CEA_1920X1080P60, 1920, 1080, 60, FB_VMODE_NONINTERLACED, "1080p@60" },
{ V4L2_DV_BT_CEA_1920X1080I50, 1920, 1080, 50, FB_VMODE_INTERLACED, "1080i@50" },
{ V4L2_DV_BT_CEA_1920X1080I60, 1920, 1080, 60, FB_VMODE_INTERLACED, "1080i@60" },
};

static struct edid_3d_preset {
Expand Down Expand Up @@ -400,24 +417,43 @@ static void edid_find_3d_more_preset(struct fb_video *vic, char s3d_structure)
static void edid_bootarg_preset(void)
{
int i;
printk("###########################################\n");
printk("# HDMI PHY Resolution %s #\n", HdmiPHYBootArgs);
printk("###########################################\n");
if (strncmp(HdmiPHYBootArgs, "1080p60hz", 9) == 0)
preferred_preset = hdmi_conf[11].dv_timings;
preferred_preset = hdmi_conf[17].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "1080p50hz", 9) == 0)
preferred_preset = hdmi_conf[10].dv_timings;
preferred_preset = hdmi_conf[16].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "1080p30hz", 9) == 0)
preferred_preset = hdmi_conf[9].dv_timings;
preferred_preset = hdmi_conf[15].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "1080i60hz", 9) == 0)
preferred_preset = hdmi_conf[6].dv_timings;
preferred_preset = hdmi_conf[12].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "1080i50hz", 9) == 0)
preferred_preset = hdmi_conf[5].dv_timings;
preferred_preset = hdmi_conf[11].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "1024p60hz", 9) == 0)
preferred_preset = hdmi_conf[10].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "900p60hz", 8) == 0)
preferred_preset = hdmi_conf[9].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "960p60hz", 8) == 0)
preferred_preset = hdmi_conf[8].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "800p59hz", 8) == 0)
preferred_preset = hdmi_conf[4].dv_timings;
preferred_preset = hdmi_conf[7].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "720p60hz", 8) == 0)
preferred_preset = hdmi_conf[3].dv_timings;
preferred_preset = hdmi_conf[6].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "720p50hz", 8) == 0)
preferred_preset = hdmi_conf[5].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "768p60hz", 8) == 0)
preferred_preset = hdmi_conf[4].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "600p60hz", 8) == 0)
preferred_preset = hdmi_conf[3].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "576p50hz", 8) == 0)
preferred_preset = hdmi_conf[2].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "480p59.94hz", 11) == 0)
preferred_preset = hdmi_conf[1].dv_timings;
else if (strncmp(HdmiPHYBootArgs, "480p60hz", 8) == 0)
preferred_preset = hdmi_conf[0].dv_timings;
else
preferred_preset = hdmi_conf[3].dv_timings;
preferred_preset = hdmi_conf[6].dv_timings;

for (i = 0; i < ARRAY_SIZE(edid_presets); i++)
edid_presets[i].supported =
Expand Down Expand Up @@ -497,16 +533,15 @@ int edid_update(struct hdmi_device *hdev)
int ret = 0;
int i;

#ifdef CONFIG_MACH_ODROIDXU3
if (HdmiEDIDBootArgs == 0)
goto out;
#endif

edid_misc = 0;

block_cnt = edid_read(hdev, &edid);
if (block_cnt < 0)
if (block_cnt < 0) {
printk("###########################################\n");
printk("# edid_read fail, broken??\n");
printk("###########################################\n");
goto out;
}

fb_edid_to_monspecs(edid, &specs);
for (i = 1; i < block_cnt; i++) {
Expand Down
Loading