aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2018-12-14 18:37:26 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2018-12-14 18:37:26 +0000
commit6a9997ed67b564bf37552df18335fa6c49815671 (patch)
tree7a94611a4032e04c1f22df384c45e0f7136dcefe
parent8b2de3f0d4602c920f20a5a5a79ee9576cf6baaa (diff)
downloadsrc-6a9997ed67b564bf37552df18335fa6c49815671.tar.gz
src-6a9997ed67b564bf37552df18335fa6c49815671.zip
pwm: Convert period and duty to unsigned int
We don't need a 64 bits value to store nanoseconds Discused with: ian, jhibbits
Notes
Notes: svn path=/head/; revision=342087
-rw-r--r--sys/arm/allwinner/aw_pwm.c8
-rw-r--r--sys/dev/pwm/pwm_if.m8
-rw-r--r--sys/dev/pwm/pwmbus.c4
-rw-r--r--sys/dev/pwm/pwmbus_if.m8
-rw-r--r--sys/sys/pwm.h4
-rw-r--r--usr.sbin/pwm/pwm.c6
6 files changed, 19 insertions, 19 deletions
diff --git a/sys/arm/allwinner/aw_pwm.c b/sys/arm/allwinner/aw_pwm.c
index 731047e43e94..5758d7083648 100644
--- a/sys/arm/allwinner/aw_pwm.c
+++ b/sys/arm/allwinner/aw_pwm.c
@@ -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;
diff --git a/sys/dev/pwm/pwm_if.m b/sys/dev/pwm/pwm_if.m
index 75a22d8067cb..103f4db1fa29 100644
--- a/sys/dev/pwm/pwm_if.m
+++ b/sys/dev/pwm/pwm_if.m
@@ -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;
};
#
diff --git a/sys/dev/pwm/pwmbus.c b/sys/dev/pwm/pwmbus.c
index b150497e905d..66f8495d5e83 100644
--- a/sys/dev/pwm/pwmbus.c
+++ b/sys/dev/pwm/pwmbus.c
@@ -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;
diff --git a/sys/dev/pwm/pwmbus_if.m b/sys/dev/pwm/pwmbus_if.m
index 441f6f0d7e80..23ecf237b2de 100644
--- a/sys/dev/pwm/pwmbus_if.m
+++ b/sys/dev/pwm/pwmbus_if.m
@@ -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;
};
#
diff --git a/sys/sys/pwm.h b/sys/sys/pwm.h
index 83f5e8191bb5..9940c8cad9e9 100644
--- a/sys/sys/pwm.h
+++ b/sys/sys/pwm.h
@@ -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;
};
diff --git a/usr.sbin/pwm/pwm.c b/usr.sbin/pwm/pwm.c
index 394840328fa2..ebb4349635fd 100644
--- a/usr.sbin/pwm/pwm.c
+++ b/usr.sbin/pwm/pwm.c
@@ -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: