Lines Matching +full:ddc +full:- +full:i2c
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()
108 b->minfo = minfo; in i2c_bus_reg()
109 b->mask.data = data; in i2c_bus_reg()
110 b->mask.clock = clock; in i2c_bus_reg()
111 b->adapter.owner = THIS_MODULE; in i2c_bus_reg()
112 snprintf(b->adapter.name, sizeof(b->adapter.name), name, in i2c_bus_reg()
113 minfo->fbcon.node); in i2c_bus_reg()
114 i2c_set_adapdata(&b->adapter, b); in i2c_bus_reg()
115 b->adapter.class = class; in i2c_bus_reg()
116 b->adapter.algo_data = &b->bac; in i2c_bus_reg()
117 b->adapter.dev.parent = &minfo->pcidev->dev; in i2c_bus_reg()
118 b->bac = matrox_i2c_algo_template; in i2c_bus_reg()
119 b->bac.data = b; in i2c_bus_reg()
120 err = i2c_bit_add_bus(&b->adapter); in i2c_bus_reg()
121 b->initialized = !err; in i2c_bus_reg()
126 if (b->initialized) { in i2c_bit_bus_del()
127 i2c_del_adapter(&b->adapter); in i2c_bit_bus_del()
128 b->initialized = 0; in i2c_bit_bus_del()
133 i2c_bit_bus_del(&minfo2->maven); in i2c_maven_done()
137 i2c_bit_bus_del(&minfo2->ddc1); in i2c_ddc1_done()
141 i2c_bit_bus_del(&minfo2->ddc2); in i2c_ddc2_done()
158 switch (minfo->chip) { in i2c_matroxfb_probe()
161 err = i2c_bus_reg(&m2info->ddc1, minfo, in i2c_matroxfb_probe()
163 "DDC:fb%u #0", I2C_CLASS_DDC); in i2c_matroxfb_probe()
166 err = i2c_bus_reg(&m2info->ddc1, minfo, in i2c_matroxfb_probe()
168 "DDC:fb%u #0", I2C_CLASS_DDC); in i2c_matroxfb_probe()
173 if (minfo->devflags.dualhead) { in i2c_matroxfb_probe()
174 err = i2c_bus_reg(&m2info->ddc2, minfo, in i2c_matroxfb_probe()
176 "DDC:fb%u #1", I2C_CLASS_DDC); in i2c_matroxfb_probe()
177 if (err == -ENODEV) { in i2c_matroxfb_probe()
178 printk(KERN_INFO "i2c-matroxfb: VGA->TV plug detected, DDC unavailable.\n"); in i2c_matroxfb_probe()
180 …printk(KERN_INFO "i2c-matroxfb: Could not register secondary output i2c bus. Continuing anyway.\n"… in i2c_matroxfb_probe()
182 err = i2c_bus_reg(&m2info->maven, minfo, in i2c_matroxfb_probe()
185 printk(KERN_INFO "i2c-matroxfb: Could not register Maven i2c bus. Continuing anyway.\n"); in i2c_matroxfb_probe()
194 i2c_new_scanned_device(&m2info->maven.adapter, in i2c_matroxfb_probe()
201 printk(KERN_ERR "i2c-matroxfb: Could not register primary adapter DDC bus.\n"); in i2c_matroxfb_probe()
216 .name = "i2c-matroxfb",
223 printk(KERN_ERR "i2c-matroxfb: failed to register driver\n"); in i2c_matroxfb_init()
224 return -ENXIO; in i2c_matroxfb_init()
233 MODULE_AUTHOR("(c) 1999-2002 Petr Vandrovec <vandrove@vc.cvut.cz>");
234 MODULE_DESCRIPTION("Support module providing I2C buses present on Matrox videocards");