From patchwork Wed Apr 3 08:45:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 15838 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8A15723E21 for ; Wed, 3 Apr 2013 08:47:11 +0000 (UTC) Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by fiordland.canonical.com (Postfix) with ESMTP id 30101A18484 for ; Wed, 3 Apr 2013 08:47:11 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id gf12sf2013114vcb.4 for ; Wed, 03 Apr 2013 01:47:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=Gf1J4DqD7RnsyYzgBrNFSpgEsBlZfC9OXQGEXiAYmWc=; b=DceqnoGXCOFC9oAmrn//49OKVc/RKCW5+Qt8huLg/8XRz1pghuTDJC4pezN74EMpxX UWJ8wEewfLCK4YuzEqcOAXJMBZDDPzeYapQZv9wADUP2vv3lzo7YaVghnX1JzyBfLgzn vDVV2PCmIRQeNxqnZRQHnIBbp8PMsPYalmXpsb/kkoL1V59nOeBI/lSpOR88AG83OaPD wIhkENCpBqk0SXH5UGj/BQid1lB4LNDxC0jJjLOMB+5kdiKuSw5u5FuDvZmGiPz3cjKF vVeePMu4hrBiXr+iRsjcm4e7tx8uETkrm8Vztn+rI8/1Pk2iuJDIQRHx51M3txRADqfe fUKA== X-Received: by 10.224.185.79 with SMTP id cn15mr703053qab.4.1364978830625; Wed, 03 Apr 2013 01:47:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.42.105 with SMTP id n9ls789198qel.32.gmail; Wed, 03 Apr 2013 01:47:10 -0700 (PDT) X-Received: by 10.52.23.205 with SMTP id o13mr420021vdf.78.1364978830452; Wed, 03 Apr 2013 01:47:10 -0700 (PDT) Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [2607:f8b0:400c:c02::230]) by mx.google.com with ESMTPS id p8si4260880vdw.75.2013.04.03.01.47.10 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 01:47:10 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::230; Received: by mail-vb0-f48.google.com with SMTP id p13so257812vbe.21 for ; Wed, 03 Apr 2013 01:47:10 -0700 (PDT) X-Received: by 10.220.154.199 with SMTP id p7mr496045vcw.46.1364978830328; Wed, 03 Apr 2013 01:47:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp160619ved; Wed, 3 Apr 2013 01:47:09 -0700 (PDT) X-Received: by 10.14.179.201 with SMTP id h49mr1814950eem.26.1364978829288; Wed, 03 Apr 2013 01:47:09 -0700 (PDT) Received: from mail-ea0-x22a.google.com (mail-ea0-x22a.google.com [2a00:1450:4013:c01::22a]) by mx.google.com with ESMTPS id g8si7606683eem.59.2013.04.03.01.47.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 01:47:09 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4013:c01::22a is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:4013:c01::22a; Received: by mail-ea0-f170.google.com with SMTP id a15so546859eae.1 for ; Wed, 03 Apr 2013 01:47:08 -0700 (PDT) X-Received: by 10.15.32.67 with SMTP id z43mr1843435eeu.24.1364978828763; Wed, 03 Apr 2013 01:47:08 -0700 (PDT) Received: from localhost ([2a01:2003:1:1e91:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id r4sm6862904eeo.12.2013.04.03.01.47.02 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Apr 2013 01:47:08 -0700 (PDT) From: Fabio Baltieri To: Felipe Balbi Cc: Linus Walleij , Praveena Nadahally , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Sakethram Bommisetti , Fabio Baltieri Subject: [PATCH 04/12] usb: phy: ab8500-usb: fix eye diagram for ab8500 v2.0 Date: Wed, 3 Apr 2013 10:45:05 +0200 Message-Id: <1364978713-19612-5-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1364978713-19612-1-git-send-email-fabio.baltieri@linaro.org> References: <1364978713-19612-1-git-send-email-fabio.baltieri@linaro.org> X-Gm-Message-State: ALoCoQn4goLFmhSEbVQzbQdYVr6NzAjSrbGApiiUSdkdJjSwXmS3yRTIbHrxFrg0Fa00mqni1Wx9 X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Sakethram Bommisetti AB8500 v2.0 has eye diagram issues when drawing more than 100mA from VBUS. Force charging current to 100mA in case of standard host. Signed-off-by: Sakethram Bommisetti Acked-by: Linus Walleij Signed-off-by: Fabio Baltieri --- drivers/usb/phy/phy-ab8500-usb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 5b92a59..1fd0780 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c @@ -485,6 +485,18 @@ static void ab8500_usb_phy_disable_work(struct work_struct *work) ab8500_usb_peri_phy_dis(ab); } +static unsigned ab8500_eyediagram_workaroud(struct ab8500_usb *ab, unsigned mA) +{ + /* AB8500 V2 has eye diagram issues when drawing more than 100mA from + * VBUS. Set charging current to 100mA in case of standard host + */ + if (is_ab8500_2p0_or_earlier(ab->ab8500)) + if (mA > 100) + mA = 100; + + return mA; +} + static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA) { struct ab8500_usb *ab; @@ -494,6 +506,8 @@ static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA) ab = phy_to_ab(phy); + mA = ab8500_eyediagram_workaroud(ab, mA); + ab->vbus_draw = mA; if (mA)