Lines Matching +full:ddc +full:- +full:i2c +full:- +full:bus
1 // SPDX-License-Identifier: GPL-2.0-only
6 * (c) 1998-2002 Petr Vandrovec <vandrove@vc.cvut.cz>
16 #include <linux/i2c.h>
18 #include <linux/i2c-algo-bit.h>
20 /* MGA-TVO I2C for G200, G400 */
23 /* primary head DDC for Mystique(?), G100, G200, G400 */
26 /* primary head DDC for Millennium, Millennium II */
29 /* secondary head DDC for G400 */
63 /* software I2C functions */
74 matroxfb_i2c_set(b->minfo, b->mask.data, state); in matroxfb_gpio_setsda()
79 matroxfb_i2c_set(b->minfo, b->mask.clock, state); in matroxfb_gpio_setscl()
84 return (matroxfb_read_gpio(b->minfo) & b->mask.data) ? 1 : 0; in matroxfb_gpio_getsda()
89 return (matroxfb_read_gpio(b->minfo) & b->mask.clock) ? 1 : 0; in matroxfb_gpio_getscl()
107 b->minfo = minfo; in i2c_bus_reg()
108 b->mask.data = data; in i2c_bus_reg()
109 b->mask.clock = clock; in i2c_bus_reg()
110 b->adapter.owner = THIS_MODULE; in i2c_bus_reg()
111 snprintf(b->adapter.name, sizeof(b->adapter.name), name, in i2c_bus_reg()
112 minfo->fbcon.node); in i2c_bus_reg()
113 i2c_set_adapdata(&b->adapter, b); in i2c_bus_reg()
114 b->adapter.algo_data = &b->bac; in i2c_bus_reg()
115 b->adapter.dev.parent = &minfo->pcidev->dev; in i2c_bus_reg()
116 b->bac = matrox_i2c_algo_template; in i2c_bus_reg()
117 b->bac.data = b; in i2c_bus_reg()
118 err = i2c_bit_add_bus(&b->adapter); in i2c_bus_reg()
119 b->initialized = !err; in i2c_bus_reg()
124 if (b->initialized) { in i2c_bit_bus_del()
125 i2c_del_adapter(&b->adapter); in i2c_bit_bus_del()
126 b->initialized = 0; in i2c_bit_bus_del()
131 i2c_bit_bus_del(&minfo2->maven); in i2c_maven_done()
135 i2c_bit_bus_del(&minfo2->ddc1); in i2c_ddc1_done()
139 i2c_bit_bus_del(&minfo2->ddc2); in i2c_ddc2_done()
156 switch (minfo->chip) { in i2c_matroxfb_probe()
159 err = i2c_bus_reg(&m2info->ddc1, minfo, in i2c_matroxfb_probe()
161 "DDC:fb%u #0"); in i2c_matroxfb_probe()
164 err = i2c_bus_reg(&m2info->ddc1, minfo, in i2c_matroxfb_probe()
166 "DDC:fb%u #0"); in i2c_matroxfb_probe()
171 if (minfo->devflags.dualhead) { in i2c_matroxfb_probe()
172 err = i2c_bus_reg(&m2info->ddc2, minfo, DDC2_DATA, DDC2_CLK, "DDC:fb%u #1"); in i2c_matroxfb_probe()
173 if (err == -ENODEV) { in i2c_matroxfb_probe()
174 printk(KERN_INFO "i2c-matroxfb: VGA->TV plug detected, DDC unavailable.\n"); in i2c_matroxfb_probe()
176 …printk(KERN_INFO "i2c-matroxfb: Could not register secondary output i2c bus. Continuing anyway.\n"… in i2c_matroxfb_probe()
177 /* Register maven bus even on G450/G550 */ in i2c_matroxfb_probe()
178 err = i2c_bus_reg(&m2info->maven, minfo, MAT_DATA, MAT_CLK, "MAVEN:fb%u"); in i2c_matroxfb_probe()
180 printk(KERN_INFO "i2c-matroxfb: Could not register Maven i2c bus. Continuing anyway.\n"); in i2c_matroxfb_probe()
189 i2c_new_scanned_device(&m2info->maven.adapter, in i2c_matroxfb_probe()
196 printk(KERN_ERR "i2c-matroxfb: Could not register primary adapter DDC bus.\n"); in i2c_matroxfb_probe()
211 .name = "i2c-matroxfb",
218 printk(KERN_ERR "i2c-matroxfb: failed to register driver\n"); in i2c_matroxfb_init()
219 return -ENXIO; in i2c_matroxfb_init()
228 MODULE_AUTHOR("(c) 1999-2002 Petr Vandrovec <vandrove@vc.cvut.cz>");
229 MODULE_DESCRIPTION("Support module providing I2C buses present on Matrox videocards");