22 #include <asm/types.h>
27 #include <linux/kernel.h>
28 #include <linux/module.h>
29 #include <linux/list.h>
33 #include <linux/slab.h>
35 #include <linux/pci.h>
38 #include "../w1_int.h"
39 #include "../w1_log.h"
43 MODULE_DESCRIPTION(
"Driver for transport(Dallas 1-wire prtocol) over VGA DDC(matrox gpio).");
54 static struct pci_driver matrox_w1_pci_driver = {
56 .id_table = matrox_w1_tbl,
57 .probe = matrox_w1_probe,
65 #define MATROX_G400_DDC_CLK (1<<4)
66 #define MATROX_G400_DDC_DATA (1<<1)
68 #define MATROX_BASE 0x3C00
69 #define MATROX_STATUS 0x1e14
71 #define MATROX_PORT_INDEX_OFFSET 0x00
72 #define MATROX_PORT_DATA_OFFSET 0x0A
74 #define MATROX_GET_CONTROL 0x2A
75 #define MATROX_GET_DATA 0x2B
76 #define MATROX_CURSOR_CTL 0x06
92 static u8 matrox_w1_read_ddc_bit(
void *);
93 static void matrox_w1_write_ddc_bit(
void *,
u8);
124 static void matrox_w1_write_ddc_bit(
void *
data,
u8 bit)
139 static u8 matrox_w1_read_ddc_bit(
void *data)
170 "%s: Failed to create new matrox_device object.\n",
176 dev->
bus_master = (
struct w1_bus_master *)(dev + 1);
186 dev_err(&pdev->
dev,
"%s: failed to ioremap(0x%lx, %d).\n",
189 goto err_out_free_device;
197 matrox_w1_hw_init(dev);
200 dev->
bus_master->read_bit = &matrox_w1_read_ddc_bit;
201 dev->
bus_master->write_bit = &matrox_w1_write_ddc_bit;
205 goto err_out_free_device;
207 pci_set_drvdata(pdev, dev);
211 dev_info(&pdev->
dev,
"Matrox G400 GPIO transport layer for 1-wire.\n");
236 static int __init matrox_w1_init(
void)
238 return pci_register_driver(&matrox_w1_pci_driver);
241 static void __exit matrox_w1_fini(
void)