Commit 2a0ecedb authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Tom Rini

[PATCH] I2C: add I2C_DEBUG_CHIP config option and convert the i2c chip drivers to use it.

This cleans up the mismatch of ways we could enable debugging messages.
parent 86292572
...@@ -49,5 +49,14 @@ config I2C_DEBUG_CORE ...@@ -49,5 +49,14 @@ config I2C_DEBUG_CORE
messages to the system log. Select this if you are having a messages to the system log. Select this if you are having a
problem with I2C support and want to see more of what is going on. problem with I2C support and want to see more of what is going on.
config I2C_DEBUG_CHIP
bool "I2C Chip debugging messages"
depends on I2C
help
Say Y here if you want the I2C chip drivers to produce a bunch of
debug messages to the system log. Select this if you are having
a problem with I2C support and want to see more of what is going
on.
endmenu endmenu
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -36,7 +36,10 @@ ...@@ -36,7 +36,10 @@
asb100 7 3 1 4 0x31 0x0694 yes no asb100 7 3 1 4 0x31 0x0694 yes no
*/ */
/* #define DEBUG 1 */ #include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -1035,7 +1038,6 @@ static struct asb100_data *asb100_update_device(struct device *dev) ...@@ -1035,7 +1038,6 @@ static struct asb100_data *asb100_update_device(struct device *dev)
static int __init asb100_init(void) static int __init asb100_init(void)
{ {
printk(KERN_INFO "asb100 version %s\n", ASB100_VERSION);
return i2c_add_driver(&asb100_driver); return i2c_add_driver(&asb100_driver);
} }
......
...@@ -26,7 +26,10 @@ ...@@ -26,7 +26,10 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* #define DEBUG */ #include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
type at module load time. type at module load time.
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -667,8 +672,8 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -667,8 +672,8 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind)
} }
else { else {
if (kind == 0) if (kind == 0)
printk dev_info(&adapter->dev,
("it87.o: Ignoring 'force' parameter for unknown chip at " "Ignoring 'force' parameter for unknown chip at "
"adapter %d, address 0x%02x\n", "adapter %d, address 0x%02x\n",
i2c_adapter_id(adapter), address); i2c_adapter_id(adapter), address);
goto ERROR1; goto ERROR1;
......
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* #define DEBUG 1 */ #include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -615,7 +620,7 @@ int lm78_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -615,7 +620,7 @@ int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
kind = lm79; kind = lm79;
else { else {
if (kind == 0) if (kind == 0)
printk(KERN_WARNING "lm78.o: Ignoring 'force' " dev_warn(&adapter->dev, "Ignoring 'force' "
"parameter for unknown chip at " "parameter for unknown chip at "
"adapter %d, address 0x%02x\n", "adapter %d, address 0x%02x\n",
i2c_adapter_id(adapter), address); i2c_adapter_id(adapter), address);
......
...@@ -27,6 +27,11 @@ ...@@ -27,6 +27,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
Warning - only supports a single device. Warning - only supports a single device.
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pci.h> #include <linux/pci.h>
......
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -1651,7 +1656,7 @@ w83781d_update_client(struct i2c_client *client) ...@@ -1651,7 +1656,7 @@ w83781d_update_client(struct i2c_client *client)
if (time_after if (time_after
(jiffies - data->last_updated, (unsigned long) (HZ + HZ / 2)) (jiffies - data->last_updated, (unsigned long) (HZ + HZ / 2))
|| time_before(jiffies, data->last_updated) || !data->valid) { || time_before(jiffies, data->last_updated) || !data->valid) {
pr_debug(KERN_DEBUG "Starting device update\n"); pr_debug("Starting device update\n");
for (i = 0; i <= 8; i++) { for (i = 0; i <= 8; i++) {
if ((data->type == w83783s || data->type == w83697hf) if ((data->type == w83783s || data->type == w83697hf)
......
...@@ -27,6 +27,11 @@ ...@@ -27,6 +27,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CHIP
#define DEBUG 1
#endif
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment