target: msm8974: changes to avoid the compilation warnings
Changes made to avoid the compilation warnings for supporting
Werror flag.
Change-Id: I09db62804d0f00b4b23b34d740d017dc606a6714
diff --git a/target/msm8974/include/target/display.h b/target/msm8974/include/target/display.h
index 953a1af..bbe2c3c 100644
--- a/target/msm8974/include/target/display.h
+++ b/target/msm8974/include/target/display.h
@@ -34,30 +34,6 @@
/*---------------------------------------------------------------------------*/
#include <display_resource.h>
-/*---------------------------------------------------------------------------*/
-/* GPIO configuration */
-/*---------------------------------------------------------------------------*/
-static struct gpio_pin reset_gpio = {
- "pm8941_gpios", 19, 2, 1, 0, 1
-};
-
-static struct gpio_pin enable_gpio = {
- "msmgpio", 58, 3, 1, 0, 1
-};
-
-static struct gpio_pin pwm_gpio = {
- "pm8941_gpios", 36, 3, 1, 0, 1
-};
-
-/*---------------------------------------------------------------------------*/
-/* LDO configuration */
-/*---------------------------------------------------------------------------*/
-static struct ldo_entry ldo_entry_array[] = {
- { "vdd", 22, 0, 3000000, 100000, 100, 0, 20, 0, 0},
-{ "vddio", 12, 0, 1800000, 100000, 100, 0, 20, 0, 0},
-{ "vdda", 2, 1, 1200000, 100000, 100, 0, 0, 0, 0},
-};
-
#define TOTAL_LDO_DEFINED 3
/*---------------------------------------------------------------------------*/
@@ -109,4 +85,9 @@
#define HDMI_PANEL_NAME "hdmi"
#define HDMI_CONTROLLER_STRING "hdmi:0"
+int target_cont_splash_screen();
+uint8_t target_panel_auto_detect_enabled();
+uint32_t target_hw_interposer();
+void target_force_cont_splash_disable(uint8_t override);
+uint32_t oem_panel_max_auto_detect_panels();
#endif
diff --git a/target/msm8974/init.c b/target/msm8974/init.c
index 59f7ffd..a7e0ca8 100644
--- a/target/msm8974/init.c
+++ b/target/msm8974/init.c
@@ -31,6 +31,7 @@
#include <platform/irqs.h>
#include <platform/gpio.h>
#include <reg.h>
+#include <string.h>
#include <target.h>
#include <platform.h>
#include <dload_util.h>
@@ -46,6 +47,8 @@
#include <hsusb.h>
#include <clock.h>
#include <partition_parser.h>
+#include <sdhci_msm.h>
+#include <qtimer.h>
#include <scm.h>
#include <platform/clock.h>
#include <platform/gpio.h>
@@ -53,6 +56,8 @@
#define HW_PLATFORM_8994_INTERPOSER 0x3
+extern int platform_is_8974();
+extern int platform_is_8974ac();
extern bool target_use_signed_kernel(void);
static void set_sdc_power_ctrl();
@@ -384,7 +389,7 @@
ret = scm_protect_keystore((uint32_t *)&buffer[0],size);
if(ret != 0)
- dprintf(CRITICAL,"ERROR: scm_protect_keystore Failed");
+ dprintf(CRITICAL,"ERROR: scm_protect_keystore Failed\n");
free(buffer);
}
@@ -663,7 +668,6 @@
unsigned target_pause_for_battery_charge(void)
{
- uint8_t pon_reason = pm8x41_get_pon_reason();
/* This function will always return 0 to facilitate
* automated testing/reboot with usb connected.
@@ -772,7 +776,6 @@
void target_usb_stop(void)
{
- uint32_t platform = board_platform_id();
/* Disable VBUS mimicing in the controller. */
if (target_needs_vbus_mimic())
diff --git a/target/msm8974/oem_panel.c b/target/msm8974/oem_panel.c
index 34cdd1b..45b00d9 100755
--- a/target/msm8974/oem_panel.c
+++ b/target/msm8974/oem_panel.c
@@ -33,6 +33,8 @@
#include <msm_panel.h>
#include <board.h>
#include <mipi_dsi.h>
+#include <string.h>
+#include <target/display.h>
#include "include/panel.h"
#include "panel_display.h"
@@ -283,7 +285,6 @@
struct mdss_dsi_phy_ctrl *phy_db)
{
uint32_t hw_id = board_hardware_id();
- uint32_t target_id = board_target_id();
int32_t panel_override_id;
if (panel_name) {
diff --git a/target/msm8974/target_display.c b/target/msm8974/target_display.c
index 003201e..289675c 100755
--- a/target/msm8974/target_display.c
+++ b/target/msm8974/target_display.c
@@ -30,16 +30,20 @@
#include <debug.h>
#include <smem.h>
#include <err.h>
+#include <qtimer.h>
+#include <string.h>
#include <msm_panel.h>
#include <mipi_dsi.h>
#include <pm8x41.h>
#include <pm8x41_wled.h>
#include <board.h>
#include <mdp5.h>
+#include <edp.h>
#include <platform/gpio.h>
#include <platform/clock.h>
#include <platform/iomap.h>
#include <target/display.h>
+#include <gcdb_display.h>
#include "include/panel.h"
#include "include/display_resource.h"
@@ -48,6 +52,30 @@
#define HFPLL_LDO_ID 12
+/*---------------------------------------------------------------------------*/
+/* GPIO configuration */
+/*---------------------------------------------------------------------------*/
+static struct gpio_pin reset_gpio = {
+ "pm8941_gpios", 19, 2, 1, 0, 1
+};
+
+static struct gpio_pin enable_gpio = {
+ "msmgpio", 58, 3, 1, 0, 1
+};
+
+static struct gpio_pin pwm_gpio = {
+ "pm8941_gpios", 36, 3, 1, 0, 1
+};
+
+/*---------------------------------------------------------------------------*/
+/* LDO configuration */
+/*---------------------------------------------------------------------------*/
+static struct ldo_entry ldo_entry_array[] = {
+ { "vdd", 22, 0, 3000000, 100000, 100, 0, 20, 0, 0},
+ { "vddio", 12, 0, 1800000, 100000, 100, 0, 20, 0, 0},
+ { "vdda", 2, 1, 1200000, 100000, 100, 0, 0, 0, 0},
+};
+
static struct pm8x41_wled_data wled_ctrl = {
.mod_scheme = 0x00,
.led1_brightness = (0x0F << 8) | 0xEF,
@@ -289,7 +317,7 @@
0x100 * ldo_entry_array[ldocounter].ldo_id),
ldo_entry_array[ldocounter].ldo_type);
- dprintf(SPEW, "Setting %s\n",
+ dprintf(SPEW, "Setting %u\n",
ldo_entry_array[ldocounter].ldo_id);
/* Set voltage during power on */
@@ -306,7 +334,7 @@
return NO_ERROR;
}
-static int msm8974_mdss_edp_panel_clock(int enable, struct msm_panel_info *pinfo)
+static uint32_t msm8974_mdss_edp_panel_clock(uint8_t enable , struct msm_panel_info *pinfo)
{
uint32_t dual_dsi = pinfo->mipi.dual_dsi;
if (enable) {
@@ -323,17 +351,8 @@
return 0;
}
-static int msm8974_edp_panel_power(int enable)
+static int msm8974_edp_panel_power(uint8_t enable)
{
- struct pm8x41_gpio gpio36_param = {
- .direction = PM_GPIO_DIR_OUT,
- .function = PM_GPIO_FUNC_2,
- .vin_sel = 2, /* VIN_2 */
- .pull = PM_GPIO_PULL_UP_1_5 | PM_GPIO_PULLDOWN_10,
- .output_buffer = PM_GPIO_OUT_CMOS,
- .out_strength = PM_GPIO_OUT_DRIVE_HIGH,
- };
-
struct pm8x41_ldo ldo12 = LDO(PM8x41_LDO12, PLDO_TYPE);
if (enable) {
@@ -372,7 +391,7 @@
if (!strcmp(panel_name, HDMI_PANEL_NAME)) {
if (buf_size < (prefix_string_len + LK_OVERRIDE_PANEL_LEN +
- HDMI_CONTROLLER_STRING)) {
+ strlen(HDMI_CONTROLLER_STRING))) {
dprintf(CRITICAL, "command line argument is greater than buffer size\n");
return false;
}
@@ -393,7 +412,7 @@
{
uint32_t hw_id = board_hardware_id();
uint32_t panel_loop = 0;
- uint32_t ret = 0;
+ int ret = 0;
if (target_hw_interposer())
return;
@@ -432,14 +451,14 @@
do {
target_force_cont_splash_disable(false);
ret = gcdb_display_init(panel_name, MDP_REV_50,
- MIPI_FB_ADDR);
+ (void *)MIPI_FB_ADDR);
if (!ret || ret == ERR_NOT_SUPPORTED) {
break;
} else {
target_force_cont_splash_disable(true);
msm_display_off();
}
- } while (++panel_loop <= oem_panel_max_auto_detect_panels());
+ } while (++panel_loop <= (uint32_t)oem_panel_max_auto_detect_panels());
break;
}
}