Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 462 → Rev 461

/shark/trunk/drivers/linuxc26/class.c
File deleted
/shark/trunk/drivers/linuxc26/shark_linuxc26.c
22,7 → 22,6
 
extern int devices_init(void);
extern int buses_init(void);
extern int classes_init(void);
 
/* Init the Emulation Library */
int LINUXC26_register_module() {
31,7 → 30,6
 
devices_init();
buses_init();
classes_init();
 
return 0;
 
/shark/trunk/drivers/linuxc26/makefile
11,7 → 11,7
OBJS_PATH = $(BASE)/drivers/linuxc26
 
OBJS = bus.o linuxcomp.o core.o driver.o vsprintf.o interface.o kobject.o\
shark_linuxc26.o class.o
shark_linuxc26.o
 
C_OPT += -I../linuxc26/include
 
/shark/trunk/drivers/linuxc26/linuxcomp.c
11,7 → 11,6
#include <asm/io.h>
#include <linux/ctype.h>
#include <linux/device.h>
#include <linux/completion.h>
 
unsigned char _ctype[] = {
_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */
318,34 → 317,3
}
 
unsigned long __copy_to_user_ll(void __user *to, const void *from, unsigned long n) {
 
memcpy(to,from,n);
return n;
 
}
 
unsigned long __copy_from_user_ll(void *to, const void __user *from, unsigned long n) {
 
memcpy(to,from,n);
return n;
 
}
 
void complete(struct completion *c) {
}
 
void wait_for_completion(struct completion *c) {
}
 
struct device legacy_bus = {
.bus_id = "legacy",
};
 
int register_chrdev(unsigned int a, const char *b, struct file_operations *c) {
return 0;
}
 
int unregister_chrdev(unsigned int a, const char *b) {
return 0;
}
/shark/trunk/drivers/i2c/i2c-core.c
21,9 → 21,9
All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl>
SMBus 2.0 support by Mark Studebaker <mdsxyz123@yahoo.com> */
 
/* $Id: i2c-core.c,v 1.4 2004-02-24 14:28:42 giacomo Exp $ */
/* $Id: i2c-core.c,v 1.3 2004-02-23 14:56:41 giacomo Exp $ */
 
#define DEBUG 1 /* needed to pick up the dev_dbg() calls */
/* #define DEBUG 1 */ /* needed to pick up the dev_dbg() calls */
 
#include <linuxcomp.h>
 
128,7 → 128,7
struct list_head *item;
struct i2c_driver *driver;
 
//down(&core_lists);
down(&core_lists);
 
adap->nr = nr++;
init_MUTEX(&adap->bus_lock);
152,7 → 152,7
memset(&adap->class_dev, 0x00, sizeof(struct class_device));
adap->class_dev.dev = &adap->dev;
adap->class_dev.class = &i2c_adapter_class;
strncpy(adap->class_dev.class_id, adap->dev.bus_id, BUS_ID_SIZE);
strlcpy(adap->class_dev.class_id, adap->dev.bus_id, BUS_ID_SIZE);
class_device_register(&adap->class_dev);
 
/* inform drivers of new adapters */
162,7 → 162,7
/* We ignore the return code; if it fails, too bad */
driver->attach_adapter(adap);
}
//up(&core_lists);
up(&core_lists);
 
DEB(dev_dbg(&adap->dev, "registered as adapter #%d\n", adap->nr));
return 0;
176,7 → 176,7
struct i2c_client *client;
int res = 0;
 
//down(&core_lists);
down(&core_lists);
 
list_for_each(item,&drivers) {
driver = list_entry(item, struct i2c_driver, list);
222,7 → 222,7
DEB(dev_dbg(&adap->dev, "adapter unregistered\n"));
 
out_unlock:
//up(&core_lists);
up(&core_lists);
return res;
}
 
239,7 → 239,7
struct i2c_adapter *adapter;
int res = 0;
 
//down(&core_lists);
down(&core_lists);
 
/* add the driver to the list of i2c drivers in the driver core */
driver->driver.name = driver->name;
263,7 → 263,7
}
 
out_unlock:
//up(&core_lists);
up(&core_lists);
return res;
}
 
275,7 → 275,7
int res = 0;
 
//down(&core_lists);
down(&core_lists);
 
