#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <soc/bcm2835/raspberrypi-firmware.h>
#include <dt-bindings/pwm/raspberrypi,firmware-poe-pwm.h>
#define RPI_PWM_MAX_DUTY …
#define RPI_PWM_PERIOD_NS …
#define RPI_PWM_CUR_DUTY_REG …
struct raspberrypi_pwm { … };
struct raspberrypi_pwm_prop { … } __packed;
static inline
struct raspberrypi_pwm *raspberrypi_pwm_from_chip(struct pwm_chip *chip)
{ … }
static int raspberrypi_pwm_set_property(struct rpi_firmware *firmware,
u32 reg, u32 val)
{ … }
static int raspberrypi_pwm_get_property(struct rpi_firmware *firmware,
u32 reg, u32 *val)
{ … }
static int raspberrypi_pwm_get_state(struct pwm_chip *chip,
struct pwm_device *pwm,
struct pwm_state *state)
{ … }
static int raspberrypi_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{ … }
static const struct pwm_ops raspberrypi_pwm_ops = …;
static int raspberrypi_pwm_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id raspberrypi_pwm_of_match[] = …;
MODULE_DEVICE_TABLE(of, raspberrypi_pwm_of_match);
static struct platform_driver raspberrypi_pwm_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;