static void bit_hydra_setsda(void *data, int state) { u32 val = pdregr(); if (state) val &= ~HYDRA_SDAT_OE; else { val &= ~HYDRA_SDAT; val |= HYDRA_SDAT_OE; } pdregw(val); pdregr(); /* flush posted write */ }
static void bit_hydra_setscl(void *data, int state) { u32 val = pdregr(); if (state) val &= ~HYDRA_SCLK_OE; else { val &= ~HYDRA_SCLK; val |= HYDRA_SCLK_OE; } pdregw(val); }
static int bit_hydra_getsda(void *data) { return (pdregr() & HYDRA_SDAT) != 0; }
static int bit_hydra_getscl(void *data) { return (pdregr() & HYDRA_SCLK) != 0; }