linux/drivers/pwm/pwm-img.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Imagination Technologies Pulse Width Modulator driver
 *
 * Copyright (c) 2014-2015, Imagination Technologies
 *
 * Based on drivers/pwm/pwm-tegra.c, Copyright (c) 2010, NVIDIA Corporation
 */

#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/pwm.h>
#include <linux/regmap.h>
#include <linux/slab.h>

/* PWM registers */
#define PWM_CTRL_CFG
#define PWM_CTRL_CFG_NO_SUB_DIV
#define PWM_CTRL_CFG_SUB_DIV0
#define PWM_CTRL_CFG_SUB_DIV1
#define PWM_CTRL_CFG_SUB_DIV0_DIV1
#define PWM_CTRL_CFG_DIV_SHIFT(ch)
#define PWM_CTRL_CFG_DIV_MASK

#define PWM_CH_CFG(ch)
#define PWM_CH_CFG_TMBASE_SHIFT
#define PWM_CH_CFG_DUTY_SHIFT

#define PERIP_PWM_PDM_CONTROL
#define PERIP_PWM_PDM_CONTROL_CH_MASK
#define PERIP_PWM_PDM_CONTROL_CH_SHIFT(ch)

#define IMG_PWM_PM_TIMEOUT

/*
 * PWM period is specified with a timebase register,
 * in number of step periods. The PWM duty cycle is also
 * specified in step periods, in the [0, $timebase] range.
 * In other words, the timebase imposes the duty cycle
 * resolution. Therefore, let's constraint the timebase to
 * a minimum value to allow a sane range of duty cycle values.
 * Imposing a minimum timebase, will impose a maximum PWM frequency.
 *
 * The value chosen is completely arbitrary.
 */
#define MIN_TMBASE_STEPS

#define IMG_PWM_NPWM

struct img_pwm_soc_data {};

struct img_pwm_chip {};

static inline struct img_pwm_chip *to_img_pwm_chip(struct pwm_chip *chip)
{}

static inline void img_pwm_writel(struct img_pwm_chip *imgchip,
				  u32 reg, u32 val)
{}

static inline u32 img_pwm_readl(struct img_pwm_chip *imgchip, u32 reg)
{}

static int img_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
			  int duty_ns, int period_ns)
{}

static int img_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
{}

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

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

static const struct pwm_ops img_pwm_ops =;

static const struct img_pwm_soc_data pistachio_pwm =;

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

static int img_pwm_runtime_suspend(struct device *dev)
{}

static int img_pwm_runtime_resume(struct device *dev)
{}

static int img_pwm_probe(struct platform_device *pdev)
{}

static void img_pwm_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int img_pwm_suspend(struct device *dev)
{}

static int img_pwm_resume(struct device *dev)
{}
#endif /* CONFIG_PM */

static const struct dev_pm_ops img_pwm_pm_ops =;

static struct platform_driver img_pwm_driver =;
module_platform_driver();

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