From 27cd37bbd233088b727c52aad91e4c6f76a2914d Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Tue, 21 Sep 2010 16:37:26 +0100 Subject: [PATCH] --- yaml --- r: 225607 b: refs/heads/master c: b884a94ed16d1a633e76f80fb1bd75d0e7373ce3 h: refs/heads/master i: 225605: 115d98d733f6f87ea5ec43148ce3fc9943e724d1 225603: 67bf2f807f6ce8cf277a260e8120e0e8cba72640 225599: 86bcb53d11a603c1ba2901c58d6c0bf72f576d03 v: v3 --- [refs] | 2 +- trunk/drivers/video/via/via-core.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 52f1bf6336b8..cb6e1a9b455f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 67eb6f9617a24dfb033b584d6b1b42b39cc9297a +refs/heads/master: b884a94ed16d1a633e76f80fb1bd75d0e7373ce3 diff --git a/trunk/drivers/video/via/via-core.c b/trunk/drivers/video/via/via-core.c index 42be3d955887..86bd7197f366 100644 --- a/trunk/drivers/video/via/via-core.c +++ b/trunk/drivers/video/via/via-core.c @@ -17,6 +17,7 @@ #include #include #include +#include /* * The default port config. @@ -30,6 +31,19 @@ static struct via_port_cfg adap_configs[] = { { 0, 0, 0, 0 } }; +/* + * 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)