aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/pinctrl.txt
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2014-01-13 14:00:14 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-01-15 07:59:50 -0500
commit4dfb0bd76b0efea8b2081daee8262c13f965499b (patch)
tree7006b4eebb1ff5a793f4262779ccfa7e6f227473 /Documentation/pinctrl.txt
parent655dada62779917e2337b9abf8ab95e891cc0938 (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.txt43
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
23Definition of PIN: 23Definition of PIN:
24 24
@@ -90,7 +90,7 @@ selected drivers, you need to select them from your machine's Kconfig entry,
90since these are so tightly integrated with the machines they are used on. 90since these are so tightly integrated with the machines they are used on.
91See for example arch/arm/mach-u300/Kconfig for an example. 91See for example arch/arm/mach-u300/Kconfig for an example.
92 92
93Pins usually have fancier names than this. You can find these in the dataheet 93Pins usually have fancier names than this. You can find these in the datasheet
94for your chip. Notice that the core pinctrl.h file provides a fancy macro 94for your chip. Notice that the core pinctrl.h file provides a fancy macro
95called PINCTRL_PIN() to create the struct entries. As you can see I enumerated 95called PINCTRL_PIN() to create the struct entries. As you can see I enumerated
96the pins from 0 in the upper left corner to 63 in the lower right corner. 96the 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
187The pin control subsystem will call the .get_groups_count() function to 187The pin control subsystem will call the .get_groups_count() function to
188determine total number of legal selectors, then it will call the other functions 188determine the total number of legal selectors, then it will call the other functions
189to retrieve the name and pins of the group. Maintaining the data structure of 189to retrieve the name and pins of the group. Maintaining the data structure of
190the groups is up to the driver, this is just a simple example - in practice you 190the groups is up to the driver, this is just a simple example - in practice you
191may need more entries in your group structure, for example specific register 191may need more entries in your group structure, for example specific register
@@ -195,7 +195,7 @@ ranges associated with each group and so on.
195Pin configuration 195Pin configuration
196================= 196=================
197 197
198Pins can sometimes be software-configured in an various ways, mostly related 198Pins can sometimes be software-configured in various ways, mostly related
199to their electronic properties when used as inputs or outputs. For example you 199to their electronic properties when used as inputs or outputs. For example you
200may be able to make an output pin high impedance, or "tristate" meaning it is 200may be able to make an output pin high impedance, or "tristate" meaning it is
201effectively disconnected. You may be able to connect an input pin to VDD or GND 201effectively 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
291controller we need a mapping so that the pin control subsystem can figure out 291controller we need a mapping so that the pin control subsystem can figure out
292which pin controller handles control of a certain GPIO pin. Since a single 292which pin controller handles control of a certain GPIO pin. Since a single
293pin controller may be muxing several GPIO ranges (typically SoCs that have 293pin controller may be muxing several GPIO ranges (typically SoCs that have
294one set of pins but internally several GPIO silicon blocks, each modelled as 294one set of pins, but internally several GPIO silicon blocks, each modelled as
295a struct gpio_chip) any number of GPIO ranges can be added to a pin controller 295a struct gpio_chip) any number of GPIO ranges can be added to a pin controller
296instance like this: 296instance like this:
297 297
@@ -373,9 +373,9 @@ will be called on that specific pin controller.
373 373
374For all functionalities dealing with pin biasing, pin muxing etc, the pin 374For all functionalities dealing with pin biasing, pin muxing etc, the pin
375controller subsystem will look up the corresponding pin number from the passed 375controller subsystem will look up the corresponding pin number from the passed
376in gpio number, and use the range's internals to retrive a pin number. After 376in gpio number, and use the range's internals to retrieve a pin number. After
377that, the subsystem passes it on to the pin control driver, so the driver 377that, the subsystem passes it on to the pin control driver, so the driver
378will get an pin number into its handled number range. Further it is also passed 378will get a pin number into its handled number range. Further it is also passed
379the range ID value, so that the pin controller knows which range it should 379the range ID value, so that the pin controller knows which range it should
380deal with. 380deal 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
430to the chip, and quite a few will be taken by large ports like an external 430to the chip, and quite a few will be taken by large ports like an external
431memory interface. The remaining pins will often be subject to pin multiplexing. 431memory interface. The remaining pins will often be subject to pin multiplexing.
432 432
433The example 8x8 PGA package above will have pin numbers 0 thru 63 assigned to 433The example 8x8 PGA package above will have pin numbers 0 through 63 assigned
434its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using 434to its physical pins. It will name the pins { A1, A2, A3 ... H6, H7, H8 } using
435pinctrl_register_pins() and a suitable data set as shown earlier. 435pinctrl_register_pins() and a suitable data set as shown earlier.
436 436
437In this 8x8 BGA package the pins { A8, A7, A6, A5 } can be used as an SPI port 437In 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
442of the package the silicon performing the SPI logic can alternatively be routed 442of the package the silicon performing the SPI logic can alternatively be routed
443out on pins { G4, G3, G2, G1 }. 443out on pins { G4, G3, G2, G1 }.
444 444
445On the botton row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something 445On the bottom row at { A1, B1, C1, D1, E1, F1, G1, H1 } we have something
446special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will 446special - it's an external MMC bus that can be 2, 4 or 8 bits wide, and it will
447consume 2, 4 or 8 pins respectively, so either { A1, B1 } are taken or 447consume 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
550We assume that the number of possible function maps to pin groups is limited by 550We assume that the number of possible function maps to pin groups is limited by
551the hardware. I.e. we assume that there is no system where any function can be 551the hardware. I.e. we assume that there is no system where any function can be
552mapped to any pin, like in a phone exchange. So the available pins groups for 552mapped to any pin, like in a phone exchange. So the available pin groups for
553a certain function will be limited to a few choices (say up to eight or so), 553a certain function will be limited to a few choices (say up to eight or so),
554not hundreds or any amount of choices. This is the characteristic we have found 554not hundreds or any amount of choices. This is the characteristic we have found
555by inspecting available pinmux hardware, and a necessary assumption since we 555by 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
564the pin controller driver to execute different settings. 564the pin controller driver to execute different settings.
565 565
566It is the responsibility of the pinmux driver to impose further restrictions 566It 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
568whether or not the requested function can actually be allowed, and in case it 568whether or not the requested function can actually be allowed, and in case it
569is possible to perform the requested mux setting, poke the hardware so that 569is possible to perform the requested mux setting, poke the hardware so that
570this happens. 570this happens.
@@ -755,7 +755,7 @@ Pin control interaction with the GPIO subsystem
755Note that the following implies that the use case is to use a certain pin 755Note that the following implies that the use case is to use a certain pin
756from the Linux kernel using the API in <linux/gpio.h> with gpio_request() 756from the Linux kernel using the API in <linux/gpio.h> with gpio_request()
757and similar functions. There are cases where you may be using something 757and similar functions. There are cases where you may be using something
758that your datasheet calls "GPIO mode" but actually is just an electrical 758that your datasheet calls "GPIO mode", but actually is just an electrical
759configuration for a certain device. See the section below named 759configuration 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
895system sleep, we need to put this pin into "GPIO mode" and ground it. 895system sleep, we need to put this pin into "GPIO mode" and ground it.
896 896
897If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start 897If you make a 1-to-1 map to the GPIO subsystem for this pin, you may start
898to think that you need to come up with something real complex, that the 898to think that you need to come up with something really complex, that the
899pin shall be used for UART TX and GPIO at the same time, that you will grab 899pin shall be used for UART TX and GPIO at the same time, that you will grab
900a pin control handle and set it to a certain state to enable UART TX to be 900a pin control handle and set it to a certain state to enable UART TX to be
901muxed in, then twist it over to GPIO mode and use gpio_direction_output() 901muxed in, then twist it over to GPIO mode and use gpio_direction_output()
@@ -964,12 +964,12 @@ GPIO mode.
964This will give the desired effect without any bogus interaction with the 964This will give the desired effect without any bogus interaction with the
965GPIO subsystem. It is just an electrical configuration used by that device 965GPIO subsystem. It is just an electrical configuration used by that device
966when going to sleep, it might imply that the pin is set into something the 966when going to sleep, it might imply that the pin is set into something the
967datasheet calls "GPIO mode" but that is not the point: it is still used 967datasheet calls "GPIO mode", but that is not the point: it is still used
968by that UART device to control the pins that pertain to that very UART 968by that UART device to control the pins that pertain to that very UART
969driver, putting them into modes needed by the UART. GPIO in the Linux 969driver, putting them into modes needed by the UART. GPIO in the Linux
970kernel sense are just some 1-bit line, and is a different use case. 970kernel sense are just some 1-bit line, and is a different use case.
971 971
972How the registers are poked to attain the push/pull and output low 972How the registers are poked to attain the push or pull, and output low
973configuration and the muxing of the "u0" or "gpio-mode" group onto these 973configuration and the muxing of the "u0" or "gpio-mode" group onto these
974pins is a question for the driver. 974pins 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
978the same thing electrically speaking, but in this latter case the 978the same thing electrically speaking, but in this latter case the
979software engineers will usually quickly identify that this is some 979software engineers will usually quickly identify that this is some
980specific muxing/configuration rather than anything related to the GPIO 980specific muxing or configuration rather than anything related to the GPIO
981API. 981API.
982 982
983 983
@@ -1024,8 +1024,7 @@ up the device struct (just like with clockdev or regulators). The function name
1024must match a function provided by the pinmux driver handling this pin range. 1024must match a function provided by the pinmux driver handling this pin range.
1025 1025
1026As you can see we may have several pin controllers on the system and thus 1026As you can see we may have several pin controllers on the system and thus
1027we need to specify which one of them that contain the functions we wish 1027we need to specify which one of them contains the functions we wish to map.
1028to map.
1029 1028
1030You register this pinmux mapping to the pinmux subsystem by simply: 1029You 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