rivafb/nvidiafb: Enable hardware monitoring
authorJean Delvare <khali@linux-fr>
Tue, 8 May 2007 07:38:15 +0000 (00:38 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:28 +0000 (11:15 -0700)
Let the hardware monitoring drivers probe the second rivafb/nvidiafb I2C bus
for devices.

Signed-off-by: Jean Delvare <khali@linux-fr>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/nvidia/nv_i2c.c
drivers/video/riva/rivafb-i2c.c

index bcde013d0b98cc4c33f148c456b9b3c915720378..badc1a6c43578a22ebf08c28950b36544304509f 100644 (file)
@@ -86,13 +86,15 @@ static int nvidia_gpio_getsda(void *data)
        return val;
 }
 
-static int nvidia_setup_i2c_bus(struct nvidia_i2c_chan *chan, const char *name)
+static int nvidia_setup_i2c_bus(struct nvidia_i2c_chan *chan, const char *name,
+                               unsigned int i2c_class)
 {
        int rc;
 
        strcpy(chan->adapter.name, name);
        chan->adapter.owner = THIS_MODULE;
        chan->adapter.id = I2C_HW_B_NVIDIA;
+       chan->adapter.class = i2c_class;
        chan->adapter.algo_data = &chan->algo;
        chan->adapter.dev.parent = &chan->par->pci_dev->dev;
        chan->algo.setsda = nvidia_gpio_setsda;
@@ -132,13 +134,13 @@ void nvidia_create_i2c_busses(struct nvidia_par *par)
        par->chan[2].par = par;
 
        par->chan[0].ddc_base = 0x36;
-       nvidia_setup_i2c_bus(&par->chan[0], "nvidia #0");
+       nvidia_setup_i2c_bus(&par->chan[0], "nvidia #0", I2C_CLASS_HWMON);
 
        par->chan[1].ddc_base = 0x3e;
-       nvidia_setup_i2c_bus(&par->chan[1], "nvidia #1");
+       nvidia_setup_i2c_bus(&par->chan[1], "nvidia #1", 0);
 
        par->chan[2].ddc_base = 0x50;
-       nvidia_setup_i2c_bus(&par->chan[2], "nvidia #2");
+       nvidia_setup_i2c_bus(&par->chan[2], "nvidia #2", 0);
 }
 
 void nvidia_delete_i2c_busses(struct nvidia_par *par)
index 0405e839ff939f5dc9e13d33f02dd4f1cd51ca06..ca9e7e81a9c5b9afc9be20acdc52d1e157ddfcad 100644 (file)
@@ -88,13 +88,15 @@ static int riva_gpio_getsda(void* data)
        return val;
 }
 
-static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name)
+static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name,
+                             unsigned int i2c_class)
 {
        int rc;
 
        strcpy(chan->adapter.name, name);
        chan->adapter.owner             = THIS_MODULE;
        chan->adapter.id                = I2C_HW_B_RIVA;
+       chan->adapter.class             = i2c_class;
        chan->adapter.algo_data         = &chan->algo;
        chan->adapter.dev.parent        = &chan->par->pdev->dev;
        chan->algo.setsda               = riva_gpio_setsda;
@@ -135,9 +137,9 @@ void riva_create_i2c_busses(struct riva_par *par)
        par->chan[0].ddc_base = 0x3e;
        par->chan[1].ddc_base = 0x36;
        par->chan[2].ddc_base = 0x50;
-       riva_setup_i2c_bus(&par->chan[0], "BUS1");
-       riva_setup_i2c_bus(&par->chan[1], "BUS2");
-       riva_setup_i2c_bus(&par->chan[2], "BUS3");
+       riva_setup_i2c_bus(&par->chan[0], "BUS1", 0);
+       riva_setup_i2c_bus(&par->chan[1], "BUS2", I2C_CLASS_HWMON);
+       riva_setup_i2c_bus(&par->chan[2], "BUS3", 0);
 }
 
 void riva_delete_i2c_busses(struct riva_par *par)