fix filenames
[AROS.git] / workbench / hidds / radeon / ati_i2c.c
blob071bfc2e08cb3d7dc45974e958cb6a908bfa6858
1 /*
2 Copyright © 2004, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "ati.h"
7 #include "radeon.h"
8 #include "radeon_reg.h"
9 #include "radeon_macros.h"
11 #include <aros/symbolsets.h>
12 #include <aros/debug.h>
13 #include <proto/exec.h>
15 #include <hidd/i2c.h>
17 void METHOD(ATII2C, Hidd_I2C, PutBits)
19 struct ati_staticdata *sd = SD(cl);
20 ULONG val;
22 val = INREG(sd->Card.DDCReg) & (ULONG)~(RADEON_GPIO_EN_0 | RADEON_GPIO_EN_1);
23 val |= (msg->scl ? 0:RADEON_GPIO_EN_1);
24 val |= (msg->sda ? 0:RADEON_GPIO_EN_0);
25 OUTREG(sd->Card.DDCReg, val);
26 val = INREG(sd->Card.DDCReg);
29 void METHOD(ATII2C, Hidd_I2C, GetBits)
31 struct ati_staticdata *sd = SD(cl);
33 ULONG val = INREG(sd->Card.DDCReg);
34 *msg->sda = (val & RADEON_GPIO_Y_0) != 0;
35 *msg->scl = (val & RADEON_GPIO_Y_1) != 0;
38 ADD2LIBS((STRPTR)"i2c.hidd", 0, static struct Library *, I2CBase);