aboutsummaryrefslogtreecommitdiff
path: root/doc/driver-model
diff options
context:
space:
mode:
authorSimon Glass2020-12-03 16:55:23 -0700
committerSimon Glass2020-12-13 16:51:09 -0700
commit8a8d24bdf174851ebb8607f359d54b72e3283b97 (patch)
tree89fe2b9fd0c33209ce154170f9bda61f624dd9cd /doc/driver-model
parentb012ff1f1b0d662587dcf8707fe7cbf1c1f35d2f (diff)
dm: treewide: Rename ..._platdata variables to just ..._plat
Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'doc/driver-model')
-rw-r--r--doc/driver-model/of-plat.rst10
-rw-r--r--doc/driver-model/spi-howto.rst16
-rw-r--r--doc/driver-model/usb-info.rst8
3 files changed, 17 insertions, 17 deletions
diff --git a/doc/driver-model/of-plat.rst b/doc/driver-model/of-plat.rst
index 4436c4a2721..afa27c211cc 100644
--- a/doc/driver-model/of-plat.rst
+++ b/doc/driver-model/of-plat.rst
@@ -242,7 +242,7 @@ For example:
#include <dt-structs.h>
- struct mmc_platdata {
+ struct mmc_plat {
#if CONFIG_IS_ENABLED(OF_PLATDATA)
/* Put this first since driver model will copy the data here */
struct dtd_mmc dtplat;
@@ -258,7 +258,7 @@ For example:
{
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
/* Decode the device tree data */
- struct mmc_platdata *plat = dev_get_plat(dev);
+ struct mmc_plat *plat = dev_get_plat(dev);
const void *blob = gd->fdt_blob;
int node = dev_of_offset(dev);
@@ -270,7 +270,7 @@ For example:
static int mmc_probe(struct udevice *dev)
{
- struct mmc_platdata *plat = dev_get_plat(dev);
+ struct mmc_plat *plat = dev_get_plat(dev);
#if CONFIG_IS_ENABLED(OF_PLATDATA)
/* Decode the of-platdata from the C structures */
@@ -294,12 +294,12 @@ For example:
.of_to_plat = mmc_of_to_plat,
.probe = mmc_probe,
.priv_auto = sizeof(struct mmc_priv),
- .plat_auto = sizeof(struct mmc_platdata),
+ .plat_auto = sizeof(struct mmc_plat),
};
U_BOOT_DRIVER_ALIAS(mmc_drv, vendor_mmc) /* matches compatible string */
-Note that struct mmc_platdata is defined in the C file, not in a header. This
+Note that struct mmc_plat is defined in the C file, not in a header. This
is to avoid needing to include dt-structs.h in a header file. The idea is to
keep the use of each of-platdata struct to the smallest possible code area.
There is just one driver C file for each struct, that can convert from the
diff --git a/doc/driver-model/spi-howto.rst b/doc/driver-model/spi-howto.rst
index 0770a09f0b7..f1c41671390 100644
--- a/doc/driver-model/spi-howto.rst
+++ b/doc/driver-model/spi-howto.rst
@@ -209,7 +209,7 @@ DM tells you. The name is not quite right. So in this case we would use:
.. code-block:: c
- struct exynos_spi_platdata {
+ struct exynos_spi_plat {
enum periph_id periph_id;
s32 frequency; /* Default clock frequency, -1 for none */
struct exynos_spi *regs;
@@ -231,7 +231,7 @@ tree, but we need to tell it the size:
U_BOOT_DRIVER(spi_exynos) = {
...
- .plat_auto = sizeof(struct exynos_spi_platdata),
+ .plat_auto = sizeof(struct exynos_spi_plat),
Here is a sample function. It gets a pointer to the platform data and
@@ -241,7 +241,7 @@ fills in the fields from device tree.
static int exynos_spi_of_to_plat(struct udevice *bus)
{
- struct exynos_spi_platdata *plat = bus->plat;
+ struct exynos_spi_plat *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
@@ -274,7 +274,7 @@ Specify this data in a U_BOOT_DEVICE() declaration in your board file:
.. code-block:: c
- struct exynos_spi_platdata platdata_spi0 = {
+ struct exynos_spi_plat platdata_spi0 = {
.periph_id = ...
.frequency = ...
.regs = ...
@@ -357,7 +357,7 @@ what you can copy out to set things up.
static int exynos_spi_probe(struct udevice *bus)
{
- struct exynos_spi_platdata *plat = dev_get_plat(bus);
+ struct exynos_spi_plat *plat = dev_get_plat(bus);
struct exynos_spi_priv *priv = dev_get_priv(bus);
priv->regs = plat->regs;
@@ -437,7 +437,7 @@ Here is an example for the speed part:
static int exynos_spi_set_speed(struct udevice *bus, uint speed)
{
- struct exynos_spi_platdata *plat = bus->plat;
+ struct exynos_spi_plat *plat = bus->plat;
struct exynos_spi_priv *priv = dev_get_priv(bus);
int ret;
@@ -585,7 +585,7 @@ The new version looks like this:
static void spi_cs_activate(struct udevice *dev)
{
struct udevice *bus = dev->parent;
- struct exynos_spi_platdata *pdata = dev_get_plat(bus);
+ struct exynos_spi_plat *pdata = dev_get_plat(bus);
struct exynos_spi_priv *priv = dev_get_priv(bus);
/* If it's too soon to do another transaction, wait */
@@ -657,7 +657,7 @@ A little note about SPI uclass features
The SPI uclass keeps some information about each device 'dev' on the bus:
- struct dm_spi_slave_platdata:
+ struct dm_spi_slave_plat:
This is device_get_parent_plat(dev).
This is where the chip select number is stored, along with
the default bus speed and mode. It is automatically read
diff --git a/doc/driver-model/usb-info.rst b/doc/driver-model/usb-info.rst
index e9fe9d2904c..24d1e81a6c6 100644
--- a/doc/driver-model/usb-info.rst
+++ b/doc/driver-model/usb-info.rst
@@ -43,7 +43,7 @@ as drivers in the USB uclass. For example:
.probe = tegra_ehci_usb_probe,
.remove = tegra_ehci_usb_remove,
.ops = &ehci_usb_ops,
- .plat_auto = sizeof(struct usb_platdata),
+ .plat_auto = sizeof(struct usb_plat),
.priv_auto = sizeof(struct fdt_usb),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
@@ -63,7 +63,7 @@ This can hold run-time information needed by the driver for operation. It
exists when the device is probed (not when it is bound) and is removed when
the driver is removed.
-Note that usb_platdata is currently only used to deal with setting up a bus
+Note that usb_plat is currently only used to deal with setting up a bus
in USB device mode (OTG operation). It can be omitted if that is not
supported.
@@ -93,12 +93,12 @@ The following primary data structures are in use:
handles that). Once the device is set up, you can find the device
descriptor and current configuration descriptor in this structure.
-- struct usb_platdata:
+- struct usb_plat:
This holds platform data for a controller. So far this is only used
as a work-around for controllers which can act as USB devices in OTG
mode, since the gadget framework does not use driver model.
-- struct usb_dev_platdata:
+- struct usb_dev_plat:
This holds platform data for a device. You can access it for a
device 'dev' with dev_get_parent_plat(dev). It holds the device
address and speed - anything that can be determined before the device