From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: [PATCH v2 28/29] phy.txt: standardize document format
Date: Sat, 17 Jun 2017 12:26:56 -0300 [thread overview]
Message-ID: <5629d38bd598c5b1d8bcf99089502dd9fd49541c.1497713210.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <2932e5ece623ed990b6c3b80174df270278dc314.1497713210.git.mchehab@s-opensource.com>
In-Reply-To: <2932e5ece623ed990b6c3b80174df270278dc314.1497713210.git.mchehab@s-opensource.com>
Each text file under Documentation follows a different
format. Some doesn't even have titles!
Change its representation to follow the adopted standard,
using ReST markups for it to be parseable by Sphinx:
- mark titles;
- use :Author: for authorship;
- mark literal blocks.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
Documentation/phy.txt | 106 +++++++++++++++++++++++++++++++-------------------
1 file changed, 67 insertions(+), 39 deletions(-)
diff --git a/Documentation/phy.txt b/Documentation/phy.txt
index 383cdd863f08..457c3e0f86d6 100644
--- a/Documentation/phy.txt
+++ b/Documentation/phy.txt
@@ -1,10 +1,14 @@
- PHY SUBSYSTEM
- Kishon Vijay Abraham I <kishon@ti.com>
+=============
+PHY subsystem
+=============
+
+:Author: Kishon Vijay Abraham I <kishon@ti.com>
This document explains the Generic PHY Framework along with the APIs provided,
and how-to-use.
-1. Introduction
+Introduction
+============
*PHY* is the abbreviation for physical layer. It is used to connect a device
to the physical medium e.g., the USB controller has a PHY to provide functions
@@ -21,7 +25,8 @@ better code maintainability.
This framework will be of use only to devices that use external PHY (PHY
functionality is not embedded within the controller).
-2. Registering/Unregistering the PHY provider
+Registering/Unregistering the PHY provider
+==========================================
PHY provider refers to an entity that implements one or more PHY instances.
For the simple case where the PHY provider implements only a single instance of
@@ -30,11 +35,14 @@ of_phy_simple_xlate. If the PHY provider implements multiple instances, it
should provide its own implementation of of_xlate. of_xlate is used only for
dt boot case.
-#define of_phy_provider_register(dev, xlate) \
- __of_phy_provider_register((dev), NULL, THIS_MODULE, (xlate))
+::
-#define devm_of_phy_provider_register(dev, xlate) \
- __devm_of_phy_provider_register((dev), NULL, THIS_MODULE, (xlate))
+ #define of_phy_provider_register(dev, xlate) \
+ __of_phy_provider_register((dev), NULL, THIS_MODULE, (xlate))
+
+ #define devm_of_phy_provider_register(dev, xlate) \
+ __devm_of_phy_provider_register((dev), NULL, THIS_MODULE,
+ (xlate))
of_phy_provider_register and devm_of_phy_provider_register macros can be used to
register the phy_provider and it takes device and of_xlate as
@@ -47,28 +55,35 @@ nodes within extra levels for context and extensibility, in which case the low
level of_phy_provider_register_full() and devm_of_phy_provider_register_full()
macros can be used to override the node containing the children.
-#define of_phy_provider_register_full(dev, children, xlate) \
- __of_phy_provider_register(dev, children, THIS_MODULE, xlate)
+::
-#define devm_of_phy_provider_register_full(dev, children, xlate) \
- __devm_of_phy_provider_register_full(dev, children, THIS_MODULE, xlate)
+ #define of_phy_provider_register_full(dev, children, xlate) \
+ __of_phy_provider_register(dev, children, THIS_MODULE, xlate)
-void devm_of_phy_provider_unregister(struct device *dev,
- struct phy_provider *phy_provider);
-void of_phy_provider_unregister(struct phy_provider *phy_provider);
+ #define devm_of_phy_provider_register_full(dev, children, xlate) \
+ __devm_of_phy_provider_register_full(dev, children,
+ THIS_MODULE, xlate)
+
+ void devm_of_phy_provider_unregister(struct device *dev,
+ struct phy_provider *phy_provider);
+ void of_phy_provider_unregister(struct phy_provider *phy_provider);
devm_of_phy_provider_unregister and of_phy_provider_unregister can be used to
unregister the PHY.
-3. Creating the PHY
+Creating the PHY
+================
The PHY driver should create the PHY in order for other peripheral controllers
to make use of it. The PHY framework provides 2 APIs to create the PHY.
-struct phy *phy_create(struct device *dev, struct device_node *node,
- const struct phy_ops *ops);
-struct phy *devm_phy_create(struct device *dev, struct device_node *node,
- const struct phy_ops *ops);
+::
+
+ struct phy *phy_create(struct device *dev, struct device_node *node,
+ const struct phy_ops *ops);
+ struct phy *devm_phy_create(struct device *dev,
+ struct device_node *node,
+ const struct phy_ops *ops);
The PHY drivers can use one of the above 2 APIs to create the PHY by passing
the device pointer and phy ops.
@@ -84,12 +99,16 @@ phy_ops to get back the private data.
Before the controller can make use of the PHY, it has to get a reference to
it. This framework provides the following APIs to get a reference to the PHY.
-struct phy *phy_get(struct device *dev, const char *string);
-struct phy *phy_optional_get(struct device *dev, const char *string);
-struct phy *devm_phy_get(struct device *dev, const char *string);
-struct phy *devm_phy_optional_get(struct device *dev, const char *string);
-struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np,
- int index);
+::
+
+ struct phy *phy_get(struct device *dev, const char *string);
+ struct phy *phy_optional_get(struct device *dev, const char *string);
+ struct phy *devm_phy_get(struct device *dev, const char *string);
+ struct phy *devm_phy_optional_get(struct device *dev,
+ const char *string);
+ struct phy *devm_of_phy_get_by_index(struct device *dev,
+ struct device_node *np,
+ int index);
phy_get, phy_optional_get, devm_phy_get and devm_phy_optional_get can
be used to get the PHY. In the case of dt boot, the string arguments
@@ -111,30 +130,35 @@ the phy_init() and phy_exit() calls, and phy_power_on() and
phy_power_off() calls are all NOP when applied to a NULL phy. The NULL
phy is useful in devices for handling optional phy devices.
-5. Releasing a reference to the PHY
+Releasing a reference to the PHY
+================================
When the controller no longer needs the PHY, it has to release the reference
to the PHY it has obtained using the APIs mentioned in the above section. The
PHY framework provides 2 APIs to release a reference to the PHY.
-void phy_put(struct phy *phy);
-void devm_phy_put(struct device *dev, struct phy *phy);
+::
+
+ void phy_put(struct phy *phy);
+ void devm_phy_put(struct device *dev, struct phy *phy);
Both these APIs are used to release a reference to the PHY and devm_phy_put
destroys the devres associated with this PHY.
-6. Destroying the PHY
+Destroying the PHY
+==================
When the driver that created the PHY is unloaded, it should destroy the PHY it
-created using one of the following 2 APIs.
+created using one of the following 2 APIs::
-void phy_destroy(struct phy *phy);
-void devm_phy_destroy(struct device *dev, struct phy *phy);
+ void phy_destroy(struct phy *phy);
+ void devm_phy_destroy(struct device *dev, struct phy *phy);
Both these APIs destroy the PHY and devm_phy_destroy destroys the devres
associated with this PHY.
-7. PM Runtime
+PM Runtime
+==========
This subsystem is pm runtime enabled. So while creating the PHY,
pm_runtime_enable of the phy device created by this subsystem is called and
@@ -150,7 +174,8 @@ There are exported APIs like phy_pm_runtime_get, phy_pm_runtime_get_sync,
phy_pm_runtime_put, phy_pm_runtime_put_sync, phy_pm_runtime_allow and
phy_pm_runtime_forbid for performing PM operations.
-8. PHY Mappings
+PHY Mappings
+============
In order to get reference to a PHY without help from DeviceTree, the framework
offers lookups which can be compared to clkdev that allow clk structures to be
@@ -158,12 +183,15 @@ bound to devices. A lookup can be made be made during runtime when a handle to
the struct phy already exists.
The framework offers the following API for registering and unregistering the
-lookups.
+lookups::
-int phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id);
-void phy_remove_lookup(struct phy *phy, const char *con_id, const char *dev_id);
+ int phy_create_lookup(struct phy *phy, const char *con_id,
+ const char *dev_id);
+ void phy_remove_lookup(struct phy *phy, const char *con_id,
+ const char *dev_id);
-9. DeviceTree Binding
+DeviceTree Binding
+==================
The documentation for PHY dt binding can be found @
Documentation/devicetree/bindings/phy/phy-bindings.txt
--
2.9.4
next prev parent reply other threads:[~2017-06-17 15:34 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-17 15:26 [PATCH v2 01/29] IPMI.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 02/29] IRQ-affinity.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 03/29] IRQ-domain.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 04/29] irqflags-tracing.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 05/29] IRQ.txt: add a markup for its title Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 06/29] isapnp.txt: promote title level Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 07/29] isa.txt: standardize document format Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 08/29] kernel-per-CPU-kthreads.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 09/29] kobject.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 10/29] kprobes.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 11/29] kref.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 12/29] kselftest.rst: do some adjustments after ReST conversion Mauro Carvalho Chehab
2017-06-23 14:04 ` Shuah Khan
2017-06-23 21:32 ` Mauro Carvalho Chehab
2017-06-24 0:47 ` Shuah Khan
2017-06-25 19:35 ` Jonathan Corbet
2017-06-26 16:30 ` Shuah Khan
2017-06-17 15:26 ` [PATCH v2 13/29] ldm.txt: standardize document format Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 14/29] lockup-watchdogs.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 15/29] lzo.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 16/29] mailbox.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 17/29] memory-barriers.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 18/29] memory-barriers.txt: use literals for variables Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 19/29] memory-hotplug.txt: standardize document format Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 20/29] men-chameleon-bus.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 21/29] nommu-mmap.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 22/29] nommu-mmap.txt: don't use all upper case on titles Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 23/29] ntb.txt: standardize document format Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 24/29] numastat.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 25/29] padata.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 26/29] parport-lowlevel.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` [PATCH v2 27/29] percpu-rw-semaphore.txt: " Mauro Carvalho Chehab
2017-06-17 15:26 ` Mauro Carvalho Chehab [this message]
2017-06-17 15:26 ` [PATCH v2 29/29] pi-futex.txt: " Mauro Carvalho Chehab
2017-06-17 15:46 ` [PATCH v2 01/29] IPMI.txt: " Corey Minyard
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=5629d38bd598c5b1d8bcf99089502dd9fd49541c.1497713210.git.mchehab@s-opensource.com \
--to=mchehab@s-opensource.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@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
all inboxes | Powered by JetHome®