Lines Matching refs:ced
106 struct clock_event_device ced; member
551 if (clockevent_state_oneshot(&ch->ced)) { in sh_cmt_interrupt()
556 ch->ced.event_handler(&ch->ced); in sh_cmt_interrupt()
567 if ((clockevent_state_shutdown(&ch->ced)) in sh_cmt_interrupt()
732 static struct sh_cmt_channel *ced_to_sh_cmt(struct clock_event_device *ced) in ced_to_sh_cmt() argument
734 return container_of(ced, struct sh_cmt_channel, ced); in ced_to_sh_cmt()
747 static int sh_cmt_clock_event_shutdown(struct clock_event_device *ced) in sh_cmt_clock_event_shutdown() argument
749 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_shutdown()
755 static int sh_cmt_clock_event_set_state(struct clock_event_device *ced, in sh_cmt_clock_event_set_state() argument
758 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_set_state()
761 if (clockevent_state_oneshot(ced) || clockevent_state_periodic(ced)) in sh_cmt_clock_event_set_state()
770 static int sh_cmt_clock_event_set_oneshot(struct clock_event_device *ced) in sh_cmt_clock_event_set_oneshot() argument
772 return sh_cmt_clock_event_set_state(ced, 0); in sh_cmt_clock_event_set_oneshot()
775 static int sh_cmt_clock_event_set_periodic(struct clock_event_device *ced) in sh_cmt_clock_event_set_periodic() argument
777 return sh_cmt_clock_event_set_state(ced, 1); in sh_cmt_clock_event_set_periodic()
781 struct clock_event_device *ced) in sh_cmt_clock_event_next() argument
783 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_next()
785 BUG_ON(!clockevent_state_oneshot(ced)); in sh_cmt_clock_event_next()
794 static void sh_cmt_clock_event_suspend(struct clock_event_device *ced) in sh_cmt_clock_event_suspend() argument
796 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_suspend()
802 static void sh_cmt_clock_event_resume(struct clock_event_device *ced) in sh_cmt_clock_event_resume() argument
804 struct sh_cmt_channel *ch = ced_to_sh_cmt(ced); in sh_cmt_clock_event_resume()
813 struct clock_event_device *ced = &ch->ced; in sh_cmt_register_clockevent() local
830 ced->name = name; in sh_cmt_register_clockevent()
831 ced->features = CLOCK_EVT_FEAT_PERIODIC; in sh_cmt_register_clockevent()
832 ced->features |= CLOCK_EVT_FEAT_ONESHOT; in sh_cmt_register_clockevent()
833 ced->rating = 125; in sh_cmt_register_clockevent()
834 ced->cpumask = cpu_possible_mask; in sh_cmt_register_clockevent()
835 ced->set_next_event = sh_cmt_clock_event_next; in sh_cmt_register_clockevent()
836 ced->set_state_shutdown = sh_cmt_clock_event_shutdown; in sh_cmt_register_clockevent()
837 ced->set_state_periodic = sh_cmt_clock_event_set_periodic; in sh_cmt_register_clockevent()
838 ced->set_state_oneshot = sh_cmt_clock_event_set_oneshot; in sh_cmt_register_clockevent()
839 ced->suspend = sh_cmt_clock_event_suspend; in sh_cmt_register_clockevent()
840 ced->resume = sh_cmt_clock_event_resume; in sh_cmt_register_clockevent()
843 ced->shift = 32; in sh_cmt_register_clockevent()
844 ced->mult = div_sc(ch->cmt->rate, NSEC_PER_SEC, ced->shift); in sh_cmt_register_clockevent()
845 ced->max_delta_ns = clockevent_delta2ns(ch->max_match_value, ced); in sh_cmt_register_clockevent()
846 ced->max_delta_ticks = ch->max_match_value; in sh_cmt_register_clockevent()
847 ced->min_delta_ns = clockevent_delta2ns(0x1f, ced); in sh_cmt_register_clockevent()
848 ced->min_delta_ticks = 0x1f; in sh_cmt_register_clockevent()
852 clockevents_register_device(ced); in sh_cmt_register_clockevent()