From: Bill Gatliff <bgat@billgatliff.com>
To: linuxppc-dev@ozlabs.org
Cc: Bill Gatliff <bgat@billgatliff.com>
Subject: [PATCH 1/2] Create a struct of_i2c_gpio_chip, for i2c-based GPIO devices
Date: Tue, 5 Jan 2010 21:51:37 -0600 [thread overview]
Message-ID: <1262749898-19197-2-git-send-email-bgat@billgatliff.com> (raw)
In-Reply-To: <1262749898-19197-1-git-send-email-bgat@billgatliff.com>
Signed-off-by: Bill Gatliff <bgat@billgatliff.com>
---
include/linux/of_gpio.h | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index fc2472c..0c39242 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -102,4 +102,27 @@ static inline int of_get_gpio(struct device_node *np, int index)
return of_get_gpio_flags(np, index, NULL);
}
+
+
+
+/*
+ * OF GPIO chip for I2C-based devices
+ */
+struct of_i2c_gpio_chip {
+ struct of_gpio_chip of_gc;
+};
+
+static inline struct of_i2c_gpio_chip *to_of_i2c_gpio_chip(struct gpio_chip *gc)
+{
+ struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
+
+ return container_of(of_gc, struct of_i2c_gpio_chip, of_gc);
+}
+
+extern int of_i2c_gpiochip_add(struct device_node *np,
+ struct of_i2c_gpio_chip *gc);
+
+
+
+
#endif /* __LINUX_OF_GPIO_H */
--
1.6.5
next prev parent reply other threads:[~2010-01-06 3:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-06 3:51 [PATCH 0/2] Create an of_i2c_gpiochip_add() Bill Gatliff
2010-01-06 3:51 ` Bill Gatliff [this message]
2010-01-06 3:51 ` [PATCH 2/2] " Bill Gatliff
2010-01-06 20:07 ` [PATCH 0/2] " Bill Gatliff
2010-01-06 20:17 ` Wolfram Sang
2010-01-06 20:31 ` Bill Gatliff
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=1262749898-19197-2-git-send-email-bgat@billgatliff.com \
--to=bgat@billgatliff.com \
--cc=linuxppc-dev@ozlabs.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