Permalink
Browse files

smdk4412: bulk update from i9300 update 9

Change-Id: Icd3e7b601f3f4c8b3dcf053fed5819fb7caf5296
  • Loading branch information...
1 parent 3d8b293 commit 55bb2048feb59f2190f704c2a4df81b557b55c7a Daniel Hillenbrand committed Jun 3, 2013
@@ -835,9 +835,10 @@ static struct s3c_mshci_platdata exynos4_mshc_pdata __initdata = {
MMC_CAP_UHS_DDR50 | MMC_CAP_CMD23,
#ifdef CONFIG_MMC_MSHCI_ENABLE_CACHE
.host_caps2 = MMC_CAP2_ADAPT_PACKED | MMC_CAP2_PACKED_CMD |
- MMC_CAP2_CACHE_CTRL,
+ MMC_CAP2_CACHE_CTRL | MMC_CAP2_POWEROFF_NOTIFY,
#else
- .host_caps2 = MMC_CAP2_ADAPT_PACKED | MMC_CAP2_PACKED_CMD,
+ .host_caps2 = MMC_CAP2_ADAPT_PACKED | MMC_CAP2_PACKED_CMD |
+ MMC_CAP2_POWEROFF_NOTIFY,
#endif
#elif defined(CONFIG_EXYNOS4_MSHC_8BIT)
.max_width = 8,
@@ -3430,29 +3431,16 @@ static void __init exynos4_reserve(void)
.start = 0x65800000,
.reserved = 1,
};
-
+
if (cma_early_region_register(&fimc_reg))
pr_err("S5P/CMA: Failed to register '%s'\n",
- fimc_reg.name);
+ fimc_reg.name);
}
#endif
#if defined(CONFIG_USE_MFC_CMA) && defined(CONFIG_MACH_M0)
ret = dma_declare_contiguous(&s5p_device_mfc.dev,
0x02800000, 0x5C800000, 0);
-
- if (ret == 0) {
- static struct cma_region mfc_reg = {
- .name = "mfc",
- .size = 0x02800000,
- .start = 0x5C800000,
- .reserved = 1,
- };
-
- if (cma_early_region_register(&mfc_reg))
- pr_err("S5P/CMA: Failed to register '%s'\n",
- mfc_reg.name);
- }
#endif
if (ret != 0)
printk(KERN_ERR "%s Fail\n", __func__);
@@ -331,11 +331,16 @@ struct platform_device s3c_device_fm34 = {
defined(CONFIG_FM_SI4705_MODULE)
static void fmradio_power(int on)
{
+ int err;
#if defined(CONFIG_MACH_M0) || defined(CONFIG_MACH_M0_CTC)
gpio_set_value(si47xx_data.gpio_sw, GPIO_LEVEL_HIGH);
#endif
if (on) {
- gpio_request(GPIO_FM_INT, "GPC1");
+ err = gpio_request(GPIO_FM_INT, "GPC1");
+ if (err) {
+ pr_err(KERN_ERR "GPIO_FM_INT GPIO set error!\n");
+ return;
+ }
gpio_direction_output(GPIO_FM_INT, 1);
gpio_set_value(si47xx_data.gpio_rst, GPIO_LEVEL_LOW);
gpio_set_value(GPIO_FM_INT, GPIO_LEVEL_LOW);
@@ -463,7 +463,8 @@ void max77693_set_input_current(struct max77693_charger_data *chg_data,
#endif
if (set_current == OFF_CURR) {
- max77693_write_reg(i2c, MAX77693_CHG_REG_CHG_CNFG_09, set_current);
+ max77693_write_reg(i2c, MAX77693_CHG_REG_CHG_CNFG_09,
+ set_current);
if (chg_data->soft_reg_state == true) {
pr_info("%s: exit soft regulation loop\n", __func__);
@@ -676,11 +677,12 @@ static int max77693_get_cable_type(struct max77693_charger_data *chg_data)
int state;
u8 reg_data, mu_adc, mu_adc1k, otg;
u8 dtls_00, chgin_dtls;
+ u8 dtls_01, chg_dtls;
u8 mu_st2, chgdetrun, vbvolt, chgtyp, dxovp;
- int muic_cb_typ;
+#ifdef CONFIG_BATTERY_WPC_CHARGER
bool wc_state;
- bool retry_det;
- bool chg_det_erred = false; /* TEMP: set as true for logging */
+#endif
+ bool retry_det, chg_det_erred;
bool otg_detected = false;
int retry_cnt = 0;
pr_debug("%s\n", __func__);
@@ -719,10 +721,8 @@ static int max77693_get_cable_type(struct max77693_charger_data *chg_data)
}
#endif
- muic_cb_typ = max77693_muic_get_charging_type();
/* if type detection by otg, do not otg check */
- if ((muic_cb_typ != CABLE_TYPE_AUDIODOCK_MUIC) &&
- (((otg || (mu_adc == 0x00 && !mu_adc1k))))) {
+ if (otg || (mu_adc == 0x00 && !mu_adc1k)) {
pr_info("%s: otg enabled(otg(0x%x), adc(0x%x))\n",
__func__, otg, mu_adc);
state = POWER_SUPPLY_TYPE_BATTERY;
@@ -737,25 +737,30 @@ static int max77693_get_cable_type(struct max77693_charger_data *chg_data)
goto chg_det_finish;
}
+ chg_det_erred = false; /* TEMP: set as true for logging */
do {
retry_det = false;
max77693_read_reg(chg_data->max77693->i2c,
MAX77693_CHG_REG_CHG_DTLS_00, &dtls_00);
+ max77693_read_reg(chg_data->max77693->i2c,
+ MAX77693_CHG_REG_CHG_DTLS_01, &dtls_01);
max77693_read_reg(chg_data->max77693->muic,
MAX77693_MUIC_REG_STATUS2, &mu_st2);
chgin_dtls = ((dtls_00 & MAX77693_CHGIN_DTLS) >>
MAX77693_CHGIN_DTLS_SHIFT);
+ chg_dtls = ((dtls_01 & MAX77693_CHG_DTLS) >>
+ MAX77693_CHG_DTLS_SHIFT);
chgdetrun = ((mu_st2 & MAX77693_CHGDETRUN) >>
MAX77693_CHGDETRUN_SHIFT);
vbvolt = ((mu_st2 & MAX77693_VBVOLT) >>
MAX77693_VBVOLT_SHIFT);
chgtyp = ((mu_st2 & MAX77693_CHGTYPE) >>
MAX77693_CHGTYPE_SHIFT);
if (chg_det_erred)
- pr_err("%s: CHGIN(0x%x). MU_ST2(0x%x), "
+ pr_err("%s: CHGIN(0x%x). CHG(0x%x), MU_ST2(0x%x), "
"CDR(0x%x), VB(0x%x), CHGTYP(0x%x)\n", __func__,
- chgin_dtls, mu_st2,
+ chgin_dtls, chg_dtls, mu_st2,
chgdetrun, vbvolt, chgtyp);
/* input power state */
@@ -772,9 +777,7 @@ static int max77693_get_cable_type(struct max77693_charger_data *chg_data)
chg_det_erred = true;
/* check chargable input power */
- if ((chgin_dtls == 0x0) &&
- (chg_data->cable_type ==
- POWER_SUPPLY_TYPE_BATTERY)) {
+ if ((chgin_dtls == 0x0) && (chg_dtls == 0x8)) {
pr_err("%s: unchargable power\n", __func__);
state = POWER_SUPPLY_TYPE_BATTERY;
goto chg_det_finish;
@@ -974,10 +977,6 @@ static int max77693_get_online_type(struct max77693_charger_data *chg_data)
m_typ = max77693_get_cable_type(chg_data);
- pr_info("%s: main(%d), sub(%d), pwr(%d)\n", __func__, m_typ,
- chg_data->cable_sub_type,
- chg_data->cable_pwr_type);
-
state = ((m_typ << ONLINE_TYPE_MAIN_SHIFT) |
(chg_data->cable_sub_type << ONLINE_TYPE_SUB_SHIFT) |
(chg_data->cable_pwr_type << ONLINE_TYPE_PWR_SHIFT));
@@ -637,7 +637,7 @@ static void battery_notify_full_state(struct battery_info *info)
info->battery_raw_soc, info->battery_full_soc,
info->battery_soc);
- if ((info->recharge_phase && info->full_charged_state) ||
+ if (info->full_charged_state ||
((info->charge_real_state != POWER_SUPPLY_STATUS_DISCHARGING) &&
(info->battery_raw_soc > info->battery_full_soc) &&
(info->battery_soc == 100))) {
@@ -808,7 +808,7 @@ static bool battery_fullcharged_cond(struct battery_info *info)
if (info->charge_real_state == POWER_SUPPLY_STATUS_FULL) {
if ((info->battery_vcell > f_cond_vcell) &&
(info->battery_soc > f_cond_soc)) {
- pr_info("%s: real full charged, v(%d), s(%d)\n",
+ pr_debug("%s: real full charged, v(%d), s(%d)\n",
__func__, info->battery_vcell,
info->battery_soc);
#if defined(USE_2STEP_TERM)
@@ -1606,6 +1606,8 @@ static void battery_monitor_work(struct work_struct *work)
case POWER_SUPPLY_TYPE_DOCK:
if (!info->pdata->suspend_chging)
wake_lock(&info->charge_wake_lock);
+ /* default dock prop is AC */
+ info->online_prop = ONLINE_PROP_AC;
muic_cb_typ = max77693_muic_get_charging_type();
switch (muic_cb_typ) {
case CABLE_TYPE_AUDIODOCK_MUIC:
@@ -1633,6 +1635,7 @@ static void battery_monitor_work(struct work_struct *work)
case CABLE_TYPE_SMARTDOCK_USB_MUIC:
pr_info("%s: smart dock usb(low), %d\n",
__func__, DOCK_TYPE_LOW_CURR);
+ info->online_prop = ONLINE_PROP_USB;
battery_charge_control(info,
DOCK_TYPE_LOW_CURR,
DOCK_TYPE_LOW_CURR);
@@ -2037,7 +2040,9 @@ static int samsung_usb_get_property(struct power_supply *ps,
val->intval = ((info->charge_virt_state !=
POWER_SUPPLY_STATUS_DISCHARGING) &&
((info->cable_type == POWER_SUPPLY_TYPE_USB) ||
- (info->cable_type == POWER_SUPPLY_TYPE_USB_CDP)));
+ (info->cable_type == POWER_SUPPLY_TYPE_USB_CDP) ||
+ ((info->cable_type == POWER_SUPPLY_TYPE_DOCK) &&
+ (info->online_prop == ONLINE_PROP_USB))));
return 0;
}
@@ -2057,7 +2062,8 @@ static int samsung_ac_get_property(struct power_supply *ps,
POWER_SUPPLY_STATUS_DISCHARGING) &&
((info->cable_type == POWER_SUPPLY_TYPE_MAINS) ||
(info->cable_type == POWER_SUPPLY_TYPE_MISC) ||
- (info->cable_type == POWER_SUPPLY_TYPE_DOCK) ||
+ ((info->cable_type == POWER_SUPPLY_TYPE_DOCK) &&
+ (info->online_prop != ONLINE_PROP_USB)) ||
(info->cable_type == POWER_SUPPLY_TYPE_WIRELESS)));
return 0;
View
@@ -1034,8 +1034,8 @@ static int ion_share_mmap(struct file *file, struct vm_area_struct *vma)
return -EINVAL;
}
- if ((size > buffer->size) || (size + (vma->vm_pgoff << PAGE_SHIFT) >
- buffer->size)) {
+ if (((vma->vm_pgoff << PAGE_SHIFT) >= buffer->size) ||
+ (size > (buffer->size - (vma->vm_pgoff << PAGE_SHIFT)))) {
pr_err("%s: trying to map larger area than handle has available"
"\n", __func__);
ret = -EINVAL;
Oops, something went wrong.

0 comments on commit 55bb204

Please sign in to comment.