[Motorola Atrix 2] Ravikirancg:
So thats what you did!! you dont at all touch first boot now.. instead create a new bool.. great work!.. :svetius:

out of curiosity, why did you push the following code above #ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT

if ((skip_first_boot || !first_boot) && !dssdev->phy.dsi.d2l_use_ulps) {
if (dssdev->platform_enable) {
ret = dssdev->platform_enable(dssdev);
if (ret)
goto err0;

my question is.. if I undid my initial commit and added lines to turn first boot to false later on.. after bootloader init, would I have solved the issue?

look at the codes below to get an idea of what I am trying to say here..

instead of what you did, could I have done

static int mapphone_panel_power_on(struct omap_dss_device *dssdev)
{

static bool first_boot = true;

struct mapphone_data *mp_data = dev_get_drvdata(&dssdev->dev);
int ret;
u8 power_mode = 0;
struct mapphone_dsi_panel_data *panel_data = get_panel_data(dssdev);

if (!first_boot && dssdev->phy.dsi.d2l_use_ulps) {
if (dssdev->platform_enable) {
ret = dssdev->platform_enable(dssdev);
if (ret)
goto err0;
}
}

set_default_panel_init_state(dssdev);

/*
* If 'secret off' is still enabled, DSI is still enabled. Disable
* it initially
*/
if (mp_data->som_enabled)
omapdss_dsi_display_disable(dssdev, true, false);

ret = omapdss_dsi_display_enable(dssdev);
if (ret) {
dev_err(&dssdev->dev, "failed to enable DSI\n");
goto err0;
}

#ifdef CONFIG_FB_OMAP_BOOTLOADER_INIT
if (first_boot) {
/*
* At this point the panel mapphone code has taken over the
* ownership of the dss clock states and the dss_fck and
* dss_sys_clk enable count can be decremented by calling
* clk_disable. These clocks were left enabled during boot
* since the ENABLE_ON_INIT flag is set for these clocks
* when CONFIG_FB_OMAP_BOOTLOADER_INIT is defined.
*/
struct clk *clk = omap_clk_get_by_name("dss_fck");
if (IS_ERR(clk))
printk(KERN_ERR "can't get clock dss_fck\n");
else
clk_disable(clk);

clk = omap_clk_get_by_name("dss_sys_clk");
if (IS_ERR(clk))
printk(KERN_ERR "can't get clock dss_sys_clk\n");
else
clk_disable(clk);

clk = omap_clk_get_by_name("dss_dss_clk");
if (IS_ERR(clk))
printk(KERN_ERR "can't get clock dss_dss_clk\n");
else
clk_disable(clk);
}
#endif
[B]
#ifdef CONFIG_PANEL_MAPPHONE_SKIP_FIRSTBOOT
static bool first_boot = false;
#else
static bool first_boot = true;
#endif

if (!first_boot && !dssdev->phy.dsi.d2l_use_ulps) {
if (dssdev->platform_enable) {
ret = dssdev->platform_enable(dssdev);
if (ret)
goto err0;
}
}

mapphone_hw_reset(dssdev);
[/B]
omapdss_dsi_vc_enable_hs(dssdev, dsi_vc_cmd, false);

if (dssdev->phy.dsi.type == OMAP_DSS_DSI_TYPE_VIDEO_MODE &&
!dssdev->skip_vm_init) {
//do extra job to match kozio registers
dsi_videomode_panel_preinit(dssdev);
//Need to wait a certain time - Toshiba Bridge Constraint
msleep(1);
}

check_mapphone_panel_present(dssdev);
if (panel_init_state == MAPPHONE_PANEL_NOT_PRESENT) {
printk(KERN_WARNING "%s:Panel is not attached or \
failed to send BTA.\n", __func__);
ret = -EINVAL;
goto err0;
}

switch (dssdev->panel.panel_id) {
case MOT_DISP_MIPI_CM_480_854:
case MOT_DISP_MIPI_CM_370_480_854:
ret = dsi_mipi_cm_480_854_panel_enable(dssdev);
break;
case MOT_DISP_MIPI_CM_430_480_854:
ret = dsi_mipi_430_cm_480_854_panel_enable(dssdev);
break;
case MOT_DISP_MIPI_CM_310_320_480_1:
ret = dsi_mipi_310_1_cm_320_480_panel_enable(dssdev);
break;
case MOT_DISP_MIPI_CM_400_540_960:
case MOT_DISP_MIPI_CM_430_540_960:
ret = mapphone_panel_MIPI_540_960_detect(dssdev);
break;
case MOT_DISP_MIPI_CM_430_540_960_3:
ret = dsi_mipi_cm_430_540_960_m3_v1_panel_enable(dssdev);
break;
case MOT_DISP_MIPI_CM_430_540_960_AMOLED:
ret = dsi_mipi_430_cm_540_960_amoled_panel_enable(dssdev);
break;
case MOT_DISP_MIPI_VM_248_320_240:
ret = dsi_mipi_248_vm_320_240_panel_enable(dssdev);
break;
case MOT_DISP_MIPI_VM_280_320_240:
ret = dsi_mipi_280_vm_320_240_panel_enable(dssdev);
break;
case MOT_DISP_MIPI_CM_450_720_1280:
ret = dsi_mipi_cm_450_720_1280_panel_enable(dssdev);
break;
case MOT_DISP_LVDS_MIPI_VM_1007_1280_800:
if (!dssdev->skip_vm_init)
ret = dsi_lvds_mipi_vm_1007_1280_800_panel_enable(dssdev);
break;
default:
printk(KERN_ERR "unsupport panel =0x%lx\n",
dssdev->panel.panel_id);
ret = -EINVAL;
goto err;
}

if (ret)
goto err;

panel_init_state = MAPPHONE_PANEL_INIT_DONE;

/* The first time we enable the display, read the current power mode.
* This is done to ensure AP + display are in sync for the display's
* state, as the bootloader can change the display's initial state.
* This is needed to ensure ESD check is done correctly.
*/
if (first_boot) {
if (panel_data->use_esd_check) {
if (dsi_vc_dcs_read(dssdev, dsi_vc_cmd,
EDISCO_CMD_GET_POWER_MODE,
&power_mode, 1) != 1) {
printk(KERN_ERR "Failed to read "
"'get_power_mode' first time\n");
ret = -EINVAL;
goto err;
}

/*Set the panel state to on if the display reports
* it is already on
*/
if (power_mode & 0x04)
atomic_set(&panel_data->state, PANEL_ON);
}
first_boot = false;
}

(sry for a copy paste.. I dont have nix or a git client anymore.. so couldn't show a commit)

or something like https://github.com/ravikirancg/andr...mmit/41bfee83daec01de73e48637e638aa644604e8ab

the reason I am asking this is because the idea I had was something like that my idea was something like "the idea that I had in mind is, well, if you look in the function panel_power_on, there are multiple modules that use first_boot.. what you need to do is, figure out which one of them actually is necessary for the device to power on the panel.. it might be more than one.. you need to check by trial and error.."

thats a conversation I had with altered btw..

nonetheless, not changing first boot at all was a much better solution.. keep up the great work.. :)

EDIT: now I want a moto a2 again.. :crying::crying::crying: