From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: George Cherian <george.cherian@ti.com>
Cc: linux-usb@vger.kernel.org, balbi@ti.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] usb: phy: Add AM335x PHY driver
Date: Thu, 01 Aug 2013 12:55:11 +0200 [thread overview]
Message-ID: <51FA3E8F.7010906@linutronix.de> (raw)
In-Reply-To: <51F9F3D4.50108@ti.com>
On 08/01/2013 07:36 AM, George Cherian wrote:
please keep the file here file snipping
>> +static const struct of_device_id omap_control_usb_id_table[] = {
>> + { .compatible = "ti,am335x-ctrl-module", .data = &ctrl_am335x },
>> + {}
>> +};
>> +MODULE_DEVICE_TABLE(of, omap_control_usb_id_table);
>> +
>> +static struct platform_driver am335x_control_driver;
>> +static int match(struct device *dev, void *data)
>> +{
>> + struct device_node *node = (struct device_node *)data;
>> + return dev->of_node == node &&
>> + dev->driver == &am335x_control_driver.driver;
>> +}
>> +
>> +struct phy_control *am335x_get_phy_control(struct device *dev)
>> +{
>> + struct device_node *node;
>> + struct am335x_control_usb *ctrl_usb;
>> +
>> + node = of_parse_phandle(dev->of_node, "ti,ctrl_mod", 0);
>> + if (!node)
>> + return NULL;
>> +
>> + dev = bus_find_device(&platform_bus_type, NULL, node, match);
>
> of_find_device_by_node doesn't work???
It would but I have here a reference to the device.
>
>> + ctrl_usb = dev_get_drvdata(dev);
>> + if (!ctrl_usb)
>> + return NULL;
>> + return &ctrl_usb->phy_ctrl;
>> +}
>> +EXPORT_SYMBOL_GPL(am335x_get_phy_control);
>> +
>> +static int am335x_control_usb_probe(struct platform_device *pdev)
>> +{
>> + struct resource *res;
>> + struct am335x_control_usb *ctrl_usb;
>> + const struct of_device_id *of_id;
>> + const struct phy_control *phy_ctrl;
>> +
>> + of_id = of_match_node(omap_control_usb_id_table, pdev->dev.of_node);
>> + if (!of_id)
>> + return -EINVAL;
>> +
>> + phy_ctrl = of_id->data;
>> +
>> + ctrl_usb = devm_kzalloc(&pdev->dev, sizeof(*ctrl_usb), GFP_KERNEL);
>> + if (!ctrl_usb) {
>> + dev_err(&pdev->dev, "unable to alloc memory for control usb\n");
>> + return -ENOMEM;
>> + }
>> +
>> + ctrl_usb->dev = &pdev->dev;
>> +
>> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>> "control_dev");
>> + ctrl_usb->reset_reg = devm_ioremap_resource(&pdev->dev, res);
>
> As per current DTSI in patch 5 you are mapping from control module base
> till 0x650.
> Cant it be split to 2 registers one mapping for phy on/off and one for
> phy wkup?
You asked the same question in the other pathch. It could but please
refer to the other patch.
Sebastian
next prev parent reply other threads:[~2013-08-01 10:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-30 20:16 am335x, multi instance and phy support, v3 Sebastian Andrzej Siewior
2013-07-30 20:16 ` [PATCH 1/5] usb: phy: rename nop_usb_xceiv => usb_phy_gen_xceiv Sebastian Andrzej Siewior
2013-07-30 20:16 ` [PATCH 2/5] usb: phy: phy-generic: export init functions Sebastian Andrzej Siewior
2013-07-30 20:16 ` [PATCH 3/5] usb: phy: Add AM335x PHY driver Sebastian Andrzej Siewior
2013-08-01 5:36 ` George Cherian
2013-08-01 10:55 ` Sebastian Andrzej Siewior [this message]
2013-07-30 20:16 ` [PATCH 4/5] usb: musb: dsps: remove the hardcoded phy pieces Sebastian Andrzej Siewior
2013-07-30 20:16 ` [PATCH 5/5] usb: musb: dsps: use proper child nodes Sebastian Andrzej Siewior
2013-08-01 5:24 ` George Cherian
2013-08-01 10:52 ` Sebastian Andrzej Siewior
2013-08-01 11:30 ` Sebastian Andrzej Siewior
2013-08-02 10:29 ` Sebastian Andrzej Siewior
2013-08-02 14:49 ` George Cherian
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=51FA3E8F.7010906@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=balbi@ti.com \
--cc=george.cherian@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.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