pwm: Convert period and duty to unsigned int
We don't need a 64 bits value to store nanoseconds Discused with: ian, jhibbits
This commit is contained in:
parent
8b2de3f0d4
commit
6a9997ed67
@ -87,8 +87,8 @@ struct aw_pwm_softc {
|
||||
struct resource *res;
|
||||
|
||||
uint64_t clk_freq;
|
||||
uint64_t period;
|
||||
uint64_t duty;
|
||||
unsigned int period;
|
||||
unsigned int duty;
|
||||
uint32_t flags;
|
||||
bool enabled;
|
||||
};
|
||||
@ -191,7 +191,7 @@ aw_pwm_channel_max(device_t dev, int *nchannel)
|
||||
}
|
||||
|
||||
static int
|
||||
aw_pwm_channel_config(device_t dev, int channel, uint64_t period, uint64_t duty)
|
||||
aw_pwm_channel_config(device_t dev, int channel, unsigned int period, unsigned int duty)
|
||||
{
|
||||
struct aw_pwm_softc *sc;
|
||||
uint64_t period_freq, duty_freq;
|
||||
@ -254,7 +254,7 @@ aw_pwm_channel_config(device_t dev, int channel, uint64_t period, uint64_t duty)
|
||||
}
|
||||
|
||||
static int
|
||||
aw_pwm_channel_get_config(device_t dev, int channel, uint64_t *period, uint64_t *duty)
|
||||
aw_pwm_channel_get_config(device_t dev, int channel, unsigned int *period, unsigned int *duty)
|
||||
{
|
||||
struct aw_pwm_softc *sc;
|
||||
|
||||
|
@ -46,8 +46,8 @@ METHOD device_t get_bus {
|
||||
METHOD int channel_config {
|
||||
device_t dev;
|
||||
int channel;
|
||||
uint64_t period;
|
||||
uint64_t duty;
|
||||
unsigned int period;
|
||||
unsigned duty;
|
||||
};
|
||||
|
||||
#
|
||||
@ -57,8 +57,8 @@ METHOD int channel_config {
|
||||
METHOD int channel_get_config {
|
||||
device_t dev;
|
||||
int channel;
|
||||
uint64_t *period;
|
||||
uint64_t *duty;
|
||||
unsigned int *period;
|
||||
unsigned int *duty;
|
||||
};
|
||||
|
||||
#
|
||||
|
@ -138,7 +138,7 @@ pwmbus_detach(device_t dev)
|
||||
}
|
||||
|
||||
static int
|
||||
pwmbus_channel_config(device_t bus, int channel, uint64_t period, uint64_t duty)
|
||||
pwmbus_channel_config(device_t bus, int channel, unsigned int period, unsigned int duty)
|
||||
{
|
||||
struct pwmbus_softc *sc;
|
||||
|
||||
@ -151,7 +151,7 @@ pwmbus_channel_config(device_t bus, int channel, uint64_t period, uint64_t duty)
|
||||
}
|
||||
|
||||
static int
|
||||
pwmbus_channel_get_config(device_t bus, int channel, uint64_t *period, uint64_t *duty)
|
||||
pwmbus_channel_get_config(device_t bus, int channel, unsigned int *period, unsigned int *duty)
|
||||
{
|
||||
struct pwmbus_softc *sc;
|
||||
|
||||
|
@ -59,8 +59,8 @@ HEADER {
|
||||
METHOD int channel_config {
|
||||
device_t bus;
|
||||
int channel;
|
||||
uint64_t period;
|
||||
uint64_t duty;
|
||||
unsigned int period;
|
||||
unsigned int duty;
|
||||
};
|
||||
|
||||
#
|
||||
@ -70,8 +70,8 @@ METHOD int channel_config {
|
||||
METHOD int channel_get_config {
|
||||
device_t bus;
|
||||
int channel;
|
||||
uint64_t *period;
|
||||
uint64_t *duty;
|
||||
unsigned int *period;
|
||||
unsigned int *duty;
|
||||
};
|
||||
|
||||
#
|
||||
|
@ -35,8 +35,8 @@
|
||||
|
||||
struct pwm_state {
|
||||
int channel;
|
||||
uint64_t period;
|
||||
uint64_t duty;
|
||||
unsigned int period;
|
||||
unsigned int duty;
|
||||
uint32_t flags;
|
||||
bool enable;
|
||||
};
|
||||
|
@ -190,9 +190,9 @@ main(int argc, char *argv[])
|
||||
}
|
||||
break;
|
||||
case PWM_SHOW_CONFIG:
|
||||
printf("period: %ju\nduty: %ju\nenabled:%d\n",
|
||||
(uintmax_t) state.period,
|
||||
(uintmax_t) state.duty,
|
||||
printf("period: %u\nduty: %u\nenabled:%d\n",
|
||||
state.period,
|
||||
state.duty,
|
||||
state.enable);
|
||||
break;
|
||||
case PWM_PERIOD:
|
||||
|
Loading…
Reference in New Issue
Block a user