Commit 672c9a6f authored by ckkim's avatar ckkim Committed by Mauro Ribeiro

odroid_fan pwm_control

parent 446938cc
......@@ -658,7 +658,40 @@
reg = <0x77>;
};
};
pinctrl@14010000 {
pwm0_out: pwm0-out {
samsung,pins = "gpb2-0";
samsung,pin-function = <2>;
samsung,pin-pud = <0x03>;
};
};
sec_pwm: pwm@12dd0000 {
status = "okay";
};
odroid_fan {
compatible = "odroid-fan";
pinctrl-names = "default";
pinctrl-0 = <&pwm0_out>;
pwm_id = <0>;
pwm_periode_ns = <20972>; /* 22kHz */
pwm_duty = <200>; /* initial value : 0 to 255 */
fan_mode = <1>; /* 0:manual, 1:auto */
tmu_level_0 = <57>;
tmu_level_1 = <63>;
tmu_level_2 = <68>;
fan_speed_0 = <1>;
fan_speed_1 = <51>;
fan_speed_2 = <71>;
fan_speed_3 = <91>;
};
leds {
compatible = "gpio-leds";
/* Blue LED */
......
......@@ -3011,6 +3011,7 @@ CONFIG_ARM_GIC=y
#
# ODROID Specific Hardware
#
CONFIG_ODROID_EXYNOS5_FAN=y
CONFIG_ODROID_EXYNOS5_SP=y
CONFIG_ODROID_EXYNOS5_IOBOARD=y
# CONFIG_ODROID_EXYNOS5_IOBOARD_DEBUG is not set
......
menu "ODROID Specific Hardware"
config ODROID_EXYNOS5_FAN
bool "Enable the PWM Controlled FAN on ODROID-EXYNOS5"
depends on MACH_ODROIDXU3
default y
---help---
Enables the PWM Controlled FAN on ODROID-EXYNOS5
config ODROID_EXYNOS5_SP
bool "Enable the INA231 Sensor on ODROID-EXYNOS5"
depends on MACH_ODROIDXU3
......
obj-$(CONFIG_ODROID_EXYNOS5_FAN) += odroid_fan.o
obj-$(CONFIG_ODROID_EXYNOS5_SP) += ina231-i2c.o ina231-misc.o ina231-sysfs.o
obj-$(CONFIG_ODROID_EXYNOS5_IOBOARD) += ioboard-bh1780.o ioboard-bmp180.o
obj-$(CONFIG_ODROID_EXYNOS5_IOBOARD) += ioboard-keyled.o ioboard-spi.o ioboard-spi-misc.o
This diff is collapsed.
......@@ -1865,6 +1865,32 @@ static int exynos5_tmu_cpufreq_notifier(struct notifier_block *notifier, unsigne
}
#endif
unsigned long exynos_thermal_get_value(void)
{
struct exynos_tmu_data *data = th_zone->sensor_conf->private_data;
u8 temp_code;
unsigned long temp[EXYNOS_TMU_COUNT] = {0,}, max_temp =0;
int i;
mutex_lock(&data->lock);
clk_enable(data->clk[0]);
clk_enable(data->clk[1]);
for (i = 0; i < EXYNOS_TMU_COUNT; i++) {
temp_code = readb(data->base[i] + EXYNOS_TMU_REG_CURRENT_TEMP);
if (temp_code == 0xff)
continue;
temp[i] = code_to_temp(data, temp_code, i);
if(max_temp < temp[i]) max_temp = temp[i];
}
clk_disable(data->clk[0]);
clk_disable(data->clk[1]);
mutex_unlock(&data->lock);
return max_temp;
}
EXPORT_SYMBOL(exynos_thermal_get_value);
static int exynos_tmu_probe(struct platform_device *pdev)
{
struct exynos_tmu_data *data;
......
/*
* ISA1200 Haptic Driver
*/
#ifndef __LINUX_ODROID_FAN_H
#define __LINUX_ODROID_FAN_H
#include <linux/compiler.h>
#include <linux/types.h>
#define ISA1200_POWERDOWN_MODE (0<<3)
#define ISA1200_PWM_INPUT_MODE (1<<3)
#define ISA1200_PWM_GEN_MODE (2<<3)
#define ISA1200_WAVE_GEN_MODE (3<<3)
struct odroid_fan_platform_data {
int pwm_gpio;
int pwm_func;
int pwm_id;
unsigned short pwm_periode_ns;
unsigned short pwm_duty;
};
#endif /* __LINUX_ODROID_FAN_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment