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

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

Merge "pwm: qpnp: modify to use pwm_config_us() for some qcom drivers"

parents 8cfb389c 4409c5d5
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -848,7 +848,7 @@ static int qpnp_mpp_set(struct qpnp_led_data *led)
			duty_us = (led->mpp_cfg->pwm_cfg->pwm_period_us *
					led->cdev.brightness) / LED_FULL;
			/*config pwm for brightness scaling*/
			rc = pwm_config(led->mpp_cfg->pwm_cfg->pwm_dev,
			rc = pwm_config_us(led->mpp_cfg->pwm_cfg->pwm_dev,
					duty_us,
					led->mpp_cfg->pwm_cfg->pwm_period_us);
			if (rc < 0) {
@@ -1402,7 +1402,7 @@ static int qpnp_kpdbl_set(struct qpnp_led_data *led)
		if (led->kpdbl_cfg->pwm_cfg->mode == PWM_MODE) {
			duty_us = (led->kpdbl_cfg->pwm_cfg->pwm_period_us *
				led->cdev.brightness) / KPDBL_MAX_LEVEL;
			rc = pwm_config(led->kpdbl_cfg->pwm_cfg->pwm_dev,
			rc = pwm_config_us(led->kpdbl_cfg->pwm_cfg->pwm_dev,
					duty_us,
					led->kpdbl_cfg->pwm_cfg->pwm_period_us);
			if (rc < 0) {
@@ -1424,7 +1424,7 @@ static int qpnp_kpdbl_set(struct qpnp_led_data *led)
			led->kpdbl_cfg->pwm_cfg->default_mode;

		if (led->kpdbl_cfg->always_on) {
			rc = pwm_config(led->kpdbl_cfg->pwm_cfg->pwm_dev, 0,
			rc = pwm_config_us(led->kpdbl_cfg->pwm_cfg->pwm_dev, 0,
					led->kpdbl_cfg->pwm_cfg->pwm_period_us);
			if (rc < 0) {
				dev_err(&led->spmi_dev->dev,
@@ -1473,7 +1473,8 @@ static int qpnp_rgb_set(struct qpnp_led_data *led)
		if (led->rgb_cfg->pwm_cfg->mode == PWM_MODE) {
			duty_us = (led->rgb_cfg->pwm_cfg->pwm_period_us *
				led->cdev.brightness) / LED_FULL;
			rc = pwm_config(led->rgb_cfg->pwm_cfg->pwm_dev, duty_us,
			rc = pwm_config_us(led->rgb_cfg->pwm_cfg->pwm_dev,
					duty_us,
					led->rgb_cfg->pwm_cfg->pwm_period_us);
			if (rc < 0) {
				dev_err(&led->spmi_dev->dev,
+3 −3
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/leds.h>
#include <linux/pwm.h>
#include <linux/qpnp/pwm.h>
#include <linux/err.h>

#include "mdss_dsi.h"
@@ -69,9 +69,9 @@ static void mdss_dsi_panel_bklt_pwm(struct mdss_dsi_ctrl_pdata *ctrl, int level)
		ctrl->pwm_enabled = 0;
	}

	ret = pwm_config(ctrl->pwm_bl, duty, ctrl->pwm_period);
	ret = pwm_config_us(ctrl->pwm_bl, duty, ctrl->pwm_period);
	if (ret) {
		pr_err("%s: pwm_config() failed err=%d.\n", __func__, ret);
		pr_err("%s: pwm_config_us() failed err=%d.\n", __func__, ret);
		return;
	}

+3 −3
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include <linux/gpio.h>
#include <linux/err.h>
#include <linux/regulator/consumer.h>
#include <linux/pwm.h>
#include <linux/qpnp/pwm.h>
#include <linux/clk.h>
#include <linux/spinlock_types.h>
#include <linux/kthread.h>
@@ -206,11 +206,11 @@ void mdss_edp_set_backlight(struct mdss_panel_data *pdata, u32 bl_level)
		if (bl_level > bl_max)
			bl_level = bl_max;

		ret = pwm_config(edp_drv->bl_pwm,
		ret = pwm_config_us(edp_drv->bl_pwm,
				bl_level * edp_drv->pwm_period / bl_max,
				edp_drv->pwm_period);
		if (ret) {
			pr_err("%s: pwm_config() failed err=%d.\n", __func__,
			pr_err("%s: pwm_config_us() failed err=%d.\n", __func__,
					ret);
			return;
		}