#include <linux/bitfield.h>
#include <linux/mfd/stm32-timers.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#define CCMR_CHANNEL_SHIFT …
#define CCMR_CHANNEL_MASK …
#define MAX_BREAKINPUT …
struct stm32_breakinput { … };
struct stm32_pwm { … };
static inline struct stm32_pwm *to_stm32_pwm_dev(struct pwm_chip *chip)
{ … }
static u32 active_channels(struct stm32_pwm *dev)
{ … }
#define TIM_CCER_CC12P …
#define TIM_CCER_CC12E …
#define TIM_CCER_CC34P …
#define TIM_CCER_CC34E …
static int stm32_pwm_raw_capture(struct pwm_chip *chip, struct pwm_device *pwm,
unsigned long tmo_ms, u32 *raw_prd,
u32 *raw_dty)
{ … }
static int stm32_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,
struct pwm_capture *result, unsigned long tmo_ms)
{ … }
static int stm32_pwm_config(struct stm32_pwm *priv, unsigned int ch,
u64 duty_ns, u64 period_ns)
{ … }
static int stm32_pwm_set_polarity(struct stm32_pwm *priv, unsigned int ch,
enum pwm_polarity polarity)
{ … }
static int stm32_pwm_enable(struct stm32_pwm *priv, unsigned int ch)
{ … }
static void stm32_pwm_disable(struct stm32_pwm *priv, unsigned int ch)
{ … }
static int stm32_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{ … }
static int stm32_pwm_apply_locked(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{ … }
static int stm32_pwm_get_state(struct pwm_chip *chip,
struct pwm_device *pwm, struct pwm_state *state)
{ … }
static const struct pwm_ops stm32pwm_ops = …;
static int stm32_pwm_set_breakinput(struct stm32_pwm *priv,
const struct stm32_breakinput *bi)
{ … }
static int stm32_pwm_apply_breakinputs(struct stm32_pwm *priv)
{ … }
static int stm32_pwm_probe_breakinputs(struct stm32_pwm *priv,
struct device_node *np)
{ … }
static void stm32_pwm_detect_complementary(struct stm32_pwm *priv)
{ … }
static unsigned int stm32_pwm_detect_channels(struct regmap *regmap,
unsigned int *num_enabled)
{ … }
static int stm32_pwm_probe(struct platform_device *pdev)
{ … }
static int stm32_pwm_suspend(struct device *dev)
{ … }
static int stm32_pwm_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(stm32_pwm_pm_ops, stm32_pwm_suspend, stm32_pwm_resume);
static const struct of_device_id stm32_pwm_of_match[] = …;
MODULE_DEVICE_TABLE(of, stm32_pwm_of_match);
static struct platform_driver stm32_pwm_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;