* [PATCH 2.6.17-rc6-mm2 8/8] intelfb: RESEND - add preliminary i2c support
@ 2006-06-20 18:55 Dennis Munsie
0 siblings, 0 replies; only message in thread
From: Dennis Munsie @ 2006-06-20 18:55 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: ehustvedt, airlied
From: Dennis Munsie <dmunsie@cecropia.com>
Adds code to unregister the I2C buses in the cleanup function.
Signed-off-by: Dennis Munsie <dmunsie@cecropia.com>
---
drivers/video/intelfb/intelfb.h | 1 +
drivers/video/intelfb/intelfb_i2c.c | 16 ++++++++++++++++
drivers/video/intelfb/intelfbdrv.c | 5 +++++
3 files changed, 22 insertions(+)
diff -Naurp -X linux-2.6.17-rc6-patched/Documentation/dontdiff linux-2.6.17-rc6-patched/drivers/video/intelfb/intelfb.h linux/drivers/video/intelfb/intelfb.h
--- linux-2.6.17-rc6-patched/drivers/video/intelfb/intelfb.h 2006-06-14 15:27:30.000000000 -0500
+++ linux/drivers/video/intelfb/intelfb.h 2006-06-16 08:38:25.000000000 -0500
@@ -367,6 +367,7 @@ extern int intelfb_var_to_depth(const st
#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 */
diff -Naurp -X linux-2.6.17-rc6-patched/Documentation/dontdiff linux-2.6.17-rc6-patched/drivers/video/intelfb/intelfb_i2c.c linux/drivers/video/intelfb/intelfb_i2c.c
--- linux-2.6.17-rc6-patched/drivers/video/intelfb/intelfb_i2c.c 2006-06-14 15:27:30.000000000 -0500
+++ linux/drivers/video/intelfb/intelfb_i2c.c 2006-06-16 08:36:58.000000000 -0500
@@ -182,3 +182,19 @@ void intelfb_create_i2c_busses(struct in
}
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;
+ }
+ }
+}
diff -Naurp -X linux-2.6.17-rc6-patched/Documentation/dontdiff linux-2.6.17-rc6-patched/drivers/video/intelfb/intelfbdrv.c linux/drivers/video/intelfb/intelfbdrv.c
--- linux-2.6.17-rc6-patched/drivers/video/intelfb/intelfbdrv.c 2006-06-14 15:27:30.000000000 -0500
+++ linux/drivers/video/intelfb/intelfbdrv.c 2006-06-16 08:47:31.000000000 -0500
@@ -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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-06-20 18:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-20 18:55 [PATCH 2.6.17-rc6-mm2 8/8] intelfb: RESEND - add preliminary i2c support Dennis Munsie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).