* How to manually call i2c_client's probe from i2c-dev.c ioctl
@ 2009-09-16 16:56 Chuck Kamas
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E18153F-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Chuck Kamas @ 2009-09-16 16:56 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Hi all,
I am trying to backport Michael's patch to add PROBE and REMOVE ioctls
to 2.6.21
http://article.gmane.org/gmane.linux.drivers.i2c/3339/match=ioctls+probe
I have been able to add the IOCTLS and re-compile the kernel module, but
am confused as to what function to call in the old device model. I
believe that I should use i2c_attach_client() from i2c-core.c. Is this
correct?
This is what I have so far:
I2c-dev.c:
static int i2cdev_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
char *colon, request[I2C_NAME_SIZE + 5];
char probeTemp[I2C_NAME_SIZE];
int addr;
...
case I2C_PROBE:
res = copy_from_user(request, (char *)arg,
sizeof(request));
if (res)
return res;
colon = strchr(request, ',');
if((!colon) || (colon - request > I2C_NAME_SIZE - 1))
return -EINVAL;
memset (probeTemp,0,sizeof(probeTemp)); // set the whole
buffer to 0 so that when the string is added it is automatically null
terminated.
strncpy(probeTemp, request, colon - request);
addr = simple_strtoul(colon + 1, NULL, 0);
printk (KERN_ERR "got %s and %d\n",probeTemp,addr);
printk (KERN_ERR "client info name: %s\n",
client->name);
printk (KERN_ERR "client's adapter's name: %s\n",
client->adapter->name); // this is what probe wants
/* Check for address business */
if (i2c_check_addr(client->adapter, client->addr))
return -EBUSY;
??? What call to put here to probe the actual chip ???
return 0;
Thanks!
Chuck
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to manually call i2c_client's probe from i2c-dev.c ioctl
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E18153F-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
@ 2009-09-16 20:52 ` Jean Delvare
[not found] ` <20090916225247.2094619b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2009-09-16 20:52 UTC (permalink / raw)
To: Chuck Kamas; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Wed, 16 Sep 2009 09:56:37 -0700, Chuck Kamas wrote:
> I am trying to backport Michael's patch to add PROBE and REMOVE ioctls
> to 2.6.21
> http://article.gmane.org/gmane.linux.drivers.i2c/3339/match=ioctls+probe
>
> I have been able to add the IOCTLS and re-compile the kernel module, but
> am confused as to what function to call in the old device model. I
> believe that I should use i2c_attach_client() from i2c-core.c. Is this
> correct?
You are backporting a patch which was rejected upstream, to a model
which is deprecated. It's probably time to reconsider your technical
choices.
--
Jean Delvare
http://khali.linux-fr.org/wishlist.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: How to manually call i2c_client's probe from i2c-dev.c ioctl
[not found] ` <20090916225247.2094619b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2009-09-16 23:25 ` Chuck Kamas
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E1815B9-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Chuck Kamas @ 2009-09-16 23:25 UTC (permalink / raw)
To: Jean Delvare; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Jean,
All of this I am very aware of. However, I still need to solve this
problem. Can you please suggest a solution?
Chuck
> -----Original Message-----
> From: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> [mailto:linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Jean Delvare
> Sent: Wednesday, September 16, 2009 1:53 PM
> To: Chuck Kamas
> Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: How to manually call i2c_client's probe from
> i2c-dev.c ioctl
>
> On Wed, 16 Sep 2009 09:56:37 -0700, Chuck Kamas wrote:
> > I am trying to backport Michael's patch to add PROBE and
> REMOVE ioctls
> > to 2.6.21
> >
> http://article.gmane.org/gmane.linux.drivers.i2c/3339/match=ioctls+pro
> > be
> >
> > I have been able to add the IOCTLS and re-compile the
> kernel module,
> > but am confused as to what function to call in the old
> device model.
> > I believe that I should use i2c_attach_client() from
> i2c-core.c. Is
> > this correct?
>
> You are backporting a patch which was rejected upstream, to a
> model which is deprecated. It's probably time to reconsider
> your technical choices.
>
> --
> Jean Delvare
> http://khali.linux-fr.org/wishlist.html
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-i2c" in the body of a message to
> majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to manually call i2c_client's probe from i2c-dev.c ioctl
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E1815B9-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
@ 2009-09-17 7:26 ` Jean Delvare
[not found] ` <20090917092612.53327f80-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2009-09-17 7:26 UTC (permalink / raw)
To: Chuck Kamas; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Wed, 16 Sep 2009 16:25:59 -0700, Chuck Kamas wrote:
> All of this I am very aware of. However, I still need to solve this
> problem. Can you please suggest a solution?
You did not tell us what your problem was!
--
Jean Delvare
http://khali.linux-fr.org/wishlist.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: How to manually call i2c_client's probe from i2c-dev.c ioctl
[not found] ` <20090917092612.53327f80-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2009-09-17 15:45 ` Chuck Kamas
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E1815EC-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Chuck Kamas @ 2009-09-17 15:45 UTC (permalink / raw)
To: Jean Delvare; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Jean,
Thanks for the reply. I see now that I was not clear. In the patch
that I mentioned, Michael used a call i2c_new_device(client->adapter,
&bInfo). This is from the new model. What would be the equivalent call
from the old model? I.e. what function do I call so that a chip driver
will issue a probe and if a chip is found it will be properly
registered?
Thanks for looking at my issue.
Chuck
> -----Original Message-----
> From: Jean Delvare [mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org]
> Sent: Thursday, September 17, 2009 12:26 AM
> To: Chuck Kamas
> Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: How to manually call i2c_client's probe from
> i2c-dev.c ioctl
>
> On Wed, 16 Sep 2009 16:25:59 -0700, Chuck Kamas wrote:
> > All of this I am very aware of. However, I still need to
> solve this
> > problem. Can you please suggest a solution?
>
> You did not tell us what your problem was!
>
> --
> Jean Delvare
> http://khali.linux-fr.org/wishlist.html
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to manually call i2c_client's probe from i2c-dev.c ioctl
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E1815EC-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
@ 2009-09-17 16:04 ` Jean Delvare
[not found] ` <20090917180407.5460bf33-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Jean Delvare @ 2009-09-17 16:04 UTC (permalink / raw)
To: Chuck Kamas; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Hi Chuck,
On Thu, 17 Sep 2009 08:45:57 -0700, Chuck Kamas wrote:
> Thanks for the reply. I see now that I was not clear. In the patch
> that I mentioned, Michael used a call i2c_new_device(client->adapter,
> &bInfo). This is from the new model. What would be the equivalent call
> from the old model? I.e. what function do I call so that a chip driver
> will issue a probe and if a chip is found it will be properly
> registered?
You keep referring to Michael's patch, while this patch was never
merged, for a reason.
Please let's start all over again. Michael's patch does not exist.
Trying to inject pieces of the new binding model into the old one will
never work, both models are simply too different.
What functional problem are you trying to solve? What's your platform,
what's your I2C bus, what's your I2C device, and which drivers are you
using?
--
Jean Delvare
http://khali.linux-fr.org/wishlist.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: How to manually call i2c_client's probe from i2c-dev.c ioctl
[not found] ` <20090917180407.5460bf33-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2009-09-17 16:38 ` Chuck Kamas
0 siblings, 0 replies; 7+ messages in thread
From: Chuck Kamas @ 2009-09-17 16:38 UTC (permalink / raw)
To: Jean Delvare; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Jean,
I am trying to have the chip drivers probe for new chips after init. I
would like to do this by adding to the ioctl a PROBE function. So in the
old model how do I manually call the probe function of a chip driver and
have it properly register with the i2c subsystem?
Chuck
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-09-17 16:38 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-16 16:56 How to manually call i2c_client's probe from i2c-dev.c ioctl Chuck Kamas
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E18153F-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
2009-09-16 20:52 ` Jean Delvare
[not found] ` <20090916225247.2094619b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-09-16 23:25 ` Chuck Kamas
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E1815B9-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
2009-09-17 7:26 ` Jean Delvare
[not found] ` <20090917092612.53327f80-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-09-17 15:45 ` Chuck Kamas
[not found] ` <C62896630644CE43BF64B0FF0AC27F0E1815EC-RKsfjrak5bi0VCHWTNMfawC/G2K4zDHf@public.gmane.org>
2009-09-17 16:04 ` Jean Delvare
[not found] ` <20090917180407.5460bf33-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-09-17 16:38 ` Chuck Kamas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox