summaryrefslogtreecommitdiffstats
path: root/drivers/video/via
diff options
context:
space:
mode:
authorDaniel Drake2010-09-21 17:37:26 +0200
committerFlorian Tobias Schandinat2010-11-09 17:38:09 +0100
commitb884a94ed16d1a633e76f80fb1bd75d0e7373ce3 (patch)
tree373074010cf11e19086d1b4b9a5e5d335cae667b /drivers/video/via
parentviafb: suspend/resume for GPIOs (diff)
downloadkernel-qcow2-linux-b884a94ed16d1a633e76f80fb1bd75d0e7373ce3.tar.gz
kernel-qcow2-linux-b884a94ed16d1a633e76f80fb1bd75d0e7373ce3.tar.xz
kernel-qcow2-linux-b884a94ed16d1a633e76f80fb1bd75d0e7373ce3.zip
viafb: Add OLPC XO-1.5 port configs
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> [fts: removed useless ifdef's and corrected comment] Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via')
-rw-r--r--drivers/video/via/via-core.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/video/via/via-core.c b/drivers/video/via/via-core.c
index 42be3d955887..86bd7197f366 100644
--- a/drivers/video/via/via-core.c
+++ b/drivers/video/via/via-core.c
@@ -17,6 +17,7 @@
#include <linux/platform_device.h>
#include <linux/list.h>
#include <linux/pm.h>
+#include <asm/olpc.h>
/*
* The default port config.
@@ -31,6 +32,19 @@ static struct via_port_cfg adap_configs[] = {
};
/*
+ * The OLPC XO-1.5 puts the camera power and reset lines onto
+ * GPIO 2C.
+ */
+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 }
+};
+
+/*
* We currently only support one viafb device (will there ever be
* more than one?), so just declare it globally here.
*/
@@ -654,6 +668,9 @@ 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;
+ if (machine_is_olpc())
+ global_dev.port_cfg = olpc_adap_configs;
+
spin_lock_init(&global_dev.reg_lock);
ret = via_pci_setup_mmio(&global_dev);
if (ret)