linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: core: document calibrate() method
       [not found] <CGME20190719095254eucas1p29c9e6c7aac20cf89b589fd2f2036c485@eucas1p2.samsung.com>
@ 2019-07-19  9:52 ` Marek Szyprowski
  2019-07-19 10:04   ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Szyprowski @ 2019-07-19  9:52 UTC (permalink / raw)
  To: linux-usb, linux-samsung-soc
  Cc: linux-kernel, Kishon Vijay Abraham I, Marek Szyprowski,
	Bartlomiej Zolnierkiewicz

Commit 36914111e682 ("drivers: phy: add calibrate method") added support
for generic phy_calibrate() method, but it didn't explain in detail when
such method is supposed to be called. Add some more documentation directly
to the phy.h to make it clean that it is intended to be called after every
host controller reset.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 include/linux/phy/phy.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 15032f145063..46775e8b0ed9 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -101,6 +101,18 @@ struct phy_ops {
 	int	(*validate)(struct phy *phy, enum phy_mode mode, int submode,
 			    union phy_configure_opts *opts);
 	int	(*reset)(struct phy *phy);
+
+	/**
+	 * @calibrate:
+	 *
+	 * Optional.
+	 *
+	 * Used to calibrate phy, typically by adjusting some parameters
+	 * in runtime, which are otherwise lost after host controller
+	 * reset and cannot be set in phy_init() and phy_power_on().
+	 *
+	 * Returns: 0 if successful, an negative error code otherwise
+	 */
 	int	(*calibrate)(struct phy *phy);
 	void	(*release)(struct phy *phy);
 	struct module *owner;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: core: document calibrate() method
  2019-07-19  9:52 ` [PATCH] phy: core: document calibrate() method Marek Szyprowski
@ 2019-07-19 10:04   ` Kishon Vijay Abraham I
  2019-07-19 12:21     ` Marek Szyprowski
  0 siblings, 1 reply; 5+ messages in thread
From: Kishon Vijay Abraham I @ 2019-07-19 10:04 UTC (permalink / raw)
  To: Marek Szyprowski, linux-usb, linux-samsung-soc
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz

Hi Marek,

On 19/07/19 3:22 PM, Marek Szyprowski wrote:
> Commit 36914111e682 ("drivers: phy: add calibrate method") added support
> for generic phy_calibrate() method, but it didn't explain in detail when
> such method is supposed to be called. Add some more documentation directly
> to the phy.h to make it clean that it is intended to be called after every
> host controller reset.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  include/linux/phy/phy.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index 15032f145063..46775e8b0ed9 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -101,6 +101,18 @@ struct phy_ops {
>  	int	(*validate)(struct phy *phy, enum phy_mode mode, int submode,
>  			    union phy_configure_opts *opts);
>  	int	(*reset)(struct phy *phy);
> +
> +	/**
> +	 * @calibrate:
> +	 *
> +	 * Optional.
> +	 *
> +	 * Used to calibrate phy, typically by adjusting some parameters
> +	 * in runtime, which are otherwise lost after host controller
> +	 * reset and cannot be set in phy_init() and phy_power_on().
> +	 *
> +	 * Returns: 0 if successful, an negative error code otherwise
> +	 */
>  	int	(*calibrate)(struct phy *phy);

This should be added in drivers/phy/phy-core.c before phy_calibrate()? We could
add a separate section in Documentation/phy.txt to document these phy_ops.

Thanks
Kishon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: core: document calibrate() method
  2019-07-19 10:04   ` Kishon Vijay Abraham I
@ 2019-07-19 12:21     ` Marek Szyprowski
  2019-07-19 12:25       ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Szyprowski @ 2019-07-19 12:21 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, linux-usb, linux-samsung-soc
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz

Hi Kishon,

On 2019-07-19 12:04, Kishon Vijay Abraham I wrote:
> Hi Marek,
>
> On 19/07/19 3:22 PM, Marek Szyprowski wrote:
>> Commit 36914111e682 ("drivers: phy: add calibrate method") added support
>> for generic phy_calibrate() method, but it didn't explain in detail when
>> such method is supposed to be called. Add some more documentation directly
>> to the phy.h to make it clean that it is intended to be called after every
>> host controller reset.
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> ---
>>   include/linux/phy/phy.h | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
>> index 15032f145063..46775e8b0ed9 100644
>> --- a/include/linux/phy/phy.h
>> +++ b/include/linux/phy/phy.h
>> @@ -101,6 +101,18 @@ struct phy_ops {
>>   	int	(*validate)(struct phy *phy, enum phy_mode mode, int submode,
>>   			    union phy_configure_opts *opts);
>>   	int	(*reset)(struct phy *phy);
>> +
>> +	/**
>> +	 * @calibrate:
>> +	 *
>> +	 * Optional.
>> +	 *
>> +	 * Used to calibrate phy, typically by adjusting some parameters
>> +	 * in runtime, which are otherwise lost after host controller
>> +	 * reset and cannot be set in phy_init() and phy_power_on().
>> +	 *
>> +	 * Returns: 0 if successful, an negative error code otherwise
>> +	 */
>>   	int	(*calibrate)(struct phy *phy);
> This should be added in drivers/phy/phy-core.c before phy_calibrate()?

Okay. Do you want to keep it also in phy.h (like for validate and 
configure)?


> We could
> add a separate section in Documentation/phy.txt to document these phy_ops.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: core: document calibrate() method
  2019-07-19 12:21     ` Marek Szyprowski
@ 2019-07-19 12:25       ` Kishon Vijay Abraham I
  2019-07-22 16:50         ` Marek Szyprowski
  0 siblings, 1 reply; 5+ messages in thread
From: Kishon Vijay Abraham I @ 2019-07-19 12:25 UTC (permalink / raw)
  To: Marek Szyprowski, linux-usb, linux-samsung-soc
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz

Hi Marek,

On 19/07/19 5:51 PM, Marek Szyprowski wrote:
> Hi Kishon,
> 
> On 2019-07-19 12:04, Kishon Vijay Abraham I wrote:
>> Hi Marek,
>>
>> On 19/07/19 3:22 PM, Marek Szyprowski wrote:
>>> Commit 36914111e682 ("drivers: phy: add calibrate method") added support
>>> for generic phy_calibrate() method, but it didn't explain in detail when
>>> such method is supposed to be called. Add some more documentation directly
>>> to the phy.h to make it clean that it is intended to be called after every
>>> host controller reset.
>>>
>>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>> ---
>>>   include/linux/phy/phy.h | 12 ++++++++++++
>>>   1 file changed, 12 insertions(+)
>>>
>>> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
>>> index 15032f145063..46775e8b0ed9 100644
>>> --- a/include/linux/phy/phy.h
>>> +++ b/include/linux/phy/phy.h
>>> @@ -101,6 +101,18 @@ struct phy_ops {
>>>   	int	(*validate)(struct phy *phy, enum phy_mode mode, int submode,
>>>   			    union phy_configure_opts *opts);
>>>   	int	(*reset)(struct phy *phy);
>>> +
>>> +	/**
>>> +	 * @calibrate:
>>> +	 *
>>> +	 * Optional.
>>> +	 *
>>> +	 * Used to calibrate phy, typically by adjusting some parameters
>>> +	 * in runtime, which are otherwise lost after host controller
>>> +	 * reset and cannot be set in phy_init() and phy_power_on().
>>> +	 *
>>> +	 * Returns: 0 if successful, an negative error code otherwise
>>> +	 */
>>>   	int	(*calibrate)(struct phy *phy);
>> This should be added in drivers/phy/phy-core.c before phy_calibrate()?
> 
> Okay. Do you want to keep it also in phy.h (like for validate and 
> configure)?

No. Adding in phy.txt and before phy_calibrate() should suffice IMO.

Thanks
Kishon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: core: document calibrate() method
  2019-07-19 12:25       ` Kishon Vijay Abraham I
@ 2019-07-22 16:50         ` Marek Szyprowski
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Szyprowski @ 2019-07-22 16:50 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, linux-usb, linux-samsung-soc
  Cc: linux-kernel, Bartlomiej Zolnierkiewicz

Hi Kishon,

On 2019-07-19 14:25, Kishon Vijay Abraham I wrote:
> On 19/07/19 5:51 PM, Marek Szyprowski wrote:
>> On 2019-07-19 12:04, Kishon Vijay Abraham I wrote:
>>> On 19/07/19 3:22 PM, Marek Szyprowski wrote:
>>>> Commit 36914111e682 ("drivers: phy: add calibrate method") added support
>>>> for generic phy_calibrate() method, but it didn't explain in detail when
>>>> such method is supposed to be called. Add some more documentation directly
>>>> to the phy.h to make it clean that it is intended to be called after every
>>>> host controller reset.
>>>>
>>>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>>> ---
>>>>    include/linux/phy/phy.h | 12 ++++++++++++
>>>>    1 file changed, 12 insertions(+)
>>>>
>>>> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
>>>> index 15032f145063..46775e8b0ed9 100644
>>>> --- a/include/linux/phy/phy.h
>>>> +++ b/include/linux/phy/phy.h
>>>> @@ -101,6 +101,18 @@ struct phy_ops {
>>>>    	int	(*validate)(struct phy *phy, enum phy_mode mode, int submode,
>>>>    			    union phy_configure_opts *opts);
>>>>    	int	(*reset)(struct phy *phy);
>>>> +
>>>> +	/**
>>>> +	 * @calibrate:
>>>> +	 *
>>>> +	 * Optional.
>>>> +	 *
>>>> +	 * Used to calibrate phy, typically by adjusting some parameters
>>>> +	 * in runtime, which are otherwise lost after host controller
>>>> +	 * reset and cannot be set in phy_init() and phy_power_on().
>>>> +	 *
>>>> +	 * Returns: 0 if successful, an negative error code otherwise
>>>> +	 */
>>>>    	int	(*calibrate)(struct phy *phy);
>>> This should be added in drivers/phy/phy-core.c before phy_calibrate()?
>> Okay. Do you want to keep it also in phy.h (like for validate and
>> configure)?
> No. Adding in phy.txt and before phy_calibrate() should suffice IMO.

OKay, I will move it to phy.c. Generic PHYs documentation is converted 
to RST (Documentation/driver-api/phy/phy.rst), so it could simply 
include those comments from .c file. This can be done in separate patch.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-22 16:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20190719095254eucas1p29c9e6c7aac20cf89b589fd2f2036c485@eucas1p2.samsung.com>
2019-07-19  9:52 ` [PATCH] phy: core: document calibrate() method Marek Szyprowski
2019-07-19 10:04   ` Kishon Vijay Abraham I
2019-07-19 12:21     ` Marek Szyprowski
2019-07-19 12:25       ` Kishon Vijay Abraham I
2019-07-22 16:50         ` Marek Szyprowski

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).