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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 815C6C433E3 for ; Thu, 16 Jul 2020 06:39:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 49935206F5 for ; Thu, 16 Jul 2020 06:39:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Lqxvq1pz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="EJHuMs3A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49935206F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iban/zTA1diGDbg5ldGf2v4e8OLh2JNIvh5O1vlksrc=; b=Lqxvq1pzzMuMcA17SlfJWF5nO AD9I6wPATQnb53ea5SmcQEvRmaIHZGUaNmpHyAUlIZI0txVNyN4+v8d5uQIfzjcs7WLF7SPCcWQzx UwqHDeY640SNgYys3AVyQX9g6bV3Wqk5LjmyJFokEgBKezmBpFppXDE+QdICoYt6DjlHeMouiTE+u olzqUW2wmzDx1mFL6VIA3d6A2bBiWcRlt1wn0Qq+m3EsmGpfAOCJ/+NrMENaZDFcI3J2CYlcgmB6x PApMqb86g7jA4NISVdirSae6AAR7S83a3JbuVlCaQ9ouQKmdJfSuoKBZxG5gnw1XUgbx45B9FvKbr GWQ7VVWcA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvxWp-0008TO-3h; Thu, 16 Jul 2020 06:37:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvxWm-0008Sg-0v for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 06:37:56 +0000 Received: from localhost (unknown [122.171.202.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5999206F5; Thu, 16 Jul 2020 06:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594881474; bh=i0+VY+ygP+qTpBzCKjka9/Jb+MkkhClqH6AwSsN73UM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EJHuMs3A2ePVdZ/8EsBZn//CVJgzRPBMiPbGsqOQziG+R1NMZXk4L4tHeNxLiHYWm fdX+12atzFWsOnNMslCw+KFAMNyvylfmBkgrgDsEdRPY0jEIdpuVBhnAsOul/o+pB4 fry41USRLXqLNSf85zOgcglsrcE1gYLS9sFHZHzY= Date: Thu, 16 Jul 2020 12:07:50 +0530 From: Vinod Koul To: Kunihiko Hayashi Subject: Re: [PATCH v3 2/2] phy: socionext: Add UniPhier AHCI PHY driver support Message-ID: <20200716063750.GH55478@vkoul-mobl> References: <1594867382-27509-1-git-send-email-hayashi.kunihiko@socionext.com> <1594867382-27509-3-git-send-email-hayashi.kunihiko@socionext.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1594867382-27509-3-git-send-email-hayashi.kunihiko@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_023756_213660_EDDD221D X-CRM114-Status: GOOD ( 12.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , Masahiro Yamada , Rob Herring , linux-arm-kernel@lists.infradead.org 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 On 16-07-20, 11:43, Kunihiko Hayashi wrote: > +static int uniphier_ahciphy_pxs3_init(struct uniphier_ahciphy_priv *priv) > +{ > + int i; > + u32 val; > + > + /* setup port parameter */ > + val = readl(priv->base + TXCTRL0); > + val &= ~TXCTRL0_AMP_G3_MASK; > + val |= FIELD_PREP(TXCTRL0_AMP_G3_MASK, 0x73); > + val &= ~TXCTRL0_AMP_G2_MASK; > + val |= FIELD_PREP(TXCTRL0_AMP_G2_MASK, 0x46); > + val &= ~TXCTRL0_AMP_G1_MASK; > + val |= FIELD_PREP(TXCTRL0_AMP_G1_MASK, 0x42); > + writel(val, priv->base + TXCTRL0); > + > + val = readl(priv->base + TXCTRL1); > + val &= ~TXCTRL1_DEEMPH_G3_MASK; > + val |= FIELD_PREP(TXCTRL1_DEEMPH_G3_MASK, 0x23); > + val &= ~TXCTRL1_DEEMPH_G2_MASK; > + val |= FIELD_PREP(TXCTRL1_DEEMPH_G2_MASK, 0x05); > + val &= ~TXCTRL1_DEEMPH_G1_MASK; > + val |= FIELD_PREP(TXCTRL1_DEEMPH_G1_MASK, 0x05); > + > + val = readl(priv->base + RXCTRL); > + val &= ~RXCTRL_LOS_LVL_MASK; > + val |= FIELD_PREP(RXCTRL_LOS_LVL_MASK, 0x9); > + val &= ~RXCTRL_LOS_BIAS_MASK; > + val |= FIELD_PREP(RXCTRL_LOS_BIAS_MASK, 0x2); > + val &= ~RXCTRL_RX_EQ_MASK; > + val |= FIELD_PREP(RXCTRL_RX_EQ_MASK, 0x1); > + > + /* dummy read 25 times to make a wait time for the phy to stablize */ s/stablize/stabilize > +static int uniphier_ahciphy_power_off(struct phy *phy) > +{ > + struct uniphier_ahciphy_priv *priv = phy_get_drvdata(phy); > + int ret = 0; > + > + if (priv->data->power_off) > + ret = priv->data->power_off(priv); > + > + reset_control_assert(priv->rst); > + clk_disable_unprepare(priv->clk); > + > + return ret; > +} > + > + multiple blank lines > +static const struct phy_ops uniphier_ahciphy_ops = { > + .init = uniphier_ahciphy_init, > + .exit = uniphier_ahciphy_exit, > + .power_on = uniphier_ahciphy_power_on, > + .power_off = uniphier_ahciphy_power_off, > + .owner = THIS_MODULE, > +}; > + > +static int uniphier_ahciphy_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct uniphier_ahciphy_priv *priv; > + struct phy *phy; > + struct phy_provider *phy_provider; > + > + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); > + if (!priv) > + return -ENOMEM; > + > + priv->dev = dev; > + priv->data = of_device_get_match_data(dev); > + if (WARN_ON(!priv->data)) > + return -EINVAL; > + > + priv->base = devm_platform_ioremap_resource(pdev, 0); > + if (IS_ERR(priv->base)) > + return PTR_ERR(priv->base); > + > + priv->clk_parent = devm_clk_get(dev, "link"); > + if (IS_ERR(priv->clk_parent)) > + return PTR_ERR(priv->clk_parent); > + > + if (priv->data->is_phy_clk) { > + priv->clk = devm_clk_get(dev, "phy"); > + if (IS_ERR(priv->clk)) > + return PTR_ERR(priv->clk); > + } > + > + priv->rst_parent = devm_reset_control_get_shared(dev, "link"); > + if (IS_ERR(priv->rst_parent)) > + return PTR_ERR(priv->rst_parent); > + > + priv->rst = devm_reset_control_get_shared(dev, "phy"); > + if (IS_ERR(priv->rst)) > + return PTR_ERR(priv->rst); > + > + phy = devm_phy_create(dev, dev->of_node, &uniphier_ahciphy_ops); > + if (IS_ERR(phy)) { > + dev_err(dev, "failed to create phy\n"); > + return PTR_ERR(phy); > + } > + > + phy_set_drvdata(phy, priv); > + phy_provider = devm_of_phy_provider_register(dev, > + of_phy_simple_xlate); single line? -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel