aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2012-05-30 10:30:54 -0700
committerJP Abgrall <jpa@google.com>2012-05-30 10:30:54 -0700
commita891b03eac69f9b6ca20c83518f36a31f840843a (patch)
treeb770b2cb0874375d3f689c9f4dc42dd1a911ade7
parent4955155bbce25d2c8dc0d944712046a313b058b1 (diff)
parent0daae7684be1f646a162b4150e7e7547550250aa (diff)
downloadkernel_samsung_crespo-a891b03eac69f9b6ca20c83518f36a31f840843a.zip
kernel_samsung_crespo-a891b03eac69f9b6ca20c83518f36a31f840843a.tar.gz
kernel_samsung_crespo-a891b03eac69f9b6ca20c83518f36a31f840843a.tar.bz2
Merge remote-tracking branch 'common/android-3.0' into android-samsung-30-wip-mergedown
* common/android-3.0: USB: gadget: f_audio_source: Adjust packet timing to reduce glitches usb: gadget: android: Fix product name net: wireless: bcmdhd: Fix WPS PBC overlap failure usb: gadget: composite: Fix corruption when changing configuration
-rw-r--r--drivers/net/wireless/bcmdhd/wl_cfg80211.c2
-rw-r--r--drivers/usb/gadget/android.c5
-rw-r--r--drivers/usb/gadget/composite.c10
-rw-r--r--drivers/usb/gadget/f_audio_source.c17
4 files changed, 18 insertions, 16 deletions
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
index 79f48cc..870c903 100644
--- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c
+++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
@@ -2217,6 +2217,8 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
WL_DBG(("ASSOC2 p2p index : %d sme->ie_len %d\n",
wl_cfgp2p_find_idx(wl, dev), sme->ie_len));
wl_cfgp2p_set_management_ie(wl, dev, wl_cfgp2p_find_idx(wl, dev),
+ VNDR_IE_PRBREQ_FLAG, sme->ie, sme->ie_len);
+ wl_cfgp2p_set_management_ie(wl, dev, wl_cfgp2p_find_idx(wl, dev),
VNDR_IE_ASSOCREQ_FLAG, sme->ie, sme->ie_len);
}
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index 3abc53a..1236d6f 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -1083,10 +1083,7 @@ field ## _store(struct device *dev, struct device_attribute *attr, \
const char *buf, size_t size) \
{ \
if (size >= sizeof(buffer)) return -EINVAL; \
- if (sscanf(buf, "%s", buffer) == 1) { \
- return size; \
- } \
- return -1; \
+ return strlcpy(buffer, buf, sizeof(buffer)); \
} \
static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, field ## _show, field ## _store);
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index dc06da6..1d88a80 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -564,7 +564,7 @@ done:
return status;
}
-static int remove_config(struct usb_composite_dev *cdev,
+static int unbind_config(struct usb_composite_dev *cdev,
struct usb_configuration *config)
{
while (!list_empty(&config->functions)) {
@@ -579,7 +579,6 @@ static int remove_config(struct usb_composite_dev *cdev,
/* may free memory for "f" */
}
}
- list_del(&config->list);
if (config->unbind) {
DBG(cdev, "unbind config '%s'/%p\n", config->label, config);
config->unbind(config);
@@ -598,9 +597,11 @@ int usb_remove_config(struct usb_composite_dev *cdev,
if (cdev->config == config)
reset_config(cdev);
+ list_del(&config->list);
+
spin_unlock_irqrestore(&cdev->lock, flags);
- return remove_config(cdev, config);
+ return unbind_config(cdev, config);
}
/*-------------------------------------------------------------------------*/
@@ -1084,7 +1085,8 @@ composite_unbind(struct usb_gadget *gadget)
struct usb_configuration *c;
c = list_first_entry(&cdev->configs,
struct usb_configuration, list);
- remove_config(cdev, c);
+ list_del(&c->list);
+ unbind_config(cdev, c);
}
if (composite->unbind)
composite->unbind(cdev);
diff --git a/drivers/usb/gadget/f_audio_source.c b/drivers/usb/gadget/f_audio_source.c
index 26f51a0..23a7511 100644
--- a/drivers/usb/gadget/f_audio_source.c
+++ b/drivers/usb/gadget/f_audio_source.c
@@ -25,11 +25,11 @@
/* Each frame is two 16 bit integers (one per channel) */
#define BYTES_PER_FRAME 4
#define FRAMES_PER_MSEC (SAMPLE_RATE / 1000)
-/* Add one to FRAMES_PER_MSEC to adjust for round-off above */
-#define IN_EP_MAX_PACKET_SIZE ((FRAMES_PER_MSEC + 1) * BYTES_PER_FRAME)
+
+#define IN_EP_MAX_PACKET_SIZE 256
/* Number of requests to allocate */
-#define IN_EP_REQ_COUNT 16
+#define IN_EP_REQ_COUNT 4
#define AUDIO_AC_INTERFACE 0
#define AUDIO_AS_INTERFACE 1
@@ -339,13 +339,10 @@ static void audio_send(struct audio_dev *audio)
runtime = audio->substream->runtime;
+ /* compute number of frames to send */
now = ktime_get();
msecs = ktime_to_ns(now) - ktime_to_ns(audio->start_time);
do_div(msecs, 1000000);
- /* Add a bit to msecs so we queue some extra requests in case
- * we miss a few SOFs due to interrupts being disabled or CPU load.
- */
- msecs += IN_EP_REQ_COUNT/2;
frames = msecs * SAMPLE_RATE;
do_div(frames, 1000);
@@ -353,11 +350,15 @@ static void audio_send(struct audio_dev *audio)
* If we get too far behind it is better to drop some frames than
* to keep sending data too fast in an attempt to catch up.
*/
- if (frames - audio->frames_sent > 2 * FRAMES_PER_MSEC * IN_EP_REQ_COUNT)
+ if (frames - audio->frames_sent > 10 * FRAMES_PER_MSEC)
audio->frames_sent = frames - FRAMES_PER_MSEC;
frames -= audio->frames_sent;
+ /* We need to send something to keep the pipeline going */
+ if (frames <= 0)
+ frames = FRAMES_PER_MSEC;
+
while (frames > 0) {
req = audio_req_get(audio);
if (!req)