All of lore.kernel.org
 help / color / mirror / Atom feed
From: Przemyslaw Marczak <p.marczak@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] dm: gpio: extend gpio api by dm_gpio_set_pull()
Date: Tue, 17 Feb 2015 14:09:01 +0100	[thread overview]
Message-ID: <1424178544-28632-2-git-send-email-p.marczak@samsung.com> (raw)
In-Reply-To: <1424178544-28632-1-git-send-email-p.marczak@samsung.com>

This commits extends:
- dm gpio ops by: 'set_pull' call
- dm gpio uclass by: dm_gpio_set_pull() function

The pull mode is not defined so should be driver specific.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
CC: Simon Glass <sjg@chromium.org>
---
 drivers/gpio/gpio-uclass.c | 12 ++++++++++++
 include/asm-generic/gpio.h | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index a69bbd2..48b31c2 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -321,6 +321,18 @@ int dm_gpio_set_value(struct gpio_desc *desc, int value)
 	return 0;
 }
 
+int dm_gpio_set_pull(struct gpio_desc *desc, int pull)
+{
+	int ret;
+
+	ret = check_reserved(desc, "set_pull");
+	if (ret)
+		return ret;
+
+	gpio_get_ops(desc->dev)->set_pull(desc->dev, desc->offset, pull);
+	return 0;
+}
+
 int dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags)
 {
 	struct udevice *dev = desc->dev;
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 3b96b82..7e0d426 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -241,6 +241,7 @@ struct dm_gpio_ops {
 				int value);
 	int (*get_value)(struct udevice *dev, unsigned offset);
 	int (*set_value)(struct udevice *dev, unsigned offset, int value);
+	int (*set_pull)(struct udevice *dev, unsigned offset, int pull);
 	/**
 	 * get_function() Get the GPIO function
 	 *
@@ -479,6 +480,7 @@ int gpio_free_list_nodev(struct gpio_desc *desc, int count);
 
 /**
  * dm_gpio_get_value() - Get the value of a GPIO
+
  *
  * This is the driver model version of the existing gpio_get_value() function
  * and should be used instead of that.
@@ -495,6 +497,16 @@ int dm_gpio_get_value(struct gpio_desc *desc);
 int dm_gpio_set_value(struct gpio_desc *desc, int value);
 
 /**
+ * dm_gpio_set_pull() - Set the pull-up/down value of a GPIO
+ *
+ * @desc:	GPIO description containing device, offset and flags,
+ *		previously returned by gpio_request_by_name()
+ * @pull:	GPIO pull value - driver specific
+ * @return 0 on success or -ve on error
+*/
+int dm_gpio_set_pull(struct gpio_desc *desc, int pull);
+
+/**
  * dm_gpio_set_dir() - Set the direction for a GPIO
  *
  * This sets up the direction according tot the provided flags. It will do
-- 
1.9.1

  reply	other threads:[~2015-02-17 13:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-17 13:09 [U-Boot] [PATCH 0/4] exynos-dwmmc: check set init priority for boot channel Przemyslaw Marczak
2015-02-17 13:09 ` Przemyslaw Marczak [this message]
2015-02-18  5:01   ` [U-Boot] [PATCH 1/4] dm: gpio: extend gpio api by dm_gpio_set_pull() Simon Glass
2015-02-18 10:49     ` Przemyslaw Marczak
2015-02-18 16:39     ` Stephen Warren
2015-02-19 12:11       ` Przemyslaw Marczak
2015-02-19 17:09         ` Stephen Warren
2015-02-20  9:34           ` Przemyslaw Marczak
2015-02-20 17:50             ` Stephen Warren
2015-02-20 19:29               ` Simon Glass
2015-02-23 10:51                 ` Przemyslaw Marczak
2015-02-23 15:30                   ` Simon Glass
2015-02-23 16:56                     ` Przemyslaw Marczak
2015-02-23 17:50                       ` Simon Glass
2015-02-24  9:44                         ` Przemyslaw Marczak
2015-02-23 10:21               ` Przemyslaw Marczak
2015-02-17 13:09 ` [U-Boot] [PATCH 2/4] s5p: gpio: add implementation of dm_gpio_set_pull() Przemyslaw Marczak
2015-02-17 13:09 ` [U-Boot] [PATCH 3/4] mmc: exynos dwmmc: check boot mode before init dwmmc Przemyslaw Marczak
2015-02-18  5:02   ` Simon Glass
2015-02-18 10:50     ` Przemyslaw Marczak
2015-02-19 14:03       ` Tom Rini
2015-02-19 14:36         ` Przemyslaw Marczak
2015-02-19 16:45           ` Tom Rini
2015-02-20  9:36             ` Przemyslaw Marczak
2015-02-19 14:01     ` Tom Rini
2015-02-17 13:09 ` [U-Boot] [PATCH 4/4] mmc: print SD/eMMC type for inited mmc devices Przemyslaw Marczak
2015-02-18 10:51 ` [U-Boot] [PATCH V2 0/4] exynos-dwmmc: check set init priority for boot channel Przemyslaw Marczak
2015-02-18 10:51   ` [U-Boot] [PATCH V2 1/4] dm: gpio: extend gpio api by dm_gpio_set_pull() Przemyslaw Marczak
2015-02-18 10:51   ` [U-Boot] [PATCH V2 2/4] s5p: gpio: add implementation of dm_gpio_set_pull() Przemyslaw Marczak
2015-02-18 10:51   ` [U-Boot] [PATCH V2 3/4] mmc: exynos dwmmc: check boot mode before init dwmmc Przemyslaw Marczak
2015-02-18 10:51   ` [U-Boot] [PATCH V2 4/4] mmc: print SD/eMMC type for inited mmc devices Przemyslaw Marczak
2015-02-20 11:29 ` [U-Boot] [PATCH V3 0/2] exynos-dwmmc: set init priority for boot channel Przemyslaw Marczak
2015-02-20 11:29   ` [U-Boot] [PATCH V3 1/2] mmc: exynos dwmmc: check boot mode before init dwmmc Przemyslaw Marczak
2015-02-23 17:49     ` Pantelis Antoniou
2015-02-20 11:29   ` [U-Boot] [PATCH V3 2/2] mmc: print SD/eMMC type for inited mmc devices Przemyslaw Marczak
2015-02-23 17:50     ` Pantelis Antoniou

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=1424178544-28632-2-git-send-email-p.marczak@samsung.com \
    --to=p.marczak@samsung.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.