linux/drivers/pwm/pwm-keembay.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Intel Keem Bay PWM driver
 *
 * Copyright (C) 2020 Intel Corporation
 * Authors: Lai Poey Seng <[email protected]>
 *          Vineetha G. Jaya Kumaran <[email protected]>
 *
 * Limitations:
 * - Upon disabling a channel, the currently running
 *   period will not be completed. However, upon
 *   reconfiguration of the duty cycle/period, the
 *   currently running period will be completed first.
 */

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/regmap.h>

#define KMB_TOTAL_PWM_CHANNELS
#define KMB_PWM_COUNT_MAX
#define KMB_PWM_EN_BIT

/* Mask */
#define KMB_PWM_HIGH_MASK
#define KMB_PWM_LOW_MASK
#define KMB_PWM_LEADIN_MASK

/* PWM Register offset */
#define KMB_PWM_LEADIN_OFFSET(ch)
#define KMB_PWM_HIGHLOW_OFFSET(ch)

struct keembay_pwm {};

static inline struct keembay_pwm *to_keembay_pwm_dev(struct pwm_chip *chip)
{}

static void keembay_clk_unprepare(void *data)
{}

static int keembay_clk_enable(struct device *dev, struct clk *clk)
{}

/*
 * With gcc 10, CONFIG_CC_OPTIMIZE_FOR_SIZE and only "inline" instead of
 * "__always_inline" this fails to compile because the compiler doesn't notice
 * for all valid masks (e.g. KMB_PWM_LEADIN_MASK) that they are ok.
 */
static __always_inline void keembay_pwm_update_bits(struct keembay_pwm *priv, u32 mask,
					   u32 val, u32 offset)
{}

static void keembay_pwm_enable(struct keembay_pwm *priv, int ch)
{}

static void keembay_pwm_disable(struct keembay_pwm *priv, int ch)
{}

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

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

static const struct pwm_ops keembay_pwm_ops =;

static int keembay_pwm_probe(struct platform_device *pdev)
{}

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

static struct platform_driver keembay_pwm_driver =;
module_platform_driver();

MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_LICENSE();