Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes for ODroid-C1 #82

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-meson8b/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/amlogic/hdmi/hdmi_tx/hdmi_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down Expand Up @@ -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 ;
Expand Down
10 changes: 2 additions & 8 deletions drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions drivers/amlogic/thermal/amlogic_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 1 addition & 8 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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
Expand Down