diff options
author | Laszlo Papp <lpapp@kde.org> | 2014-01-13 14:00:14 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-01-15 07:59:50 -0500 |
commit | 4dfb0bd76b0efea8b2081daee8262c13f965499b (patch) | |
tree | 7006b4eebb1ff5a793f4262779ccfa7e6f227473 /Documentation/pinctrl.txt | |
parent | 655dada62779917e2337b9abf8ab95e891cc0938 (diff) |
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>
Diffstat (limited to 'Documentation/pinctrl.txt')
-rw-r--r-- | Documentation/pinctrl.txt | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt index a7929cb47e7c..23f1590f49fe 100644 --- a/Documentation/pinctrl.txt +++ b/Documentation/pinctrl.txt | |||
@@ -18,7 +18,7 @@ Definition of PIN CONTROLLER: | |||
18 | 18 | ||
19 | - A pin controller is a piece of hardware, usually a set of registers, that | 19 | - A pin controller is a piece of hardware, usually a set of registers, that |
20 | can control PINs. It may be able to multiplex, bias, set load capacitance, | 20 | 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. |
22 | 22 | ||
23 | Definition of PIN: | 23 | Definition of PIN: |
24 | 24 | ||
@@ -90,7 +90,7 @@ selected drivers, you need to select them from your machine's Kconfig entry, | |||
90 | since these are so tightly integrated with the machines they are used on. | 90 | since these are so tightly integrated with the machines they are used on. |
91 | See for example arch/arm/mach-u300/Kconfig for an example. | 91 | See for example arch/arm/mach-u300/Kconfig for an example. |
92 | 92 | ||
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 |
94 | for your chip. Notice that the core pinctrl.h file provides a fancy macro | 94 | for your chip. Notice that the core pinctrl.h file provides a fancy macro |
95 | called PINCTRL_PIN() to create the struct entries. As you can see I enumerated | 95 | called PINCTRL_PIN() to create the struct entries. As you can see I enumerated |
96 | the pins from 0 in the upper left corner to 63 in the lower right corner. | 96 | 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 = { | |||
185 | }; | 185 | }; |
186 | 186 | ||
187 | The pin control subsystem will call the .get_groups_count() function to | 187 | 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 |
189 | to retrieve the name and pins of the group. Maintaining the data structure of | 189 | to retrieve the name and pins of the group. Maintaining the data structure of |
190 | the groups is up to the driver, this is just a simple example - in practice you | 190 | the groups is up to the driver, this is just a simple example - in practice you |
191 | may need more entries in your group structure, for example specific register | 191 | may need more entries in your group structure, for example specific register |
@@ -195,7 +195,7 @@ ranges associated with each group and so on. | |||
195 | Pin configuration | 195 | Pin configuration |
196 | ================= | 196 | ================= |
197 | 197 | ||
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 |
199 | to their electronic properties when used as inputs or outputs. For example you | 199 | to their electronic properties when used as inputs or outputs. For example you |
200 | may be able to make an output pin high impedance, or "tristate" meaning it is | 200 | may be able to make an output pin high impedance, or "tristate" meaning it is |
201 | effectively disconnected. You may be able to connect an input pin to VDD or GND | 201 | 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 | |||
291 | controller we need a mapping so that the pin control subsystem can figure out | 291 | controller we need a mapping so that the pin control subsystem can figure out |
292 | which pin controller handles control of a certain GPIO pin. Since a single | 292 | which pin controller handles control of a certain GPIO pin. Since a single |
293 | pin controller may be muxing several GPIO ranges (typically SoCs that have | 293 | 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 |
295 | a struct gpio_chip) any number of GPIO ranges can be added to a pin controller | 295 | a struct gpio_chip) any number of GPIO ranges can be added to a pin controller |
296 | instance like this: | 296 | instance like this: |
297 | 297 | ||
@@ -373,9 +373,9 @@ will be called on that specific pin controller. | |||
373 | 373 | ||
374 | For all functionalities dealing with pin biasing, pin muxing etc, the pin | 374 | For all functionalities dealing with pin biasing, pin muxing etc, the pin |
375 | controller subsystem will look up the corresponding pin number from the passed | 375 | 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 |
377 | that, the subsystem passes it on to the pin control driver, so the driver | 377 | 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 |
379 | the range ID value, so that the pin controller knows which range it should | 379 | the range ID value, so that the pin controller knows which range it should |
380 | deal with. | 380 | deal with. |
381 | 381 | ||
@@ -430,8 +430,8 @@ pins you see some will be taken by things like a few VCC and GND to feed power | |||
430 | to the chip, and quite a few will be taken by large ports like an external | 430 | to the chip, and quite a few will be taken by large ports like an external |
431 | memory interface. The remaining pins will often be subject to pin multiplexing. | 431 | memory interface. The remaining pins will often be subject to pin multiplexing. |
432 | 432 | ||
433 | The example 8x8 PGA package above will have pin numbers 0 thru 63 assigned to | 433 | The example 8x8 PGA package above will have pin numbers 0 through 63 assigned |
434 | its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using | 434 | to its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using |
435 | pinctrl_register_pins() and a suitable data set as shown earlier. | 435 | pinctrl_register_pins() and a suitable data set as shown earlier. |
436 | 436 | ||
437 | In this 8x8 BGA package the pins { A8, A7, A6, A5 } can be used as an SPI port | 437 | 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 | |||
442 | of the package the silicon performing the SPI logic can alternatively be routed | 442 | of the package the silicon performing the SPI logic can alternatively be routed |
443 | out on pins { G4, G3, G2, G1 }. | 443 | out on pins { G4, G3, G2, G1 }. |
444 | 444 | ||
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 |
446 | special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will | 446 | special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will |
447 | consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or | 447 | consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or |
448 | { A1, B1, C1, D1 } or all of them. If we use all 8 bits, we cannot use the SPI | 448 | { A1, B1, C1, D1 } or all of them. If we use all 8 bits, we cannot use the SPI |
@@ -549,7 +549,7 @@ Assumptions: | |||
549 | 549 | ||
550 | We assume that the number of possible function maps to pin groups is limited by | 550 | We assume that the number of possible function maps to pin groups is limited by |
551 | the hardware. I.e. we assume that there is no system where any function can be | 551 | 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 |
553 | a certain function will be limited to a few choices (say up to eight or so), | 553 | a certain function will be limited to a few choices (say up to eight or so), |
554 | not hundreds or any amount of choices. This is the characteristic we have found | 554 | not hundreds or any amount of choices. This is the characteristic we have found |
555 | by inspecting available pinmux hardware, and a necessary assumption since we | 555 | 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 | |||
564 | the pin controller driver to execute different settings. | 564 | the pin controller driver to execute different settings. |
565 | 565 | ||
566 | It is the responsibility of the pinmux driver to impose further restrictions | 566 | 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 |
568 | whether or not the requested function can actually be allowed, and in case it | 568 | whether or not the requested function can actually be allowed, and in case it |
569 | is possible to perform the requested mux setting, poke the hardware so that | 569 | is possible to perform the requested mux setting, poke the hardware so that |
570 | this happens. | 570 | this happens. |
@@ -755,7 +755,7 @@ Pin control interaction with the GPIO subsystem | |||
755 | Note that the following implies that the use case is to use a certain pin | 755 | Note that the following implies that the use case is to use a certain pin |
756 | from the Linux kernel using the API in <linux/gpio.h> with gpio_request() | 756 | from the Linux kernel using the API in <linux/gpio.h> with gpio_request() |
757 | and similar functions. There are cases where you may be using something | 757 | 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 |
759 | configuration for a certain device. See the section below named | 759 | configuration for a certain device. See the section below named |
760 | "GPIO mode pitfalls" for more details on this scenario. | 760 | "GPIO mode pitfalls" for more details on this scenario. |
761 | 761 | ||
@@ -871,7 +871,7 @@ hardware and shall be put into different subsystems: | |||
871 | 871 | ||
872 | - Registers (or fields within registers) that control muxing of signals | 872 | - Registers (or fields within registers) that control muxing of signals |
873 | from various other HW blocks (e.g. I2C, MMC, or GPIO) onto pins should | 873 | 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. |
875 | 875 | ||
876 | - Registers (or fields within registers) that control GPIO functionality | 876 | - Registers (or fields within registers) that control GPIO functionality |
877 | such as setting a GPIO's output value, reading a GPIO's input value, or | 877 | 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 | |||
895 | system sleep, we need to put this pin into "GPIO mode" and ground it. | 895 | system sleep, we need to put this pin into "GPIO mode" and ground it. |
896 | 896 | ||
897 | If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start | 897 | 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 |
899 | pin shall be used for UART TX and GPIO at the same time, that you will grab | 899 | pin shall be used for UART TX and GPIO at the same time, that you will grab |
900 | a pin control handle and set it to a certain state to enable UART TX to be | 900 | a pin control handle and set it to a certain state to enable UART TX to be |
901 | muxed in, then twist it over to GPIO mode and use gpio_direction_output() | 901 | muxed in, then twist it over to GPIO mode and use gpio_direction_output() |
@@ -964,12 +964,12 @@ GPIO mode. | |||
964 | This will give the desired effect without any bogus interaction with the | 964 | This will give the desired effect without any bogus interaction with the |
965 | GPIO subsystem. It is just an electrical configuration used by that device | 965 | GPIO subsystem. It is just an electrical configuration used by that device |
966 | when going to sleep, it might imply that the pin is set into something the | 966 | 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 |
968 | by that UART device to control the pins that pertain to that very UART | 968 | by that UART device to control the pins that pertain to that very UART |
969 | driver, putting them into modes needed by the UART. GPIO in the Linux | 969 | driver, putting them into modes needed by the UART. GPIO in the Linux |
970 | kernel sense are just some 1-bit line, and is a different use case. | 970 | kernel sense are just some 1-bit line, and is a different use case. |
971 | 971 | ||
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 |
973 | configuration and the muxing of the "u0" or "gpio-mode" group onto these | 973 | configuration and the muxing of the "u0" or "gpio-mode" group onto these |
974 | pins is a question for the driver. | 974 | pins is a question for the driver. |
975 | 975 | ||
@@ -977,7 +977,7 @@ Some datasheets will be more helpful and refer to the "GPIO mode" as | |||
977 | "low power mode" rather than anything to do with GPIO. This often means | 977 | "low power mode" rather than anything to do with GPIO. This often means |
978 | the same thing electrically speaking, but in this latter case the | 978 | the same thing electrically speaking, but in this latter case the |
979 | software engineers will usually quickly identify that this is some | 979 | 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 |
981 | API. | 981 | API. |
982 | 982 | ||
983 | 983 | ||
@@ -1024,8 +1024,7 @@ up the device struct (just like with clockdev or regulators). The function name | |||
1024 | must match a function provided by the pinmux driver handling this pin range. | 1024 | must match a function provided by the pinmux driver handling this pin range. |
1025 | 1025 | ||
1026 | As you can see we may have several pin controllers on the system and thus | 1026 | 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 | 1027 | we need to specify which one of them contains the functions we wish to map. |
1028 | to map. | ||
1029 | 1028 | ||
1030 | You register this pinmux mapping to the pinmux subsystem by simply: | 1029 | You register this pinmux mapping to the pinmux subsystem by simply: |
1031 | 1030 | ||
@@ -1254,10 +1253,10 @@ The semantics of the pinctrl APIs are: | |||
1254 | pinctrl_get(). | 1253 | pinctrl_get(). |
1255 | 1254 | ||
1256 | - pinctrl_lookup_state() is called in process context to obtain a handle to a | 1255 | - 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. |
1258 | 1257 | ||
1259 | - pinctrl_select_state() programs pin controller hardware according to the | 1258 | - 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 |
1261 | fast-path operation, since it only involved blasting some register settings | 1260 | fast-path operation, since it only involved blasting some register settings |
1262 | into hardware. However, note that some pin controllers may have their | 1261 | into hardware. However, note that some pin controllers may have their |
1263 | registers on a slow/IRQ-based bus, so client devices should not assume they | 1262 | registers on a slow/IRQ-based bus, so client devices should not assume they |