From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E3E5C49361 for ; Thu, 17 Jun 2021 22:17:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1930361369 for ; Thu, 17 Jun 2021 22:17:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1930361369 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DY79dgJtQi9uso0ztEjCRaNOlKG7pDzO/uy5Yka40ZA=; b=3WkSy59OYBDbra 0Qt+z3vKkdwRPEVG8cVlJvXvIRBf7UPH7T0ji5W3FUGDOL7xUV5+uqp8e7xUbkI+0Tp3BuGT0Fg3M igkQD2/2IE8piVfsadvsuT1tW+XFC/wf8mC4jWYLBe7I85FznW1ND6xdkMao8uDV+Z1K6+9z4hQOi LAHyG2o5JS8EGkulGmiXL9yiFIcRujGT89NnVbhIy6Bn+rUI/nEPefpcvvDrn+hoGX0DejLLza8x5 CnancgYGMRLtWYTJBDUnCPrY4Bzl2/OB1smQdljatqvjrys8P5yPYYBNKxUnSaMOI9mkRdpgWWYbR R/36jbKuXXV4l/yjZdeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu0JD-00BvdE-7R; Thu, 17 Jun 2021 22:16:23 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu0J9-00BvcA-2y; Thu, 17 Jun 2021 22:16:20 +0000 Received: by mail-ej1-x634.google.com with SMTP id og14so12504205ejc.5; Thu, 17 Jun 2021 15:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AwVsJszErVtiyw5bOlSHdlACIUbk2leEVGsI22Nm16c=; b=kJNfxLLxB72H4z5568lAYK6FwqUG64zbFQZGgHu0rNw3JSMmfIYJbli8QZgaHLkqwN dqGNlVi2B663P/UJFyPxXHsOhsML6veC9Sd2PIGMz+hwSi5aFjrSo3GNcjioZsymEJUA Xhw6CnEwgNZYNP8zdNaBu9ylCoLnUsO5jungvWWNorKlZiHs1kgXoMFXvdFI1r7NaBvB RiG6cxxfC+TpLGLP/RjArtcTWQvjExLFct8del+j85LN7oAyvABr2nfvp7j0pfgPYSCq xkmpWB1uJFj/dGkh35bZJSCxegWSck8lfgZIDsnyTimeTZJqygEl2DagMKzgWpmXb54G LfDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AwVsJszErVtiyw5bOlSHdlACIUbk2leEVGsI22Nm16c=; b=ZtyFVIjkl4lZrnd+L33kaLU9j80F6bUlCwyqaKYPqLlMxhKeo14nmHL0GR6WnjTFzB 6RZvL6eFAMBayWA4FWKYBr0sWpw117/OpCHNV7BcPJOuKX1L/VoxX/MbgoRARKiLOfCL z/xPPFv7Q/Eo9OnrxsxMCP+HPxTOcVcLd/VGKHUl1Ss2dAEw3+zrG2t9eZMRrfy74DBT RJZwu0ivg6ChMtuDoWPsBnHEKjquYZYrTPlebReM6Uyvmo56FkvCaBFd8MJUiOU4kyr7 vd2m0RY0SiEotitG1frMi4HpyJzaaii9MBQimNnkr23KRv6WRPyVZZWAvtyLeOh4SQaf liaA== X-Gm-Message-State: AOAM5314lZ3MNquNFpgQ7u29EI1OoHs794GQWY2ylOoYObYSeviPPcWY 6fRZvIWbGapb2e42Y20YKj5XhirxCdZVopKqvvk= X-Google-Smtp-Source: ABdhPJwq5lDCttRtdcLtp8xWWsEyuZqDh41mR0y7tmleLZioJ3kdB5nIgDKCGPjdhNhzugBo1SrbqHNC/5oB4qsNROA= X-Received: by 2002:a17:907:9607:: with SMTP id gb7mr7735421ejc.208.1623968177208; Thu, 17 Jun 2021 15:16:17 -0700 (PDT) MIME-Version: 1.0 References: <20210617194154.2397-1-linux.amoon@gmail.com> <20210617194154.2397-5-linux.amoon@gmail.com> In-Reply-To: <20210617194154.2397-5-linux.amoon@gmail.com> From: Martin Blumenstingl Date: Fri, 18 Jun 2021 00:16:06 +0200 Message-ID: Subject: Re: [RFCv1 4/8] phy: amlogic: meson8b-usb2: Use phy set_mode callback function To: Anand Moon Cc: Kishon Vijay Abraham I , Vinod Koul , Neil Armstrong , Kevin Hilman , Jerome Brunet , Philipp Zabel , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210617_151619_195863_93AAD17B X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Anand, On Thu, Jun 17, 2021 at 9:43 PM Anand Moon wrote: > > Reorder the code for phy set_mode in .set_mode callback function. > For now configure the phy in host mode. as mentioned in the cover-letter: to my knowledge these register bits are "static" The settings for dr_mode == USB_DR_MODE_HOST mainly apply to the second PHY (usb1_phy) [...] > +static int phy_meson8b_usb2_setmode(struct phy *phy, enum phy_mode mode, > + int submode) > { > struct phy_meson8b_usb2_priv *priv = phy_get_drvdata(phy); > u32 reg; > > + switch (mode) { > + case PHY_MODE_USB_HOST: > + if (priv->match->host_enable_aca) { > + regmap_update_bits(priv->regmap, REG_ADP_BC, > + REG_ADP_BC_ACA_ENABLE, > + REG_ADP_BC_ACA_ENABLE); > + > + udelay(ACA_ENABLE_COMPLETE_TIME); > + > + regmap_read(priv->regmap, REG_ADP_BC, ®); > + if (reg & REG_ADP_BC_ACA_PIN_FLOAT) { > + dev_warn(&phy->dev, "USB ID detect failed!\n"); > + return -EINVAL; > + } > + } > + break; > + default: > + dev_warn(&phy->dev, "USB ID detect failed to setnode! %d\n", mode); > + return -EINVAL; I have tested this driver already with PHY_MODE_USB_DEVICE (on my Odroid-C1) so I don't see why we should drop support for this Also if we want runtime mode switching in this driver then we would need to undo the changes from "case PHY_MODE_USB_HOST" above I suggest dropping this patch until we know for sure if and which registers need to be updated based on the DR mode. Best regards, Martin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel