* Re: [PATCH] i2c: Drop I2C_CLASS_ALL
[not found] ` <0F1B54C89D5F954D8535DB252AF412FA02F64B5D-SGdA1W8gREmuVPpjEGsWsTcYPEmu4y7e@public.gmane.org>
@ 2008-10-31 8:47 ` Jean Delvare
0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2008-10-31 8:47 UTC (permalink / raw)
To: Zhang, Sonic; +Cc: Linux I2C
Hi Sonic,
On Fri, 31 Oct 2008 10:51:19 +0800, Zhang, Sonic wrote:
> If only I2C_CLASS_HWMON and I2C_CLASS_SPD must be probed, why other
> classes are still list in the head files?
We are in a transition phase. We must wait for all users of a class
flag to go away before we can drop the corresponding flag. You are
right though that some flags could be removed already. For example, as
far as I can see there are no users of I2C_CLASS_CAM_ANALOG nor
I2C_CLASS_SOUND left, so we could drop these 2 flags now. Additionally,
class I2C_CLASS_CAM_DIGITAL is set by a number of bus drivers but no
chip driver checks for that flag, so it's probably safe to drop it as
well.
For I2C_CLASS_TV_ANALOG and I2C_CLASS_TV_DIGITAL, it will take some
more time, as there are a number of old drivers which do actually rely
on probing and which may be a little hard to convert. But anyway their
usage should be limited to a few drivers/media/video drivers.
In the long run, Only I2C_CLASS_HWMON, I2C_CLASS_DDC and I2C_CLASS_SPD
should be widely used.
--
Jean Delvare
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] i2c: Drop I2C_CLASS_ALL
[not found] ` <20081030153120.1c1f3476-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2008-10-31 9:09 ` Zhang, Sonic
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Sonic @ 2008-10-31 9:09 UTC (permalink / raw)
To: Jean Delvare, Linux I2C; +Cc: Sonic Zhang
Acked-by: Sonic Zhang <sonic.zhang-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
-----Original Message-----
From: Jean Delvare [mailto:khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org]
Sent: Thursday, October 30, 2008 10:31 PM
To: Linux I2C
Cc: Sonic Zhang
Subject: [PATCH] i2c: Drop I2C_CLASS_ALL
I2C_CLASS_ALL is almost never what bus driver authors really want.
These i2c classes are really only about which devices must be probed,
not what devices can be present. As device drivers get converted to the
new i2c device driver model, only a few device types will keep relying
on probing.
Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: Sonic Zhang <sonic.zhang-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-bfin-twi.c | 2 +-
drivers/i2c/busses/i2c-sh7760.c | 2 +-
include/linux/i2c.h | 1 -
3 files changed, 2 insertions(+), 3 deletions(-)
--- linux-2.6.28-rc2.orig/drivers/i2c/busses/i2c-bfin-twi.c
2008-10-10 09:27:55.000000000 +0200
+++ linux-2.6.28-rc2/drivers/i2c/busses/i2c-bfin-twi.c 2008-10-30
15:11:39.000000000 +0100
@@ -656,7 +656,7 @@ static int i2c_bfin_twi_probe(struct pla
strlcpy(p_adap->name, pdev->name, sizeof(p_adap->name));
p_adap->algo = &bfin_twi_algorithm;
p_adap->algo_data = iface;
- p_adap->class = I2C_CLASS_ALL;
+ p_adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
p_adap->dev.parent = &pdev->dev;
rc = peripheral_request_list(pin_req[pdev->id], "i2c-bfin-twi");
--- linux-2.6.28-rc2.orig/drivers/i2c/busses/i2c-sh7760.c
2008-10-10 09:21:53.000000000 +0200
+++ linux-2.6.28-rc2/drivers/i2c/busses/i2c-sh7760.c 2008-10-30
15:11:26.000000000 +0100
@@ -475,7 +475,7 @@ static int __devinit sh7760_i2c_probe(st
id->adap.nr = pdev->id;
id->adap.algo = &sh7760_i2c_algo;
- id->adap.class = I2C_CLASS_ALL;
+ id->adap.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
id->adap.retries = 3;
id->adap.algo_data = id;
id->adap.dev.parent = &pdev->dev;
--- linux-2.6.28-rc2.orig/include/linux/i2c.h 2008-10-24
09:28:36.000000000 +0200
+++ linux-2.6.28-rc2/include/linux/i2c.h 2008-10-30
15:11:14.000000000 +0100
@@ -397,7 +397,6 @@ static inline void i2c_set_adapdata(stru
#define I2C_CLASS_CAM_DIGITAL (1<<5) /* most webcams */
#define I2C_CLASS_SOUND (1<<6) /* sound devices */
#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */
-#define I2C_CLASS_ALL (UINT_MAX) /* all of the above */
/* i2c_client_address_data is the struct for holding default client
* addresses for a driver and for the parameters supplied on the
--
Jean Delvare
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-31 9:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20081030153120.1c1f3476@hyperion.delvare>
[not found] ` <0F1B54C89D5F954D8535DB252AF412FA02F64B5D@chinexm1.ad.analog.com>
[not found] ` <0F1B54C89D5F954D8535DB252AF412FA02F64B5D-SGdA1W8gREmuVPpjEGsWsTcYPEmu4y7e@public.gmane.org>
2008-10-31 8:47 ` [PATCH] i2c: Drop I2C_CLASS_ALL Jean Delvare
[not found] ` <20081030153120.1c1f3476-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-10-31 9:09 ` Zhang, Sonic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox