Skip to content

Commit 4dfb0bd

Browse files
lpappLinus Walleij
authored andcommitted
pinctrl: Fix some typos and grammar issues in the documentation
I had been trying to learn a bit more about the pinctrl subsystem, and I realized several typos and grammar issues while going through the documentation. I have probably not caught all the possible issues, but this change is addressing several places for improvement. Signed-off-by: Laszlo Papp <lpapp@kde.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 655dada commit 4dfb0bd

1 file changed

Lines changed: 21 additions & 22 deletions

File tree

‎Documentation/pinctrl.txt‎

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Definition of PIN CONTROLLER:
1818

1919
- A pin controller is a piece of hardware, usually a set of registers, that
2020
can control PINs. It may be able to multiplex, bias, set load capacitance,
21-
set drive strength etc for individual pins or groups of pins.
21+
set drive strength, etc. for individual pins or groups of pins.
2222

2323
Definition of PIN:
2424

@@ -90,7 +90,7 @@ selected drivers, you need to select them from your machine's Kconfig entry,
9090
since these are so tightly integrated with the machines they are used on.
9191
See for example arch/arm/mach-u300/Kconfig for an example.
9292

93-
Pins usually have fancier names than this. You can find these in the dataheet
93+
Pins usually have fancier names than this. You can find these in the datasheet
9494
for your chip. Notice that the core pinctrl.h file provides a fancy macro
9595
called PINCTRL_PIN() to create the struct entries. As you can see I enumerated
9696
the pins from 0 in the upper left corner to 63 in the lower right corner.
@@ -185,7 +185,7 @@ static struct pinctrl_desc foo_desc = {
185185
};
186186

187187
The pin control subsystem will call the .get_groups_count() function to
188-
determine total number of legal selectors, then it will call the other functions
188+
determine the total number of legal selectors, then it will call the other functions
189189
to retrieve the name and pins of the group. Maintaining the data structure of
190190
the groups is up to the driver, this is just a simple example - in practice you
191191
may need more entries in your group structure, for example specific register
@@ -195,7 +195,7 @@ ranges associated with each group and so on.
195195
Pin configuration
196196
=================
197197

198-
Pins can sometimes be software-configured in an various ways, mostly related
198+
Pins can sometimes be software-configured in various ways, mostly related
199199
to their electronic properties when used as inputs or outputs. For example you
200200
may be able to make an output pin high impedance, or "tristate" meaning it is
201201
effectively disconnected. You may be able to connect an input pin to VDD or GND
@@ -291,7 +291,7 @@ Since the pin controller subsystem have its pinspace local to the pin
291291
controller we need a mapping so that the pin control subsystem can figure out
292292
which pin controller handles control of a certain GPIO pin. Since a single
293293
pin controller may be muxing several GPIO ranges (typically SoCs that have
294-
one set of pins but internally several GPIO silicon blocks, each modelled as
294+
one set of pins, but internally several GPIO silicon blocks, each modelled as
295295
a struct gpio_chip) any number of GPIO ranges can be added to a pin controller
296296
instance like this:
297297

@@ -373,9 +373,9 @@ will be called on that specific pin controller.
373373

374374
For all functionalities dealing with pin biasing, pin muxing etc, the pin
375375
controller subsystem will look up the corresponding pin number from the passed
376-
in gpio number, and use the range's internals to retrive a pin number. After
376+
in gpio number, and use the range's internals to retrieve a pin number. After
377377
that, the subsystem passes it on to the pin control driver, so the driver
378-
will get an pin number into its handled number range. Further it is also passed
378+
will get a pin number into its handled number range. Further it is also passed
379379
the range ID value, so that the pin controller knows which range it should
380380
deal with.
381381

@@ -430,8 +430,8 @@ pins you see some will be taken by things like a few VCC and GND to feed power
430430
to the chip, and quite a few will be taken by large ports like an external
431431
memory interface. The remaining pins will often be subject to pin multiplexing.
432432

433-
The example 8x8 PGA package above will have pin numbers 0 thru 63 assigned to
434-
its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using
433+
The example 8x8 PGA package above will have pin numbers 0 through 63 assigned
434+
to its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using
435435
pinctrl_register_pins() and a suitable data set as shown earlier.
436436

437437
In this 8x8 BGA package the pins { A8, A7, A6, A5 } can be used as an SPI port
@@ -442,7 +442,7 @@ we cannot use the SPI port and I2C port at the same time. However in the inside
442442
of the package the silicon performing the SPI logic can alternatively be routed
443443
out on pins { G4, G3, G2, G1 }.
444444

445-
On the botton row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something
445+
On the bottom row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something
446446
special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will
447447
consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or
448448
{ A1, B1, C1, D1 } or all of them. If we use all 8 bits, we cannot use the SPI
@@ -549,7 +549,7 @@ Assumptions:
549549

