2019-09-20 06:49:06 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-01-24 02:34:37 +08:00
|
|
|
/*
|
2019-09-20 06:49:06 +08:00
|
|
|
* MediaTek Pulse Width Modulator driver
|
2017-01-24 02:34:37 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 2015 John Crispin <blogic@openwrt.org>
|
2017-06-30 14:05:18 +08:00
|
|
|
* Copyright (C) 2017 Zhi Mao <zhi.mao@mediatek.com>
|
2017-01-24 02:34:37 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/err.h>
|
|
|
|
#include <linux/io.h>
|
|
|
|
#include <linux/ioport.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/clk.h>
|
|
|
|
#include <linux/of.h>
|
2017-10-25 18:11:01 +08:00
|
|
|
#include <linux/of_device.h>
|
2017-01-24 02:34:37 +08:00
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <linux/pwm.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
/* PWM registers and bits definitions */
|
|
|
|
#define PWMCON 0x00
|
|
|
|
#define PWMHDUR 0x04
|
|
|
|
#define PWMLDUR 0x08
|
|
|
|
#define PWMGDUR 0x0c
|
|
|
|
#define PWMWAVENUM 0x28
|
|
|
|
#define PWMDWIDTH 0x2c
|
2018-03-01 16:19:12 +08:00
|
|
|
#define PWM45DWIDTH_FIXUP 0x30
|
2017-01-24 02:34:37 +08:00
|
|
|
#define PWMTHRES 0x30
|
2018-03-01 16:19:12 +08:00
|
|
|
#define PWM45THRES_FIXUP 0x34
|
2020-10-19 22:07:02 +08:00
|
|
|
#define PWM_CK_26M_SEL 0x210
|
2017-01-24 02:34:37 +08:00
|
|
|
|
2017-06-30 14:05:20 +08:00
|
|
|
#define PWM_CLK_DIV_MAX 7
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
struct pwm_mediatek_of_data {
|
2017-10-25 18:11:01 +08:00
|
|
|
unsigned int num_pwms;
|
2018-03-01 16:19:12 +08:00
|
|
|
bool pwm45_fixup;
|
2020-10-19 22:07:02 +08:00
|
|
|
bool has_ck_26m_sel;
|
2017-01-24 02:34:37 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2019-09-20 06:49:05 +08:00
|
|
|
* struct pwm_mediatek_chip - struct representing PWM chip
|
2017-01-24 02:34:37 +08:00
|
|
|
* @chip: linux PWM chip representation
|
|
|
|
* @regs: base address of PWM chip
|
2019-09-20 06:49:04 +08:00
|
|
|
* @clk_top: the top clock generator
|
|
|
|
* @clk_main: the clock used by PWM core
|
|
|
|
* @clk_pwms: the clock used by each PWM channel
|
|
|
|
* @clk_freq: the fix clock frequency of legacy MIPS SoC
|
2020-06-29 20:47:51 +08:00
|
|
|
* @soc: pointer to chip's platform data
|
2017-01-24 02:34:37 +08:00
|
|
|
*/
|
2019-09-20 06:49:05 +08:00
|
|
|
struct pwm_mediatek_chip {
|
2017-01-24 02:34:37 +08:00
|
|
|
struct pwm_chip chip;
|
|
|
|
void __iomem *regs;
|
2019-09-20 06:49:04 +08:00
|
|
|
struct clk *clk_top;
|
|
|
|
struct clk *clk_main;
|
|
|
|
struct clk **clk_pwms;
|
2019-09-20 06:49:05 +08:00
|
|
|
const struct pwm_mediatek_of_data *soc;
|
2017-01-24 02:34:37 +08:00
|
|
|
};
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static const unsigned int pwm_mediatek_reg_offset[] = {
|
2017-10-25 18:11:01 +08:00
|
|
|
0x0010, 0x0050, 0x0090, 0x00d0, 0x0110, 0x0150, 0x0190, 0x0220
|
|
|
|
};
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static inline struct pwm_mediatek_chip *
|
|
|
|
to_pwm_mediatek_chip(struct pwm_chip *chip)
|
2017-01-24 02:34:37 +08:00
|
|
|
{
|
2019-09-20 06:49:05 +08:00
|
|
|
return container_of(chip, struct pwm_mediatek_chip, chip);
|
2017-01-24 02:34:37 +08:00
|
|
|
}
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static int pwm_mediatek_clk_enable(struct pwm_chip *chip,
|
|
|
|
struct pwm_device *pwm)
|
2017-06-30 14:05:18 +08:00
|
|
|
{
|
2019-09-20 06:49:05 +08:00
|
|
|
struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
|
2017-06-30 14:05:18 +08:00
|
|
|
int ret;
|
|
|
|
|
2019-09-20 06:49:04 +08:00
|
|
|
ret = clk_prepare_enable(pc->clk_top);
|
2017-06-30 14:05:18 +08:00
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
|
|
|
|
2019-09-20 06:49:04 +08:00
|
|
|
ret = clk_prepare_enable(pc->clk_main);
|
2017-06-30 14:05:18 +08:00
|
|
|
if (ret < 0)
|
|
|
|
goto disable_clk_top;
|
|
|
|
|
2019-09-20 06:49:04 +08:00
|
|
|
ret = clk_prepare_enable(pc->clk_pwms[pwm->hwpwm]);
|
2017-06-30 14:05:18 +08:00
|
|
|
if (ret < 0)
|
|
|
|
goto disable_clk_main;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
disable_clk_main:
|
2019-09-20 06:49:04 +08:00
|
|
|
clk_disable_unprepare(pc->clk_main);
|
2017-06-30 14:05:18 +08:00
|
|
|
disable_clk_top:
|
2019-09-20 06:49:04 +08:00
|
|
|
clk_disable_unprepare(pc->clk_top);
|
2017-06-30 14:05:18 +08:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static void pwm_mediatek_clk_disable(struct pwm_chip *chip,
|
|
|
|
struct pwm_device *pwm)
|
2017-06-30 14:05:18 +08:00
|
|
|
{
|
2019-09-20 06:49:05 +08:00
|
|
|
struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
|
2017-06-30 14:05:18 +08:00
|
|
|
|
2019-09-20 06:49:04 +08:00
|
|
|
clk_disable_unprepare(pc->clk_pwms[pwm->hwpwm]);
|
|
|
|
clk_disable_unprepare(pc->clk_main);
|
|
|
|
clk_disable_unprepare(pc->clk_top);
|
2017-06-30 14:05:18 +08:00
|
|
|
}
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static inline void pwm_mediatek_writel(struct pwm_mediatek_chip *chip,
|
|
|
|
unsigned int num, unsigned int offset,
|
|
|
|
u32 value)
|
2017-01-24 02:34:37 +08:00
|
|
|
{
|
2019-09-20 06:49:05 +08:00
|
|
|
writel(value, chip->regs + pwm_mediatek_reg_offset[num] + offset);
|
2017-01-24 02:34:37 +08:00
|
|
|
}
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static int pwm_mediatek_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|
|
|
int duty_ns, int period_ns)
|
2017-01-24 02:34:37 +08:00
|
|
|
{
|
2019-09-20 06:49:05 +08:00
|
|
|
struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
|
2018-03-02 16:49:14 +08:00
|
|
|
u32 clkdiv = 0, cnt_period, cnt_duty, reg_width = PWMDWIDTH,
|
2018-03-01 16:19:12 +08:00
|
|
|
reg_thres = PWMTHRES;
|
2018-03-02 16:49:14 +08:00
|
|
|
u64 resolution;
|
2017-06-30 14:05:18 +08:00
|
|
|
int ret;
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
ret = pwm_mediatek_clk_enable(chip, pwm);
|
|
|
|
|
2017-06-30 14:05:18 +08:00
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
2017-01-24 02:34:37 +08:00
|
|
|
|
2020-10-19 22:07:02 +08:00
|
|
|
/* Make sure we use the bus clock and not the 26MHz clock */
|
|
|
|
if (pc->soc->has_ck_26m_sel)
|
|
|
|
writel(0, pc->regs + PWM_CK_26M_SEL);
|
|
|
|
|
2018-03-02 16:49:14 +08:00
|
|
|
/* Using resolution in picosecond gets accuracy higher */
|
|
|
|
resolution = (u64)NSEC_PER_SEC * 1000;
|
2019-09-20 06:49:05 +08:00
|
|
|
do_div(resolution, clk_get_rate(pc->clk_pwms[pwm->hwpwm]));
|
2017-01-24 02:34:37 +08:00
|
|
|
|
2018-03-02 16:49:14 +08:00
|
|
|
cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution);
|
|
|
|
while (cnt_period > 8191) {
|
2017-01-24 02:34:37 +08:00
|
|
|
resolution *= 2;
|
|
|
|
clkdiv++;
|
2018-03-02 16:49:14 +08:00
|
|
|
cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000,
|
|
|
|
resolution);
|
2017-01-24 02:34:37 +08:00
|
|
|
}
|
|
|
|
|
2017-06-30 14:05:20 +08:00
|
|
|
if (clkdiv > PWM_CLK_DIV_MAX) {
|
2019-09-20 06:49:05 +08:00
|
|
|
pwm_mediatek_clk_disable(chip, pwm);
|
2022-02-14 22:03:39 +08:00
|
|
|
dev_err(chip->dev, "period of %d ns not supported\n", period_ns);
|
2017-01-24 02:34:37 +08:00
|
|
|
return -EINVAL;
|
2017-06-30 14:05:20 +08:00
|
|
|
}
|
2017-01-24 02:34:37 +08:00
|
|
|
|
2018-03-01 16:19:12 +08:00
|
|
|
if (pc->soc->pwm45_fixup && pwm->hwpwm > 2) {
|
|
|
|
/*
|
|
|
|
* PWM[4,5] has distinct offset for PWMDWIDTH and PWMTHRES
|
|
|
|
* from the other PWMs on MT7623.
|
|
|
|
*/
|
|
|
|
reg_width = PWM45DWIDTH_FIXUP;
|
|
|
|
reg_thres = PWM45THRES_FIXUP;
|
|
|
|
}
|
|
|
|
|
2018-03-02 16:49:14 +08:00
|
|
|
cnt_duty = DIV_ROUND_CLOSEST_ULL((u64)duty_ns * 1000, resolution);
|
2019-09-20 06:49:05 +08:00
|
|
|
pwm_mediatek_writel(pc, pwm->hwpwm, PWMCON, BIT(15) | clkdiv);
|
|
|
|
pwm_mediatek_writel(pc, pwm->hwpwm, reg_width, cnt_period);
|
|
|
|
pwm_mediatek_writel(pc, pwm->hwpwm, reg_thres, cnt_duty);
|
2017-01-24 02:34:37 +08:00
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
pwm_mediatek_clk_disable(chip, pwm);
|
2017-06-30 14:05:18 +08:00
|
|
|
|
2017-01-24 02:34:37 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static int pwm_mediatek_enable(struct pwm_chip *chip, struct pwm_device *pwm)
|
2017-01-24 02:34:37 +08:00
|
|
|
{
|
2019-09-20 06:49:05 +08:00
|
|
|
struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
|
2017-01-24 02:34:37 +08:00
|
|
|
u32 value;
|
|
|
|
int ret;
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
ret = pwm_mediatek_clk_enable(chip, pwm);
|
2017-01-24 02:34:37 +08:00
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
value = readl(pc->regs);
|
|
|
|
value |= BIT(pwm->hwpwm);
|
|
|
|
writel(value, pc->regs);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static void pwm_mediatek_disable(struct pwm_chip *chip, struct pwm_device *pwm)
|
2017-01-24 02:34:37 +08:00
|
|
|
{
|
2019-09-20 06:49:05 +08:00
|
|
|
struct pwm_mediatek_chip *pc = to_pwm_mediatek_chip(chip);
|
2017-01-24 02:34:37 +08:00
|
|
|
u32 value;
|
|
|
|
|
|
|
|
value = readl(pc->regs);
|
|
|
|
value &= ~BIT(pwm->hwpwm);
|
|
|
|
writel(value, pc->regs);
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
pwm_mediatek_clk_disable(chip, pwm);
|
2017-01-24 02:34:37 +08:00
|
|
|
}
|
|
|
|
|
2022-05-07 16:43:37 +08:00
|
|
|
static int pwm_mediatek_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
|
|
|
const struct pwm_state *state)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
|
|
|
|
if (state->polarity != PWM_POLARITY_NORMAL)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (!state->enabled) {
|
|
|
|
if (pwm->state.enabled)
|
|
|
|
pwm_mediatek_disable(chip, pwm);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
err = pwm_mediatek_config(pwm->chip, pwm, state->duty_cycle, state->period);
|
|
|
|
if (err)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
if (!pwm->state.enabled)
|
|
|
|
err = pwm_mediatek_enable(chip, pwm);
|
|
|
|
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static const struct pwm_ops pwm_mediatek_ops = {
|
2022-05-07 16:43:37 +08:00
|
|
|
.apply = pwm_mediatek_apply,
|
2017-01-24 02:34:37 +08:00
|
|
|
.owner = THIS_MODULE,
|
|
|
|
};
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static int pwm_mediatek_probe(struct platform_device *pdev)
|
2017-01-24 02:34:37 +08:00
|
|
|
{
|
2019-09-20 06:49:05 +08:00
|
|
|
struct pwm_mediatek_chip *pc;
|
2017-01-24 02:34:37 +08:00
|
|
|
unsigned int i;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL);
|
|
|
|
if (!pc)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2019-09-20 06:49:02 +08:00
|
|
|
pc->soc = of_device_get_match_data(&pdev->dev);
|
2017-10-25 18:11:01 +08:00
|
|
|
|
2019-12-29 16:05:45 +08:00
|
|
|
pc->regs = devm_platform_ioremap_resource(pdev, 0);
|
2017-01-24 02:34:37 +08:00
|
|
|
if (IS_ERR(pc->regs))
|
|
|
|
return PTR_ERR(pc->regs);
|
|
|
|
|
2022-02-14 22:03:38 +08:00
|
|
|
pc->clk_pwms = devm_kmalloc_array(&pdev->dev, pc->soc->num_pwms,
|
2019-09-20 06:49:04 +08:00
|
|
|
sizeof(*pc->clk_pwms), GFP_KERNEL);
|
|
|
|
if (!pc->clk_pwms)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
pc->clk_top = devm_clk_get(&pdev->dev, "top");
|
2022-02-14 22:03:37 +08:00
|
|
|
if (IS_ERR(pc->clk_top))
|
|
|
|
return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk_top),
|
2022-02-14 22:03:39 +08:00
|
|
|
"Failed to get top clock\n");
|
2019-09-20 06:49:04 +08:00
|
|
|
|
|
|
|
pc->clk_main = devm_clk_get(&pdev->dev, "main");
|
2022-02-14 22:03:37 +08:00
|
|
|
if (IS_ERR(pc->clk_main))
|
|
|
|
return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk_main),
|
2022-02-14 22:03:39 +08:00
|
|
|
"Failed to get main clock\n");
|
2019-09-20 06:49:04 +08:00
|
|
|
|
|
|
|
for (i = 0; i < pc->soc->num_pwms; i++) {
|
|
|
|
char name[8];
|
|
|
|
|
|
|
|
snprintf(name, sizeof(name), "pwm%d", i + 1);
|
|
|
|
|
|
|
|
pc->clk_pwms[i] = devm_clk_get(&pdev->dev, name);
|
2022-02-14 22:03:37 +08:00
|
|
|
if (IS_ERR(pc->clk_pwms[i]))
|
|
|
|
return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk_pwms[i]),
|
2022-02-14 22:03:39 +08:00
|
|
|
"Failed to get %s clock\n", name);
|
2017-01-24 02:34:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
pc->chip.dev = &pdev->dev;
|
2019-09-20 06:49:05 +08:00
|
|
|
pc->chip.ops = &pwm_mediatek_ops;
|
2019-09-20 06:49:02 +08:00
|
|
|
pc->chip.npwm = pc->soc->num_pwms;
|
2017-01-24 02:34:37 +08:00
|
|
|
|
2021-07-08 00:28:11 +08:00
|
|
|
ret = devm_pwmchip_add(&pdev->dev, &pc->chip);
|
2022-02-14 22:03:37 +08:00
|
|
|
if (ret < 0)
|
|
|
|
return dev_err_probe(&pdev->dev, ret, "pwmchip_add() failed\n");
|
2017-01-24 02:34:37 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt2712_pwm_data = {
|
2017-10-25 18:11:01 +08:00
|
|
|
.num_pwms = 8,
|
2018-03-01 16:19:12 +08:00
|
|
|
.pwm45_fixup = false,
|
2020-10-19 22:07:02 +08:00
|
|
|
.has_ck_26m_sel = false,
|
2017-10-25 18:11:01 +08:00
|
|
|
};
|
|
|
|
|
2022-05-03 18:54:04 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt6795_pwm_data = {
|
|
|
|
.num_pwms = 7,
|
|
|
|
.pwm45_fixup = false,
|
|
|
|
.has_ck_26m_sel = false,
|
|
|
|
};
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt7622_pwm_data = {
|
2017-10-25 18:11:01 +08:00
|
|
|
.num_pwms = 6,
|
2018-03-01 16:19:12 +08:00
|
|
|
.pwm45_fixup = false,
|
2020-10-19 22:07:02 +08:00
|
|
|
.has_ck_26m_sel = false,
|
2017-10-25 18:11:01 +08:00
|
|
|
};
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt7623_pwm_data = {
|
2017-10-25 18:11:01 +08:00
|
|
|
.num_pwms = 5,
|
2018-03-01 16:19:12 +08:00
|
|
|
.pwm45_fixup = true,
|
2020-10-19 22:07:02 +08:00
|
|
|
.has_ck_26m_sel = false,
|
2018-07-25 17:52:09 +08:00
|
|
|
};
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt7628_pwm_data = {
|
2018-07-25 17:52:09 +08:00
|
|
|
.num_pwms = 4,
|
|
|
|
.pwm45_fixup = true,
|
2020-10-19 22:07:02 +08:00
|
|
|
.has_ck_26m_sel = false,
|
2017-10-25 18:11:01 +08:00
|
|
|
};
|
|
|
|
|
2019-09-25 22:32:33 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt7629_pwm_data = {
|
|
|
|
.num_pwms = 1,
|
|
|
|
.pwm45_fixup = false,
|
2020-10-19 22:07:02 +08:00
|
|
|
.has_ck_26m_sel = false,
|
2019-09-25 22:32:33 +08:00
|
|
|
};
|
|
|
|
|
2020-10-19 22:07:03 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt8183_pwm_data = {
|
|
|
|
.num_pwms = 4,
|
|
|
|
.pwm45_fixup = false,
|
|
|
|
.has_ck_26m_sel = true,
|
|
|
|
};
|
|
|
|
|
2022-05-31 04:50:38 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt8365_pwm_data = {
|
|
|
|
.num_pwms = 3,
|
|
|
|
.pwm45_fixup = false,
|
|
|
|
.has_ck_26m_sel = true,
|
|
|
|
};
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static const struct pwm_mediatek_of_data mt8516_pwm_data = {
|
2019-08-05 20:58:48 +08:00
|
|
|
.num_pwms = 5,
|
|
|
|
.pwm45_fixup = false,
|
2020-10-19 22:07:02 +08:00
|
|
|
.has_ck_26m_sel = true,
|
2019-08-05 20:58:48 +08:00
|
|
|
};
|
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static const struct of_device_id pwm_mediatek_of_match[] = {
|
2017-10-25 18:11:01 +08:00
|
|
|
{ .compatible = "mediatek,mt2712-pwm", .data = &mt2712_pwm_data },
|
2022-05-03 18:54:04 +08:00
|
|
|
{ .compatible = "mediatek,mt6795-pwm", .data = &mt6795_pwm_data },
|
2017-10-25 18:11:01 +08:00
|
|
|
{ .compatible = "mediatek,mt7622-pwm", .data = &mt7622_pwm_data },
|
|
|
|
{ .compatible = "mediatek,mt7623-pwm", .data = &mt7623_pwm_data },
|
2018-07-25 17:52:09 +08:00
|
|
|
{ .compatible = "mediatek,mt7628-pwm", .data = &mt7628_pwm_data },
|
2019-09-25 22:32:33 +08:00
|
|
|
{ .compatible = "mediatek,mt7629-pwm", .data = &mt7629_pwm_data },
|
2020-10-19 22:07:03 +08:00
|
|
|
{ .compatible = "mediatek,mt8183-pwm", .data = &mt8183_pwm_data },
|
2022-05-31 04:50:38 +08:00
|
|
|
{ .compatible = "mediatek,mt8365-pwm", .data = &mt8365_pwm_data },
|
2019-08-05 20:58:48 +08:00
|
|
|
{ .compatible = "mediatek,mt8516-pwm", .data = &mt8516_pwm_data },
|
2017-10-25 18:11:01 +08:00
|
|
|
{ },
|
2017-01-24 02:34:37 +08:00
|
|
|
};
|
2019-09-20 06:49:05 +08:00
|
|
|
MODULE_DEVICE_TABLE(of, pwm_mediatek_of_match);
|
2017-01-24 02:34:37 +08:00
|
|
|
|
2019-09-20 06:49:05 +08:00
|
|
|
static struct platform_driver pwm_mediatek_driver = {
|
2017-01-24 02:34:37 +08:00
|
|
|
.driver = {
|
2019-09-20 06:49:05 +08:00
|
|
|
.name = "pwm-mediatek",
|
|
|
|
.of_match_table = pwm_mediatek_of_match,
|
2017-01-24 02:34:37 +08:00
|
|
|
},
|
2019-09-20 06:49:05 +08:00
|
|
|
.probe = pwm_mediatek_probe,
|
2017-01-24 02:34:37 +08:00
|
|
|
};
|
2019-09-20 06:49:05 +08:00
|
|
|
module_platform_driver(pwm_mediatek_driver);
|
2017-01-24 02:34:37 +08:00
|
|
|
|
|
|
|
MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
|
2019-09-20 06:49:06 +08:00
|
|
|
MODULE_LICENSE("GPL v2");
|