aboutsummaryrefslogtreecommitdiffstats
path: root/drv_generic_i2c.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2005-04-05 05:12:57 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2005-04-05 05:12:57 +0000
commit8621c074afa688d5019818bdf44c14cdf53f1aa6 (patch)
tree6fca158553c4d7c504ad52ff41136ea7c00e39c0 /drv_generic_i2c.c
parentadd33a2a7f689611d2b76029a0d5597281f684bc (diff)
downloadlcd4linux-8621c074afa688d5019818bdf44c14cdf53f1aa6.tar.gz
[lcd4linux @ 2005-04-05 05:12:48 by reinelt]
i2c patch from Paul (still does not work here :-( git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@527 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'drv_generic_i2c.c')
-rw-r--r--drv_generic_i2c.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drv_generic_i2c.c b/drv_generic_i2c.c
index 5a01cdd..052800a 100644
--- a/drv_generic_i2c.c
+++ b/drv_generic_i2c.c
@@ -1,4 +1,4 @@
-/* $Id: drv_generic_i2c.c,v 1.1 2005/03/28 19:39:23 reinelt Exp $
+/* $Id: drv_generic_i2c.c,v 1.2 2005/04/05 05:12:57 reinelt Exp $
*
* generic driver helper for i2c displays
*
@@ -23,6 +23,9 @@
*
*
* $Log: drv_generic_i2c.c,v $
+ * Revision 1.2 2005/04/05 05:12:57 reinelt
+ * i2c patch from Paul (still does not work here :-(
+ *
* Revision 1.1 2005/03/28 19:39:23 reinelt
* HD44780/I2C patch from Luis merged (still does not work for me)
*
@@ -89,19 +92,22 @@ int drv_generic_i2c_open (const char *section, const char *driver)
udelay_init();
- bus = cfg_get(section, "Port", NULL);
- device = cfg_get(section, "Device", NULL);
+ Section = (char*)section;
+ Driver = (char*)driver;
+
+ bus = cfg_get(Section, "Port", NULL);
+ device = cfg_get(Section, "Device", NULL);
dev = atoi(device);
- info ("%s: initializing I2C bus %s",driver,bus);
+ info ("%s: initializing I2C bus %s",Driver,bus);
info ("device %d",dev);
if ((i2c_device = open(bus,O_WRONLY)) < 0) {
- error("%s: I2C bus %s open failed !\n",driver,bus);
+ error("%s: I2C bus %s open failed !\n",Driver,bus);
return -1;
}
- info ("%s: initializing I2C slave device 0x%x",driver,dev);
+ info ("%s: initializing I2C slave device 0x%x",Driver,dev);
if (ioctl(i2c_device,I2C_SLAVE, dev ) < 0) {
- error("%s: error initializing device 0x%x\n",driver,dev);
+ error("%s: error initializing device 0x%x\n",Driver,dev);
close(i2c_device);
return -1;
}