diff options
Diffstat (limited to 'drivers/video/via/viafbdev.c')
-rw-r--r-- | drivers/video/via/viafbdev.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index a13c258bd32f..6d5b64923236 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/stat.h> | 25 | #include <linux/stat.h> |
26 | #include <linux/via-core.h> | 26 | #include <linux/via-core.h> |
27 | #include <linux/via_i2c.h> | ||
27 | #include <asm/olpc.h> | 28 | #include <asm/olpc.h> |
28 | 29 | ||
29 | #define _MASTER_FILE | 30 | #define _MASTER_FILE |
@@ -1729,6 +1730,29 @@ static struct viafb_pm_hooks viafb_fb_pm_hooks = { | |||
1729 | 1730 | ||
1730 | #endif | 1731 | #endif |
1731 | 1732 | ||
1733 | static void __devinit i2c_bus_probe(struct viafb_shared *shared) | ||
1734 | { | ||
1735 | /* should be always CRT */ | ||
1736 | printk(KERN_INFO "viafb: Probing I2C bus 0x26\n"); | ||
1737 | shared->i2c_26 = via_aux_probe(viafb_find_i2c_adapter(VIA_PORT_26)); | ||
1738 | |||
1739 | /* seems to be usually DVP1 */ | ||
1740 | printk(KERN_INFO "viafb: Probing I2C bus 0x31\n"); | ||
1741 | shared->i2c_31 = via_aux_probe(viafb_find_i2c_adapter(VIA_PORT_31)); | ||
1742 | |||
1743 | /* FIXME: what is this? */ | ||
1744 | printk(KERN_INFO "viafb: Probing I2C bus 0x2C\n"); | ||
1745 | shared->i2c_2C = via_aux_probe(viafb_find_i2c_adapter(VIA_PORT_2C)); | ||
1746 | |||
1747 | printk(KERN_INFO "viafb: Finished I2C bus probing"); | ||
1748 | } | ||
1749 | |||
1750 | static void i2c_bus_free(struct viafb_shared *shared) | ||
1751 | { | ||
1752 | via_aux_free(shared->i2c_26); | ||
1753 | via_aux_free(shared->i2c_31); | ||
1754 | via_aux_free(shared->i2c_2C); | ||
1755 | } | ||
1732 | 1756 | ||
1733 | int __devinit via_fb_pci_probe(struct viafb_dev *vdev) | 1757 | int __devinit via_fb_pci_probe(struct viafb_dev *vdev) |
1734 | { | 1758 | { |
@@ -1762,6 +1786,7 @@ int __devinit via_fb_pci_probe(struct viafb_dev *vdev) | |||
1762 | &viaparinfo->shared->lvds_setting_info2; | 1786 | &viaparinfo->shared->lvds_setting_info2; |
1763 | viaparinfo->chip_info = &viaparinfo->shared->chip_info; | 1787 | viaparinfo->chip_info = &viaparinfo->shared->chip_info; |
1764 | 1788 | ||
1789 | i2c_bus_probe(viaparinfo->shared); | ||
1765 | if (viafb_dual_fb) | 1790 | if (viafb_dual_fb) |
1766 | viafb_SAMM_ON = 1; | 1791 | viafb_SAMM_ON = 1; |
1767 | parse_lcd_port(); | 1792 | parse_lcd_port(); |
@@ -1915,6 +1940,7 @@ out_fb1_release: | |||
1915 | if (viafbinfo1) | 1940 | if (viafbinfo1) |
1916 | framebuffer_release(viafbinfo1); | 1941 | framebuffer_release(viafbinfo1); |
1917 | out_fb_release: | 1942 | out_fb_release: |
1943 | i2c_bus_free(viaparinfo->shared); | ||
1918 | framebuffer_release(viafbinfo); | 1944 | framebuffer_release(viafbinfo); |
1919 | return rc; | 1945 | return rc; |
1920 | } | 1946 | } |
@@ -1927,6 +1953,7 @@ void __devexit via_fb_pci_remove(struct pci_dev *pdev) | |||
1927 | if (viafb_dual_fb) | 1953 | if (viafb_dual_fb) |
1928 | unregister_framebuffer(viafbinfo1); | 1954 | unregister_framebuffer(viafbinfo1); |
1929 | viafb_remove_proc(viaparinfo->shared); | 1955 | viafb_remove_proc(viaparinfo->shared); |
1956 | i2c_bus_free(viaparinfo->shared); | ||
1930 | framebuffer_release(viafbinfo); | 1957 | framebuffer_release(viafbinfo); |
1931 | if (viafb_dual_fb) | 1958 | if (viafb_dual_fb) |
1932 | framebuffer_release(viafbinfo1); | 1959 | framebuffer_release(viafbinfo1); |