linux/drivers/pwm/pwm-axi-pwmgen.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Analog Devices AXI PWM generator
 *
 * Copyright 2024 Analog Devices Inc.
 * Copyright 2024 Baylibre SAS
 *
 * Device docs: https://analogdevicesinc.github.io/hdl/library/axi_pwm_gen/index.html
 *
 * Limitations:
 * - The writes to registers for period and duty are shadowed until
 *   LOAD_CONFIG is written to AXI_PWMGEN_REG_CONFIG, at which point
 *   they take effect.
 * - Writing LOAD_CONFIG also has the effect of re-synchronizing all
 *   enabled channels, which could cause glitching on other channels. It
 *   is therefore expected that channels are assigned harmonic periods
 *   and all have a single user coordinating this.
 * - Supports normal polarity. Does not support changing polarity.
 * - On disable, the PWM output becomes low (inactive).
 */
#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/fpga/adi-axi-common.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/regmap.h>
#include <linux/slab.h>

#define AXI_PWMGEN_REG_CORE_VERSION
#define AXI_PWMGEN_REG_ID
#define AXI_PWMGEN_REG_SCRATCHPAD
#define AXI_PWMGEN_REG_CORE_MAGIC
#define AXI_PWMGEN_REG_CONFIG
#define AXI_PWMGEN_REG_NPWM
#define AXI_PWMGEN_CHX_PERIOD(ch)
#define AXI_PWMGEN_CHX_DUTY(ch)
#define AXI_PWMGEN_CHX_OFFSET(ch)
#define AXI_PWMGEN_REG_CORE_MAGIC_VAL
#define AXI_PWMGEN_LOAD_CONFIG
#define AXI_PWMGEN_REG_CONFIG_RESET

struct axi_pwmgen_ddata {};

static const struct regmap_config axi_pwmgen_regmap_config =;

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

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

static const struct pwm_ops axi_pwmgen_pwm_ops =;

static int axi_pwmgen_setup(struct regmap *regmap, struct device *dev)
{}

static int axi_pwmgen_probe(struct platform_device *pdev)
{}

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

static struct platform_driver axi_pwmgen_driver =;
module_platform_driver();

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