Commit 92b53939 authored by Nicolas Boichat's avatar Nicolas Boichat Committed by Linus Torvalds

[PATCH] Rivafb I2C fixes

The I2C busses opened by rivafb were deleted immediately after reading the
EDID, but they should be kept open, so user-space applications can use them.

They are now deleted when the driver is unloaded.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1d59c3b9
...@@ -1876,7 +1876,6 @@ static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev) ...@@ -1876,7 +1876,6 @@ static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
#ifdef CONFIG_FB_RIVA_I2C #ifdef CONFIG_FB_RIVA_I2C
par = (struct riva_par *) info->par; par = (struct riva_par *) info->par;
riva_create_i2c_busses(par);
for (i = par->bus; i >= 1; i--) { for (i = par->bus; i >= 1; i--) {
riva_probe_i2c_connector(par, i, &par->EDID); riva_probe_i2c_connector(par, i, &par->EDID);
if (par->EDID) { if (par->EDID) {
...@@ -1884,7 +1883,6 @@ static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev) ...@@ -1884,7 +1883,6 @@ static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
break; break;
} }
} }
riva_delete_i2c_busses(par);
#endif #endif
#endif #endif
NVTRACE_LEAVE(); NVTRACE_LEAVE();
...@@ -2038,6 +2036,10 @@ static int __devinit rivafb_probe(struct pci_dev *pd, ...@@ -2038,6 +2036,10 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
} }
#endif /* CONFIG_MTRR */ #endif /* CONFIG_MTRR */
#ifdef CONFIG_FB_RIVA_I2C
riva_create_i2c_busses((struct riva_par *) info->par);
#endif
info->fbops = &riva_fb_ops; info->fbops = &riva_fb_ops;
info->fix = rivafb_fix; info->fix = rivafb_fix;
riva_get_EDID(info, pd); riva_get_EDID(info, pd);
...@@ -2072,6 +2074,9 @@ static int __devinit rivafb_probe(struct pci_dev *pd, ...@@ -2072,6 +2074,9 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
return 0; return 0;
err_out_iounmap_fb: err_out_iounmap_fb:
#ifdef CONFIG_FB_RIVA_I2C
riva_delete_i2c_busses((struct riva_par *) info->par);
#endif
iounmap(info->screen_base); iounmap(info->screen_base);
err_out_free_base1: err_out_free_base1:
if (default_par->riva.Architecture == NV_ARCH_03) if (default_par->riva.Architecture == NV_ARCH_03)
...@@ -2101,6 +2106,10 @@ static void __exit rivafb_remove(struct pci_dev *pd) ...@@ -2101,6 +2106,10 @@ static void __exit rivafb_remove(struct pci_dev *pd)
if (!info) if (!info)
return; return;
#ifdef CONFIG_FB_RIVA_I2C
riva_delete_i2c_busses(par);
#endif
unregister_framebuffer(info); unregister_framebuffer(info);
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
if (par->mtrr.vram_valid) if (par->mtrr.vram_valid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment