Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-08 Thread Kishon Vijay Abraham I
Hi, On Thursday 04 April 2013 05:24 AM, Stephen Warren wrote: On 04/03/2013 06:53 AM, Kishon Vijay Abraham I wrote: The PHY framework provides a set of APIs for the PHY drivers to create/destroy a PHY and APIs for the PHY users to obtain a reference to the PHY with or without using phandle. To

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-04 Thread Felipe Balbi
Hi, On Wed, Apr 03, 2013 at 05:54:11PM -0600, Stephen Warren wrote: struct phy { struct device *dev; struct module *owner; int (*init)(struct phy *phy); int (*exit)(struct phy *phy); int (*suspend)(struct phy *phy); int (*resume)(struct

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-04 Thread Kishon Vijay Abraham I
Hi, On Wednesday 03 April 2013 09:17 PM, Felipe Balbi wrote: Hi, On Wed, Apr 03, 2013 at 08:02:52PM +0530, Kishon Vijay Abraham I wrote: + ret = -EINVAL; + goto err0; + } + + if (!phy_class) + phy_core_init(); why don't you setup the

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-04 Thread Kishon Vijay Abraham I
Hi, On Thursday 04 April 2013 03:16 AM, Sylwester Nawrocki wrote: On 04/03/2013 02:53 PM, Kishon Vijay Abraham I wrote: . . snip . . diff --git a/Documentation/phy.txt b/Documentation/phy.txt new file mode 100644 index 000..7785ec0 --- /dev/null +++ b/Documentation/phy.txt @@ -0,0 +1,113

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-04 Thread Sylwester Nawrocki
Hi, On 04/04/2013 11:21 AM, Kishon Vijay Abraham I wrote: On Thursday 04 April 2013 03:16 AM, Sylwester Nawrocki wrote: On 04/03/2013 02:53 PM, Kishon Vijay Abraham I wrote: +4. Getting a reference to the PHY + +Before the controller can make use of the PHY, it has to get a reference to

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-04 Thread Kishon Vijay Abraham I
Hi, On Thursday 04 April 2013 04:11 PM, Sylwester Nawrocki wrote: Hi, On 04/04/2013 11:21 AM, Kishon Vijay Abraham I wrote: On Thursday 04 April 2013 03:16 AM, Sylwester Nawrocki wrote: On 04/03/2013 02:53 PM, Kishon Vijay Abraham I wrote: +4. Getting a reference to the PHY + +Before the

[PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-03 Thread Kishon Vijay Abraham I
The PHY framework provides a set of APIs for the PHY drivers to create/destroy a PHY and APIs for the PHY users to obtain a reference to the PHY with or without using phandle. To obtain a reference to the PHY without using phandle, the platform specfic intialization code (say from board file)

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-03 Thread Felipe Balbi
On Wed, Apr 03, 2013 at 06:23:49PM +0530, Kishon Vijay Abraham I wrote: The PHY framework provides a set of APIs for the PHY drivers to create/destroy a PHY and APIs for the PHY users to obtain a reference to the PHY with or without using phandle. To obtain a reference to the PHY without using

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-03 Thread Kishon Vijay Abraham I
Hi, On Wednesday 03 April 2013 07:12 PM, Felipe Balbi wrote: On Wed, Apr 03, 2013 at 06:23:49PM +0530, Kishon Vijay Abraham I wrote: The PHY framework provides a set of APIs for the PHY drivers to create/destroy a PHY and APIs for the PHY users to obtain a reference to the PHY with or without

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-03 Thread Felipe Balbi
hi, On Wed, Apr 03, 2013 at 07:48:42PM +0530, Kishon Vijay Abraham I wrote: +struct phy *of_phy_xlate(struct phy *phy, struct of_phandle_args *args) +{ + return phy; +} +EXPORT_SYMBOL_GPL(of_phy_xlate); so you get a PHY and just return it ? What gives ?? (maybe I skipped some of the

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-03 Thread Kishon Vijay Abraham I
Hi, On Wednesday 03 April 2013 07:57 PM, Felipe Balbi wrote: hi, On Wed, Apr 03, 2013 at 07:48:42PM +0530, Kishon Vijay Abraham I wrote: +struct phy *of_phy_xlate(struct phy *phy, struct of_phandle_args *args) +{ + return phy; +} +EXPORT_SYMBOL_GPL(of_phy_xlate); so you get a PHY and

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-03 Thread Felipe Balbi
Hi, On Wed, Apr 03, 2013 at 08:02:52PM +0530, Kishon Vijay Abraham I wrote: + ret = -EINVAL; + goto err0; + } + + if (!phy_class) + phy_core_init(); why don't you setup the class on module_init ? Then this would be a terrible error condition here :-) This is

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-03 Thread Sylwester Nawrocki
On 04/03/2013 02:53 PM, Kishon Vijay Abraham I wrote: --- /dev/null +++ b/Documentation/devicetree/bindings/phy/phy-bindings.txt @@ -0,0 +1,67 @@ +This document explains only the dt data binding. For general information about s/dt data/device tree ? +PHY subsystem refer Documentation/phy.txt

Re: [PATCH v5 1/6] drivers: phy: add generic PHY framework

2013-04-03 Thread Stephen Warren
On 04/03/2013 06:53 AM, Kishon Vijay Abraham I wrote: The PHY framework provides a set of APIs for the PHY drivers to create/destroy a PHY and APIs for the PHY users to obtain a reference to the PHY with or without using phandle. To obtain a reference to the PHY without using phandle, the