linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] viafb: Add OLPC XO-1.5 port configs
@ 2010-09-21 15:37 Daniel Drake
  2010-09-21 17:15 ` Florian Tobias Schandinat
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Daniel Drake @ 2010-09-21 15:37 UTC (permalink / raw)
  To: linux-fbdev

The OLPC XO-1.5 does not use the standard port wiring suggested
in the viafb driver.

This is required for the upcoming OLPC DCON and via-camera drivers,
to be submitted soon.

Signed-off-by: Daniel Drake <dsd@laptop.org>
---
 drivers/video/via/via-core.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/video/via/via-core.c b/drivers/video/via/via-core.c
index 08390fe..a0efb8f 100644
--- a/drivers/video/via/via-core.c
+++ b/drivers/video/via/via-core.c
@@ -16,6 +16,10 @@
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 
+#ifdef CONFIG_OLPC
+#include <asm/olpc.h>
+#endif
+
 /*
  * The default port config.
  */
@@ -28,6 +32,21 @@ static const struct via_port_cfg adap_configs[] = {
 	{ 0, 0, 0, 0 }
 };
 
+#ifdef CONFIG_OLPC
+/*
+ * The OLPC XO-1.5 puts the camera power and reset lines onto
+ * GPIO 2C.  The configuration for 26 is also modified.
+ */
+static const struct via_port_cfg olpc_adap_configs[] = {
+	[VIA_PORT_26]	= { VIA_PORT_I2C,  VIA_MODE_I2C, VIASR, 0x26 },
+	[VIA_PORT_31]	= { VIA_PORT_I2C,  VIA_MODE_I2C, VIASR, 0x31 },
+	[VIA_PORT_25]	= { VIA_PORT_GPIO, VIA_MODE_GPIO, VIASR, 0x25 },
+	[VIA_PORT_2C]	= { VIA_PORT_GPIO, VIA_MODE_GPIO, VIASR, 0x2c },
+	[VIA_PORT_3D]	= { VIA_PORT_GPIO, VIA_MODE_GPIO, VIASR, 0x3d },
+	{ 0, 0, 0, 0 }
+};
+#endif
+
 /*
  * We currently only support one viafb device (will there ever be
  * more than one?), so just declare it globally here.
@@ -575,6 +594,12 @@ static int __devinit via_pci_probe(struct pci_dev *pdev,
 	global_dev.pdev = pdev;
 	global_dev.chip_type = ent->driver_data;
 	global_dev.port_cfg = adap_configs;
+
+#ifdef CONFIG_OLPC
+	if (machine_is_olpc())
+		global_dev.port_cfg = olpc_adap_configs;
+#endif
+
 	spin_lock_init(&global_dev.reg_lock);
 	ret = via_pci_setup_mmio(&global_dev);
 	if (ret)
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-11-11 17:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-21 15:37 [PATCH 2/2] viafb: Add OLPC XO-1.5 port configs Daniel Drake
2010-09-21 17:15 ` Florian Tobias Schandinat
2010-09-21 17:15 ` Daniel Drake
2010-09-21 17:54 ` Florian Tobias Schandinat
2010-09-26 14:57 ` Daniel Drake
2010-09-26 15:50 ` Florian Tobias Schandinat
2010-09-26 15:57 ` Daniel Drake
2010-09-26 21:52 ` Jonathan Corbet
2010-09-27  4:55 ` Florian Tobias Schandinat
2010-10-06 21:15 ` Jonathan Corbet
2010-10-27 15:08 ` Daniel Drake
2010-10-28 18:51 ` Jonathan Corbet
2010-10-28 21:54 ` Daniel Drake
2010-10-28 22:04 ` Jonathan Corbet
2010-10-29 14:03 ` Daniel Drake
2010-11-11 14:59 ` Daniel Drake
2010-11-11 16:01 ` Florian Tobias Schandinat
2010-11-11 17:07 ` Daniel Drake

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