diff options
author | Tom Rini <trini@konsulko.com> | 2017-05-10 17:40:11 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-05-10 17:40:11 -0400 |
commit | 1f5541c8818d3ecd243f9bbf58db9ea5f55a3195 (patch) | |
tree | 83053c0f224f8fe641550492e95818033e5af7e2 /drivers/pwm/sandbox_pwm.c | |
parent | 102d86552abc82818c22b39fdef4b3a280a60643 (diff) | |
parent | 2085de57f3928d72b27338f68d4250d1fb302d04 (diff) |
Merge git://git.denx.de/u-boot-rockchip
This adds a new firefly-rk3399 board, MIPI support for rk3399 and
rk3288, rk818 pmic support, mkimage improvements for rockchip and a few
other things.
Diffstat (limited to 'drivers/pwm/sandbox_pwm.c')
-rw-r--r-- | drivers/pwm/sandbox_pwm.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pwm/sandbox_pwm.c b/drivers/pwm/sandbox_pwm.c index c2ce974ddea..fcb10845515 100644 --- a/drivers/pwm/sandbox_pwm.c +++ b/drivers/pwm/sandbox_pwm.c @@ -21,6 +21,7 @@ struct sandbox_pwm_chan { uint period_ns; uint duty_ns; bool enable; + bool polarity; }; struct sandbox_pwm_priv { @@ -56,9 +57,24 @@ static int sandbox_pwm_set_enable(struct udevice *dev, uint channel, return 0; } +static int sandbox_pwm_set_invert(struct udevice *dev, uint channel, + bool polarity) +{ + struct sandbox_pwm_priv *priv = dev_get_priv(dev); + struct sandbox_pwm_chan *chan; + + if (channel >= NUM_CHANNELS) + return -ENOSPC; + chan = &priv->chan[channel]; + chan->polarity = polarity; + + return 0; +} + static const struct pwm_ops sandbox_pwm_ops = { .set_config = sandbox_pwm_set_config, .set_enable = sandbox_pwm_set_enable, + .set_invert = sandbox_pwm_set_invert, }; static const struct udevice_id sandbox_pwm_ids[] = { |