linux/drivers/pwm/pwm-twl.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for TWL4030/6030 Generic Pulse Width Modulator
 *
 * Copyright (C) 2012 Texas Instruments
 * Author: Peter Ujfalusi <[email protected]>
 */

#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/mfd/twl.h>
#include <linux/slab.h>

/*
 * This driver handles the PWMs of TWL4030 and TWL6030.
 * The TRM names for the PWMs on TWL4030 are: PWM0, PWM1
 * TWL6030 also have two PWMs named in the TRM as PWM1, PWM2
 */

#define TWL_PWM_MAX

/* Registers, bits and macro for TWL4030 */
#define TWL4030_GPBR1_REG
#define TWL4030_PMBR1_REG

/* GPBR1 register bits */
#define TWL4030_PWMXCLK_ENABLE
#define TWL4030_PWMX_ENABLE
#define TWL4030_PWMX_BITS
#define TWL4030_PWM_TOGGLE(pwm, x)

/* PMBR1 register bits */
#define TWL4030_GPIO6_PWM0_MUTE_MASK
#define TWL4030_GPIO6_PWM0_MUTE_PWM0
#define TWL4030_GPIO7_VIBRASYNC_PWM1_MASK
#define TWL4030_GPIO7_VIBRASYNC_PWM1_PWM1

/* Register, bits and macro for TWL6030 */
#define TWL6030_TOGGLE3_REG

#define TWL6030_PWMXR
#define TWL6030_PWMXS
#define TWL6030_PWMXEN
#define TWL6030_PWM_TOGGLE(pwm, x)

struct twl_pwm_chip {};

static inline struct twl_pwm_chip *to_twl(struct pwm_chip *chip)
{}

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

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

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

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

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

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

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

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

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

static const struct pwm_ops twl4030_pwm_ops =;

static const struct pwm_ops twl6030_pwm_ops =;

static int twl_pwm_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_OF
static const struct of_device_id twl_pwm_of_match[] =;
MODULE_DEVICE_TABLE(of, twl_pwm_of_match);
#endif

static struct platform_driver twl_pwm_driver =;
module_platform_driver();

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