PKGBUILDs/core/linux-odroid/51bffe8798f00dc412767f4284e66c02cb82c786.patch
2014-02-07 02:47:12 +00:00

101 lines
3 KiB
Diff

From 51bffe8798f00dc412767f4284e66c02cb82c786 Mon Sep 17 00:00:00 2001
From: ckkim <ckkim@hardkernel.com>
Date: Wed, 5 Feb 2014 15:50:07 +0900
Subject: [PATCH] usb3503 hub mode switch modify
---
drivers/usb/misc/usb3503.c | 37 +++++--------------------------------
1 file changed, 5 insertions(+), 32 deletions(-)
diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index 2b62a87..3dd06e8 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -53,7 +53,7 @@
#define USB3503_MAX_2A (0x80 << 0)
#define USB3503_SP_ILOCK 0xe7
-#define USB3503_OCS_PINSEL (1 << 4)
+#define USB3503_OCS_PINSEL (1 << 5)
#define USB3503_PRTPWR_PINSEL (1 << 4)
#define USB3503_SPILOCK_CONNECT (1 << 1)
#define USB3503_SPILOCK_CONFIG (1 << 0)
@@ -173,12 +173,11 @@ static int usb3503_switch_mode(struct usb3503 *hub, enum usb3503_mode mode)
/* CFG1 : SELF_BUS_PWR -> Self-Powerd operation */
err = usb3503_set_bits(i2c, USB3503_CFG1,
- ( USB3503_SELF_BUS_PWR));
+ ( USB3503_SELF_BUS_PWR ));
if (err < 0) {
dev_err(&i2c->dev, "CFG1 failed (%d)\n", err);
goto err_hubmode;
}
-
err = usb3503_clear_bits(i2c, USB3503_CFG1,
( USB3503_MTT_ENABLE
| USB3503_OCS_INDIVIDUAL
@@ -188,29 +187,6 @@ static int usb3503_switch_mode(struct usb3503 *hub, enum usb3503_mode mode)
goto err_hubmode;
}
- err = usb3503_set_bits(i2c, USB3503_BSTUP3,
- BOOST_IOOUT3_30);
- if (err < 0) {
- dev_err(&i2c->dev, "USB3503_BSTUP3 failed (%d)\n", err);
- goto err_hubmode;
- }
-
- err = usb3503_set_bits(i2c, USB3503_BSTUP21,
- ( BOOST_IOOUT2_30
- | BOOST_IOOUT1_30));
- if (err < 0) {
- dev_err(&i2c->dev, "USB3503_BSTUP21 failed (%d)\n", err);
- goto err_hubmode;
- }
-
- /* SP_LOCK: clear connect_n */
- err = usb3503_clear_bits(i2c, USB3503_SP_ILOCK,
- USB3503_SPILOCK_CONNECT);
- if (err < 0) {
- dev_err(&i2c->dev, "USB3503_SPILOCK_CONNECT failed (%d)\n", err);
- goto err_hubmode;
- }
-
/* USB3503_SP_ILOCK config_n lock */
err = usb3503_set_bits(i2c, USB3503_SP_ILOCK,
USB3503_SPILOCK_CONFIG);
@@ -220,9 +196,8 @@ static int usb3503_switch_mode(struct usb3503 *hub, enum usb3503_mode mode)
}
hub->mode = mode;
- dev_info(&i2c->dev, "switched to HUB mode\n");
-
usb3503_connect(hub->gpio_connect, 1);
+ dev_info(&i2c->dev, "switched to HUB mode\n");
break;
@@ -300,8 +275,7 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
goto err_gpio_reset;
}
- gpio_direction_output(hub->gpio_reset, 0);
-
+ usb3503_reset(hub->gpio_reset, 0);
if(hub->clk == USB3503_REFCLK_24M)
gpio_direction_output(hub->gpio_intn, 0);
else if(hub->clk == USB3503_REFCLK_26M)
@@ -309,8 +283,7 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
else
gpio_direction_output(hub->gpio_intn, 1);
- gpio_direction_output(hub->gpio_connect, 0);
- msleep(10);
+ usb3503_connect(hub->gpio_connect, 0);
usb3503_reset(hub->gpio_reset, 1);
/* Hub Wait RefClk stage */
--
1.8.5.1