550550
We assume that the number of possible function maps to pin groups is limited by
551551
the hardware. I.e. we assume that there is no system where any function can be
552-
mapped to any pin, like in a phone exchange. So the available pins groups for
552+
mapped to any pin, like in a phone exchange. So the available pin groups for
553553
a certain function will be limited to a few choices (say up to eight or so),
554554
not hundreds or any amount of choices. This is the characteristic we have found
555555
by inspecting available pinmux hardware, and a necessary assumption since we
@@ -564,7 +564,7 @@ The pinmux core takes care of preventing conflicts on pins and calling
564564
the pin controller driver to execute different settings.
565565

566566
It is the responsibility of the pinmux driver to impose further restrictions
567-
(say for example infer electronic limitations due to load etc) to determine
567+
(say for example infer electronic limitations due to load, etc.) to determine
568568
whether or not the requested function can actually be allowed, and in case it
569569
is possible to perform the requested mux setting, poke the hardware so that
570570
this happens.
@@ -755,7 +755,7 @@ Pin control interaction with the GPIO subsystem
755755
Note that the following implies that the use case is to use a certain pin
756756
from the Linux kernel using the API in <linux/gpio.h> with gpio_request()
757757
and similar functions. There are cases where you may be using something
758-
that your datasheet calls "GPIO mode" but actually is just an electrical
758+
that your datasheet calls "GPIO mode", but actually is just an electrical
759759
configuration for a certain device. See the section below named
760760
"GPIO mode pitfalls" for more details on this scenario.
761761

@@ -871,7 +871,7 @@ hardware and shall be put into different subsystems:
871871

872872
- Registers (or fields within registers) that control muxing of signals
873873
from various other HW blocks (e.g. I2C, MMC, or GPIO) onto pins should
874-
be exposed through the pinctrl subssytem, as mux functions.
874+
be exposed through the pinctrl subsystem, as mux functions.
875875

876876
- Registers (or fields within registers) that control GPIO functionality
877877
such as setting a GPIO's output value, reading a GPIO's input value, or
@@ -895,7 +895,7 @@ Example: a pin is usually muxed in to be used as a UART TX line. But during
895895
system sleep, we need to put this pin into "GPIO mode" and ground it.
896896

897897
If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start
898-
to think that you need to come up with something real complex, that the
898+
to think that you need to come up with something really complex, that the
899899
pin shall be used for UART TX and GPIO at the same time, that you will grab
900900
a pin control handle and set it to a certain state to enable UART TX to be
901901
muxed in, then twist it over to GPIO mode and use gpio_direction_output()
@@ -964,20 +964,20 @@ GPIO mode.
964964
This will give the desired effect without any bogus interaction with the
965965
GPIO subsystem. It is just an electrical configuration used by that device
966966
when going to sleep, it might imply that the pin is set into something the
967-
datasheet calls "GPIO mode" but that is not the point: it is still used
967+
datasheet calls "GPIO mode", but that is not the point: it is still used
968968
by that UART device to control the pins that pertain to that very UART
969969
driver, putting them into modes needed by the UART. GPIO in the Linux
970970
kernel sense are just some 1-bit line, and is a different use case.
971971

972-
How the registers are poked to attain the push/pull and output low
972+
How the registers are poked to attain the push or pull, and output low
973973
configuration and the muxing of the "u0" or "gpio-mode" group onto these
974974
pins is a question for the driver.
975975

976976
Some datasheets will be more helpful and refer to the "GPIO mode" as
977977
"low power mode" rather than anything to do with GPIO. This often means
978978
the same thing electrically speaking, but in this latter case the
979979
software engineers will usually quickly identify that this is some
980-
specific muxing/configuration rather than anything related to the GPIO
980+
specific muxing or configuration rather than anything related to the GPIO
981981
API.
982982

983983

@@ -1024,8 +1024,7 @@ up the device struct (just like with clockdev or regulators). The function name
10241024
must match a function provided by the pinmux driver handling this pin range.
10251025

10261026
As you can see we may have several pin controllers on the system and thus
1027-
we need to specify which one of them that contain the functions we wish
1028-
to map.
1027+
we need to specify which one of them contains the functions we wish to map.
10291028

10301029
You register this pinmux mapping to the pinmux subsystem by simply:
10311030

@@ -1254,10 +1253,10 @@ The semantics of the pinctrl APIs are:
12541253
pinctrl_get().
12551254

12561255
- pinctrl_lookup_state() is called in process context to obtain a handle to a
1257-
specific state for a the client device. This operation may be slow too.
1256+
specific state for a client device. This operation may be slow, too.
12581257

12591258
- pinctrl_select_state() programs pin controller hardware according to the
1260-
definition of the state as given by the mapping table. In theory this is a
1259+
definition of the state as given by the mapping table. In theory, this is a
12611260
fast-path operation, since it only involved blasting some register settings
12621261
into hardware. However, note that some pin controllers may have their
12631262
registers on a slow/IRQ-based bus, so client devices should not assume they

0 commit comments

Comments
 (0)