Lines Matching defs:sc

64 	struct cros_ec_softc *sc = (struct cros_ec_softc *)self;
67 sc->sc_tag = ia->ia_tag;
68 sc->sc_addr = ia->ia_addr;
72 if (cros_ec_check_version(sc)) {
77 if (cros_ec_init_keyboard(sc)) {
84 cros_ec_check_version(struct cros_ec_softc *sc)
89 sc->cmd_version_is_supported = 1;
90 if (cros_ec_command_inptr(sc, EC_CMD_HELLO, 0, &req, sizeof(req),
93 sc->cmd_version_is_supported = 1;
103 cros_ec_i2c_command(struct cros_ec_softc *sc, uint8_t cmd, int cmd_version,
107 uint8_t *ptr = sc->out;
108 uint8_t *inptr = sc->in;
111 if (!sc->cmd_version_is_supported) {
129 if (sc->cmd_version_is_supported)
131 cros_ec_calc_checksum(sc->out, out_len + 3);
133 iic_acquire_bus(sc->sc_tag, 0);
134 ret = iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP,
135 sc->sc_addr, NULL, 0, &sc->out, out_bytes, 0);
138 iic_release_bus(sc->sc_tag, 0);
142 ret = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,
143 sc->sc_addr, NULL, 0, inptr, in_bytes, 0);
146 iic_release_bus(sc->sc_tag, 0);
150 iic_release_bus(sc->sc_tag, 0);
157 if (sc->cmd_version_is_supported) {
161 if (len > sizeof(sc->in)) {
173 *in = sc->in + sizeof(uint64_t);
179 cros_ec_send_command(struct cros_ec_softc *sc, uint8_t cmd, int cmd_version,
182 return cros_ec_i2c_command(sc, cmd, cmd_version,
187 cros_ec_command(struct cros_ec_softc *sc, uint8_t cmd,
193 len = cros_ec_command_inptr(sc, cmd, cmd_version, out, out_len,
206 cros_ec_command_inptr(struct cros_ec_softc *sc, uint8_t cmd,
212 len = cros_ec_send_command(sc, cmd, cmd_version,
223 ret = cros_ec_send_command(sc, EC_CMD_GET_COMMS_STATUS, 0,
234 len = cros_ec_send_command(sc, EC_CMD_RESEND_RESPONSE, 0,
255 cros_ec_scan_keyboard(struct cros_ec_softc *sc, uint8_t *scan, int len)
257 if (cros_ec_command(sc, EC_CMD_CROS_EC_STATE, 0, NULL, 0, scan,
265 cros_ec_info(struct cros_ec_softc *sc, struct ec_response_cros_ec_info *info)
267 if (cros_ec_command(sc, EC_CMD_CROS_EC_INFO, 0, NULL, 0, info,