Lines Matching refs:state

66 	u8 state;
164 } state;
212 static u16 sdtx_translate_base_state(struct sdtx_device *ddev, u8 state)
214 switch (state) {
225 dev_err(ddev->dev, "unknown base state: %#04x\n", state);
226 return SDTX_UNKNOWN(state);
294 info.state = sdtx_translate_base_state(ddev, raw.state);
572 * events, then check and validate the device mode against the base state and
663 /* If state has not changed: do not send new event. */
664 if (ddev->state.base.state == in->data[0] &&
665 ddev->state.base.base_id == in->data[1])
668 ddev->state.base.state = in->data[0];
669 ddev->state.base.base_id = in->data[1];
673 event.base.v.state = sdtx_translate_base_state(ddev, in->data[0]);
691 /* If state has not changed: do not send new event. */
692 if (ddev->state.latch_status == in->data[0])
695 ddev->state.latch_status = in->data[0];
754 * makes sense for the given base state and try again later if it
757 if (sdtx_device_mode_invalid(mode, base.state)) {
767 if (ddev->state.device_mode == mode) {
772 ddev->state.device_mode = mode;
802 if (ddev->state.base.state == info.state &&
803 ddev->state.base.base_id == info.base_id)
806 ddev->state.base = info;
810 event.v.state = sdtx_translate_base_state(ddev, info.state);
823 * Note: This function must be called after updating the base state
825 * base state value in the validity check below.
830 if (sdtx_device_mode_invalid(mode, ddev->state.base.state)) {
837 if (ddev->state.device_mode == mode)
840 ddev->state.device_mode = mode;
863 if (ddev->state.latch_status == status)
866 ddev->state.latch_status = status;
888 * Ensure that the state gets marked as dirty before continuing to
891 * bits if an event is received while updating the state here.
897 dev_err(ddev->dev, "failed to get base state: %d\n", status);
917 * received, updating this state. The queried state may thus be out of
918 * date. At this point, we can safely assume that the state provided
976 * Get current device state. We want to guarantee that events are only
977 * sent when state actually changes. Thus we cannot use special
979 * querying the state in surface_dtx_pm_complete(). I.e. we would not
980 * be able to detect state changes there if no change event has been
984 * notifier, as that may access the state values.
986 status = ssam_retry(ssam_bas_get_base, ddev->ctrl, &ddev->state.base);
990 status = ssam_retry(ssam_bas_get_device_mode, ddev->ctrl, &ddev->state.device_mode);
994 status = ssam_retry(ssam_bas_get_latch_status, ddev->ctrl, &ddev->state.latch_status);
1008 tablet_mode = (ddev->state.device_mode != SDTX_DEVICE_MODE_LAPTOP);
1029 * Update device state in case it has changed between getting the
1124 * display-off state) and release them when resumed (i.e. transitioned
1125 * to display-on state). During hibernation, however, the EC will be
1130 * To prevent any problems, we update the device state here. We do
1135 * update the state.