linux/drivers/pwm/pwm-tiecap.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * ECAP PWM driver
 *
 * Copyright (C) 2012 Texas Instruments, Inc. - https://www.ti.com/
 */

#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/pwm.h>
#include <linux/of.h>

/* ECAP registers and bits definitions */
#define CAP1
#define CAP2
#define CAP3
#define CAP4
#define ECCTL2
#define ECCTL2_APWM_POL_LOW
#define ECCTL2_APWM_MODE
#define ECCTL2_SYNC_SEL_DISA
#define ECCTL2_TSCTR_FREERUN

struct ecap_context {};

struct ecap_pwm_chip {};

static inline struct ecap_pwm_chip *to_ecap_pwm_chip(struct pwm_chip *chip)
{}

/*
 * period_ns = 10^9 * period_cycles / PWM_CLK_RATE
 * duty_ns   = 10^9 * duty_cycles / PWM_CLK_RATE
 */
static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
			   int duty_ns, int period_ns, int enabled)
{}

static int ecap_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
				 enum pwm_polarity polarity)
{}

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

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

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

static const struct pwm_ops ecap_pwm_ops =;

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

static int ecap_pwm_probe(struct platform_device *pdev)
{}

static void ecap_pwm_remove(struct platform_device *pdev)
{}

static void ecap_pwm_save_context(struct pwm_chip *chip)
{}

static void ecap_pwm_restore_context(struct pwm_chip *chip)
{}

static int ecap_pwm_suspend(struct device *dev)
{}

static int ecap_pwm_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(ecap_pwm_pm_ops, ecap_pwm_suspend, ecap_pwm_resume);

static struct platform_driver ecap_pwm_driver =;
module_platform_driver();

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