^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * (c) 1998-2002 Petr Vandrovec <vandrove@vc.cvut.cz>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Version: 1.64 2002/06/10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * See matroxfb_base.c for contributors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include "matroxfb_base.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include "matroxfb_maven.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/i2c-algo-bit.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* MGA-TVO I2C for G200, G400 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define MAT_CLK 0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define MAT_DATA 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) /* primary head DDC for Mystique(?), G100, G200, G400 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define DDC1_CLK 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define DDC1_DATA 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /* primary head DDC for Millennium, Millennium II */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define DDC1B_CLK 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define DDC1B_DATA 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /* secondary head DDC for G400 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define DDC2_CLK 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define DDC2_DATA 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /******************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct matroxfb_dh_maven_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct i2c_bit_adapter maven;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct i2c_bit_adapter ddc1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct i2c_bit_adapter ddc2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) static int matroxfb_read_gpio(struct matrox_fb_info* minfo) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) int v;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) matroxfb_DAC_lock_irqsave(flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) v = matroxfb_DAC_in(minfo, DAC_XGENIODATA);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) matroxfb_DAC_unlock_irqrestore(flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) return v;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) static void matroxfb_set_gpio(struct matrox_fb_info* minfo, int mask, int val) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) int v;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) matroxfb_DAC_lock_irqsave(flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) v = (matroxfb_DAC_in(minfo, DAC_XGENIOCTRL) & mask) | val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) matroxfb_DAC_out(minfo, DAC_XGENIOCTRL, v);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) /* We must reset GENIODATA very often... XFree plays with this register */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) matroxfb_DAC_out(minfo, DAC_XGENIODATA, 0x00);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) matroxfb_DAC_unlock_irqrestore(flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /* software I2C functions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) static inline void matroxfb_i2c_set(struct matrox_fb_info* minfo, int mask, int state) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) if (state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) state = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) state = mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) matroxfb_set_gpio(minfo, ~mask, state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) static void matroxfb_gpio_setsda(void* data, int state) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) struct i2c_bit_adapter* b = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) matroxfb_i2c_set(b->minfo, b->mask.data, state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) static void matroxfb_gpio_setscl(void* data, int state) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) struct i2c_bit_adapter* b = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) matroxfb_i2c_set(b->minfo, b->mask.clock, state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) static int matroxfb_gpio_getsda(void* data) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) struct i2c_bit_adapter* b = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) return (matroxfb_read_gpio(b->minfo) & b->mask.data) ? 1 : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) static int matroxfb_gpio_getscl(void* data) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) struct i2c_bit_adapter* b = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) return (matroxfb_read_gpio(b->minfo) & b->mask.clock) ? 1 : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) static const struct i2c_algo_bit_data matrox_i2c_algo_template =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) .setsda = matroxfb_gpio_setsda,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) .setscl = matroxfb_gpio_setscl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) .getsda = matroxfb_gpio_getsda,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) .getscl = matroxfb_gpio_getscl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) .udelay = 10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) .timeout = 100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) unsigned int data, unsigned int clock, const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) int class)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) b->minfo = minfo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) b->mask.data = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) b->mask.clock = clock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) b->adapter.owner = THIS_MODULE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) snprintf(b->adapter.name, sizeof(b->adapter.name), name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) minfo->fbcon.node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) i2c_set_adapdata(&b->adapter, b);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) b->adapter.class = class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) b->adapter.algo_data = &b->bac;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) b->adapter.dev.parent = &minfo->pcidev->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) b->bac = matrox_i2c_algo_template;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) b->bac.data = b;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) err = i2c_bit_add_bus(&b->adapter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) b->initialized = !err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) static void i2c_bit_bus_del(struct i2c_bit_adapter* b) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) if (b->initialized) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) i2c_del_adapter(&b->adapter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) b->initialized = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) static inline void i2c_maven_done(struct matroxfb_dh_maven_info* minfo2) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) i2c_bit_bus_del(&minfo2->maven);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) static inline void i2c_ddc1_done(struct matroxfb_dh_maven_info* minfo2) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) i2c_bit_bus_del(&minfo2->ddc1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) static inline void i2c_ddc2_done(struct matroxfb_dh_maven_info* minfo2) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) i2c_bit_bus_del(&minfo2->ddc2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) struct matroxfb_dh_maven_info* m2info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) m2info = kzalloc(sizeof(*m2info), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) if (!m2info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) matroxfb_DAC_lock_irqsave(flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) matroxfb_DAC_out(minfo, DAC_XGENIODATA, 0xFF);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) matroxfb_DAC_out(minfo, DAC_XGENIOCTRL, 0x00);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) matroxfb_DAC_unlock_irqrestore(flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) switch (minfo->chip) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) case MGA_2064:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) case MGA_2164:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) err = i2c_bus_reg(&m2info->ddc1, minfo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) DDC1B_DATA, DDC1B_CLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) "DDC:fb%u #0", I2C_CLASS_DDC);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) err = i2c_bus_reg(&m2info->ddc1, minfo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) DDC1_DATA, DDC1_CLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) "DDC:fb%u #0", I2C_CLASS_DDC);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) goto fail_ddc1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) if (minfo->devflags.dualhead) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) err = i2c_bus_reg(&m2info->ddc2, minfo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) DDC2_DATA, DDC2_CLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) "DDC:fb%u #1", I2C_CLASS_DDC);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) if (err == -ENODEV) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) printk(KERN_INFO "i2c-matroxfb: VGA->TV plug detected, DDC unavailable.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) } else if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) printk(KERN_INFO "i2c-matroxfb: Could not register secondary output i2c bus. Continuing anyway.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) /* Register maven bus even on G450/G550 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) err = i2c_bus_reg(&m2info->maven, minfo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) MAT_DATA, MAT_CLK, "MAVEN:fb%u", 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) printk(KERN_INFO "i2c-matroxfb: Could not register Maven i2c bus. Continuing anyway.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) struct i2c_board_info maven_info = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) I2C_BOARD_INFO("maven", 0x1b),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) unsigned short const addr_list[2] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 0x1b, I2C_CLIENT_END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) i2c_new_scanned_device(&m2info->maven.adapter,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) &maven_info, addr_list, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) return m2info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) fail_ddc1:;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) kfree(m2info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) printk(KERN_ERR "i2c-matroxfb: Could not register primary adapter DDC bus.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) static void i2c_matroxfb_remove(struct matrox_fb_info* minfo, void* data) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) struct matroxfb_dh_maven_info* m2info = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) i2c_maven_done(m2info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) i2c_ddc2_done(m2info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) i2c_ddc1_done(m2info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) kfree(m2info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) static struct matroxfb_driver i2c_matroxfb = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) .node = LIST_HEAD_INIT(i2c_matroxfb.node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) .name = "i2c-matroxfb",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) .probe = i2c_matroxfb_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) .remove = i2c_matroxfb_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) static int __init i2c_matroxfb_init(void) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) if (matroxfb_register_driver(&i2c_matroxfb)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) printk(KERN_ERR "i2c-matroxfb: failed to register driver\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) return -ENXIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) static void __exit i2c_matroxfb_exit(void) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) matroxfb_unregister_driver(&i2c_matroxfb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) MODULE_AUTHOR("(c) 1999-2002 Petr Vandrovec <vandrove@vc.cvut.cz>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) MODULE_DESCRIPTION("Support module providing I2C buses present on Matrox videocards");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) module_init(i2c_matroxfb_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) module_exit(i2c_matroxfb_exit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) /* no __setup required */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) MODULE_LICENSE("GPL");