/* Have a look at each adapter, if clients of this driver are still
* attached. If so, detach them to be able to kill the driver
326,7 → 326,7
DEB(printk(KERN_DEBUG "i2c-core.o: driver unregistered: %s\n",driver->name));
 
out_unlock:
//up(&core_lists);
up(&core_lists);
return 0;
}
 
347,9 → 347,9
{
int rval;
 
//down(&adapter->clist_lock);
down(&adapter->clist_lock);
rval = __i2c_check_addr(adapter, addr);
//up(&adapter->clist_lock);
up(&adapter->clist_lock);
 
return rval;
}
358,13 → 358,13
{
struct i2c_adapter *adapter = client->adapter;
 
//down(&adapter->clist_lock);
down(&adapter->clist_lock);
if (__i2c_check_addr(client->adapter, client->addr)) {
//up(&adapter->clist_lock);
up(&adapter->clist_lock);
return -EBUSY;
}
list_add_tail(&client->list,&adapter->clients);
//up(&adapter->clist_lock);
up(&adapter->clist_lock);
if (adapter->client_register) {
if (adapter->client_register(client)) {
374,8 → 374,8
}
}
 
//DEB(dev_dbg(&adapter->dev, "client [%s] registered to adapter\n",
// client->dev.name));
DEB(dev_dbg(&adapter->dev, "client [%s] registered to adapter\n",
client->dev.name));
 
if (client->flags & I2C_CLIENT_ALLOW_USE)
client->usage_count = 0;
413,12 → 413,12
}
}
 
//down(&adapter->clist_lock);
down(&adapter->clist_lock);
list_del(&client->list);
init_completion(&client->released);
device_remove_file(&client->dev, &dev_attr_client_name);
device_unregister(&client->dev);
//up(&adapter->clist_lock);
up(&adapter->clist_lock);
wait_for_completion(&client->released);
 
out:
486,19 → 486,19
struct list_head *item;
struct i2c_client *client;
 
//down(&adap->clist_lock);
down(&adap->clist_lock);
list_for_each(item,&adap->clients) {
client = list_entry(item, struct i2c_client, list);
if (!try_module_get(client->driver->owner))
continue;
if (NULL != client->driver->command) {
//up(&adap->clist_lock);
up(&adap->clist_lock);
client->driver->command(client,cmd,arg);
//down(&adap->clist_lock);
down(&adap->clist_lock);
}
module_put(client->driver->owner);
}
//up(&adap->clist_lock);
up(&adap->clist_lock);
}
 
 
513,7 → 513,7
.match = i2c_device_match,
};
 
int __init i2c_init(void)
static int __init i2c_init(void)
{
int retval;
 
548,9 → 548,9
if (adap->algo->master_xfer) {
DEB2(dev_dbg(&adap->dev, "master_xfer: with %d msgs.\n", num));
 
//down(&adap->bus_lock);
down(&adap->bus_lock);
ret = adap->algo->master_xfer(adap,msgs,num);
//up(&adap->bus_lock);
up(&adap->bus_lock);
 
return ret;
} else {
574,9 → 574,9
DEB2(dev_dbg(&client->adapter->dev, "master_send: writing %d bytes.\n",
count));
//down(&adap->bus_lock);
down(&adap->bus_lock);
ret = adap->algo->master_xfer(adap,&msg,1);
//up(&adap->bus_lock);
up(&adap->bus_lock);
 
/* if everything went ok (i.e. 1 msg transmitted), return #bytes
* transmitted, else error code.
603,9 → 603,9
DEB2(dev_dbg(&client->adapter->dev, "master_recv: reading %d bytes.\n",
count));
//down(&adap->bus_lock);
down(&adap->bus_lock);
ret = adap->algo->master_xfer(adap,&msg,1);
//up(&adap->bus_lock);
up(&adap->bus_lock);
DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: return:%d (count:%d, addr:0x%02x)\n",
ret, count, client->addr));
781,16 → 781,16
struct list_head *item;
struct i2c_adapter *adapter;
//down(&core_lists);
down(&core_lists);
list_for_each(item,&adapters) {
adapter = list_entry(item, struct i2c_adapter, list);
if (id == adapter->nr &&
try_module_get(adapter->owner)) {
//up(&core_lists);
up(&core_lists);
return adapter;
}
}
//up(&core_lists);
up(&core_lists);
return NULL;
}
 
1230,10 → 1230,10
}
 
if (adapter->algo->smbus_xfer) {
//down(&adapter->bus_lock);
down(&adapter->bus_lock);
res = adapter->algo->smbus_xfer(adapter,addr,flags,read_write,
command,size,data);
//up(&adapter->bus_lock);
up(&adapter->bus_lock);
} else
res = i2c_smbus_xfer_emulated(adapter,addr,flags,read_write,
command,size,data);
/shark/trunk/drivers/i2c/i2c-dev.c
30,7 → 30,7
<pmhahn@titan.lahn.de> */
 
/* If you want debugging uncomment: */
#define DEBUG 1
/* #define DEBUG 1 */
 
#include <linuxcomp.h>
 
415,7 → 415,7
 
static struct file_operations i2cdev_fops = {
.owner = THIS_MODULE,
.llseek = NULL,//no_llseek,
.llseek = no_llseek,
.read = i2cdev_read,
.write = i2cdev_write,
.ioctl = i2cdev_ioctl,