linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: Mark I2C_CLASS_DDC as deprecated and emit warning if adapters declare support for it
@ 2023-10-11  9:26 Heiner Kallweit
  2023-10-26 17:37 ` Wolfram Sang
  0 siblings, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2023-10-11  9:26 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c@vger.kernel.org

With removal of the legacy eeprom driver the only i2c client device
driver with I2C_CLASS_DDC is gone, so it's time to mark I2C_CLASS_DDC
as deprecated.
Use pr_warn_once, because graphics adapters can have several i2c
busses and we may see the warning multiple times otherwise.

Note:
Driver staging/olpc_dcon declares support for classes HWMON and DDC,
but only HWMON is used with the scx200_acb adapter driver on olpc
devices.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/i2c/i2c-core-base.c | 4 ++++
 include/linux/i2c.h         | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 60746652f..34b475823 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1487,6 +1487,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 		goto out_list;
 	}
 
+	if (adap->class & I2C_CLASS_DDC)
+		pr_warn_once("adapter '%s': Probing for class DDC devices is deprecated\n",
+			     adap->name);
+
 	if (!adap->lock_ops)
 		adap->lock_ops = &i2c_adapter_lock_ops;
 
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 0dae9db27..dfbd121b7 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -850,7 +850,7 @@ static inline void i2c_mark_adapter_resumed(struct i2c_adapter *adap)
 
 /* i2c adapter classes (bitmask) */
 #define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */
-#define I2C_CLASS_DDC		(1<<3)	/* DDC bus on graphics adapters */
+#define I2C_CLASS_DDC		(1<<3)	/* Deprecated: DDC bus on graphics adapters */
 #define I2C_CLASS_SPD		(1<<7)	/* Memory modules */
 /* Warn users that the adapter doesn't support classes anymore */
 #define I2C_CLASS_DEPRECATED	(1<<8)
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: Mark I2C_CLASS_DDC as deprecated and emit warning if adapters declare support for it
  2023-10-11  9:26 [PATCH] i2c: Mark I2C_CLASS_DDC as deprecated and emit warning if adapters declare support for it Heiner Kallweit
@ 2023-10-26 17:37 ` Wolfram Sang
  2023-10-26 20:22   ` Heiner Kallweit
  2023-10-31  6:43   ` Heiner Kallweit
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2023-10-26 17:37 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: linux-i2c@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

Hi Heiner!

> With removal of the legacy eeprom driver the only i2c client device
> driver with I2C_CLASS_DDC is gone, so it's time to mark I2C_CLASS_DDC
> as deprecated.

OK, but I will need to wait until the eeprom-removal hits mainline.

> Use pr_warn_once, because graphics adapters can have several i2c
> busses and we may see the warning multiple times otherwise.
> 
> Note:
> Driver staging/olpc_dcon declares support for classes HWMON and DDC,
> but only HWMON is used with the scx200_acb adapter driver on olpc
> devices.

And why don't we remove its DDC declaration here in this patch?

Thanks for cleaning this up!

Regards,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: Mark I2C_CLASS_DDC as deprecated and emit warning if adapters declare support for it
  2023-10-26 17:37 ` Wolfram Sang
@ 2023-10-26 20:22   ` Heiner Kallweit
  2023-10-31  6:43   ` Heiner Kallweit
  1 sibling, 0 replies; 5+ messages in thread
From: Heiner Kallweit @ 2023-10-26 20:22 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c@vger.kernel.org

On 26.10.2023 19:37, Wolfram Sang wrote:
> Hi Heiner!
> 
>> With removal of the legacy eeprom driver the only i2c client device
>> driver with I2C_CLASS_DDC is gone, so it's time to mark I2C_CLASS_DDC
>> as deprecated.
> 
> OK, but I will need to wait until the eeprom-removal hits mainline.
> 
>> Use pr_warn_once, because graphics adapters can have several i2c
>> busses and we may see the warning multiple times otherwise.
>>
>> Note:
>> Driver staging/olpc_dcon declares support for classes HWMON and DDC,
>> but only HWMON is used with the scx200_acb adapter driver on olpc
>> devices.
> 
> And why don't we remove its DDC declaration here in this patch?
> 
OK, will submit this as follow-up.

> Thanks for cleaning this up!
> 
> Regards,
> 
>    Wolfram
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: Mark I2C_CLASS_DDC as deprecated and emit warning if adapters declare support for it
  2023-10-26 17:37 ` Wolfram Sang
  2023-10-26 20:22   ` Heiner Kallweit
@ 2023-10-31  6:43   ` Heiner Kallweit
  2023-10-31  8:55     ` Wolfram Sang
  1 sibling, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2023-10-31  6:43 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c@vger.kernel.org

On 26.10.2023 19:37, Wolfram Sang wrote:
> Hi Heiner!
> 
>> With removal of the legacy eeprom driver the only i2c client device
>> driver with I2C_CLASS_DDC is gone, so it's time to mark I2C_CLASS_DDC
>> as deprecated.
> 
> OK, but I will need to wait until the eeprom-removal hits mainline.
> 
>> Use pr_warn_once, because graphics adapters can have several i2c
>> busses and we may see the warning multiple times otherwise.
>>
>> Note:
>> Driver staging/olpc_dcon declares support for classes HWMON and DDC,
>> but only HWMON is used with the scx200_acb adapter driver on olpc
>> devices.
> 
> And why don't we remove its DDC declaration here in this patch?
> 

Both changes should reach mainline in the next days.
0210a684cdb2 ("staging: olpc_dcon: Remove I2C_CLASS_DDC support")
0113a99b8a75 ("eeprom: Remove deprecated legacy eeprom driver")

I reactivated my rudimentary Coccinelle skills and think I'll prepare
a series that removes definition of I2C_CLASS_DDC and all its users.
Means you can drop the patch introducing a depreciation warning.

> Thanks for cleaning this up!
> 
> Regards,
> 
>    Wolfram
> 
Heiner

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] i2c: Mark I2C_CLASS_DDC as deprecated and emit warning if adapters declare support for it
  2023-10-31  6:43   ` Heiner Kallweit
@ 2023-10-31  8:55     ` Wolfram Sang
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2023-10-31  8:55 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: linux-i2c@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]


> I reactivated my rudimentary Coccinelle skills and think I'll prepare
> a series that removes definition of I2C_CLASS_DDC and all its users.
> Means you can drop the patch introducing a depreciation warning.

Okay, cool!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-31  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-11  9:26 [PATCH] i2c: Mark I2C_CLASS_DDC as deprecated and emit warning if adapters declare support for it Heiner Kallweit
2023-10-26 17:37 ` Wolfram Sang
2023-10-26 20:22   ` Heiner Kallweit
2023-10-31  6:43   ` Heiner Kallweit
2023-10-31  8:55     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).