Commit 06079a1c authored by codewalker's avatar codewalker Committed by Brian Kim

ODROID-XU4: PMIC: Reset eth by USB hub.

Change-Id: Ibb4882d5fa0b8d178e8eafe0f1c9933eeeb8118a
(cherry picked from commit f1b0f73a1215b4d8cb29010150f02003b5153bed)
parent 52b56846
...@@ -349,6 +349,53 @@ static int s2mps11_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, ...@@ -349,6 +349,53 @@ static int s2mps11_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev,
return 0; return 0;
} }
#endif /* CONFIG_OF */ #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) static int s2mps11_pmic_probe(struct platform_device *pdev)
{ {
...@@ -358,6 +405,8 @@ 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; struct s2mps11_info *s2mps11;
int i, ret; int i, ret;
g_iodev = dev_get_drvdata(pdev->dev.parent);
ret = sec_reg_read(iodev, S2MPS11_REG_ID, &iodev->rev_num); ret = sec_reg_read(iodev, S2MPS11_REG_ID, &iodev->rev_num);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
#define USB_VENDOR_GENESYS_LOGIC 0x05e3 #define USB_VENDOR_GENESYS_LOGIC 0x05e3
#define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01
#if defined(CONFIG_MACH_ODROIDXU3)
extern int s2mps11_pmic_ethonoff(unsigned char status);
#endif //CONFIG_MACH_ODROIDXU3
static inline int hub_is_superspeed(struct usb_device *hdev) static inline int hub_is_superspeed(struct usb_device *hdev)
{ {
return (hdev->descriptor.bDeviceProtocol == USB_HUB_PR_SS); return (hdev->descriptor.bDeviceProtocol == USB_HUB_PR_SS);
...@@ -4875,6 +4879,10 @@ static void hub_events(void) ...@@ -4875,6 +4879,10 @@ static void hub_events(void)
status = usb_reset_device(udev); status = usb_reset_device(udev);
usb_unlock_device(udev); usb_unlock_device(udev);
connect_change = 0; connect_change = 0;
#if defined(CONFIG_MACH_ODROIDXU3)
s2mps11_pmic_ethonoff(0);
s2mps11_pmic_ethonoff(1);
#endif //CONFIG_MACH_ODROIDXU3
} }
} }
......
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