From 8987c75563ed089c31041aaf6934823458b9e491 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Sun, 15 Feb 2015 14:49:16 -0800 Subject: [PATCH 1/4] Revert amlogic's dtb make modification --- arch/arm/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 2caae284ae4c19..7f868f00283620 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -299,10 +299,7 @@ zinstall uinstall install: vmlinux $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ %.dtb: scripts - $(Q)$(MAKE) $(build)=$(subst $(wildcard $(srctree)//),,$(subst $(join /,$(subst dtb,dts,$@)),,$(firstword $(wildcard $(srctree)/$(boot)/dts/amlogic/$(subst dtb,dts,$@) $(srctree)/$(CUSTOMER_DIR_NAME)/meson/dt/$(subst dtb,dts,$@))))) \ - MACHINE=$(MACHINE) \ - $(subst $(wildcard $(srctree)//),,$(subst .dts,.dtb,$(firstword $(wildcard $(srctree)/$(boot)/dts/amlogic/$(subst dtb,dts,$@) $(srctree)/$(CUSTOMER_DIR_NAME)/meson/dt/$(subst dtb,dts,$@))))) - rm $(firstword $(wildcard $(srctree)/$(boot)/dts/amlogic/$(subst dtb,dts,$@) $(srctree)/$(CUSTOMER_DIR_NAME)/meson/dt/$(subst dtb,dts,$@))) + $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ dtbs: scripts $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs From 154fdfb4ea2d850ec4b86af414f3c7db0ec3d9a3 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Sun, 15 Feb 2015 12:27:02 -0800 Subject: [PATCH 2/4] amlogic: Default debug level to ERR This reverts commit 9ee92c45657f4b6db1cce76fa93c29be0a8c6387. --- drivers/amlogic/hdmi/hdmi_tx/hdmi_tx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx.c b/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx.c index 07dc053ac94884..c33fb03e3fb4df 100644 --- a/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx.c +++ b/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx.c @@ -142,7 +142,7 @@ static int force_vout_index = 0; static int hdmi_prbs_mode = 0xffff; /* 0xffff=disable; 0=PRBS 11; 1=PRBS 15; 2=PRBS 7; 3=PRBS 31*/ static int hdmi_480p_force_clk = 0; /* 200, 225, 250, 270 */ -static int debug_level = INF; // 1: error 2: important 3: normal 4: detailed +static int debug_level = ERR; // 1 (ERR): error 2 (IMP): important 3 (INF): normal 4 (LOW): verbose 5 (DET): detailed /***************************** * hdmitx attr management : @@ -860,7 +860,6 @@ static ssize_t show_support_3d(struct device * dev, struct device_attribute *att void hdmi_print(int dbg_lvl, const char *fmt, ...) { - return; va_list args; if(dbg_lvl == OFF) return ; From c7eaabe4d61767a62bd7dcdb205c0c515bb72744 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Sat, 14 Feb 2015 18:16:13 -0800 Subject: [PATCH 3/4] amlogic: Fix CEC null pointer dereference --- drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c b/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c index 5b47f9f893fef0..e90dad7c8970a1 100644 --- a/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c +++ b/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c @@ -1564,22 +1564,16 @@ static int __init cec_init(void) init_waitqueue_head(&hdmitx_device->cec_wait_rx); cec_key_init(); hdmi_print(INF, CEC "CEC init\n"); - cec_global_info.cec_flag.cec_key_flag = 0; - cec_global_info.cec_flag.cec_fiq_flag = 0; - cec_global_info.cec_flag.cec_init_flag = 0; + + memset(&cec_global_info, 0, sizeof(cec_global_info_t)); #if MESON_CPU_TYPE == MESON_CPU_TYPE_MESON6 hdmi_wr_reg(CEC0_BASE_ADDR+CEC_CLOCK_DIV_H, 0x00 ); hdmi_wr_reg(CEC0_BASE_ADDR+CEC_CLOCK_DIV_L, 0xf0 ); #endif - cec_global_info.cec_rx_msg_buf.rx_write_pos = 0; - cec_global_info.cec_rx_msg_buf.rx_read_pos = 0; cec_global_info.cec_rx_msg_buf.rx_buf_size = sizeof(cec_global_info.cec_rx_msg_buf.cec_rx_message)/sizeof(cec_global_info.cec_rx_msg_buf.cec_rx_message[0]); - memset(cec_global_info.cec_rx_msg_buf.cec_rx_message, 0, sizeof(cec_global_info.cec_rx_msg_buf.cec_rx_message)); - memset(&cec_global_info, 0, sizeof(cec_global_info_t)); - cec_global_info.hdmitx_device = hdmitx_device; hdmitx_device->task_cec = kthread_run(cec_task, (void*)hdmitx_device, "kthread_cec"); From d8debc5c2758c767d2aefbb0239bbc5d88344914 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Sun, 15 Feb 2015 16:51:45 -0800 Subject: [PATCH 4/4] amlogic: Use millicelsius for system temperature --- arch/arm/mach-meson8b/thermal.c | 2 +- drivers/amlogic/thermal/amlogic_thermal.c | 6 +++--- drivers/thermal/thermal_core.c | 9 +-------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-meson8b/thermal.c b/arch/arm/mach-meson8b/thermal.c index f17da11a6bfddf..d53cc4b43c312a 100644 --- a/arch/arm/mach-meson8b/thermal.c +++ b/arch/arm/mach-meson8b/thermal.c @@ -65,7 +65,7 @@ int get_cpu_temp(void) if(temps->flag){ ret=get_adc_sample(6); if(ret>=0){ - tempa=(10*(ret-temps->adc_efuse))/32+27; + tempa=(10000*(ret-temps->adc_efuse))/32+27000; ret=tempa; } } diff --git a/drivers/amlogic/thermal/amlogic_thermal.c b/drivers/amlogic/thermal/amlogic_thermal.c index d685c650afdd42..f1dd2afd5da1d6 100644 --- a/drivers/amlogic/thermal/amlogic_thermal.c +++ b/drivers/amlogic/thermal/amlogic_thermal.c @@ -669,7 +669,7 @@ static int amlogic_get_temp(struct thermal_zone_device *thermal, } else if (virtual_thermal_en) { *temp = aml_cal_virtual_temp(); } else { - *temp = 45; // fix cpu temperature to 45 if not trimed && disable virtual thermal + *temp = 45000; // fix cpu temperature to 45 if not trimed && disable virtual thermal } #else *temp = (unsigned long)get_cpu_temp(); @@ -865,8 +865,8 @@ static struct amlogic_thermal_platform_data * amlogic_thermal_init_from_dts(stru } descend=get_desend(); for (i = 0; i < pdata->temp_trip_count; i++) { - printk("temperature=%d on trip point=%d\n",tmp_level[i].temperature,i); - pdata->tmp_trip[i].temperature=tmp_level[i].temperature; + printk("temperature=%d on trip point=%d\n",tmp_level[i].temperature * 1000,i); + pdata->tmp_trip[i].temperature=tmp_level[i].temperature * 1000; printk("fixing high_freq=%d to ",tmp_level[i].cpu_high_freq); tmp_level[i].cpu_high_freq=fix_to_freq(tmp_level[i].cpu_high_freq,descend); pdata->tmp_trip[i].cpu_lower_level=cpufreq_cooling_get_level(0,tmp_level[i].cpu_high_freq); diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 936f6ec36925eb..d024180c9d24d6 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -347,7 +347,7 @@ static void handle_critical_trips(struct thermal_zone_device *tz, if (trip_type == THERMAL_TRIP_CRITICAL) { dev_emerg(&tz->device, "critical temperature reached(%d C),shutting down\n", - tz->temperature); + tz->temperature / 1000); orderly_poweroff(true); } } @@ -481,14 +481,7 @@ temp_show(struct device *dev, struct device_attribute *attr, char *buf) if (ret) return ret; -#if defined(CONFIG_MACH_MESON8B_ODROIDC) - /* Fake workaround to return the temperature - * as millidegree Celsius - */ - return sprintf(buf, "%ld\n", temperature * 1000); -#else return sprintf(buf, "%ld\n", temperature); -#endif } static ssize_t