From: antoine.tenart@free-electrons.com (Antoine Ténart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/6] phy: add a driver for the Berlin SATA PHY
Date: Tue, 13 May 2014 14:14:50 +0200 [thread overview]
Message-ID: <20140513121450.GC3213@kwain> (raw)
In-Reply-To: <1399886217-20474-2-git-send-email-antoine.tenart@free-electrons.com>
On Mon, May 12, 2014 at 11:16:52AM +0200, Antoine T?nart wrote:
[?]
> +static int phy_berlin_sata_probe(struct platform_device *pdev)
> +{
> + struct phy *phy;
> + struct phy_provider *phy_provider;
> + struct priv *priv;
> + struct resource *res;
> + int i;
> +
> + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + priv->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> + if (IS_ERR(priv->base))
> + return PTR_ERR(priv->base);
> +
> + phy = devm_phy_create(&pdev->dev, &phy_berlin_sata_ops, NULL);
> + if (IS_ERR(phy))
> + return PTR_ERR(phy);
Not needed.
Antoine
> +
> + dev_set_drvdata(&pdev->dev, priv);
> + spin_lock_init(&priv->lock);
> +
> + for (i = 0; i < BERLIN_SATA_PHY_NB; i++) {
> + struct phy *phy = devm_phy_create(&pdev->dev,
> + &phy_berlin_sata_ops, NULL);
> + if (IS_ERR(phy)) {
> + dev_err(&pdev->dev, "failed to create PHY %d\n", i);
> + return PTR_ERR(phy);
> + }
> +
> + priv->phys[i].phy = phy;
> + priv->phys[i].val = desc[i].val;
> + priv->phys[i].index = i;
> + phy_set_drvdata(phy, &priv->phys[i]);
> +
> + /* Make sure the PHY is off */
> + phy_berlin_sata_power_off(phy);
> + }
> +
> + phy_provider = devm_of_phy_provider_register(&pdev->dev,
> + berlin_sata_phy_xlate);
> + if (IS_ERR(phy_provider))
> + return PTR_ERR(phy_provider);
> +
> + return 0;
> +}
> +
> +static const struct of_device_id phy_berlin_sata_of_match[] = {
> + { .compatible = "marvell,berlin-sata-phy" },
> + { },
> +};
> +
> +static struct platform_driver phy_berlin_sata_driver = {
> + .probe = phy_berlin_sata_probe,
> + .driver = {
> + .name = "phy-berlin-sata",
> + .owner = THIS_MODULE,
> + .of_match_table = phy_berlin_sata_of_match,
> + },
> +};
> +module_platform_driver(phy_berlin_sata_driver);
> +
> +MODULE_DESCRIPTION("Marvell Berlin SATA PHY driver");
> +MODULE_AUTHOR("Antoine T?nart <antoine.tenart@free-electrons.com>");
> +MODULE_LICENSE("GPL");
> --
> 1.9.1
>
--
Antoine T?nart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-05-13 12:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 9:16 [PATCH v2 0/6] ARM: berlin: add AHCI support Antoine Ténart
2014-05-12 9:16 ` [PATCH v2 1/6] phy: add a driver for the Berlin SATA PHY Antoine Ténart
2014-05-12 12:46 ` Kishon Vijay Abraham I
2014-05-12 14:18 ` Sebastian Hesselbarth
2014-05-13 5:28 ` Kishon Vijay Abraham I
2014-05-13 12:11 ` Antoine Ténart
2014-05-13 12:14 ` Antoine Ténart [this message]
2014-05-12 9:16 ` [PATCH v2 2/6] Documentation: bindings: add " Antoine Ténart
2014-05-12 9:16 ` [PATCH v2 3/6] ata: ahci: add AHCI support for the Berlin BG2Q Antoine Ténart
2014-05-12 14:12 ` Andrew Lunn
2014-05-13 12:07 ` Antoine Ténart
2014-05-12 9:16 ` [PATCH v2 4/6] Documentation: bindings: add the berlin-ahci compatible to the ahci platform Antoine Ténart
2014-05-12 9:16 ` [PATCH v2 5/6] ARM: berlin: add the AHCI node for the BG2Q Antoine Ténart
2014-05-12 9:16 ` [PATCH v2 6/6] ARM: berlin: enable the eSATA interface on the BG2Q DMP Antoine Ténart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140513121450.GC3213@kwain \
--to=antoine.tenart@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).