Lines Matching refs:ced

101 	struct clock_event_device ced;  member
530 if (clockevent_state_oneshot(&ch->ced)) { in sh_cmt_interrupt()
535 ch->ced.event_handler(&ch->ced); in sh_cmt_interrupt()
546 if ((clockevent_state_shutdown(&ch->ced)) in sh_cmt_interrupt()
693 static struct sh_cmt_channel *ced_to_sh_cmt(struct clock_event_device *ced) in ced_to_sh_cmt() argument
695 return container_of(ced, struct sh_cmt_channel, ced); in ced_to_sh_cmt()
708 static int sh_cmt_clock_event_shutdown(struct clock_event_device *ced) in sh_cmt_clock_event_shutdown() argument
710 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_shutdown()
716 static int sh_cmt_clock_event_set_state(struct clock_event_device *ced, in sh_cmt_clock_event_set_state() argument
719 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_set_state()
722 if (clockevent_state_oneshot(ced) || clockevent_state_periodic(ced)) in sh_cmt_clock_event_set_state()
731 static int sh_cmt_clock_event_set_oneshot(struct clock_event_device *ced) in sh_cmt_clock_event_set_oneshot() argument
733 return sh_cmt_clock_event_set_state(ced, 0); in sh_cmt_clock_event_set_oneshot()
736 static int sh_cmt_clock_event_set_periodic(struct clock_event_device *ced) in sh_cmt_clock_event_set_periodic() argument
738 return sh_cmt_clock_event_set_state(ced, 1); in sh_cmt_clock_event_set_periodic()
742 struct clock_event_device *ced) in sh_cmt_clock_event_next() argument
744 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_next()
746 BUG_ON(!clockevent_state_oneshot(ced)); in sh_cmt_clock_event_next()
755 static void sh_cmt_clock_event_suspend(struct clock_event_device *ced) in sh_cmt_clock_event_suspend() argument
757 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_suspend()
763 static void sh_cmt_clock_event_resume(struct clock_event_device *ced) in sh_cmt_clock_event_resume() argument
765 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_resume()
774 struct clock_event_device *ced = &ch->ced; in sh_cmt_register_clockevent() local
791 ced->name = name; in sh_cmt_register_clockevent()
792 ced->features = CLOCK_EVT_FEAT_PERIODIC; in sh_cmt_register_clockevent()
793 ced->features |= CLOCK_EVT_FEAT_ONESHOT; in sh_cmt_register_clockevent()
794 ced->rating = 125; in sh_cmt_register_clockevent()
795 ced->cpumask = cpu_possible_mask; in sh_cmt_register_clockevent()
796 ced->set_next_event = sh_cmt_clock_event_next; in sh_cmt_register_clockevent()
797 ced->set_state_shutdown = sh_cmt_clock_event_shutdown; in sh_cmt_register_clockevent()
798 ced->set_state_periodic = sh_cmt_clock_event_set_periodic; in sh_cmt_register_clockevent()
799 ced->set_state_oneshot = sh_cmt_clock_event_set_oneshot; in sh_cmt_register_clockevent()
800 ced->suspend = sh_cmt_clock_event_suspend; in sh_cmt_register_clockevent()
801 ced->resume = sh_cmt_clock_event_resume; in sh_cmt_register_clockevent()
804 ced->shift = 32; in sh_cmt_register_clockevent()
805 ced->mult = div_sc(ch->cmt->rate, NSEC_PER_SEC, ced->shift); in sh_cmt_register_clockevent()
806 ced->max_delta_ns = clockevent_delta2ns(ch->max_match_value, ced); in sh_cmt_register_clockevent()
807 ced->max_delta_ticks = ch->max_match_value; in sh_cmt_register_clockevent()
808 ced->min_delta_ns = clockevent_delta2ns(0x1f, ced); in sh_cmt_register_clockevent()
809 ced->min_delta_ticks = 0x1f; in sh_cmt_register_clockevent()
813 clockevents_register_device(ced); in sh_cmt_register_clockevent()