Merge "target: use PWM GPIO config from target"
diff --git a/target/apq8084/include/target/display.h b/target/apq8084/include/target/display.h
index 5861791..728d7bf 100644
--- a/target/apq8084/include/target/display.h
+++ b/target/apq8084/include/target/display.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -104,4 +104,6 @@
#define MIPI_VSYNC_BACK_PORCH_LINES 3
#define MIPI_VSYNC_FRONT_PORCH_LINES 9
+#define PWM_BL_LPG_CHAN_ID 3
+
#endif
diff --git a/target/apq8084/target_display.c b/target/apq8084/target_display.c
index 53e74b6..517ea1b 100644
--- a/target/apq8084/target_display.c
+++ b/target/apq8084/target_display.c
@@ -98,17 +98,17 @@
};
if (enable) {
- pm8x41_gpio_config(bl->bl_pwm_gpio_num, &pwmgpio_param);
+ pm8x41_gpio_config(pwm_gpio.pin_id, &pwmgpio_param);
/* lpg channel 2 */
- pm8x41_lpg_write(bl->bl_lpg_chan_id, 0x41, 0x33); /* LPG_PWM_SIZE_CLK, */
- pm8x41_lpg_write(bl->bl_lpg_chan_id, 0x42, 0x01); /* LPG_PWM_FREQ_PREDIV */
- pm8x41_lpg_write(bl->bl_lpg_chan_id, 0x43, 0x20); /* LPG_PWM_TYPE_CONFIG */
- pm8x41_lpg_write(bl->bl_lpg_chan_id, 0x44, 0xcc); /* LPG_VALUE_LSB */
- pm8x41_lpg_write(bl->bl_lpg_chan_id, 0x45, 0x00); /* LPG_VALUE_MSB */
- pm8x41_lpg_write(bl->bl_lpg_chan_id, 0x46, 0xe4); /* LPG_ENABLE_CONTROL */
+ pm8x41_lpg_write(PWM_BL_LPG_CHAN_ID, 0x41, 0x33); /* LPG_PWM_SIZE_CLK, */
+ pm8x41_lpg_write(PWM_BL_LPG_CHAN_ID, 0x42, 0x01); /* LPG_PWM_FREQ_PREDIV */
+ pm8x41_lpg_write(PWM_BL_LPG_CHAN_ID, 0x43, 0x20); /* LPG_PWM_TYPE_CONFIG */
+ pm8x41_lpg_write(PWM_BL_LPG_CHAN_ID, 0x44, 0xcc); /* LPG_VALUE_LSB */
+ pm8x41_lpg_write(PWM_BL_LPG_CHAN_ID, 0x45, 0x00); /* LPG_VALUE_MSB */
+ pm8x41_lpg_write(PWM_BL_LPG_CHAN_ID, 0x46, 0xe4); /* LPG_ENABLE_CONTROL */
} else {
- pm8x41_lpg_write(bl->bl_lpg_chan_id, 0x46, 0x0); /* LPG_ENABLE_CONTROL */
+ pm8x41_lpg_write(PWM_BL_LPG_CHAN_ID, 0x46, 0x0); /* LPG_ENABLE_CONTROL */
}
return NO_ERROR;
diff --git a/target/msm8974/include/target/display.h b/target/msm8974/include/target/display.h
index 8897239..b827cf6 100644
--- a/target/msm8974/include/target/display.h
+++ b/target/msm8974/include/target/display.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -45,6 +45,9 @@
"msmgpio", 58, 3, 1, 0, 1
};
+static struct gpio_pin pwm_gpio = {
+ "pm8941_gpios", 36, 3, 1, 0, 1
+};
/*---------------------------------------------------------------------------*/
/* LDO configuration */
@@ -100,6 +103,8 @@
#define MIPI_VSYNC_BACK_PORCH_LINES 3
#define MIPI_VSYNC_FRONT_PORCH_LINES 9
+#define PWM_BL_LPG_CHAN_ID 8
+
extern int mdss_dsi_phy_init(struct mipi_dsi_panel_config *, uint32_t ctl_base);
#endif
diff --git a/target/msm8974/target_display.c b/target/msm8974/target_display.c
index ffe3202..c32cef0 100644
--- a/target/msm8974/target_display.c
+++ b/target/msm8974/target_display.c
@@ -160,8 +160,8 @@
ret = msm8974_wled_backlight_ctrl(enable);
break;
case BL_PWM:
- ret = msm8974_pwm_backlight_ctrl(bl->bl_pwm_gpio_num,
- bl->bl_lpg_chan_id,
+ ret = msm8974_pwm_backlight_ctrl(pwm_gpio.pin_id,
+ PWM_BL_LPG_CHAN_ID,
enable);
break;
default: