Documentation: gpio: consumer: describe active low property
Subsystems (2)
PATCH v2 1/1 Documentation: gpio: consumer: describe active low property
I've been searching for any documentation of 'the active-low property of a GPIO' already mentioned in this documenation. But couldn't find any. Add it.
---
Changes in v2: Incorporate the review comments from Alexandre.
Documentation/gpio/consumer.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
Documentation/gpio/consumer.txt +33 -0
@@ -237,6 +237,39 @@ Note that these functions should only be used with great moderation ; a driver should not have to care about the physical line level. +The active-low property +----------------------- + +As a driver should not have to care about the physical line level, all of the +gpiod_set_value_xxx() or gpiod_set_array_value_xxx() functions operate with +the *logical* value. With this they take the active-low property into account. +This does mean that they check whether the GPIO is configured to be active-low. +And if so, they manipulate the passed value before the physical line level is +driven. + +With this, all the gpiod_set_(array)_value_xxx() functions interpret the parameter +"value" as "active" ("1") or "inactive" ("0"). The physical line level will be +driven accordingly. + +As an example, if the active-low poperty for a dedicated GPIO is set, and the +gpiod_set_(array)_value_xxx() passes "active" ("1"), the physical line level will be +driven low. + +To summarize: + +Function (example) active-low proporty physical line +gpiod_set_raw_value(desc, 0); don't care low +gpiod_set_raw_value(desc, 1); don't care high +gpiod_set_value(desc, 0); default (active-high) low +gpiod_set_value(desc, 1); default (active-high) high +gpiod_set_value(desc, 0); active-low high +gpiod_set_value(desc, 1); active-low low + +Please note again that the set_raw/get_raw functions should be avoided as much +as possible, especially by drivers which should not care about the actual physical +line level and worry about the logical value instead. + + Set multiple GPIO outputs with a single function call ----------------------------------------------------- The following functions set the output values of an array of GPIOs:
Signature · 1 line
2.4.6
Quoted 45 lines · Dirk Behme
I've been searching for any documentation of 'the active-low property of a GPIO' already mentioned in this documenation. But couldn't find any. Add it.
Sigend-off-by Dirk Behme <[email protected]>---
Changes in v2: Incorporate the review comments from Alexandre.Documentation/gpio/consumer.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)Documentation/gpio/consumer.txt +26
-0@@ -237,6 +237,39 @@ Note that these functions should only be used with great moderation ; a driver should not have to care about the physical line level. +The active-low property +----------------------- + +As a driver should not have to care about the physical line level, all of the +gpiod_set_value_xxx() or gpiod_set_array_value_xxx() functions operate with +the *logical* value. With this they take the active-low property into account. +This does mean that they check whether the GPIO is configured to be active-low. +And if so, they manipulate the passed value before the physical line level is +driven. + +With this, all the gpiod_set_(array)_value_xxx() functions interpret the parameter +"value" as "active" ("1") or "inactive" ("0"). The physical line level will be +driven accordingly. + +As an example, if the active-low poperty for a dedicated GPIO is set, and the +gpiod_set_(array)_value_xxx() passes "active" ("1"), the physical line level will be +driven low. + +To summarize: + +Function (example) active-low proporty physical line +gpiod_set_raw_value(desc, 0); don't care low +gpiod_set_raw_value(desc, 1); don't care high +gpiod_set_value(desc, 0); default (active-high) low +gpiod_set_value(desc, 1); default (active-high) high +gpiod_set_value(desc, 0); active-low high
Documentation/gpio/consumer.txt Note that these functions should only be used with great moderation ; a driver · line 275
Quoted 10 lines
Documentation/gpio/consumer.txt +7
-0+gpiod_set_value(desc, 1); active-low low + +Please note again that the set_raw/get_raw functions should be avoided as much +as possible, especially by drivers which should not care about the actual physical +line level and worry about the logical value instead. + + Set multiple GPIO outputs with a single function call ----------------------------------------------------- The following functions set the output values of an array of GPIOs:
Any further comments on this? Could this be applied?
Dirk
Quoted 65 lines · Dirk Behme
Quoted 64 lines · Dirk Behme
I've been searching for any documentation of 'the active-low property of a GPIO'
already mentioned in this documenation. But couldn't find any. Add it.Sigend-off-by Dirk Behme <[email protected]>---
Changes in v2: Incorporate the review comments from Alexandre.Documentation/gpio/consumer.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)Documentation/gpio/consumer.txt +0
-0@@ -237,6 +237,39 @@ Note that these functions should only be usedwith great moderation ; a driver
should not have to care about the physical line level.Documentation/gpio/consumer.txt +4
-0+The active-low property +----------------------- + +As a driver should not have to care about the physical line level,all of the
+gpiod_set_value_xxx() orgpiod_set_array_value_xxx()functions operate with
+the *logical* value. With this they take the active-low property into account.
+This does mean that they check whether the GPIO is configured to be active-low.
+And if so, they manipulate the passed value before the physical line level isDocumentation/gpio/consumer.txt +3
-0+driven. + +With this, all the gpiod_set_(array)_value_xxx() functions interpretthe parameter
+"value" as "active" ("1") or "inactive" ("0"). The physical line level will beDocumentation/gpio/consumer.txt +3
-0+driven accordingly. + +As an example, if the active-low poperty for a dedicated GPIO is set,and the
+gpiod_set_(array)_value_xxx() passes "active" ("1"), the physical line level will beDocumentation/gpio/consumer.txt +13
-0+driven low. + +To summarize: + +Function (example) active-low proporty physical line +gpiod_set_raw_value(desc, 0); don't care low +gpiod_set_raw_value(desc, 1); don't care high +gpiod_set_value(desc, 0); default (active-high) low +gpiod_set_value(desc, 1); default (active-high) high +gpiod_set_value(desc, 0); active-low high +gpiod_set_value(desc, 1); active-low low + +Please note again that the set_raw/get_raw functions should beavoided as much
+as possible, especially by drivers which should not care about the actual physical
+line level and worry about the logical value instead.
Quoted 8 lines
Documentation/gpio/consumer.txt Note that these functions should only be used with great moderation ; a driver · line 275
Quoted 5 lines
Documentation/gpio/consumer.txt +2
-0+ + Set multiple GPIO outputs with a single function call ----------------------------------------------------- The following functions set the output values of an array of GPIOs:Any further comments on this? Could this be applied?
I am ok with it - Linus?
Quoted 37 lines · Alexandre Courbot
Quoted 36 lines · Dirk Behme
Quoted 35 lines · Dirk Behme
I've been searching for any documentation of 'the active-low property of a GPIO'
already mentioned in this documenation. But couldn't find any. Add it.Sigend-off-by Dirk Behme <[email protected]>---
Changes in v2: Incorporate the review comments from Alexandre.Documentation/gpio/consumer.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)Documentation/gpio/consumer.txt +0
-0@@ -237,6 +237,39 @@ Note that these functions should only be usedwith great moderation ; a driver
should not have to care about the physical line level.Documentation/gpio/consumer.txt +4
-0+The active-low property +----------------------- + +As a driver should not have to care about the physical line level,all of the
+gpiod_set_value_xxx() orgpiod_set_array_value_xxx()functions operate with
+the *logical* value. With this they take the active-low property into account.
+This does mean that they check whether the GPIO is configured to be active-low.
+And if so, they manipulate the passed value before the physical line level is
Quoted 8 lines
Quoted 8 lines
Documentation/gpio/consumer.txt
Quoted 8 lines
Documentation/gpio/consumer.txt +3
-0+driven. + +With this, all the gpiod_set_(array)_value_xxx() functions interpretthe parameter
+"value" as "active" ("1") or "inactive" ("0"). The physical line level will beDocumentation/gpio/consumer.txt +2
-0+driven accordingly. +
Property is misspelled here. poperty
Quoted 8 lines
Quoted 8 lines
Documentation/gpio/consumer.txt Note that these functions should only be used with great moderation ; a driver · line 259
Quoted 8 lines
+As an example, if the active-low poperty for a dedicated GPIO is set, and the
+gpiod_set_(array)_value_xxx() passes "active" ("1"), the physical line level will beDocumentation/gpio/consumer.txt +4
-0+driven low. + +To summarize: +
Property is also spelled wrong here too. proporty
Quoted 27 lines
Quoted 13 lines
Quoted 13 lines
Documentation/gpio/consumer.txt +9
-0+Function (example) active-low proporty physical line +gpiod_set_raw_value(desc, 0); don't care low +gpiod_set_raw_value(desc, 1); don't care high +gpiod_set_value(desc, 0); default (active-high) low +gpiod_set_value(desc, 1); default (active-high) high +gpiod_set_value(desc, 0); active-low high +gpiod_set_value(desc, 1); active-low low + +Please note again that the set_raw/get_raw functions should beavoided as much
+as possible, especially by drivers which should not care about the actual physical
+line level and worry about the logical value instead.Quoted 8 lines
Documentation/gpio/consumer.txt Note that these functions should only be used with great moderation ; a driver · line 275
Quoted 5 lines
Documentation/gpio/consumer.txt +2
-0+ + Set multiple GPIO outputs with a single function call ----------------------------------------------------- The following functions set the output values of an array of GPIOs:Any further comments on this? Could this be applied?
I am ok with it - Linus?
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Dirk Behme
I've been searching for any documentation of 'the active-low property of a GPIO' already mentioned in this documenation. But couldn't find any. Add it.
Sigend-off-by Dirk Behme <[email protected]>---
Changes in v2: Incorporate the review comments from Alexandre.
I fixed some spelling and grammar and applied this patch.
Yours,
Linus Walleij