mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: barebox@lists.infradead.org
Cc: Robert Jarzmik <robert.jarzmik@atosorigin.com>
Subject: [PATCH 8/9] arm/mach-pxa: add basic devices hooks
Date: Thu, 24 Nov 2011 04:02:43 +0100	[thread overview]
Message-ID: <1322103764-6265-9-git-send-email-robert.jarzmik@free.fr> (raw)
In-Reply-To: <1322103764-6265-1-git-send-email-robert.jarzmik@free.fr>

From: Robert Jarzmik <robert.jarzmik@atosorigin.com>

Add basic functions to declare the basic PXA devices :
 - I2C device
 - frame buffer device
 - MMC device
 - UART device

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 arch/arm/mach-pxa/devices.c              |   32 ++++++++++++++++++++++++++++++
 arch/arm/mach-pxa/include/mach/devices.h |    9 ++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-pxa/devices.c
 create mode 100644 arch/arm/mach-pxa/include/mach/devices.h

diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
new file mode 100644
index 0000000..f5aabae
--- /dev/null
+++ b/arch/arm/mach-pxa/devices.c
@@ -0,0 +1,32 @@
+#include <common.h>
+#include <driver.h>
+#include <mach/devices.h>
+#include <mach/pxafb.h>
+
+static inline struct device_d *pxa_add_device(char *name, int id, void *base,
+					      int size, void *pdata)
+{
+	return add_generic_device(name, id, NULL, (resource_size_t)base, size,
+				  IORESOURCE_MEM, pdata);
+}
+
+struct device_d *pxa_add_i2c(void *base, int id,
+			     struct i2c_platform_data *pdata)
+{
+	return pxa_add_device("i2c-pxa", id, base, 0x1000, pdata);
+}
+
+struct device_d *pxa_add_uart(void *base, int id)
+{
+	return pxa_add_device("pxa_serial", id, base, 0x1000, NULL);
+}
+
+struct device_d *pxa_add_fb(void *base, struct pxafb_platform_data *pdata)
+{
+	return pxa_add_device("pxafb", -1, base, 0x1000, pdata);
+}
+
+struct device_d *pxa_add_mmc(void *base, int id, void *pdata)
+{
+	return pxa_add_device("pxa-mmc", id, base, 0x1000, pdata);
+}
diff --git a/arch/arm/mach-pxa/include/mach/devices.h b/arch/arm/mach-pxa/include/mach/devices.h
new file mode 100644
index 0000000..b549f69
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/devices.h
@@ -0,0 +1,9 @@
+#include <i2c/i2c.h>
+#include <mach/pxafb.h>
+
+struct device_d *pxa_add_i2c(void *base, int id,
+			     struct i2c_platform_data *pdata);
+struct device_d *pxa_add_uart(void *base, int id);
+struct device_d *pxa_add_fb(void *base, struct pxafb_platform_data *pdata);
+struct device_d *pxa_add_mmc(void *base, int id, void *pdata);
+
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-11-24  3:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24  3:02 [PATCH 0/9] Initial PXA support and Mitac MIOA701 board Robert Jarzmik
2011-11-24  3:02 ` [PATCH 1/9] initial Intel/Marvell PXA support Robert Jarzmik
2011-11-24  9:29   ` Sascha Hauer
2011-11-25 21:26     ` Robert Jarzmik
2011-11-24  3:02 ` [PATCH 2/9] fix association of cache handling code for PXA Robert Jarzmik
2011-11-24  3:02 ` [PATCH 3/9] fix core version selection Robert Jarzmik
2011-11-24  3:02 ` [PATCH 4/9] add PXA framebuffer support Robert Jarzmik
2011-11-24  3:02 ` [PATCH 5/9] drivers: pxafb: Fix IOMEM API evolution Robert Jarzmik
2011-11-24  3:02 ` [PATCH 6/9] drivers: pxafb: add include ifdefery Robert Jarzmik
2011-11-24  3:02 ` [PATCH 7/9] arm/mach-pxa: add gpio direction functions Robert Jarzmik
2011-11-24  3:02 ` Robert Jarzmik [this message]
2011-11-24  3:02 ` [PATCH 9/9] arm/mach-pxa: add mioa701 board Robert Jarzmik
2011-11-24  9:13   ` Marc Kleine-Budde
2011-11-24 21:15     ` Robert Jarzmik
2011-11-24  9:45   ` Sascha Hauer
2011-11-24 21:22     ` Robert Jarzmik
2011-11-24 23:08       ` Sascha Hauer
2011-11-25 21:50         ` Robert Jarzmik
2011-11-24  9:10 ` [PATCH 0/9] Initial PXA support and Mitac MIOA701 board Marc Kleine-Budde
2011-11-24  9:28   ` Sascha Hauer
2011-11-24 21:32   ` Robert Jarzmik

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=1322103764-6265-9-git-send-email-robert.jarzmik@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=barebox@lists.infradead.org \
    --cc=robert.jarzmik@atosorigin.com \
    /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