linux/drivers/pwm/pwm-imx27.c

// SPDX-License-Identifier: GPL-2.0
/*
 * simple driver for PWM (Pulse Width Modulator) controller
 *
 * Derived from pxa PWM driver by eric miao <[email protected]>
 *
 * Limitations:
 * - When disabled the output is driven to 0 independent of the configured
 *   polarity.
 */

#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/slab.h>

#define MX3_PWMCR
#define MX3_PWMSR
#define MX3_PWMSAR
#define MX3_PWMPR

#define MX3_PWMCR_FWM
#define MX3_PWMCR_STOPEN
#define MX3_PWMCR_DOZEN
#define MX3_PWMCR_WAITEN
#define MX3_PWMCR_DBGEN
#define MX3_PWMCR_BCTR
#define MX3_PWMCR_HCTR

#define MX3_PWMCR_POUTC
#define MX3_PWMCR_POUTC_NORMAL
#define MX3_PWMCR_POUTC_INVERTED
#define MX3_PWMCR_POUTC_OFF

#define MX3_PWMCR_CLKSRC
#define MX3_PWMCR_CLKSRC_OFF
#define MX3_PWMCR_CLKSRC_IPG
#define MX3_PWMCR_CLKSRC_IPG_HIGH
#define MX3_PWMCR_CLKSRC_IPG_32K

#define MX3_PWMCR_PRESCALER

#define MX3_PWMCR_SWR

#define MX3_PWMCR_REPEAT
#define MX3_PWMCR_REPEAT_1X
#define MX3_PWMCR_REPEAT_2X
#define MX3_PWMCR_REPEAT_4X
#define MX3_PWMCR_REPEAT_8X

#define MX3_PWMCR_EN

#define MX3_PWMSR_FWE
#define MX3_PWMSR_CMP
#define MX3_PWMSR_ROV
#define MX3_PWMSR_FE

#define MX3_PWMSR_FIFOAV
#define MX3_PWMSR_FIFOAV_EMPTY
#define MX3_PWMSR_FIFOAV_1WORD
#define MX3_PWMSR_FIFOAV_2WORDS
#define MX3_PWMSR_FIFOAV_3WORDS
#define MX3_PWMSR_FIFOAV_4WORDS

#define MX3_PWMCR_PRESCALER_SET(x)
#define MX3_PWMCR_PRESCALER_GET(x)

#define MX3_PWM_SWR_LOOP

/* PWMPR register value of 0xffff has the same effect as 0xfffe */
#define MX3_PWMPR_MAX

struct pwm_imx27_chip {};

static inline struct pwm_imx27_chip *to_pwm_imx27_chip(struct pwm_chip *chip)
{}

static int pwm_imx27_clk_prepare_enable(struct pwm_imx27_chip *imx)
{}

static void pwm_imx27_clk_disable_unprepare(struct pwm_imx27_chip *imx)
{}

static int pwm_imx27_get_state(struct pwm_chip *chip,
			       struct pwm_device *pwm, struct pwm_state *state)
{}

static void pwm_imx27_sw_reset(struct pwm_chip *chip)
{}

static void pwm_imx27_wait_fifo_slot(struct pwm_chip *chip,
				     struct pwm_device *pwm)
{}

static int pwm_imx27_apply(struct pwm_chip *chip, struct pwm_device *pwm,
			   const struct pwm_state *state)
{}

static const struct pwm_ops pwm_imx27_ops =;

static const struct of_device_id pwm_imx27_dt_ids[] =;
MODULE_DEVICE_TABLE(of, pwm_imx27_dt_ids);

static int pwm_imx27_probe(struct platform_device *pdev)
{}

static struct platform_driver imx_pwm_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();