aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr>2007-05-08 03:38:15 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:28 -0400
commit1e73db2536695ef95458b0043234456eb42a8962 (patch)
tree54554296395d0edd8b39b5595571b88b378e62eb
parent70802c60379fb843c485dfd4cab9e8f527d8fe81 (diff)
rivafb/nvidiafb: Enable hardware monitoring
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>
-rw-r--r--drivers/video/nvidia/nv_i2c.c10
-rw-r--r--drivers/video/riva/rivafb-i2c.c10
2 files changed, 12 insertions, 8 deletions
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
index bcde013d0b98..badc1a6c4357 100644
--- a/drivers/video/nvidia/nv_i2c.c
+++ b/drivers/video/nvidia/nv_i2c.c
@@ -86,13 +86,15 @@ static int nvidia_gpio_getsda(void *data)
86 return val; 86 return val;
87} 87}
88 88
89static int nvidia_setup_i2c_bus(struct nvidia_i2c_chan *chan, const char *name) 89static int nvidia_setup_i2c_bus(struct nvidia_i2c_chan *chan, const char *name,
90 unsigned int i2c_class)
90{ 91{
91 int rc; 92 int rc;
92 93
93 strcpy(chan->adapter.name, name); 94 strcpy(chan->adapter.name, name);
94 chan->adapter.owner = THIS_MODULE; 95 chan->adapter.owner = THIS_MODULE;
95 chan->adapter.id = I2C_HW_B_NVIDIA; 96 chan->adapter.id = I2C_HW_B_NVIDIA;
97 chan->adapter.class = i2c_class;
96 chan->adapter.algo_data = &chan->algo; 98 chan->adapter.algo_data = &chan->algo;
97 chan->adapter.dev.parent = &chan->par->pci_dev->dev; 99 chan->adapter.dev.parent = &chan->par->pci_dev->dev;
98 chan->algo.setsda = nvidia_gpio_setsda; 100 chan->algo.setsda = nvidia_gpio_setsda;
@@ -132,13 +134,13 @@ void nvidia_create_i2c_busses(struct nvidia_par *par)
132 par->chan[2].par = par; 134 par->chan[2].par = par;
133 135
134 par->chan[0].ddc_base = 0x36; 136 par->chan[0].ddc_base = 0x36;
135 nvidia_setup_i2c_bus(&par->chan[0], "nvidia #0"); 137 nvidia_setup_i2c_bus(&par->chan[0], "nvidia #0", I2C_CLASS_HWMON);
136 138
137 par->chan[1].ddc_base = 0x3e; 139 par->chan[1].ddc_base = 0x3e;
138 nvidia_setup_i2c_bus(&par->chan[1], "nvidia #1"); 140 nvidia_setup_i2c_bus(&par->chan[1], "nvidia #1", 0);
139 141
140 par->chan[2].ddc_base = 0x50; 142 par->chan[2].ddc_base = 0x50;
141 nvidia_setup_i2c_bus(&par->chan[2], "nvidia #2"); 143 nvidia_setup_i2c_bus(&par->chan[2], "nvidia #2", 0);
142} 144}
143 145
144void nvidia_delete_i2c_busses(struct nvidia_par *par) 146void nvidia_delete_i2c_busses(struct nvidia_par *par)
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c
index 0405e839ff93..ca9e7e81a9c5 100644
--- a/drivers/video/riva/rivafb-i2c.c
+++ b/drivers/video/riva/rivafb-i2c.c
@@ -88,13 +88,15 @@ static int riva_gpio_getsda(void* data)
88 return val; 88 return val;
89} 89}
90 90
91static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name) 91static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name,
92 unsigned int i2c_class)
92{ 93{
93 int rc; 94 int rc;
94 95
95 strcpy(chan->adapter.name, name); 96 strcpy(chan->adapter.name, name);
96 chan->adapter.owner = THIS_MODULE; 97 chan->adapter.owner = THIS_MODULE;
97 chan->adapter.id = I2C_HW_B_RIVA; 98 chan->adapter.id = I2C_HW_B_RIVA;
99 chan->adapter.class = i2c_class;
98 chan->adapter.algo_data = &chan->algo; 100 chan->adapter.algo_data = &chan->algo;
99 chan->adapter.dev.parent = &chan->par->pdev->dev; 101 chan->adapter.dev.parent = &chan->par->pdev->dev;
100 chan->algo.setsda = riva_gpio_setsda; 102 chan->algo.setsda = riva_gpio_setsda;
@@ -135,9 +137,9 @@ void riva_create_i2c_busses(struct riva_par *par)
135 par->chan[0].ddc_base = 0x3e; 137 par->chan[0].ddc_base = 0x3e;
136 par->chan[1].ddc_base = 0x36; 138 par->chan[1].ddc_base = 0x36;
137 par->chan[2].ddc_base = 0x50; 139 par->chan[2].ddc_base = 0x50;
138 riva_setup_i2c_bus(&par->chan[0], "BUS1"); 140 riva_setup_i2c_bus(&par->chan[0], "BUS1", 0);
139 riva_setup_i2c_bus(&par->chan[1], "BUS2"); 141 riva_setup_i2c_bus(&par->chan[1], "BUS2", I2C_CLASS_HWMON);
140 riva_setup_i2c_bus(&par->chan[2], "BUS3"); 142 riva_setup_i2c_bus(&par->chan[2], "BUS3", 0);
141} 143}
142 144
143void riva_delete_i2c_busses(struct riva_par *par) 145void riva_delete_i2c_busses(struct riva_par *par)