Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pwm/pwmbus_if.m
Show All 27 Lines | |||||
# | # | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
INTERFACE pwmbus; | INTERFACE pwmbus; | ||||
CODE { | CODE { | ||||
static int | static int | ||||
pwm_default_set_flags(device_t dev, u_int channel, uint32_t flags) | pwm_default_set_flags(device_t bus, u_int channel, uint32_t flags) | ||||
{ | { | ||||
return (EOPNOTSUPP); | return (EOPNOTSUPP); | ||||
} | } | ||||
static int | static int | ||||
pwm_default_get_flags(device_t dev, u_int channel, uint32_t *flags) | pwm_default_get_flags(device_t bus, u_int channel, uint32_t *flags) | ||||
{ | { | ||||
*flags = 0; | *flags = 0; | ||||
return (0); | return (0); | ||||
} | } | ||||
}; | }; | ||||
# | # | ||||
# Config the period (Total number of cycle in ns) and | # Config the period (Total number of cycle in ns) and | ||||
# the duty (active number of cycle in ns) | # the duty (active number of cycle in ns) | ||||
# | # | ||||
METHOD int channel_config { | METHOD int channel_config { | ||||
device_t bus; | device_t bus; | ||||
u_int channel; | u_int channel; | ||||
unsigned int period; | u_int period; | ||||
unsigned int duty; | u_int duty; | ||||
}; | }; | ||||
# | # | ||||
# Get the period (Total number of cycle in ns) and | # Get the period (Total number of cycle in ns) and | ||||
# the duty (active number of cycle in ns) | # the duty (active number of cycle in ns) | ||||
# | # | ||||
METHOD int channel_get_config { | METHOD int channel_get_config { | ||||
device_t bus; | device_t bus; | ||||
u_int channel; | u_int channel; | ||||
unsigned int *period; | u_int *period; | ||||
unsigned int *duty; | u_int *duty; | ||||
}; | }; | ||||
# | # | ||||
# Set the flags | # Set the flags | ||||
# | # | ||||
METHOD int channel_set_flags { | METHOD int channel_set_flags { | ||||
device_t bus; | device_t bus; | ||||
u_int channel; | u_int channel; | ||||
uint32_t flags; | uint32_t flags; | ||||
} DEFAULT pwm_default_set_flags; | } DEFAULT pwm_default_set_flags; | ||||
# | # | ||||
# Get the flags | # Get the flags | ||||
# | # | ||||
METHOD int channel_get_flags { | METHOD int channel_get_flags { | ||||
device_t dev; | device_t bus; | ||||
u_int channel; | u_int channel; | ||||
uint32_t *flags; | uint32_t *flags; | ||||
} DEFAULT pwm_default_get_flags; | } DEFAULT pwm_default_get_flags; | ||||
# | # | ||||
# Enable the pwm output | # Enable the pwm output | ||||
# | # | ||||
METHOD int channel_enable { | METHOD int channel_enable { | ||||
Show All 21 Lines |