#include <linux/module.h>
#include <linux/init.h>
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/ioport.h>
#include <linux/io.h>
#include <linux/mfd/syscon.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <soc/at91/atmel_tcb.h>
#define NPWM …
#define ATMEL_TC_ACMR_MASK …
#define ATMEL_TC_BCMR_MASK …
struct atmel_tcb_pwm_device { … };
struct atmel_tcb_channel { … };
struct atmel_tcb_pwm_chip { … };
static const u8 atmel_tcb_divisors[] = …;
static inline struct atmel_tcb_pwm_chip *to_tcb_chip(struct pwm_chip *chip)
{ … }
static int atmel_tcb_pwm_request(struct pwm_chip *chip,
struct pwm_device *pwm)
{ … }
static void atmel_tcb_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
{ … }
static void atmel_tcb_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm,
enum pwm_polarity polarity)
{ … }
static int atmel_tcb_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm,
enum pwm_polarity polarity)
{ … }
static int atmel_tcb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
int duty_ns, int period_ns)
{ … }
static int atmel_tcb_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{ … }
static const struct pwm_ops atmel_tcb_pwm_ops = …;
static struct atmel_tcb_config tcb_rm9200_config = …;
static struct atmel_tcb_config tcb_sam9x5_config = …;
static struct atmel_tcb_config tcb_sama5d2_config = …;
static const struct of_device_id atmel_tcb_of_match[] = …;
static int atmel_tcb_pwm_probe(struct platform_device *pdev)
{ … }
static void atmel_tcb_pwm_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id atmel_tcb_pwm_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);
static int atmel_tcb_pwm_suspend(struct device *dev)
{ … }
static int atmel_tcb_pwm_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend,
atmel_tcb_pwm_resume);
static struct platform_driver atmel_tcb_pwm_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;