Commit 2a1c0c22 authored by Mis012's avatar Mis012

__WIP__

parent 526d64d1
......@@ -72,7 +72,7 @@
};
};
pmx_mdss_active: pmx_mdss_active {
pmx_mdss_default: pmx_mdss_default {
pinmux {
function = "gpio";
pins = "gpio25", "gpio9";
......@@ -83,7 +83,7 @@
};
};
pmx_mdss_suspend: pmx_mdss_suspend {
pmx_mdss_sleep: pmx_mdss_sleep {
pinmux {
function = "gpio";
pins = "gpio25", "gpio9";
......@@ -94,7 +94,7 @@
};
};
pmx_lcd_active: pmx_lcd_active {
pmx_lcd_default: pmx_lcd_default {
pinmux {
function = "gpio";
pins = "gpio56";
......@@ -102,10 +102,11 @@
pinconf {
drive-strength = <2>;
bias-pull-none;
input-enable;
};
};
pmx_lcd_suspend: pmx_lcd_suspend {
pmx_lcd_sleep: pmx_lcd_sleep {
pinmux {
function = "gpio";
pins = "gpio56";
......@@ -113,6 +114,7 @@
pinconf {
drive-strength = <2>;
bias-pull-down;
input-enable;
};
};
......
......@@ -254,24 +254,27 @@
};
[email protected] {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
vdda-supply = <&pm8916_l2>;
vdd-supply = <&pm8916_l17>;
vddio-supply = <&pm8916_l6>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pmx_mdss_active &pmx_lcd_active>;
pinctrl-1 = <&pmx_mdss_suspend &pmx_lcd_suspend>;
pinctrl-0 = <&pmx_mdss_default &pmx_lcd_default>;
pinctrl-1 = <&pmx_mdss_sleep &pmx_lcd_sleep>;
[email protected] {
reg = <0>;
compatible = "samsung,s6e88a0-ams452ef01";
//vddp-supply = </*??*/>;
iovcc-supply = <&pm8916_l6>;
//enable-gpios = </*??*/>;
enable-gpios = <&msmgpio 9 GPIO_ACTIVE_HIGH>;
reset-gpios = <&msmgpio 25 GPIO_ACTIVE_HIGH>;
port {
......@@ -285,7 +288,6 @@
[email protected] {
dsi0_out: endpoint {
remote-endpoint = <&panel_in>;
data-lanes = <0 1>;
};
};
};
......@@ -335,6 +337,8 @@
l2 { //already-same
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-always-on; //FIXME trying to avoid dsi deinit
regulator-boot-on; //FIXME trying to avoid dsi deinit
};
/* PM8916 L3 VDD_MX supply */
......@@ -351,11 +355,15 @@
l5 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on; //as per downstream
regulator-boot-on; //as per downstream
};
l6 { //already-same
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on; //FIXME trying to avoid dsi deinit
regulator-boot-on; //FIXME trying to avoid dsi deinit
};
l7 {
......@@ -410,8 +418,10 @@
};
l17 {
regulator-min-microvolt = <2850000>;
regulator-max-microvolt = <2850000>;
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-always-on; //FIXME trying to avoid dsi deinit
regulator-boot-on; //FIXME trying to avoid dsi deinit
};
l18 {
......
......@@ -85,11 +85,14 @@ static int s6e88a0_panel_on(struct s6e88a0_panel *s6e88a0)
return ret;
}
msleep(10); //FIXME needed or not?
ret = mipi_dsi_dcs_write(dsi, 0xcc, (u8[]){ 0x4c }, 1);
if (ret < 0) {
dev_err(dev, "failed on dsc command `0xcc 0x4c` (whatever it is) : %d\n", ret);
return ret;
}
msleep(10); //FIXME needed or not?
ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
if (ret < 0) {
......@@ -97,6 +100,8 @@ static int s6e88a0_panel_on(struct s6e88a0_panel *s6e88a0)
return ret;
}
msleep(120);
ret = mipi_dsi_dcs_write(dsi, 0xca, (u8[]){ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
......@@ -106,50 +111,58 @@ static int s6e88a0_panel_on(struct s6e88a0_panel *s6e88a0)
dev_err(dev, "failed on setting 'brightness (and) gama' : %d\n", ret);
return ret;
}
msleep(10); //FIXME needed or not?
ret = mipi_dsi_dcs_write(dsi, 0xb2, (u8[]){ 0x40, 0x0a, 0x17, 0x00, 0x0a }, 5);
if (ret < 0) {
dev_err(dev, "failed on dsc command `b2 40 0a 17 00 0a` ('aid set') : %d\n", ret);
return ret;
}
msleep(10); //FIXME needed or not?
ret = mipi_dsi_dcs_write(dsi, 0xb6, (u8[]){ 0x2c, 0x0b }, 5);
if (ret < 0) {
dev_err(dev, "failed on dsc command `b6 2c 0b` ('elvss') : %d\n", ret);
return ret;
}
msleep(10); //FIXME needed or not?
ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_POWER_SAVE, (u8[]){ 0x00 }, 1);
if (ret < 0) {
dev_err(dev, "failed on MIPI_DCS_WRITE_POWER_SAVE command : %d\n", ret);
return ret;
}
msleep(10); //FIXME needed or not?
ret = mipi_dsi_dcs_write(dsi, 0xf7, (u8[]){ 0x03 }, 5);
if (ret < 0) {
dev_err(dev, "failed on dsc command `f7 03` ('gamma update') : %d\n", ret);
return ret;
}
msleep(10); //FIXME needed or not?
ret = mipi_dsi_dcs_write(dsi, 0xf0, (u8[]){ 0xa5, 0xa5 }, 2);
if (ret < 0) {
dev_err(dev, "failed on dsc command `f0 a5 a5` ('tesk key off') : %d\n", ret);
return ret;
}
msleep(10); //FIXME needed or not?
ret = mipi_dsi_dcs_set_display_on(dsi);
if (ret < 0) {
dev_err(dev, "failed to set display on: %d\n", ret);
return ret;
}
msleep(40); //just in case FIXME
return 0;
}
static void s6e88a0_panel_off(struct s6e88a0_panel *s6e88a0) //CORRECT [FIXME - remove this comment]
{
struct mipi_dsi_device *dsi = s6e88a0->dsi;
struct device *dev = &s6e88a0->dsi->dev; //-Wunused-variable
struct device *dev = &s6e88a0->dsi->dev; //-Wunused-variable FIXME
int ret;
dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
......@@ -198,7 +211,7 @@ static int s6e88a0_panel_unprepare(struct drm_panel *panel)
gpiod_set_value(s6e88a0->reset_gpio, 1);
gpiod_set_value(s6e88a0->dcdc_en_gpio, 0);
//gpiod_set_value(s6e88a0->dcdc_en_gpio, 0);
s6e88a0->prepared = false;
......@@ -222,8 +235,8 @@ static int s6e88a0_panel_prepare(struct drm_panel *panel)
msleep(20);
gpiod_set_value(s6e88a0->dcdc_en_gpio, 1);
usleep_range(10, 20);
//gpiod_set_value(s6e88a0->dcdc_en_gpio, 1);
//usleep_range(10, 20);
gpiod_set_value(s6e88a0->reset_gpio, 0);
usleep_range(10, 20);
......@@ -256,7 +269,7 @@ static int s6e88a0_panel_prepare(struct drm_panel *panel)
gpiod_set_value(s6e88a0->reset_gpio, 1);
gpiod_set_value(s6e88a0->dcdc_en_gpio, 0);
//gpiod_set_value(s6e88a0->dcdc_en_gpio, 0);
return ret;
}
......@@ -314,7 +327,7 @@ static int s6e88a0_panel_get_modes(struct drm_panel *panel)
}
static int dsi_dcs_bl_get_brightness(struct backlight_device *bl)
{
{/*
struct mipi_dsi_device *dsi = bl_get_data(bl);
int ret;
u16 brightness = bl->props.brightness;
......@@ -327,11 +340,13 @@ static int dsi_dcs_bl_get_brightness(struct backlight_device *bl)
dsi->mode_flags |= MIPI_DSI_MODE_LPM;
return brightness & 0xff;
return brightness & 0xff;*/
return 0;
}
static int dsi_dcs_bl_update_status(struct backlight_device *bl)
{
{/*
struct mipi_dsi_device *dsi = bl_get_data(bl);
int ret;
......@@ -342,7 +357,7 @@ static int dsi_dcs_bl_update_status(struct backlight_device *bl)
return ret;
dsi->mode_flags |= MIPI_DSI_MODE_LPM;
*/
return 0;
}
......@@ -398,7 +413,7 @@ static int s6e88a0_panel_add(struct s6e88a0_panel *s6e88a0)
return ret;
}
s6e88a0->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
s6e88a0->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
if (IS_ERR(s6e88a0->enable_gpio)) {
ret = PTR_ERR(s6e88a0->enable_gpio);
dev_err(dev, "cannot get enable-gpio %d\n", ret);
......@@ -412,12 +427,12 @@ static int s6e88a0_panel_add(struct s6e88a0_panel *s6e88a0)
return ret;
}
s6e88a0->dcdc_en_gpio = devm_gpiod_get(dev, "dcdc-en", GPIOD_OUT_LOW);
/*s6e88a0->dcdc_en_gpio = devm_gpiod_get(dev, "dcdc-en", GPIOD_OUT_LOW);
if (IS_ERR(s6e88a0->dcdc_en_gpio)) {
ret = PTR_ERR(s6e88a0->dcdc_en_gpio);
dev_err(dev, "cannot get dcdc-en-gpio %d\n", ret);
return ret;
}
}*/
s6e88a0->backlight = drm_panel_create_dsi_backlight(s6e88a0->dsi);
if (IS_ERR(s6e88a0->backlight)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment