diff options
-rw-r--r-- | drivers/video/intelfb/intelfb.h | 1 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfb_i2c.c | 16 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 5 |
3 files changed, 22 insertions, 0 deletions
diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index 6ef38c90c4d6..abdadc2a1b47 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h | |||
@@ -367,6 +367,7 @@ extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var); | |||
367 | 367 | ||
368 | #ifdef CONFIG_FB_INTEL_I2C | 368 | #ifdef CONFIG_FB_INTEL_I2C |
369 | extern void intelfb_create_i2c_busses(struct intelfb_info *dinfo); | 369 | extern void intelfb_create_i2c_busses(struct intelfb_info *dinfo); |
370 | extern void intelfb_delete_i2c_busses(struct intelfb_info *dinfo); | ||
370 | #endif | 371 | #endif |
371 | 372 | ||
372 | #endif /* _INTELFB_H */ | 373 | #endif /* _INTELFB_H */ |
diff --git a/drivers/video/intelfb/intelfb_i2c.c b/drivers/video/intelfb/intelfb_i2c.c index d73572355c57..c1113d6e941d 100644 --- a/drivers/video/intelfb/intelfb_i2c.c +++ b/drivers/video/intelfb/intelfb_i2c.c | |||
@@ -182,3 +182,19 @@ void intelfb_create_i2c_busses(struct intelfb_info *dinfo) | |||
182 | } | 182 | } |
183 | dinfo->num_outputs = i; | 183 | dinfo->num_outputs = i; |
184 | } | 184 | } |
185 | |||
186 | void intelfb_delete_i2c_busses(struct intelfb_info *dinfo) | ||
187 | { | ||
188 | int i; | ||
189 | |||
190 | for (i = 0; i < MAX_OUTPUTS; i++) { | ||
191 | if (dinfo->output[i].i2c_bus.dinfo) { | ||
192 | i2c_bit_del_bus(&dinfo->output[i].i2c_bus.adapter); | ||
193 | dinfo->output[i].i2c_bus.dinfo = NULL; | ||
194 | } | ||
195 | if (dinfo->output[i].ddc_bus.dinfo) { | ||
196 | i2c_bit_del_bus(&dinfo->output[i].ddc_bus.adapter); | ||
197 | dinfo->output[i].ddc_bus.dinfo = NULL; | ||
198 | } | ||
199 | } | ||
200 | } | ||
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index f412b5ab8f98..f6e30b3d1081 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -474,6 +474,11 @@ cleanup(struct intelfb_info *dinfo) | |||
474 | agp_free_memory(dinfo->gtt_ring_mem); | 474 | agp_free_memory(dinfo->gtt_ring_mem); |
475 | } | 475 | } |
476 | 476 | ||
477 | #ifdef CONFIG_FB_INTEL_I2C | ||
478 | /* un-register I2C bus */ | ||
479 | intelfb_delete_i2c_busses(dinfo); | ||
480 | #endif | ||
481 | |||
477 | if (dinfo->mmio_base) | 482 | if (dinfo->mmio_base) |
478 | iounmap((void __iomem *)dinfo->mmio_base); | 483 | iounmap((void __iomem *)dinfo->mmio_base); |
479 | if (dinfo->aperture.virtual) | 484 | if (dinfo->aperture.virtual) |