Commit 8f284b62 authored by Mauro Ribeiro's avatar Mauro Ribeiro

Merge branch 'odroidxu3-3.10.y'

parents f532f99a b4b6c7c9
......@@ -318,6 +318,7 @@
regulator-min-microvolt = <2850000>;
regulator-max-microvolt = <2850000>;
regulator-always-on;
regulator-ramp-delay = <12000>;
regulator-initial-mode = <1>;
};
......@@ -459,6 +460,8 @@
usb@12000000 {
dwc3-vbus-supply = <&dwc3_vbus>;
vdd33-supply = <&ldo9_reg>;
vdd10-supply = <&ldo11_reg>;
samsung,bsess-gpio = <&gpx3 5 0xf>;
pinctrl-names = "default";
pinctrl-0 = <&b_sess0_irq>;
......@@ -475,6 +478,8 @@
usb@12400000 {
dwc3-vbus-supply = <&dwc3_vbus>;
vdd33-supply = <&ldo9_reg>;
vdd10-supply = <&ldo11_reg>;
samsung,bsess-gpio = <&gpx3 4 0xf>;
pinctrl-names = "default";
pinctrl-0 = <&b_sess1_irq>;
......@@ -624,6 +629,7 @@
eSHUNT_BUS_VOLT_CONTINUOUS),
update_period = CONVERSION_DELAY(eVSH_CON_8244uS, eVBUS_CON_8244uS, eAVG_CON_16), // unit = usec
*/
i2c@12C60000 {
status = "okay";
clock-frequency = <400000>;
......
......@@ -28,15 +28,15 @@
mshc0 = &dwmmc_0;
mshc1 = &dwmmc_1;
mshc2 = &dwmmc_2;
mfc0 = &mfc_0;
gsc0 = &gsc_0;
gsc1 = &gsc_1;
mfc0 = &mfc_0;
mdev0 = &mdev_0;
jpeg0 = &jpeg_0;
jpeg1 = &jpeg_1;
spi0 = &spi_0;
spi1 = &spi_1;
spi2 = &spi_2;
jpeg0 = &jpeg_0;
jpeg1 = &jpeg_1;
spi3 = &spi_3;
spi4 = &spi_4;
scaler0 = &scaler_0;
......@@ -101,7 +101,6 @@
pmu_wdt_reset_type = <1>;
};
firmware@02073000 {
compatible = "samsung,secure-firmware";
reg = <0x02073000 0x1000>;
......@@ -1429,5 +1428,4 @@
secmem = <&gsc_0>,
<&gsc_1>;
};
};
......@@ -4,6 +4,8 @@
#include <linux/version.h>
#include <generated/utsrelease.h>
struct device;
#if defined(CONFIG_DEBUG_FS)
struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
struct dentry *parent,
......
......@@ -12,6 +12,8 @@
*/
#include <linux/string.h>
struct device;
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
/* backport
* commit 9f3b795a626ee79574595e06d1437fe0c7d51d29
......
......@@ -910,7 +910,7 @@ PHY_RFShadowCompareAll(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{
PHY_RFShadowCompare(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset);
}
......@@ -928,7 +928,7 @@ PHY_RFShadowRecorverAll(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{
PHY_RFShadowRecorver(Adapter, (RF_RADIO_PATH_E)eRFPath, Offset);
}
......@@ -972,7 +972,7 @@ PHY_RFShadowCompareFlagSetAll(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{
// 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!!
if (Offset != 0x26 && Offset != 0x27)
......@@ -994,7 +994,7 @@ PHY_RFShadowRecorverFlagSetAll(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{
// 2008/11/20 MH For S3S4 test, we only check reg 26/27 now!!!!
if (Offset != 0x26 && Offset != 0x27)
......@@ -1015,7 +1015,7 @@ PHY_RFShadowRefresh(
for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{
RF_Shadow[eRFPath][Offset].Value = 0;
RF_Shadow[eRFPath][Offset].Compare = _FALSE;
......
......@@ -1228,15 +1228,9 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
return 0;
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14,0))
static int cfg80211_rtw_get_station(struct wiphy *wiphy,
struct net_device *ndev,
const u8 *mac, struct station_info *sinfo)
#else
static int cfg80211_rtw_get_station(struct wiphy *wiphy,
struct net_device *ndev,
u8 *mac, struct station_info *sinfo)
#endif
{
int ret = 0;
struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
......@@ -2963,29 +2957,16 @@ static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14,0))
static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
const u8 *mac, struct station_parameters *params)
#else
static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
u8 *mac, struct station_parameters *params)
#endif
{
DBG_8192D(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
struct station_del_parameters *params)
#elif (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14, 0))
static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
const u8 *mac)
#else
static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
u8 *mac)
#endif
{
int ret=0;
struct list_head *phead, *plist;
......@@ -2994,9 +2975,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
struct rtw_adapter *padapter = (struct rtw_adapter *)rtw_netdev_priv(ndev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct sta_priv *pstapriv = &padapter->stapriv;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
const u8 *mac = params->mac;
#endif
DBG_8192D("+"FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
......@@ -3070,13 +3049,8 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
return ret;
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14, 0))
static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
const u8 *mac, struct station_parameters *params)
#else
static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
u8 *mac, struct station_parameters *params)
#endif
{
DBG_8192D(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
......@@ -3506,18 +3480,8 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len,
return ret;
}
int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
struct ieee80211_channel *chan, bool offchan,
unsigned int wait, const u8 *buf, size_t len,
bool no_cck, bool dont_wait_for_ack, u64 *cookie);
static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0))
struct ieee80211_channel *chan, bool offchan,
unsigned int wait, const u8 *buf, size_t len,
bool no_cck, bool dont_wait_for_ack,
#else
struct cfg80211_mgmt_tx_params *params,
#endif
u64 *cookie)
{
struct rtw_adapter *padapter =
......@@ -3529,11 +3493,9 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
bool ack = true;
u8 category, action;
unsigned long start = jiffies;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
size_t len = params->len;
struct ieee80211_channel *chan = params->chan;
const u8 *buf = params->buf;
#endif
struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *)buf;
u8 tx_ch = (u8) ieee80211_frequency_to_channel(chan->center_freq);
......
......@@ -801,8 +801,8 @@ static ssize_t show_target_loads(
for (i = 0; i < tunables->ntarget_loads; i++)
ret += sprintf(buf + ret, "%u%s", tunables->target_loads[i],
i & 0x1 ? ":" : " ");
ret += sprintf(buf + --ret, "\n");
ret--;
ret += sprintf(buf + ret, "\n");
spin_unlock_irqrestore(&tunables->target_loads_lock, flags);
return ret;
}
......@@ -842,7 +842,8 @@ static ssize_t show_above_hispeed_delay(
tunables->above_hispeed_delay[i],
i & 0x1 ? ":" : " ");
ret += sprintf(buf + --ret, "\n");
ret--;
ret += sprintf(buf + ret, "\n");
spin_unlock_irqrestore(&tunables->above_hispeed_delay_lock, flags);
return ret;
}
......
......@@ -942,7 +942,7 @@ static int exynos5_int_busfreq_target(struct device *dev,
unsigned long freq;
unsigned long old_freq;
unsigned long target_volt;
int i, target_idx = LV_0;
int target_idx = LV_0;
bool set_abb_first_than_volt;
mutex_lock(&data->lock);
......@@ -1117,7 +1117,7 @@ static ssize_t int_show_state(struct device *dev, struct device_attribute *attr,
ssize_t len = 0;
ssize_t write_cnt = (ssize_t)((PAGE_SIZE / LV_END) - 2);
for (i = LV_0; i < LV_END; i++)
for (i = LV_0; i < ARRAY_SIZE(int_bus_opp_list); i++)
len += snprintf(buf + len, write_cnt, "%ld %llu\n", int_bus_opp_list[i].freq,
(unsigned long long)int_bus_opp_list[i].time_in_state);
......@@ -1238,7 +1238,7 @@ static int exynos5_devfreq_int_probe(struct platform_device *pdev)
struct clk *tmp_clk = NULL, *tmp_parent_clk = NULL, *tmp_p_parent_clk = NULL;
struct int_pm_clks *int_clk;
unsigned long volt;
int i, index = -1;
int index = -1;
data = kzalloc(sizeof(struct busfreq_data_int), GFP_KERNEL);
......
......@@ -765,8 +765,10 @@ static int exynos_drm_init(void)
return 0;
#ifdef CONFIG_DRM_EXYNOS_VIDI
err_unregister_pd:
platform_device_unregister(exynos_drm_pdev);
#endif
err_remove_vidi:
#ifdef CONFIG_DRM_EXYNOS_VIDI
......
......@@ -246,7 +246,7 @@ __setup("vout=", dvi_force_enable);
// Default gEnableHPD = true,
//
//-----------------------------------------------------------------------------
unsigned int gEnableHPD = true; // Default setup
unsigned long gEnableHPD = true; // Default setup
static int __init hdmi_hpd_enable(char *line)
{
......@@ -1779,7 +1779,9 @@ static void hdmi_v13_mode_apply(struct hdmi_context *hdata)
}
clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi);
/* enable HDMI and timing generator */
......@@ -1941,7 +1943,9 @@ static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
}
clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi);
/* enable HDMI and timing generator */
......@@ -1962,7 +1966,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
u32 reg;
clk_disable_unprepare(hdata->res.sclk_hdmi);
// clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel);
#ifndef CONFIG_ODROIDXU3
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel);
#endif
clk_prepare_enable(hdata->res.sclk_hdmi);
/* operation mode */
......@@ -2004,6 +2010,7 @@ static void hdmiphy_poweron(struct hdmi_context *hdata)
hdmiphy_conf_reset(hdata);
}
#ifndef CONFIG_MACH_ODROIDXU3
static void hdmiphy_poweroff(struct hdmi_context *hdata)
{
if (hdata->type != HDMI_TYPE14)
......@@ -2025,6 +2032,7 @@ static void hdmiphy_poweroff(struct hdmi_context *hdata)
hdmiphy_reg_writeb(hdata, HDMIPHY_MODE_SET_DONE,
HDMI_PHY_DISABLE_MODE_SET);
}
#endif
static void hdmiphy_conf_apply(struct hdmi_context *hdata)
{
......@@ -2371,12 +2379,16 @@ static void hdmi_poweroff(struct exynos_drm_display *display)
/* HDMI System Disable */
hdmi_reg_writemask(hdata, HDMI_CON_0, 0, HDMI_EN);
// hdmiphy_poweroff(hdata);
#ifndef CONFIG_MACH_ODROIDXU3
hdmiphy_poweroff(hdata);
#endif
cancel_delayed_work(&hdata->hotplug_work);
// clk_disable_unprepare(res->sclk_hdmi);
// clk_disable_unprepare(res->hdmi);
#ifndef CONFIG_MACH_ODROIDXU3
clk_disable_unprepare(res->sclk_hdmi);
clk_disable_unprepare(res->hdmi);
#endif
/* reset pmu hdmiphy control bit to disable hdmiphy */
regmap_update_bits(hdata->pmureg, PMU_HDMI_PHY_CONTROL,
......@@ -2495,7 +2507,9 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
goto fail;
}
// clk_set_parent(res->mout_hdmi, res->sclk_pixel);
#ifndef CONFIG_MACH_ODROIDXU3
clk_set_parent(res->mout_hdmi, res->sclk_pixel);
#endif
clk_set_parent(res->sclk_hdmi, res->sclk_hdmiphy);
res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) *
......
......@@ -54,6 +54,8 @@ static struct ioboard_spi *ioboard_spi;
#define CMD_HIGH_SPEED_READ 0x0B
#define CMD_READ_STATUS_REG 0x05
#define SPI_READ_HIGHSPEED
// Erase memory
#define CMD_ERASE_4KB 0x20
#define CMD_ERASE_32KB 0x52
......@@ -196,7 +198,7 @@ static int ioboard_spi_byte_write (struct spi_device *spi, unsigned int addr,
return 0;
}
#ifdef SPI_READ_HIGHSPEED
//[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_read_memory_highspeed (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size)
{
......@@ -218,7 +220,7 @@ static int ioboard_spi_read_memory_highspeed (struct spi_device *spi, unsigne
return 0;
}
#else
//[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_read_memory (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size)
{
......@@ -239,6 +241,7 @@ static int ioboard_spi_read_memory (struct spi_device *spi, unsigne
return 0;
}
#endif
//[*]--------------------------------------------------------------------------------------------------[*]
int ioboard_spi_read (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size)
......@@ -249,12 +252,20 @@ int ioboard_spi_read (struct spi_device *spi, unsigned int addr, unsigned cha
na = size % SPI_MAX_BUFFER_SIZE;
while(mok) {
#ifdef SPI_READ_HIGHSPEED
ioboard_spi_read_memory_highspeed(spi, addr + offset, &rdata[offset], SPI_MAX_BUFFER_SIZE);
#else
ioboard_spi_read_memory(spi, addr + offset, &rdata[offset], SPI_MAX_BUFFER_SIZE);
#endif
offset += SPI_MAX_BUFFER_SIZE; mok = mok - 1;
}
if(na) {
#ifdef SPI_READ_HIGHSPEED
ioboard_spi_read_memory_highspeed(spi, addr + offset, &rdata[offset], na);
#else
ioboard_spi_read_memory(spi, addr + offset, &rdata[offset], na);
#endif
}
return 0;
......@@ -326,6 +337,7 @@ static void ioboard_spi_wp_disable (unsigned char disable)
}
//[*]--------------------------------------------------------------------------------------------------[*]
#ifdef CONFIG_ODROID_EXYNOS5_IOBOARD_DEBUG
static void ioboard_spi_test (struct spi_device *spi)
{
unsigned char wdata[64], rdata[64];
......@@ -367,6 +379,7 @@ static void ioboard_spi_test (struct spi_device *spi)
pr_info("[0x%02X] ", rdata[i]);
}
}
#endif
//[*]--------------------------------------------------------------------------------------------------[*]
static int ioboard_spi_probe (struct spi_device *spi)
......
......@@ -256,7 +256,7 @@ out:
return 0;
}
static void appleir_input_configured(struct hid_device *hid,
static int appleir_input_configured(struct hid_device *hid,
struct hid_input *hidinput)
{
struct input_dev *input_dev = hidinput->input;
......@@ -275,6 +275,8 @@ static void appleir_input_configured(struct hid_device *hid,
for (i = 0; i < ARRAY_SIZE(appleir_key_table); i++)
set_bit(appleir->keymap[i], input_dev->keybit);
clear_bit(KEY_RESERVED, input_dev->keybit);
return 0;
}
static int appleir_input_mapping(struct hid_device *hid,
......
......@@ -471,18 +471,22 @@ static int magicmouse_input_mapping(struct hid_device *hdev,
return 0;
}
static void magicmouse_input_configured(struct hid_device *hdev,
static int magicmouse_input_configured(struct hid_device *hdev,
struct hid_input *hi)
{
struct magicmouse_sc *msc = hid_get_drvdata(hdev);
int ret;
int ret = magicmouse_setup_input(msc->input, hdev);
ret = magicmouse_setup_input(msc->input, hdev);
if (ret) {
hid_err(hdev, "magicmouse setup input failed (%d)\n", ret);
/* clean msc->input to notify probe() of the failure */
msc->input = NULL;
return ret;
}
return 0;
}
......
......@@ -859,14 +859,14 @@ not_claimed_input:
return 1;
}
static void ntrig_input_configured(struct hid_device *hid,
static int ntrig_input_configured(struct hid_device *hid,
struct hid_input *hidinput)
{
struct input_dev *input = hidinput->input;
if (hidinput->report->maxfield < 1)
return;
return 0;
switch (hidinput->report->field[0]->application) {
case HID_DG_PEN:
......@@ -890,6 +890,8 @@ static void ntrig_input_configured(struct hid_device *hid,
"N-Trig MultiTouch";
break;
}
return 0;
}
static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
......
......@@ -2105,6 +2105,7 @@ static struct video_device s5p_mfc_enc_videodev = {
.release = video_device_release,
};
#ifndef CONFIG_MACH_ODROIDXU3
static struct video_device s5p_mfc_dec_drm_videodev = {
.name = S5P_MFC_DEC_DRM_NAME,
.fops = &s5p_mfc_fops,
......@@ -2118,6 +2119,7 @@ static struct video_device s5p_mfc_enc_drm_videodev = {
.minor = -1,
.release = video_device_release,
};
#endif
static void *mfc_get_drv_data(struct platform_device *pdev);
......@@ -2336,8 +2338,9 @@ static int s5p_mfc_probe(struct platform_device *pdev)
video_set_drvdata(vfd, dev);
#ifndef CONFIG_MACH_ODROIDXU3
/* secure decoder */
/* vfd = video_device_alloc();
vfd = video_device_alloc();
if (!vfd) {
v4l2_err(&dev->v4l2_dev, "Failed to allocate video device\n");
ret = -ENOMEM;
......@@ -2363,10 +2366,10 @@ static int s5p_mfc_probe(struct platform_device *pdev)
vfd->num);
dev->vfd_dec_drm = vfd;
video_set_drvdata(vfd, dev); */
video_set_drvdata(vfd, dev);
/* secure encoder */
/* vfd = video_device_alloc();
vfd = video_device_alloc();
if (!vfd) {
v4l2_err(&dev->v4l2_dev, "Failed to allocate video device\n");
ret = -ENOMEM;
......@@ -2391,8 +2394,9 @@ static int s5p_mfc_probe(struct platform_device *pdev)
vfd->num);
dev->vfd_enc_drm = vfd;
video_set_drvdata(vfd, dev); */
video_set_drvdata(vfd, dev);
/* end of node setting*/
#endif
platform_set_drvdata(pdev, dev);
......
......@@ -349,6 +349,53 @@ static int s2mps11_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev,
return 0;
}
#endif /* CONFIG_OF */
//////////////////////////////////////
struct sec_pmic_dev *g_iodev = NULL;
int s2mps11_pmic_ethonoff(unsigned char status)
{
unsigned int ldo15 = 0, ldo17 = 0;
if(sec_reg_read(g_iodev, S2MPS11_REG_L15CTRL, &ldo15)) {
printk(KERN_EMERG "%s : S2MPS11 LDO CTRL15 read Error!!\n", __func__);
return -1;
}
if(sec_reg_read(g_iodev, S2MPS11_REG_L17CTRL, &ldo17)) {
printk(KERN_EMERG "%s : S2MPS11 LDO CTRL17 read Error!!\n", __func__);
return -1;
}
if(status) {
// ETH VDD0 ON
if(sec_reg_update(g_iodev, S2MPS11_REG_L15CTRL, 0x72, 0xFF)) {
printk(KERN_EMERG "%s : S2MPS11 LDO CTRL15 Error!!\n", __func__);
return -1;
}
// ETH VDD1 ON
if(sec_reg_update(g_iodev, S2MPS11_REG_L17CTRL, 0x72, 0xFF)) {
printk(KERN_EMERG "%s : S2MPS11 LDO CTRL17 Error!!\n", __func__);
return -1;
}
} else {
// ETH VDD0 OFF
if(sec_reg_update(g_iodev, S2MPS11_REG_L15CTRL, 0x00, 0x3F)) {
printk(KERN_EMERG "%s : S2MPS11 LDO CTRL15 Error!!\n", __func__);
return -1;
}
// ETH VDD1 OFF
if(sec_reg_update(g_iodev, S2MPS11_REG_L17CTRL, 0x00, 0x3F)) {
printk(KERN_EMERG "%s : S2MPS11 LDO CTRL17 Error!!\n", __func__);
return -1;
}
}
return 0;
}
EXPORT_SYMBOL(s2mps11_pmic_ethonoff);
//////////////////////////////////////
static int s2mps11_pmic_probe(struct platform_device *pdev)
{
......@@ -358,6 +405,8 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
struct s2mps11_info *s2mps11;
int i, ret;
g_iodev = dev_get_drvdata(pdev->dev.parent);
ret = sec_reg_read(iodev, S2MPS11_REG_ID, &iodev->rev_num);
if (ret < 0)
return ret;
......
......@@ -226,6 +226,8 @@ static enum mif_noti_state_t mif_old_state = MIF_TH_LV1;
static bool is_suspending;
static bool is_cpu_hotplugged_out;
static unsigned long ctmu_normal, ctmu_cold, ctmu_hot, ctmu_critical, throttle_cpu;
static BLOCKING_NOTIFIER_HEAD(exynos_tmu_notifier);
static BLOCKING_NOTIFIER_HEAD(exynos_gpu_notifier);
......@@ -511,9 +513,9 @@ void exynos_tmu_call_notifier(enum tmu_noti_state_t cur_state, int temp)
else
blocking_notifier_call_chain(&exynos_tmu_notifier, cur_state, &tmu_old_state);
if (cur_state == TMU_COLD)
pr_info("tmu temperature state %d to %d\n", tmu_old_state, cur_state);
pr_debug("tmu temperature state %d to %d\n", tmu_old_state, cur_state);
else
pr_info("tmu temperature state %d to %d, cur_temp : %d\n", tmu_old_state, cur_state, temp);
pr_debug("tmu temperature state %d to %d, cur_temp : %d\n", tmu_old_state, cur_state, temp);
tmu_old_state = cur_state;
}
}
......@@ -529,7 +531,7 @@ void exynos_gpu_call_notifier(enum gpu_noti_state_t cur_state)
cur_state = GPU_COLD;
if (cur_state != gpu_old_state) {
pr_info("gpu temperature state %d to %d\n", gpu_old_state, cur_state);
pr_debug("gpu temperature state %d to %d\n", gpu_old_state, cur_state);
blocking_notifier_call_chain(&exynos_gpu_notifier, cur_state, &cur_state);
gpu_old_state = cur_state;
}
......@@ -540,18 +542,35 @@ static void exynos_check_tmu_noti_state(int min_temp, int max_temp)
enum tmu_noti_state_t cur_state;
/* check current temperature state */
if (max_temp > HOT_CRITICAL_TEMP)
if (max_temp > HOT_CRITICAL_TEMP) {
cur_state = TMU_CRITICAL;
else if (max_temp > HOT_NORMAL_TEMP && max_temp <= HOT_CRITICAL_TEMP)
ctmu_critical++;
} else if (max_temp > HOT_NORMAL_TEMP && max_temp <= HOT_CRITICAL_TEMP) {
cur_state = TMU_HOT;
else if (max_temp > COLD_TEMP && max_temp <= HOT_NORMAL_TEMP)
ctmu_hot++;
} else if (max_temp > COLD_TEMP && max_temp <= HOT_NORMAL_TEMP) {
cur_state = TMU_NORMAL;
else
ctmu_normal++;
} else {
cur_state = TMU_COLD;
ctmu_cold++;
}
if (min_temp <= COLD_TEMP)
cur_state = TMU_COLD;
/* Just to check for overflow */
if (ctmu_critical >= ULONG_MAX)
ctmu_critical = 0;
if (ctmu_hot >= ULONG_MAX)
ctmu_hot = 0;
if (ctmu_normal >= ULONG_MAX)
ctmu_normal = 0;
if (ctmu_cold > ULONG_MAX)
ctmu_cold = 0;
if (throttle_cpu > ULONG_MAX)
throttle_cpu = 0;
exynos_tmu_call_notifier(cur_state, max_temp);
}
......@@ -666,6 +685,7 @@ static int __ref exynos_throttle_cpu_hotplug(struct thermal_zone_device *thermal
* If current temperature is lower than low threshold,
* call big_cores_hotplug(false) for hotplugged out cpus.
*/
throttle_cpu++;
ret = big_cores_hotplug(false);
if (ret)
pr_err("%s: failed big cores hotplug in\n",
......@@ -679,6 +699,7 @@ static int __ref exynos_throttle_cpu_hotplug(struct thermal_zone_device *thermal
* If current temperature is higher than high threshold,
* call big_cores_hotplug(true) to hold temperature down.
*/
throttle_cpu++;
ret = big_cores_hotplug(true);
if (ret)
pr_err("%s: failed big cores hotplug out\n",
......@@ -1778,8 +1799,25 @@ exynos_thermal_sensor_temp(struct device *dev,
static DEVICE_ATTR(temp, S_IRUSR | S_IRGRP, exynos_thermal_sensor_temp, NULL);
static ssize_t exynos_throttle_counter(struct device *dev,
struct device_attribute *attr, char *buf)
{
int len = 0;
len += snprintf(&buf[len], PAGE_SIZE, "TMU_NORMAL :%ld\n", ctmu_normal);
len += snprintf(&buf[len], PAGE_SIZE, "TMU_COLD :%ld\n", ctmu_cold);
len += snprintf(&buf[len], PAGE_SIZE, "TMU_HOT :%ld\n", ctmu_hot);