]> err.no Git - linux-2.6/commitdiff
intelfb: add preliminary i2c support
authorDennis Munsie <dmunsie@cecropia.com>
Tue, 20 Jun 2006 18:55:55 +0000 (14:55 -0400)
committerDave Airlie <airlied@linux.ie>
Mon, 3 Jul 2006 09:04:37 +0000 (19:04 +1000)
Adds code to unregister the I2C buses in the cleanup function.

Signed-off-by: Dennis Munsie <dmunsie@cecropia.com>
drivers/video/intelfb/intelfb.h
drivers/video/intelfb/intelfb_i2c.c
drivers/video/intelfb/intelfbdrv.c

index 6ef38c90c4d62aa363b3c7931bbf37e547523fb4..abdadc2a1b4796fa71b105f04fb9010a0b97277e 100644 (file)
@@ -367,6 +367,7 @@ extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var);
 
 #ifdef CONFIG_FB_INTEL_I2C
 extern void intelfb_create_i2c_busses(struct intelfb_info *dinfo);
+extern void intelfb_delete_i2c_busses(struct intelfb_info *dinfo);
 #endif
 
 #endif /* _INTELFB_H */
index d73572355c575379951b8f03596d3829cd90d8cd..c1113d6e941d2670e6aa29ab8900a356252699de 100644 (file)
@@ -182,3 +182,19 @@ void intelfb_create_i2c_busses(struct intelfb_info *dinfo)
        }
        dinfo->num_outputs = i;
 }
+
+void intelfb_delete_i2c_busses(struct intelfb_info *dinfo)
+{
+       int i;
+
+       for (i = 0; i < MAX_OUTPUTS; i++) {
+               if (dinfo->output[i].i2c_bus.dinfo) {
+                       i2c_bit_del_bus(&dinfo->output[i].i2c_bus.adapter);
+                       dinfo->output[i].i2c_bus.dinfo = NULL;
+               }
+               if (dinfo->output[i].ddc_bus.dinfo) {
+                       i2c_bit_del_bus(&dinfo->output[i].ddc_bus.adapter);
+                       dinfo->output[i].ddc_bus.dinfo = NULL;
+               }
+       }
+}
index f412b5ab8f982220f342c0b44fe11235a92fcc2d..f6e30b3d1081ac70bc006a32f2ac522e36964def 100644 (file)
@@ -474,6 +474,11 @@ cleanup(struct intelfb_info *dinfo)
                agp_free_memory(dinfo->gtt_ring_mem);
        }
 
+#ifdef CONFIG_FB_INTEL_I2C
+       /* un-register I2C bus */
+       intelfb_delete_i2c_busses(dinfo);
+#endif
+
        if (dinfo->mmio_base)
                iounmap((void __iomem *)dinfo->mmio_base);
        if (dinfo->aperture.virtual)