Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fc2aa5a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Add platform-enable-gpio for msm8909w"

parents a6c3bb11 20fe79ba
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -85,6 +85,25 @@
	/delete-node/ mpu6050_int_pin;
	/delete-node/ apds99xx_int_pin;
	/delete-node/ ak8963_int_pin;

	pmx_mdss {
		mdss_dsi_active: mdss_dsi_active {
			mux {
				pins = "gpio25", "gpio37", "gpio59";
			};
			config {
				pins = "gpio25", "gpio37", "gpio59";
			};
		};
		mdss_dsi_suspend: mdss_dsi_suspend {
			mux {
				pins = "gpio25", "gpio37", "gpio59";
			};
			config {
				pins = "gpio25", "gpio37", "gpio59";
			};
		};
	};
};

&i2c_3 {
@@ -222,6 +241,7 @@
&mdss_dsi0{
	qcom,dsi-pref-prim-pan = <&dsi_auo_390p_cmd>;
	qcom,platform-bklight-en-gpio = <&msm_gpio 52 0>;
	qcom,platform-enable-gpio = <&msm_gpio 59 0>;
};

&mdss_dsi0_pll {
+33 −0
Original line number Diff line number Diff line
@@ -2675,9 +2675,41 @@ static ssize_t mdp3_show_smart_blit(struct device *dev,
static DEVICE_ATTR(smart_blit, S_IRUGO | S_IWUSR | S_IWGRP,
			mdp3_show_smart_blit, mdp3_store_smart_blit);

static ssize_t mdp3_store_twm(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t len)
{
	u32 data = -1;
	ssize_t rc = 0;

	rc = kstrtoint(buf, 10, &data);
	if (rc) {
		pr_err("kstrtoint failed. rc=%d\n", rc);
		return rc;
	}
	mdp3_res->twm_en = data ? true : false;
	pr_err("TWM :  %s\n",	(mdp3_res->twm_en) ?
		"ENABLED" : "DISABLED");
	return len;
}

static ssize_t mdp3_show_twm(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	ssize_t ret = 0;

	pr_err("TWM :  %s\n",	(mdp3_res->twm_en) ?
		"ENABLED" : "DISABLED");
	ret = snprintf(buf, PAGE_SIZE, "%d\n", mdp3_res->twm_en);
	return ret;
}

static DEVICE_ATTR(twm_enable, S_IRUGO | S_IWUSR | S_IWGRP,
			mdp3_show_twm, mdp3_store_twm);

static struct attribute *mdp3_fs_attrs[] = {
	&dev_attr_caps.attr,
	&dev_attr_smart_blit.attr,
	&dev_attr_twm_enable.attr,
	NULL
};

@@ -2939,6 +2971,7 @@ static int mdp3_probe(struct platform_device *pdev)
		mdp3_dynamic_clock_gating_ctrl;
	mdp3_res->mdss_util->panel_intf_type = mdp3_panel_intf_type;
	mdp3_res->mdss_util->panel_intf_status = mdp3_panel_get_intf_status;
	mdp3_res->twm_en = false;

	if (mdp3_res->mdss_util->param_check(mdss_mdp3_panel)) {
		mdp3_res->mdss_util->display_disabled = true;
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ struct mdp3_hw_resource {
	struct mutex reg_bus_lock;
	int bklt_level;
	int bklt_update;

	bool twm_en;
	u32 max_bw;

	u8 ppp_formats[BITS_TO_BYTES(MDP_IMGTYPE_LIMIT1)];
+32 −5
Original line number Diff line number Diff line
@@ -1029,6 +1029,11 @@ end:
	return rc;
}

static bool mdp3_is_twm_en(void)
{
	return mdp3_res->twm_en;
}

static int mdp3_ctrl_off(struct msm_fb_data_type *mfd)
{
	int rc = 0;
@@ -1074,9 +1079,11 @@ static int mdp3_ctrl_off(struct msm_fb_data_type *mfd)
			pr_debug("fb%d is off already", mfd->index);
			goto off_error;
		}
		if (panel && panel->set_backlight)
		if (panel && panel->set_backlight) {
			if (!mdp3_is_twm_en())
				panel->set_backlight(panel, 0);
		}
	}

	/*
	* While transitioning from interactive to low power,
@@ -1114,9 +1121,28 @@ static int mdp3_ctrl_off(struct msm_fb_data_type *mfd)
		mdp3_irq_deregister();
	}

	if (panel->event_handler)
	if (panel->event_handler) {
		if (mdp3_is_twm_en()) {
			pr_info("TWM active skip panel off, disable disp_en\n");
			if (gpio_is_valid(panel->panel_en_gpio)) {
				rc = gpio_direction_output(
					panel->panel_en_gpio, 1);
				if (rc) {
					pr_err("%s:set dir for gpio(%d) FAIL\n",
						__func__, panel->panel_en_gpio);
				} else {
					gpio_set_value((panel->panel_en_gpio),
							0);
					usleep_range(100, 110);
					pr_debug("%s:set disp_en_gpio_%d Low\n",
						__func__, panel->panel_en_gpio);
				}
			}
		} else {
			rc = panel->event_handler(panel, MDSS_EVENT_PANEL_OFF,
				(void *) (long int)mfd->panel_power_state);
		}
	}
	if (rc)
		pr_err("EVENT_PANEL_OFF error (%d)\n", rc);

@@ -2965,6 +2991,7 @@ int mdp3_ctrl_init(struct msm_fb_data_type *mfd)
	mdp3_interface->configure_panel = mdp3_update_panel_info;
	mdp3_interface->input_event_handler = NULL;
	mdp3_interface->signal_retire_fence = NULL;
	mdp3_interface->is_twm_en = mdp3_is_twm_en;

	mdp3_session = kzalloc(sizeof(struct mdp3_session_data), GFP_KERNEL);
	if (!mdp3_session) {
+8 −0
Original line number Diff line number Diff line
@@ -196,12 +196,20 @@ int mdp3_ppp_verify_res(struct mdp_blit_req *req)

	if (((req->src_rect.x + req->src_rect.w) > req->src.width) ||
	    ((req->src_rect.y + req->src_rect.h) > req->src.height)) {
		pr_err("%s: src roi (x=%d,y=%d,w=%d, h=%d) WxH(%dx%d)\n",
			 __func__, req->src_rect.x, req->src_rect.y,
			req->src_rect.w, req->src_rect.h, req->src.width,
			req->src.height);
		pr_err("%s: src roi larger than boundary\n", __func__);
		return -EINVAL;
	}

	if (((req->dst_rect.x + req->dst_rect.w) > req->dst.width) ||
	    ((req->dst_rect.y + req->dst_rect.h) > req->dst.height)) {
		pr_err("%s: dst roi (x=%d,y=%d,w=%d, h=%d) WxH(%dx%d)\n",
			 __func__, req->dst_rect.x, req->dst_rect.y,
			req->dst_rect.w, req->dst_rect.h, req->dst.width,
			req->dst.height);
		pr_err("%s: dst roi larger than boundary\n", __func__);
		return -EINVAL;
	}
Loading