linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/8] ARM: S3C24XX: Documentation: add section on gpiolib changes
Date: Mon, 24 May 2010 04:30:06 +0100	[thread overview]
Message-ID: <1274671809-9821-6-git-send-email-ben-linux@fluff.org> (raw)
In-Reply-To: <1274671809-9821-1-git-send-email-ben-linux@fluff.org>

Add section to the S3C24XX GPIO documentation on the recent changes
to move towards gpiolib integration.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 Documentation/arm/Samsung-S3C24XX/GPIO.txt |   44 ++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
index 9fe5fea..228ecb6 100644
--- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt
+++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
@@ -36,6 +36,50 @@ GPIOLIB
   s3c2410_gpio_pullup()		s3c_gpio_setpull()
 
 
+GPIOLIB conversion
+------------------
+
+If you need to convert your board or driver to use gpiolib from the exiting
+s3c2410 api, then here are some notes on the process.
+
+1) If your board is exclusively using an GPIO, say to control peripheral
+   power, then it will require to claim the gpio with gpio_request() before
+   it can use it.
+
+   It is recommended to check the return value, with at least WARN_ON()
+   during initialisation.
+
+2) The s3c2410_gpio_cfgpin() can be directly replaced with s3c_gpio_cfgpin()
+   as they have the same arguments, and can either take the pin specific
+   values, or the more generic special-function-number arguments.
+
+3) s3c2410_gpio_pullup() changs have the problem that whilst the 
+   s3c2410_gpio_pullup(x, 1) can be easily translated to the
+   s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0)
+   are not so easy.
+
+   The s3c2410_gpio_pullup(x, 0) case enables the pull-up (or in the case
+   of some of the devices, a pull-down) and as such the new API distinguishes
+   between the UP and DOWN case. There is currently no 'just turn on' setting
+   which may be required if this becomes a problem.
+
+4) s3c2410_gpio_setpin() can be replaced by gpio_set_value(), the old call
+   does not implicitly configure the relevant gpio to output. The gpio
+   direction should be changed before using gpio_set_value().
+
+5) s3c2410_gpio_getpin() is replaceable by gpio_get_value() if the pin
+   has been set to input. It is currently unknown what the behaviour is
+   when using gpio_get_value() on an output pin (s3c2410_gpio_getpin
+   would return the value the pin is supposed to be outputting).
+
+6) s3c2410_gpio_getirq() should be directly replacable with the
+   gpio_to_irq() call.
+
+The s3c2410_gpio and gpio_ calls have always operated on the same gpio
+numberspace, so there is no problem with converting the gpio numbering
+between the calls.
+
+
 Headers
 -------
 
-- 
1.6.3.3

  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 ` Ben Dooks [this message]
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 ` [PATCH 8/8] ARM: SAMSUNG: gpio-cfg.h: update documentation Ben Dooks

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-6-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).