/* * Serial bus line handling * * serial communications register as parameter in private data * * TODO: locks with other code sections accessing video registers? */ static void bit_s3via_setscl(void *bus, int val) { struct s_i2c_bus *p = (struct s_i2c_bus *)bus; unsigned int r; SET_CR_IX(p, p->i2c_reg); r = GET_CR_DATA(p); r |= I2C_ENAB; if (val) { r |= I2C_SCL_OUT; } else { r &= ~I2C_SCL_OUT; } SET_CR_DATA(p, r); }
static void prosavage_gpio_setscl(void* data, int val) { struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; u32 r; SET_CR_IX(chan->ioaddr, chan->reg); r = GET_CR_DATA(chan->ioaddr); r |= PROSAVAGE_I2C_ENAB; if (val) { r |= PROSAVAGE_I2C_SCL_OUT; } else { r &= ~PROSAVAGE_I2C_SCL_OUT; } SET_CR_DATA(chan->ioaddr, r); }