From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/8] ARM: SAMSUNG: gpio-cfg.h: update documentation
Date: Mon, 24 May 2010 04:30:09 +0100 [thread overview]
Message-ID: <1274671809-9821-9-git-send-email-ben-linux@fluff.org> (raw)
In-Reply-To: <1274671809-9821-1-git-send-email-ben-linux@fluff.org>
Update the documentation on the gpio configuration calls to add more
references to useful information and also to document the values that
are passed.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
arch/arm/plat-samsung/include/plat/gpio-cfg.h | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index 4683823..db4112c 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -43,6 +43,11 @@ struct s3c_gpio_chip;
* layouts. Provide an point to vector control routine and provide any
* per-bank configuration information that other systems such as the
* external interrupt code will need.
+ *
+ * @sa s3c_gpio_cfgpin
+ * @sa s3c_gpio_getcfg
+ * @sa s3c_gpio_setpull
+ * @sa s3c_gpio_getpull
*/
struct s3c_gpio_cfg {
unsigned int cfg_eint;
@@ -75,6 +80,20 @@ struct s3c_gpio_cfg {
* Configure which function is actually connected to the external
* pin, such as an gpio input, output or some form of special function
* connected to an internal peripheral block.
+ *
+ * The @to parameter can be one of the generic S3C_GPIO_INPUT, S3C_GPIO_OUTPUT
+ * or S3C_GPIO_SFN() to indicate one of the possible values that the helper
+ * will then generate the correct bit mask and shift for the configuration.
+ *
+ * If a bank of GPIOs all needs to be set to special-function 2, then
+ * the following code will work:
+ *
+ * for (gpio = start; gpio < end; gpio++)
+ * s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ *
+ * The @to parameter can also be a specific value already shifted to the
+ * correct position in the control register, although these are discouraged
+ * in newer kernels and are only being kept for compatibility.
*/
extern int s3c_gpio_cfgpin(unsigned int pin, unsigned int to);
@@ -108,6 +127,8 @@ extern unsigned s3c_gpio_getcfg(unsigned int pin);
* This function sets the state of the pull-{up,down} resistor for the
* specified pin. It will return 0 if successfull, or a negative error
* code if the pin cannot support the requested pull setting.
+ *
+ * @pull is one of S3C_GPIO_PULL_NONE, S3C_GPIO_PULL_DOWN or S3C_GPIO_PULL_UP.
*/
extern int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull);
--
1.6.3.3
prev parent reply other threads:[~2010-05-24 3:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-24 3:30 Samsung documentation updates Ben Dooks
2010-05-24 3:30 ` [PATCH 1/8] ARM: SAMSUNG: Documentation: update the list of SoCs supported Ben Dooks
2010-05-24 3:30 ` [PATCH 2/8] ARM: SAMSUNG: Documentation: update directory layout Ben Dooks
2010-05-24 3:30 ` [PATCH 3/8] ARM: S3C24XX: Documentation: update documentation overview Ben Dooks
2010-05-24 3:30 ` [PATCH 4/8] ARM: S3C24XX: Documentation: update GPIO documentation Ben Dooks
2010-05-24 3:30 ` [PATCH 5/8] ARM: S3C24XX: Documentation: add section on gpiolib changes Ben Dooks
2010-05-24 3:30 ` [PATCH 6/8] ARM: SAMSUNG: Fix documentation for s3c_gpio_cfgpin() Ben Dooks
2010-05-24 3:30 ` [PATCH 7/8] ARM: SAMSUNG: Documentation: add documentation on GPIO code Ben Dooks
2010-05-24 3:30 ` Ben Dooks [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274671809-9821-9-git-send-email-ben-linux@fluff.org \
--to=ben-linux@fluff.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).