]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/pwm/pwm-uclass.c
2 * Copyright (c) 2016 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
12 int pwm_set_invert(struct udevice
*dev
, uint channel
, bool polarity
)
14 struct pwm_ops
*ops
= pwm_get_ops(dev
);
19 return ops
->set_invert(dev
, channel
, polarity
);
22 int pwm_set_config(struct udevice
*dev
, uint channel
, uint period_ns
,
25 struct pwm_ops
*ops
= pwm_get_ops(dev
);
30 return ops
->set_config(dev
, channel
, period_ns
, duty_ns
);
33 int pwm_set_enable(struct udevice
*dev
, uint channel
, bool enable
)
35 struct pwm_ops
*ops
= pwm_get_ops(dev
);
40 return ops
->set_enable(dev
, channel
, enable
);
43 UCLASS_DRIVER(pwm
) = {