Lines Matching defs:sc
67 struct dwiic_softc *sc = &fsc->sc_sc;
74 sc->sc_iot = faa->fa_iot;
76 if (bus_space_map(sc->sc_iot, faa->fa_reg[0].addr,
77 faa->fa_reg[0].size, 0, &sc->sc_ioh)) {
88 if (dwiic_init(sc)) {
90 bus_space_unmap(sc->sc_iot, sc->sc_ioh, faa->fa_reg[0].size);
95 dwiic_write(sc, DW_IC_INTR_MASK, 0);
96 dwiic_enable(sc, 0);
97 dwiic_read(sc, DW_IC_CLR_INTR);
99 sc->sc_ih = fdt_intr_establish(faa->fa_node, IPL_BIO,
100 dwiic_intr, sc, sc->sc_dev.dv_xname);
104 rw_init(&sc->sc_i2c_lock, "dwiic");
106 sc->sc_i2c_tag.ic_cookie = sc;
107 sc->sc_i2c_tag.ic_acquire_bus = dwiic_i2c_acquire_bus;
108 sc->sc_i2c_tag.ic_release_bus = dwiic_i2c_release_bus;
109 sc->sc_i2c_tag.ic_exec = dwiic_i2c_exec;
113 iba.iba_tag = &sc->sc_i2c_tag;
116 config_found(&sc->sc_dev, &iba, iicbus_print);
122 struct dwiic_softc *sc = &fsc->sc_sc;
134 sc->sda_hold_time = round_closest(freq * sda_hold, 1000000000);
137 sc->ss_hcnt = round_closest(freq * (4000 + sda_fall), 1000000000) - 3;
138 sc->ss_lcnt = round_closest(freq * (4700 + scl_fall), 1000000000) - 1;
140 sc->fs_hcnt = round_closest(freq * (600 + sda_fall), 1000000000) - 3;
141 sc->fs_lcnt = round_closest(freq * (1300 + scl_fall), 1000000000) - 1;