need soem help realter to I2C client
Hello,
I have platform which has 5 hw devices and I want single driver to control all the devices. I donot need probe as I know the devices are present and I know all the slave address. The interface for read write is using sysfs and I am planning to put it under hwmon. These all devices are separate chips.
Can I do this please let me know.
struct foo_data {
struct i2c_client client_data[5]; };
int foo_detect_client(struct i2c_adapter *adapter, int address,
unsigned short flags, int kind)
{
int err = 0;
int i;
int addrtemp[]= {0x42,0x45,0x46,0x47,0x48};
struct i2c_client *new_client;
struct foo_data *data;
const char *client_name = "";
For(i=0;i<5;i++)
{
new_client = &data->client_data[i];
new_client->addr = addrtemp[i];
new_client->data = data; //lets consider it is same
new_client->adapter = adapter;
new_client->driver = &foo_driver;
new_client->flags = 0;
strcpy(new_client->name,client_name);
/* Tell the i2c layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
}
}Thanks
Kalhan
Quoted 15 lines · Rudolf Marek
From: Rudolf Marek <r.marek-/[email protected]>
Subject: Re: need soem help realter to I2C
To: kalhantrisal-/[email protected]
Date: Thursday, 18 September, 2008, 8:01 PM
Hello,I'm very busy those days, but I think you will get the answer on I2C mailing
list. You dont need to be subscribed. But please be more specic what do you mean
by adapter, the sw entity in i2c subsys or real adapter? Are you writing your
own driver? Please explain there what you want to do more globaly.
Quoted 5 lines
Please mail your question there, I can reply later,
Here is the mail [email protected]
Rudolf
Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
A message that is not in the archive (sent off-list or not yet received): 697640.78220.qm-4UY5Ii0Ri9vS1Wi2ZBor9F5cfvJIxWXgQQ4Iyu8u01E@public.gmane.org
Hi Kalhan,
Quoted 3 lines · kalhan trisal
Hello,
I have platform which has 5 hw devices and I want single driver
to control all the devices.
Bad idea. This will make your code non-reusable, meaning that nobody will be interested in it.
Quoted 8 lines
I donot need probe as I know the devices are present and I know all the slave address. The interface for read write is using sysfs and I am planning to put it under hwmon. These all devices are separate chips.
Can I do this please let me know.
Quoted 6 lines
struct foo_data { struct i2c_client client_data[5];};
int foo_detect_client(struct
i2c_adapter*adapter, int address,
unsigned short flags, int kind)
This interface is deprecated, so no new driver will be allowed to use it. Please use the (new) standard .probe() method instead.
Quoted 10 lines
{
int err = 0;
int i;
int addrtemp[]= {0x42,0x45,0x46,0x47,0x48};
struct i2c_client *new_client;
struct foo_data *data;
const char *client_name = "";
For(i=0;i<5;i++)
{You will have to fix your coding style as well.
Quoted 12 lines
new_client = &data->client_data[i];
new_client->addr = addrtemp[i];
new_client->data = data; //lets consider it is same
new_client->adapter = adapter;
new_client->driver = &foo_driver;
new_client->flags = 0;
strcpy(new_client->name,client_name);
/* Tell the i2c layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
}
}Signature · 6 lines
Jean Delvare _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
A message that is not in the archive (sent off-list or not yet received): [email protected]
tvp5150 new style i2c driver
Hi Jean,
i need to interface with a TI tvp5150, wired via i2c on my custom board.
i'm on kernel 2.6.27git and i found there's a driver for the codec... but i get the 'SMBus not supported' error when i try to enable it. So old style coding... I was trying to convert it to new-style when i found on the ML Archive you had some similar problem....
do you have some pre-coded patch for me?
After i made it work, how to communicate with it?
thanks,
Luca Santini
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: tvp5150 new style i2c driver
Hi Luca,
Quoted 2 lines · Luca Santini
Hi Jean,
i need to interface with a TI tvp5150, wired via i2c on my custom board.
This is unrelated with the problem that was discussed in this thread. Please start new threads for new topics.
Thanks,
Signature · 6 lines
Jean Delvare _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
tvp5150 new style i2c driver
In reply to a message not in the archiveHi,
i need to interface with a TI tvp5150 (video codec), wired via i2c on my custom board.
i'm on kernel 2.6.27git and i found there's a driver for the codec... but i get the 'SMBus not supported' error when i try to enable it. So old style coding... I was trying to convert it to new-style when i found on the ML Archive someone had some similar problem....
do somebody have some pre-coded patch for me?
After i made it work, how to communicate with it?
thanks,
Luca Santini
p.s. i have no idea how previous post fallen into the wrong thread !
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: tvp5150 new style i2c driver
Quoted 1 line · Luca Santini
p.s. i have no idea how previous post fallen into the wrong thread !
Actually you just did it again. Presumably, you're using "Reply" instead of "Compose" (or "New", whatever your e-mail client calls it.) When you do that, threading clients (such as the list archive) mix unrelated topics in the same discussion thread and that makes things difficult to follow and find if you look for them later.
Signature · 6 lines
Jean Delvare _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
tvp5150 new style i2c driver
In reply to a message not in the archiveHi,
i need to interface with a TI tvp5150 (video codec), wired via i2c on my custom board.
i'm on kernel 2.6.27git and i found there's a driver for the codec... but i get the 'SMBus not supported' error when i try to enable it. So old style coding... I was trying to convert it to new-style when i found on the ML Archive someone had some similar problem....
do somebody have some pre-coded patch for me?
After i made it work, how to communicate with it?
thanks,
Luca Santini
p.s. i have no idea how previous post fallen into the wrong thread !
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c