#include <linux/clk.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/slab.h>
#define BERLIN_PWM_EN …
#define BERLIN_PWM_ENABLE …
#define BERLIN_PWM_CONTROL …
#define BERLIN_PWM_PRESCALE_4096 …
#define BERLIN_PWM_INVERT_POLARITY …
#define BERLIN_PWM_DUTY …
#define BERLIN_PWM_TCNT …
#define BERLIN_PWM_MAX_TCNT …
#define BERLIN_PWM_NUMPWMS …
struct berlin_pwm_channel { … };
struct berlin_pwm_chip { … };
static inline struct berlin_pwm_chip *to_berlin_pwm_chip(struct pwm_chip *chip)
{ … }
static inline u32 berlin_pwm_readl(struct berlin_pwm_chip *bpc,
unsigned int channel, unsigned long offset)
{ … }
static inline void berlin_pwm_writel(struct berlin_pwm_chip *bpc,
unsigned int channel, u32 value,
unsigned long offset)
{ … }
static int berlin_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
u64 duty_ns, u64 period_ns)
{ … }
static int berlin_pwm_set_polarity(struct pwm_chip *chip,
struct pwm_device *pwm,
enum pwm_polarity polarity)
{ … }
static int berlin_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
{ … }
static void berlin_pwm_disable(struct pwm_chip *chip,
struct pwm_device *pwm)
{ … }
static int berlin_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{ … }
static const struct pwm_ops berlin_pwm_ops = …;
static const struct of_device_id berlin_pwm_match[] = …;
MODULE_DEVICE_TABLE(of, berlin_pwm_match);
static int berlin_pwm_probe(struct platform_device *pdev)
{ … }
static int berlin_pwm_suspend(struct device *dev)
{ … }
static int berlin_pwm_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(berlin_pwm_pm_ops, berlin_pwm_suspend,
berlin_pwm_resume);
static struct platform_driver berlin_pwm_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;