diff options
author | KalimochoAz <calimochoazucarado@gmail.com> | 2012-10-14 10:48:20 +0200 |
---|---|---|
committer | KalimochoAz <calimochoazucarado@gmail.com> | 2012-10-14 10:48:20 +0200 |
commit | 6a9dff5ea86ccd4a1dd503a36ce9856c4c092360 (patch) | |
tree | ef51ac2f4db8b8ab5c529e20821ea32c397a8cf1 | |
parent | 18a56c57bb42bf77fbe121fb7d33a66ac0a5e22a (diff) | |
parent | 58941501e897aa344317efeed8c14f5e6da89a10 (diff) | |
download | kernel_samsung_crespo-6a9dff5ea86ccd4a1dd503a36ce9856c4c092360.zip kernel_samsung_crespo-6a9dff5ea86ccd4a1dd503a36ce9856c4c092360.tar.gz kernel_samsung_crespo-6a9dff5ea86ccd4a1dd503a36ce9856c4c092360.tar.bz2 |
Merge remote-tracking branch 'google/android-samsung-3.0-jb-mr0' into HEAD
Conflicts:
drivers/net/wireless/bcmdhd/wl_cfg80211.c
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 53 | ||||
-rw-r--r-- | drivers/net/wireless/bcmdhd/wl_cfg80211.c | 3 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c_udc_otg.c | 7 |
3 files changed, 54 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index b723b0b..61c9365 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -201,18 +201,29 @@ static void s3c24xx_i2c_message_start(struct s3c24xx_i2c *i2c, static inline void s3c24xx_i2c_stop(struct s3c24xx_i2c *i2c, int ret) { - unsigned long iicstat = readl(i2c->regs + S3C2410_IICSTAT); + unsigned long iicstat; + unsigned long iiccon; dev_dbg(i2c->dev, "STOP\n"); /* stop the transfer */ + + /* Disable irq */ + s3c24xx_i2c_disable_irq(i2c); + + /* STOP signal generation : MTx(0xD0) */ + iicstat = readl(i2c->regs + S3C2410_IICSTAT); iicstat &= ~S3C2410_IICSTAT_START; writel(iicstat, i2c->regs + S3C2410_IICSTAT); - i2c->state = STATE_STOP; + /* Clear pending bit */ + iiccon = readl(i2c->regs + S3C2410_IICCON); + iiccon &= ~S3C2410_IICCON_IRQPEND; + writel(iiccon, i2c->regs + S3C2410_IICCON); s3c24xx_i2c_master_complete(i2c, ret); - s3c24xx_i2c_disable_irq(i2c); + + i2c->state = STATE_STOP; } /* helper functions to determine the current state in the set of @@ -484,7 +495,8 @@ static int s3c24xx_i2c_set_master(struct s3c24xx_i2c *i2c) static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int num) { - unsigned long timeout; + unsigned long iicstat, timeout; + int spins = 20; int ret; if (i2c->suspended) @@ -523,7 +535,38 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, /* ensure the stop has been through the bus */ - udelay(10); + dev_dbg(i2c->dev, "waiting for bus idle\n"); + + /* first, try busy waiting briefly */ + do { + cpu_relax(); + iicstat = readl(i2c->regs + S3C2410_IICSTAT); + } while ((iicstat & S3C2410_IICSTAT_START) && --spins); + + /* if that timed out sleep */ + if (!spins) { + msleep(1); + iicstat = readl(i2c->regs + S3C2410_IICSTAT); + } + + /* if still not finished, clean it up */ + spin_lock_irq(&i2c->lock); + + if (iicstat & S3C2410_IICSTAT_BUSBUSY) { + dev_dbg(i2c->dev, "timeout waiting for bus idle\n"); + + if (i2c->state != STATE_STOP) { + dev_dbg(i2c->dev, + "timeout : i2c interrupt hasn't occurred\n"); + s3c24xx_i2c_stop(i2c, 0); + } + + /* Disable Serial Out : To forcely terminate the connection */ + iicstat = readl(i2c->regs + S3C2410_IICSTAT); + iicstat &= ~S3C2410_IICSTAT_TXRXEN; + writel(iicstat, i2c->regs + S3C2410_IICSTAT); + } + spin_unlock_irq(&i2c->lock); out: return ret; diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index fad37a5..5d4eaa9 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -7304,8 +7304,7 @@ s32 wl_update_wiphybands(struct wl_priv *wl) wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; index = IEEE80211_BAND_2GHZ; - - if (bandlist[i] == WLC_BAND_2G && bw_cap == WLC_N_BW_40ALL) + if (bw_cap == WLC_N_BW_40ALL) wiphy->bands[index]->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40; } if ((index >= 0) && nmode) { diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c index 6170aba..7bbcedc 100644 --- a/drivers/usb/gadget/s3c_udc_otg.c +++ b/drivers/usb/gadget/s3c_udc_otg.c @@ -629,8 +629,11 @@ static void set_max_pktsize(struct s3c_udc *dev, enum usb_device_speed speed) } dev->ep[0].ep.maxpacket = ep0_fifo_size; - for (i = 1; i < S3C_MAX_ENDPOINTS; i++) - dev->ep[i].ep.maxpacket = ep_fifo_size; + for (i = 1; i < S3C_MAX_ENDPOINTS; i++) { + /* fullspeed limitations don't apply to isochronous endpoints */ + if (dev->ep[i].bmAttributes != USB_ENDPOINT_XFER_ISOC) + dev->ep[i].ep.maxpacket = ep_fifo_size; + } /* EP0 - Control IN (64 bytes)*/ ep_ctrl = readl(S3C_UDC_OTG_DIEPCTL(EP0_CON)); |