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

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

Merge "msm: mdss: add backlight gpio invert support for display"

parents e9f8ab76 92172af1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ Optional properties:
- qcom,platform-reset-gpio:		Specifies the panel reset gpio.
- qcom,platform-te-gpio:		Specifies the gpio used for TE.
- qcom,platform-bklight-en-gpio:	Specifies the gpio used to enable display back-light
- qcom,platform-bklight-en-gpio-invert:	Invert the gpio used to enable display back-light
- qcom,panel-mode-gpio:			Specifies the GPIO to select video/command/single-port/dual-port
					mode of panel through gpio when it supports these modes.
- pinctrl-names:			List of names to assign mdss pin states defined in pinctrl device node
@@ -267,6 +268,7 @@ Example:
			qcom,platform-te-gpio = <&msmgpio 24 0>;
			qcom,platform-enable-gpio = <&msmgpio 58 1>;
			qcom,platform-bklight-en-gpio = <&msmgpio 86 0>;
			qcom,platform-bklight-en-gpio-invert;
			qcom,panel-mode-gpio = <&msmgpio 107 0>;
			qcom,dsi-irq-line;
			qcom,lane-map = "lane_map_3012";
+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -232,6 +232,10 @@ static int dsi_parse_gpio(struct platform_device *pdev,
		pr_err("%s:%d, bklt_en gpio not specified\n",
						__func__, __LINE__);

	ctrl_pdata->bklt_en_gpio_invert =
			of_property_read_bool(ctrl_pdev->dev.of_node,
				"qcom,platform-bklight-en-gpio-invert");

	return 0;
}

+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -4105,6 +4105,10 @@ static int mdss_dsi_parse_gpio_params(struct platform_device *ctrl_pdev,
	if (!gpio_is_valid(ctrl_pdata->bklt_en_gpio))
		pr_info("%s: bklt_en gpio not specified\n", __func__);

	ctrl_pdata->bklt_en_gpio_invert =
			of_property_read_bool(ctrl_pdev->dev.of_node,
				"qcom,platform-bklight-en-gpio-invert");

	ctrl_pdata->rst_gpio = of_get_named_gpio(ctrl_pdev->dev.of_node,
			 "qcom,platform-reset-gpio", 0);
	if (!gpio_is_valid(ctrl_pdata->rst_gpio))
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -449,6 +449,7 @@ struct mdss_dsi_ctrl_pdata {
	int rst_gpio;
	int disp_en_gpio;
	int bklt_en_gpio;
	bool bklt_en_gpio_invert;
	int lcd_mode_sel_gpio;
	int bklt_ctrl;	/* backlight ctrl */
	bool pwm_pmi;
+15 −4
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -343,8 +343,14 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
			}

			if (gpio_is_valid(ctrl_pdata->bklt_en_gpio)) {

				if (ctrl_pdata->bklt_en_gpio_invert)
					rc = gpio_direction_output(
						ctrl_pdata->bklt_en_gpio, 0);
				else
					rc = gpio_direction_output(
						ctrl_pdata->bklt_en_gpio, 1);

				if (rc) {
					pr_err("%s: unable to set dir for bklt gpio\n",
						__func__);
@@ -380,7 +386,12 @@ int mdss_dsi_panel_reset(struct mdss_panel_data *pdata, int enable)
		}
	} else {
		if (gpio_is_valid(ctrl_pdata->bklt_en_gpio)) {

			if (ctrl_pdata->bklt_en_gpio_invert)
				gpio_set_value((ctrl_pdata->bklt_en_gpio), 1);
			else
				gpio_set_value((ctrl_pdata->bklt_en_gpio), 0);

			gpio_free(ctrl_pdata->bklt_en_gpio);
		}
		if (gpio_is_valid(ctrl_pdata->disp_en_gpio)) {